From 6dc7e96e9528efec045d9f2c58cc54562b928795 Mon Sep 17 00:00:00 2001 From: Lach Date: Mon, 19 Jun 2023 23:12:55 +1000 Subject: [PATCH 01/16] Add Lost Colony symbol object --- src/deh_tables.c | 42 ++++++++++++++-- src/info.c | 99 +++++++++++++++++++++++++++++++++++++- src/info.h | 70 +++++++++++++++++++++++++++ src/k_objects.h | 5 ++ src/objects/CMakeLists.txt | 1 + src/objects/symbol.c | 44 +++++++++++++++++ src/p_mobj.c | 15 +++++- 7 files changed, 269 insertions(+), 7 deletions(-) create mode 100644 src/objects/symbol.c diff --git a/src/deh_tables.c b/src/deh_tables.c index e44c6cb52..2bb6fb26e 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -3981,6 +3981,40 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi "S_LAMPPOST", "S_MOSSYTREE", + // Lost Colony symbol signs + "S_SYMBOL_0", + "S_SYMBOL_1", + "S_SYMBOL_2", + "S_SYMBOL_3", + "S_SYMBOL_4", + "S_SYMBOL_5", + "S_SYMBOL_6", + "S_SYMBOL_7", + "S_SYMBOL_8", + "S_SYMBOL_9", + "S_SYMBOL_A", + "S_SYMBOL_B", + "S_SYMBOL_C", + "S_SYMBOL_D", + "S_SYMBOL_E", + "S_SYMBOL_F", + "S_SYMBOL_G", + "S_SYMBOL_H", + "S_SYMBOL_I", + "S_SYMBOL_J", + "S_SYMBOL_K", + "S_SYMBOL_L", + "S_SYMBOL_M", + "S_SYMBOL_N", + "S_SYMBOL_O", + "S_SYMBOL_P", + "S_SYMBOL_Q", + "S_SYMBOL_R", + "S_SYMBOL_S", + "S_SYMBOL_T", + "S_SYMBOL_U", + "S_SYMBOL_V", + "S_BUMP1", "S_BUMP2", "S_BUMP3", @@ -5332,7 +5366,7 @@ const char *const MOBJTYPE_LIST[] = { // array length left dynamic for sanity t "MT_MONITOR_PART", "MT_MONITOR_SHARD", "MT_MAGICIANBOX", - + "MT_SLIPTIDEZIP", "MT_INSTAWHIP", @@ -5499,6 +5533,8 @@ const char *const MOBJTYPE_LIST[] = { // array length left dynamic for sanity t "MT_LAMPPOST", "MT_MOSSYTREE", + "MT_SYMBOL", + "MT_BUMP", "MT_FLINGENERGY", @@ -5512,7 +5548,7 @@ const char *const MOBJTYPE_LIST[] = { // array length left dynamic for sanity t "MT_POWERCLASH", // Invinc/Grow no damage clash VFX "MT_GUARDBREAK", // Guard break - + "MT_PLAYERARROW", "MT_PLAYERWANTED", @@ -6135,7 +6171,7 @@ const char *COLOR_ENUMS[] = { "POSNUM_BEST4", "POSNUM_BEST5", "POSNUM_BEST6", - + "INTERMISSION", }; diff --git a/src/info.c b/src/info.c index cbe5556a3..0608ef9ce 100644 --- a/src/info.c +++ b/src/info.c @@ -632,6 +632,40 @@ char sprnames[NUMSPRITES + 1][5] = "CRAB", // Crystal Abyss mobs "BRNG", // Chaotix Big Ring + // Lost Colony symbol signs + "SYM0", + "SYM1", + "SYM2", + "SYM3", + "SYM4", + "SYM5", + "SYM6", + "SYM7", + "SYM8", + "SYM9", + "SYMA", + "SYMB", + "SYMC", + "SYMD", + "SYME", + "SYMF", + "SYMG", + "SYMH", + "SYMI", + "SYMJ", + "SYMK", + "SYML", + "SYMM", + "SYMN", + "SYMO", + "SYMP", + "SYMQ", + "SYMR", + "SYMS", + "SYMT", + "SYMU", + "SYMV", + "BUMP", // Player/shell bump "FLEN", // Shell hit graphics stuff "CLAS", // items clash @@ -4604,6 +4638,40 @@ state_t states[NUMSTATES] = {SPR_CRAB, 10, -1, {NULL}, 0, 0, S_NULL}, // S_LAMPPOST {SPR_CRAB, 11, -1, {NULL}, 0, 0, S_NULL}, // S_MOSSYTREE + // Lost Colony symbol signs + {SPR_SYM0, FF_ANIMATE|FF_PAPERSPRITE, -1, {NULL}, 15, 2, S_NULL}, // S_SYMBOL_0 + {SPR_SYM1, FF_ANIMATE|FF_PAPERSPRITE, -1, {NULL}, 15, 2, S_NULL}, // S_SYMBOL_1 + {SPR_SYM2, FF_ANIMATE|FF_PAPERSPRITE, -1, {NULL}, 15, 2, S_NULL}, // S_SYMBOL_2 + {SPR_SYM3, FF_ANIMATE|FF_PAPERSPRITE, -1, {NULL}, 15, 2, S_NULL}, // S_SYMBOL_3 + {SPR_SYM4, FF_ANIMATE|FF_PAPERSPRITE, -1, {NULL}, 15, 2, S_NULL}, // S_SYMBOL_4 + {SPR_SYM5, FF_ANIMATE|FF_PAPERSPRITE, -1, {NULL}, 15, 2, S_NULL}, // S_SYMBOL_5 + {SPR_SYM6, FF_ANIMATE|FF_PAPERSPRITE, -1, {NULL}, 15, 2, S_NULL}, // S_SYMBOL_6 + {SPR_SYM7, FF_ANIMATE|FF_PAPERSPRITE, -1, {NULL}, 15, 2, S_NULL}, // S_SYMBOL_7 + {SPR_SYM8, FF_ANIMATE|FF_PAPERSPRITE, -1, {NULL}, 15, 2, S_NULL}, // S_SYMBOL_8 + {SPR_SYM9, FF_ANIMATE|FF_PAPERSPRITE, -1, {NULL}, 15, 2, S_NULL}, // S_SYMBOL_9 + {SPR_SYMA, FF_ANIMATE|FF_PAPERSPRITE, -1, {NULL}, 15, 2, S_NULL}, // S_SYMBOL_A + {SPR_SYMB, FF_ANIMATE|FF_PAPERSPRITE, -1, {NULL}, 15, 2, S_NULL}, // S_SYMBOL_B + {SPR_SYMC, FF_ANIMATE|FF_PAPERSPRITE, -1, {NULL}, 15, 2, S_NULL}, // S_SYMBOL_C + {SPR_SYMD, FF_ANIMATE|FF_PAPERSPRITE, -1, {NULL}, 15, 2, S_NULL}, // S_SYMBOL_D + {SPR_SYME, FF_ANIMATE|FF_PAPERSPRITE, -1, {NULL}, 15, 2, S_NULL}, // S_SYMBOL_E + {SPR_SYMF, FF_ANIMATE|FF_PAPERSPRITE, -1, {NULL}, 15, 2, S_NULL}, // S_SYMBOL_F + {SPR_SYMG, FF_ANIMATE|FF_PAPERSPRITE, -1, {NULL}, 15, 2, S_NULL}, // S_SYMBOL_G + {SPR_SYMH, FF_ANIMATE|FF_PAPERSPRITE, -1, {NULL}, 15, 2, S_NULL}, // S_SYMBOL_H + {SPR_SYMI, FF_ANIMATE|FF_PAPERSPRITE, -1, {NULL}, 15, 2, S_NULL}, // S_SYMBOL_I + {SPR_SYMJ, FF_ANIMATE|FF_PAPERSPRITE, -1, {NULL}, 15, 2, S_NULL}, // S_SYMBOL_J + {SPR_SYMK, FF_ANIMATE|FF_PAPERSPRITE, -1, {NULL}, 15, 2, S_NULL}, // S_SYMBOL_K + {SPR_SYML, FF_ANIMATE|FF_PAPERSPRITE, -1, {NULL}, 15, 2, S_NULL}, // S_SYMBOL_L + {SPR_SYMM, FF_ANIMATE|FF_PAPERSPRITE, -1, {NULL}, 15, 2, S_NULL}, // S_SYMBOL_M + {SPR_SYMN, FF_ANIMATE|FF_PAPERSPRITE, -1, {NULL}, 15, 2, S_NULL}, // S_SYMBOL_N + {SPR_SYMO, FF_ANIMATE|FF_PAPERSPRITE, -1, {NULL}, 15, 2, S_NULL}, // S_SYMBOL_O + {SPR_SYMP, FF_ANIMATE|FF_PAPERSPRITE, -1, {NULL}, 15, 2, S_NULL}, // S_SYMBOL_P + {SPR_SYMQ, FF_ANIMATE|FF_PAPERSPRITE, -1, {NULL}, 15, 2, S_NULL}, // S_SYMBOL_Q + {SPR_SYMR, FF_ANIMATE|FF_PAPERSPRITE, -1, {NULL}, 15, 2, S_NULL}, // S_SYMBOL_R + {SPR_SYMS, FF_ANIMATE|FF_PAPERSPRITE, -1, {NULL}, 15, 2, S_NULL}, // S_SYMBOL_S + {SPR_SYMT, FF_ANIMATE|FF_PAPERSPRITE, -1, {NULL}, 15, 2, S_NULL}, // S_SYMBOL_T + {SPR_SYMU, FF_ANIMATE|FF_PAPERSPRITE, -1, {NULL}, 15, 2, S_NULL}, // S_SYMBOL_U + {SPR_SYMV, FF_ANIMATE|FF_PAPERSPRITE, -1, {NULL}, 15, 2, S_NULL}, // S_SYMBOL_V + {SPR_BUMP, FF_FULLBRIGHT, 3, {NULL}, 0, 0, S_BUMP2}, // S_BUMP1 {SPR_BUMP, FF_FULLBRIGHT|1, 3, {NULL}, 0, 0, S_BUMP3}, // S_BUMP2 {SPR_BUMP, FF_FULLBRIGHT|2, 3, {NULL}, 0, 0, S_NULL}, // S_BUMP3 @@ -22791,7 +22859,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = MF_NOGRAVITY|MF_NOCLIPHEIGHT|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, - + { // MT_SIGNSPARKLE -1, // doomednum S_SIGNSPARK1, // spawnstate @@ -26086,6 +26154,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, + { // MT_SYMBOL + -1, // doomednum + S_SYMBOL_0, // spawnstate + 1000, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 0, // speed + 43*FRACUNIT, // radius + 100*FRACUNIT, // height + 0, // display offset + 100, // mass + 0, // damage + sfx_None, // activesound + MF_NOGRAVITY|MF_SCENERY|MF_NOCLIP|MF_NOCLIPTHING|MF_NOCLIPHEIGHT|MF_DONTENCOREMAP, // flags + S_NULL // raisestate + }, + { // MT_BUMP -1, // doomednum S_BUMP1, // spawnstate @@ -29946,7 +30041,7 @@ skincolor_t skincolors[MAXSKINCOLORS] = { {"Position Best 4", {255, 255, 122, 122, 123, 123, 141, 141, 142, 142, 143, 143, 138, 139, 254, 30}, SKINCOLOR_NONE, 0, 0, false}, // SKINCOLOR_POSNUM_BEST4 {"Position Best 5", {152, 152, 153, 153, 154, 154, 155, 155, 156, 156, 157, 158, 159, 253, 254, 30}, SKINCOLOR_NONE, 0, 0, false}, // SKINCOLOR_POSNUM_BEST5 {"Position Best 6", {181, 181, 182, 182, 183, 183, 184, 184, 185, 185, 186, 186, 187, 187, 29, 30}, SKINCOLOR_NONE, 0, 0, false}, // SKINCOLOR_POSNUM_BEST6 - + {"Intermission", {0,80,80,81,81,81,84,85,86,87,246,248,251,26,28,31}, SKINCOLOR_NONE, 0, 0, false} // SKINCOLOR_INTERMISSION }; diff --git a/src/info.h b/src/info.h index 566e23eab..b0f51f256 100644 --- a/src/info.h +++ b/src/info.h @@ -1185,6 +1185,40 @@ typedef enum sprite SPR_CRAB, // Crystal Abyss mobs SPR_BRNG, // Chaotix Big Ring + // Lost Colony symbol signs + SPR_SYM0, + SPR_SYM1, + SPR_SYM2, + SPR_SYM3, + SPR_SYM4, + SPR_SYM5, + SPR_SYM6, + SPR_SYM7, + SPR_SYM8, + SPR_SYM9, + SPR_SYMA, + SPR_SYMB, + SPR_SYMC, + SPR_SYMD, + SPR_SYME, + SPR_SYMF, + SPR_SYMG, + SPR_SYMH, + SPR_SYMI, + SPR_SYMJ, + SPR_SYMK, + SPR_SYML, + SPR_SYMM, + SPR_SYMN, + SPR_SYMO, + SPR_SYMP, + SPR_SYMQ, + SPR_SYMR, + SPR_SYMS, + SPR_SYMT, + SPR_SYMU, + SPR_SYMV, + SPR_BUMP, // Player/shell bump SPR_FLEN, // Shell hit graphics stuff SPR_CLAS, // items clash @@ -5058,6 +5092,40 @@ typedef enum state S_LAMPPOST, S_MOSSYTREE, + // Lost Colony symbol signs + S_SYMBOL_0, + S_SYMBOL_1, + S_SYMBOL_2, + S_SYMBOL_3, + S_SYMBOL_4, + S_SYMBOL_5, + S_SYMBOL_6, + S_SYMBOL_7, + S_SYMBOL_8, + S_SYMBOL_9, + S_SYMBOL_A, + S_SYMBOL_B, + S_SYMBOL_C, + S_SYMBOL_D, + S_SYMBOL_E, + S_SYMBOL_F, + S_SYMBOL_G, + S_SYMBOL_H, + S_SYMBOL_I, + S_SYMBOL_J, + S_SYMBOL_K, + S_SYMBOL_L, + S_SYMBOL_M, + S_SYMBOL_N, + S_SYMBOL_O, + S_SYMBOL_P, + S_SYMBOL_Q, + S_SYMBOL_R, + S_SYMBOL_S, + S_SYMBOL_T, + S_SYMBOL_U, + S_SYMBOL_V, + S_BUMP1, S_BUMP2, S_BUMP3, @@ -6612,6 +6680,8 @@ typedef enum mobj_type MT_LAMPPOST, MT_MOSSYTREE, + MT_SYMBOL, // Lost Colony symbol signs + MT_BUMP, MT_FLINGENERGY, diff --git a/src/k_objects.h b/src/k_objects.h index 3ea63b8ce..7b752347f 100644 --- a/src/k_objects.h +++ b/src/k_objects.h @@ -140,6 +140,11 @@ void Obj_SpawnGachaBomRebound(mobj_t *source, mobj_t *target); /* Servant Hand */ void Obj_ServantHandHandling(player_t *player); +/* Lost Colony symbol signs */ +void Obj_SymbolSpawn(mobj_t *mobj); +void Obj_SymbolSetup(mobj_t *mobj, mapthing_t *mthing); +void Obj_SymbolThink(mobj_t *mobj); + #ifdef __cplusplus } // extern "C" #endif diff --git a/src/objects/CMakeLists.txt b/src/objects/CMakeLists.txt index 6ec83ac0c..b040ad1cc 100644 --- a/src/objects/CMakeLists.txt +++ b/src/objects/CMakeLists.txt @@ -21,4 +21,5 @@ target_sources(SRB2SDL2 PRIVATE block.c gachabom-rebound.cpp servant-hand.c + symbol.c ) diff --git a/src/objects/symbol.c b/src/objects/symbol.c new file mode 100644 index 000000000..fbd96fe7b --- /dev/null +++ b/src/objects/symbol.c @@ -0,0 +1,44 @@ +#include "../p_mobj.h" +#include "../p_local.h" +#include "../k_objects.h" + +#define SYMBOL_SCALE (2<extravalue1 = mobj->z; + mobj->extravalue2 = FixedMul(mobj->x + mobj->y, mapobjectscale); +} + +void Obj_SymbolSetup(mobj_t *mobj, mapthing_t *mthing) +{ + fixed_t oldHeight = mobj->height; + statenum_t stateNum = mobj->info->spawnstate + (mthing->args[0] % SYMBOL_OPTIONS); + + mobj->angle += ANGLE_90; + P_SetScale(mobj, mobj->destscale = 4 * FixedMul(mobj->scale, SYMBOL_SCALE)); + mobj->z += 4 * FixedMul(mapobjectscale, SYMBOL_ZOFFSET) * P_MobjFlip(mobj); + + if (mthing->options & MTF_OBJECTFLIP) + { + mobj->z += oldHeight - mobj->height; + } + + mobj->extravalue1 = mobj->old_z = mobj->z; + P_SetMobjState(mobj, stateNum); +} + +void Obj_SymbolThink(mobj_t *mobj) +{ + fixed_t offset = FixedMul(mapobjectscale, + FixedMul(SYMBOL_BOBRANGE, + FixedMul(FINESINE(FixedAngle(leveltime * SYMBOL_BOBSPEED + mobj->extravalue2) >> ANGLETOFINESHIFT) + FRACUNIT, FRACUNIT >> 1) + ) + ); + + mobj->z = mobj->extravalue1 + P_MobjFlip(mobj) * offset; +} diff --git a/src/p_mobj.c b/src/p_mobj.c index f28575cf7..0fb6777a7 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6681,6 +6681,9 @@ static void P_MobjSceneryThink(mobj_t *mobj) return; } break; + case MT_SYMBOL: + Obj_SymbolThink(mobj); + break; case MT_VWREF: case MT_VWREB: { @@ -8056,7 +8059,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj) // cusval: responsible for disappear FX (should only happen once) // S_MAGICANBOX: sides, starting angle is set in the spawner (SetRandomFakePlayerSkin) - // S_MAGICIANBOX_TOP, S_MAGICIANBOX_BOTTOM: splats with their own offset sprite sets + // S_MAGICIANBOX_TOP, S_MAGICIANBOX_BOTTOM: splats with their own offset sprite sets mobj->extravalue2--; @@ -10911,6 +10914,9 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) case MT_SPHEREBOX: Obj_RandomItemSpawn(mobj); break; + case MT_SYMBOL: + Obj_SymbolSpawn(mobj); + break; default: break; } @@ -12239,7 +12245,7 @@ static mobjtype_t P_GetMobjtypeSubstitute(mapthing_t *mthing, mobjtype_t i) if ((i == MT_RANDOMITEM) && (gametyperules & (GTR_PAPERITEMS|GTR_CIRCUIT)) == (GTR_PAPERITEMS|GTR_CIRCUIT)) return MT_PAPERITEMSPOT; - + return i; } @@ -13395,6 +13401,11 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj) Obj_InitLoopCenter(mobj); break; } + case MT_SYMBOL: + { + Obj_SymbolSetup(mobj, mthing); + break; + } default: break; } From edfd43ce818f2718e96a01ec0c270b6f1b2d648e Mon Sep 17 00:00:00 2001 From: AJ Martinez Date: Mon, 3 Jul 2023 16:35:52 -0700 Subject: [PATCH 02/16] Use input steering (not camera steering) on skipped tics --- src/p_user.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index b6750eed8..d6166ec1e 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2380,7 +2380,20 @@ static void P_UpdatePlayerAngle(player_t *player) INT16 targetsteering = K_UpdateSteeringValue(player->steering, player->cmd.turning); angleChange = K_GetKartTurnValue(player, targetsteering) << TICCMD_REDUCE; - if (!K_PlayerUsesBotMovement(player)) + if (K_PlayerUsesBotMovement(player)) + { + // You're a bot. Go where you're supposed to go + player->steering = targetsteering; + } + else if (!(player->cmd.flags & TICCMD_RECEIVED)) + { + // This player missed a tic! This ticcmd is copied from our last received one, + // which means it will include the same angle. If we steer them towards this, + // it's very likely we will input the wrong direction and screw with easing state. + // Instead, assume the player keeps steering in the direction they were steering. + player->steering = targetsteering; + } + else { // With a full slam on the analog stick, how far could we steer in either direction? INT16 steeringRight = K_UpdateSteeringValue(player->steering, KART_FULLTURN); @@ -2431,11 +2444,6 @@ static void P_UpdatePlayerAngle(player_t *player) angleChange = targetDelta; } } - else - { - // You're a bot. Go where you're supposed to go - player->steering = targetsteering; - } if (p == UINT8_MAX) { From fe122291bc99516e585cc83ebf9c6edabb3f7cbc Mon Sep 17 00:00:00 2001 From: AJ Martinez Date: Thu, 6 Jul 2023 01:37:05 -0700 Subject: [PATCH 03/16] Buffer double-submitted ticcmds --- src/d_clisrv.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index e5dde4921..d5023265f 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -5170,8 +5170,14 @@ static void HandlePacketFromPlayer(SINT8 node) || netbuffer->packettype == PT_NODEKEEPALIVEMIS) break; + // If we already received a ticcmd for this tic, just submit it for the next one. + tic_t faketic = maketic; + + if (!!(netcmds[maketic % BACKUPTICS][netconsole].flags & TICCMD_RECEIVED)) + faketic++; + // Copy ticcmd - G_MoveTiccmd(&netcmds[maketic%BACKUPTICS][netconsole], &netbuffer->u.clientpak.cmd, 1); + G_MoveTiccmd(&netcmds[faketic%BACKUPTICS][netconsole], &netbuffer->u.clientpak.cmd, 1); // Check ticcmd for "speed hacks" if (CheckForSpeedHacks((UINT8)netconsole)) @@ -5183,7 +5189,7 @@ static void HandlePacketFromPlayer(SINT8 node) || (netbuffer->packettype == PT_CLIENT4CMD || netbuffer->packettype == PT_CLIENT4MIS)) && (nodetoplayer2[node] >= 0)) { - G_MoveTiccmd(&netcmds[maketic%BACKUPTICS][(UINT8)nodetoplayer2[node]], + G_MoveTiccmd(&netcmds[faketic%BACKUPTICS][(UINT8)nodetoplayer2[node]], &netbuffer->u.client2pak.cmd2, 1); if (CheckForSpeedHacks((UINT8)nodetoplayer2[node])) @@ -5194,7 +5200,7 @@ static void HandlePacketFromPlayer(SINT8 node) || (netbuffer->packettype == PT_CLIENT4CMD || netbuffer->packettype == PT_CLIENT4MIS)) && (nodetoplayer3[node] >= 0)) { - G_MoveTiccmd(&netcmds[maketic%BACKUPTICS][(UINT8)nodetoplayer3[node]], + G_MoveTiccmd(&netcmds[faketic%BACKUPTICS][(UINT8)nodetoplayer3[node]], &netbuffer->u.client3pak.cmd3, 1); if (CheckForSpeedHacks((UINT8)nodetoplayer3[node])) @@ -5204,7 +5210,7 @@ static void HandlePacketFromPlayer(SINT8 node) if ((netbuffer->packettype == PT_CLIENT4CMD || netbuffer->packettype == PT_CLIENT4MIS) && (nodetoplayer4[node] >= 0)) { - G_MoveTiccmd(&netcmds[maketic%BACKUPTICS][(UINT8)nodetoplayer4[node]], + G_MoveTiccmd(&netcmds[faketic%BACKUPTICS][(UINT8)nodetoplayer4[node]], &netbuffer->u.client4pak.cmd4, 1); if (CheckForSpeedHacks((UINT8)nodetoplayer4[node])) From 9ebfc121677a32ba970fd6b4137e8a7694283618 Mon Sep 17 00:00:00 2001 From: AJ Martinez Date: Thu, 6 Jul 2023 16:04:28 -0700 Subject: [PATCH 04/16] Only use ticmiss input-steering if we didn't use it last tic --- src/p_user.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index d6166ec1e..74b5d6231 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2385,13 +2385,17 @@ static void P_UpdatePlayerAngle(player_t *player) // You're a bot. Go where you're supposed to go player->steering = targetsteering; } - else if (!(player->cmd.flags & TICCMD_RECEIVED)) + else if ((!(player->cmd.flags & TICCMD_RECEIVED)) && (!!(player->oldcmd.flags && TICCMD_RECEIVED))) { - // This player missed a tic! This ticcmd is copied from our last received one, - // which means it will include the same angle. If we steer them towards this, - // it's very likely we will input the wrong direction and screw with easing state. - // Instead, assume the player keeps steering in the direction they were steering. + // Missed a single tic. This ticcmd is copied from their previous one + // (less the TICCMD_RECEIVED flag), so it will include an old angle, and + // steering towards that will turn unambitiously. A better guess is to + // assume their inputs are the same, and turn based on those for 1 tic. player->steering = targetsteering; + // "Why not use this for multiple consecutive dropped tics?" Oversimplification: + // Clients have default netticbuffer 1, so missing more than 1 tic will freeze + // your client, and with it, your local camera. Our goal then becomes not to + // steer PAST the angle you can see, so the default turn solver behavior is best. } else { From 9a149ed35b889be70eac8e886e219477707767c5 Mon Sep 17 00:00:00 2001 From: Eidolon Date: Sun, 9 Jul 2023 12:27:00 -0500 Subject: [PATCH 05/16] Give StaticVec a special iterator type Avoids a bogus warning in std::sort in GCC's STL. --- src/core/static_vec.hpp | 64 ++++++++++++++++++++++++++++++++++------- 1 file changed, 54 insertions(+), 10 deletions(-) diff --git a/src/core/static_vec.hpp b/src/core/static_vec.hpp index 36962d591..b774f7705 100644 --- a/src/core/static_vec.hpp +++ b/src/core/static_vec.hpp @@ -15,6 +15,50 @@ namespace srb2 { +template +class StaticVec; + +// Silly hack to avoid GCC standard library algorithms bogus compile warnings +template +class StaticVecIter +{ + T* p_; + + StaticVecIter(T* p) noexcept : p_(p) {} + + friend class StaticVec; + friend class StaticVec::type, Limit>; + +public: + using difference_type = ptrdiff_t; + using value_type = T; + using pointer = T*; + using reference = T&; + using iterator_category = std::random_access_iterator_tag; + + T& operator*() const noexcept { return *p_; } + T* operator->() const noexcept { return p_; } + StaticVecIter& operator++() noexcept { p_++; return *this; } + StaticVecIter operator++(int) noexcept { StaticVecIter copy = *this; ++(*this); return copy; } + StaticVecIter& operator--() noexcept { p_--; return *this; } + StaticVecIter operator--(int) noexcept { StaticVecIter copy = *this; --(*this); return copy; } + StaticVecIter& operator+=(ptrdiff_t ofs) noexcept { p_ += ofs; return *this; } + StaticVecIter& operator-=(ptrdiff_t ofs) noexcept { p_ -= ofs; return *this; } + T& operator[](ptrdiff_t ofs) noexcept { return *(p_ + ofs); } + + friend ptrdiff_t operator+(const StaticVecIter& lhs, const StaticVecIter& rhs) noexcept { return lhs.p_ + rhs.p_; } + friend ptrdiff_t operator-(const StaticVecIter& lhs, const StaticVecIter& rhs) noexcept { return lhs.p_ - rhs.p_; } + friend StaticVecIter operator+(const StaticVecIter& lhs, ptrdiff_t rhs) noexcept { return lhs.p_ + rhs; } + friend StaticVecIter operator-(const StaticVecIter& lhs, ptrdiff_t rhs) noexcept { return lhs.p_ - rhs; } + + friend bool operator==(const StaticVecIter& lhs, const StaticVecIter& rhs) noexcept { return lhs.p_ == rhs.p_; } + friend bool operator!=(const StaticVecIter& lhs, const StaticVecIter& rhs) noexcept { return !(lhs.p_ == rhs.p_); } + friend bool operator>(const StaticVecIter& lhs, const StaticVecIter& rhs) noexcept { return lhs.p_ > rhs.p_; } + friend bool operator<=(const StaticVecIter& lhs, const StaticVecIter& rhs) noexcept { return !(lhs.p_ > rhs.p_); } + friend bool operator<(const StaticVecIter& lhs, const StaticVecIter& rhs) noexcept { return lhs.p_ < rhs.p_; } + friend bool operator>=(const StaticVecIter& lhs, const StaticVecIter& rhs) noexcept { return !(lhs.p_ < rhs.p_); } +}; + template class StaticVec { @@ -138,25 +182,25 @@ public: size_ = 0; } - constexpr T* begin() noexcept { return &arr_[0]; } + constexpr StaticVecIter begin() noexcept { return &arr_[0]; } - constexpr const T* begin() const noexcept { return cbegin(); } + constexpr StaticVecIter begin() const noexcept { return cbegin(); } - constexpr const T* cbegin() const noexcept { return &arr_[0]; } + constexpr StaticVecIter cbegin() const noexcept { return &arr_[0]; } - constexpr T* end() noexcept { return &arr_[size_]; } + constexpr StaticVecIter end() noexcept { return &arr_[size_]; } - constexpr const T* end() const noexcept { return cend(); } + constexpr StaticVecIter end() const noexcept { return cend(); } - constexpr const T* cend() const noexcept { return &arr_[size_]; } + constexpr StaticVecIter cend() const noexcept { return &arr_[size_]; } - constexpr std::reverse_iterator rbegin() noexcept { return &arr_[size_]; } + constexpr std::reverse_iterator> rbegin() noexcept { return &arr_[size_]; } - constexpr std::reverse_iterator crbegin() const noexcept { return &arr_[size_]; } + constexpr std::reverse_iterator> crbegin() const noexcept { return &arr_[size_]; } - constexpr std::reverse_iterator rend() noexcept { return &arr_[0]; } + constexpr std::reverse_iterator> rend() noexcept { return &arr_[0]; } - constexpr std::reverse_iterator crend() const noexcept { return &arr_[0]; } + constexpr std::reverse_iterator> crend() const noexcept { return &arr_[0]; } constexpr bool empty() const noexcept { return size_ == 0; } From 3ec7163a345dc5453bd5ff8d6bb1a0de79c217ef Mon Sep 17 00:00:00 2001 From: Eidolon Date: Sat, 8 Jul 2023 16:33:05 -0500 Subject: [PATCH 06/16] rhi: remove TransferContexts --- src/hwr2/pass.hpp | 4 +-- src/hwr2/pass_blit_postimg_screens.cpp | 2 +- src/hwr2/pass_blit_postimg_screens.hpp | 2 +- src/hwr2/pass_blit_rect.cpp | 2 +- src/hwr2/pass_blit_rect.hpp | 2 +- src/hwr2/pass_imgui.cpp | 2 +- src/hwr2/pass_imgui.hpp | 2 +- src/hwr2/pass_manager.cpp | 11 +++--- src/hwr2/pass_manager.hpp | 2 +- src/hwr2/pass_postprocess.cpp | 2 +- src/hwr2/pass_postprocess.hpp | 2 +- src/hwr2/pass_resource_managers.cpp | 16 ++++----- src/hwr2/pass_resource_managers.hpp | 16 ++++----- src/hwr2/pass_screenshot.cpp | 2 +- src/hwr2/pass_screenshot.hpp | 2 +- src/hwr2/pass_software.cpp | 2 +- src/hwr2/pass_software.hpp | 2 +- src/hwr2/pass_twodee.cpp | 2 +- src/hwr2/pass_twodee.hpp | 2 +- src/hwr2/patch_atlas.cpp | 2 +- src/hwr2/patch_atlas.hpp | 2 +- src/rhi/gl3_core/gl3_core_rhi.cpp | 47 ++++++-------------------- src/rhi/gl3_core/gl3_core_rhi.hpp | 17 +++------- src/rhi/rhi.hpp | 15 +++----- 24 files changed, 58 insertions(+), 102 deletions(-) diff --git a/src/hwr2/pass.hpp b/src/hwr2/pass.hpp index a745bd12b..3cf73c841 100644 --- a/src/hwr2/pass.hpp +++ b/src/hwr2/pass.hpp @@ -26,10 +26,10 @@ public: /// @param rhi virtual void prepass(rhi::Rhi& rhi) = 0; - /// @brief Upload contents for needed GPU resources. + /// @brief Upload contents for needed GPU resources. Passes must implement but this will be removed soon. /// @param rhi /// @param ctx - virtual void transfer(rhi::Rhi& rhi, rhi::Handle ctx) = 0; + virtual void transfer(rhi::Rhi& rhi, rhi::Handle ctx) = 0; /// @brief Issue draw calls. /// @param rhi diff --git a/src/hwr2/pass_blit_postimg_screens.cpp b/src/hwr2/pass_blit_postimg_screens.cpp index 7fe485faf..da3b317eb 100644 --- a/src/hwr2/pass_blit_postimg_screens.cpp +++ b/src/hwr2/pass_blit_postimg_screens.cpp @@ -141,7 +141,7 @@ static Rect get_screen_viewport(uint32_t screen, uint32_t screens, uint32_t w, u return {0, 0, w, h}; } -void BlitPostimgScreens::transfer(Rhi& rhi, Handle ctx) +void BlitPostimgScreens::transfer(Rhi& rhi, Handle ctx) { // Upload needed buffers if (upload_quad_buffer_) diff --git a/src/hwr2/pass_blit_postimg_screens.hpp b/src/hwr2/pass_blit_postimg_screens.hpp index 47893476a..382995d58 100644 --- a/src/hwr2/pass_blit_postimg_screens.hpp +++ b/src/hwr2/pass_blit_postimg_screens.hpp @@ -72,7 +72,7 @@ public: virtual ~BlitPostimgScreens(); virtual void prepass(rhi::Rhi& rhi) override; - virtual void transfer(rhi::Rhi& rhi, rhi::Handle ctx) override; + virtual void transfer(rhi::Rhi& rhi, rhi::Handle ctx) override; virtual void graphics(rhi::Rhi& rhi, rhi::Handle ctx) override; virtual void postpass(rhi::Rhi& rhi) override; diff --git a/src/hwr2/pass_blit_rect.cpp b/src/hwr2/pass_blit_rect.cpp index 38f0cf5cf..89971b456 100644 --- a/src/hwr2/pass_blit_rect.cpp +++ b/src/hwr2/pass_blit_rect.cpp @@ -124,7 +124,7 @@ void BlitRectPass::prepass(Rhi& rhi) } } -void BlitRectPass::transfer(Rhi& rhi, Handle ctx) +void BlitRectPass::transfer(Rhi& rhi, Handle ctx) { if (quad_vbo_needs_upload_ && quad_vbo_) { diff --git a/src/hwr2/pass_blit_rect.hpp b/src/hwr2/pass_blit_rect.hpp index 010583c3e..f0719b70e 100644 --- a/src/hwr2/pass_blit_rect.hpp +++ b/src/hwr2/pass_blit_rect.hpp @@ -51,7 +51,7 @@ public: virtual ~BlitRectPass(); virtual void prepass(rhi::Rhi& rhi) override; - virtual void transfer(rhi::Rhi& rhi, rhi::Handle ctx) override; + virtual void transfer(rhi::Rhi& rhi, rhi::Handle ctx) override; virtual void graphics(rhi::Rhi& rhi, rhi::Handle ctx) override; virtual void postpass(rhi::Rhi& rhi) override; diff --git a/src/hwr2/pass_imgui.cpp b/src/hwr2/pass_imgui.cpp index 3707a4a3d..9cbb87ad7 100644 --- a/src/hwr2/pass_imgui.cpp +++ b/src/hwr2/pass_imgui.cpp @@ -127,7 +127,7 @@ void ImguiPass::prepass(Rhi& rhi) } } -void ImguiPass::transfer(Rhi& rhi, Handle ctx) +void ImguiPass::transfer(Rhi& rhi, Handle ctx) { ImGuiIO& io = ImGui::GetIO(); diff --git a/src/hwr2/pass_imgui.hpp b/src/hwr2/pass_imgui.hpp index 91d2afe20..b2a7cc99c 100644 --- a/src/hwr2/pass_imgui.hpp +++ b/src/hwr2/pass_imgui.hpp @@ -50,7 +50,7 @@ public: virtual void prepass(rhi::Rhi& rhi) override; - virtual void transfer(rhi::Rhi& rhi, rhi::Handle ctx) override; + virtual void transfer(rhi::Rhi& rhi, rhi::Handle ctx) override; virtual void graphics(rhi::Rhi& rhi, rhi::Handle ctx) override; diff --git a/src/hwr2/pass_manager.cpp b/src/hwr2/pass_manager.cpp index a6bc386a7..ab0e60b21 100644 --- a/src/hwr2/pass_manager.cpp +++ b/src/hwr2/pass_manager.cpp @@ -32,7 +32,7 @@ public: virtual ~LambdaPass(); virtual void prepass(rhi::Rhi& rhi) override; - virtual void transfer(rhi::Rhi& rhi, rhi::Handle ctx) override; + virtual void transfer(rhi::Rhi& rhi, rhi::Handle ctx) override; virtual void graphics(rhi::Rhi& rhi, rhi::Handle ctx) override; virtual void postpass(rhi::Rhi& rhi) override; }; @@ -63,7 +63,7 @@ void LambdaPass::prepass(Rhi& rhi) } } -void LambdaPass::transfer(Rhi&, Handle) +void LambdaPass::transfer(Rhi&, Handle) { } @@ -137,7 +137,7 @@ void PassManager::prepass(Rhi& rhi) } } -void PassManager::transfer(Rhi& rhi, Handle ctx) +void PassManager::transfer(Rhi& rhi, Handle ctx) { for (auto& pass : passes_) { @@ -179,11 +179,8 @@ void PassManager::render(Rhi& rhi) prepass(rhi); - Handle tc = rhi.begin_transfer(); - transfer(rhi, tc); - rhi.end_transfer(tc); - Handle gc = rhi.begin_graphics(); + transfer(rhi, gc); graphics(rhi, gc); rhi.end_graphics(gc); diff --git a/src/hwr2/pass_manager.hpp b/src/hwr2/pass_manager.hpp index c462dd395..7734e0a43 100644 --- a/src/hwr2/pass_manager.hpp +++ b/src/hwr2/pass_manager.hpp @@ -43,7 +43,7 @@ public: PassManager& operator=(PassManager&&) = delete; virtual void prepass(rhi::Rhi& rhi) override; - virtual void transfer(rhi::Rhi& rhi, rhi::Handle ctx) override; + virtual void transfer(rhi::Rhi& rhi, rhi::Handle ctx) override; virtual void graphics(rhi::Rhi& rhi, rhi::Handle ctx) override; virtual void postpass(rhi::Rhi& rhi) override; diff --git a/src/hwr2/pass_postprocess.cpp b/src/hwr2/pass_postprocess.cpp index a35dea645..0f2eefdc2 100644 --- a/src/hwr2/pass_postprocess.cpp +++ b/src/hwr2/pass_postprocess.cpp @@ -175,7 +175,7 @@ void PostprocessWipePass::prepass(Rhi& rhi) }); } -void PostprocessWipePass::transfer(Rhi& rhi, Handle ctx) +void PostprocessWipePass::transfer(Rhi& rhi, Handle ctx) { if (wipe_tex_ == kNullHandle) { diff --git a/src/hwr2/pass_postprocess.hpp b/src/hwr2/pass_postprocess.hpp index ced81975c..f0deb7ff9 100644 --- a/src/hwr2/pass_postprocess.hpp +++ b/src/hwr2/pass_postprocess.hpp @@ -49,7 +49,7 @@ public: virtual ~PostprocessWipePass(); virtual void prepass(rhi::Rhi& rhi) override; - virtual void transfer(rhi::Rhi& rhi, rhi::Handle ctx) override; + virtual void transfer(rhi::Rhi& rhi, rhi::Handle ctx) override; virtual void graphics(rhi::Rhi& rhi, rhi::Handle ctx) override; virtual void postpass(rhi::Rhi& rhi) override; diff --git a/src/hwr2/pass_resource_managers.cpp b/src/hwr2/pass_resource_managers.cpp index 550f5a015..99a05ca26 100644 --- a/src/hwr2/pass_resource_managers.cpp +++ b/src/hwr2/pass_resource_managers.cpp @@ -128,7 +128,7 @@ void FramebufferManager::prepass(Rhi& rhi) } } -void FramebufferManager::transfer(Rhi& rhi, Handle ctx) +void FramebufferManager::transfer(Rhi& rhi, Handle ctx) { } @@ -169,7 +169,7 @@ void MainPaletteManager::prepass(Rhi& rhi) } } -void MainPaletteManager::upload_palette(Rhi& rhi, Handle ctx) +void MainPaletteManager::upload_palette(Rhi& rhi, Handle ctx) { std::array palette_32; for (std::size_t i = 0; i < kPaletteSize; i++) @@ -179,7 +179,7 @@ void MainPaletteManager::upload_palette(Rhi& rhi, Handle ctx) rhi.update_texture(ctx, palette_, {0, 0, kPaletteSize, 1}, PixelFormat::kRGBA8, tcb::as_bytes(tcb::span(palette_32))); } -void MainPaletteManager::upload_lighttables(Rhi& rhi, Handle ctx) +void MainPaletteManager::upload_lighttables(Rhi& rhi, Handle ctx) { if (colormaps != nullptr) { @@ -206,7 +206,7 @@ void MainPaletteManager::upload_lighttables(Rhi& rhi, Handle ct } } -void MainPaletteManager::upload_default_colormap(Rhi& rhi, Handle ctx) +void MainPaletteManager::upload_default_colormap(Rhi& rhi, Handle ctx) { std::array data; for (std::size_t i = 0; i < kPaletteSize; i++) @@ -216,7 +216,7 @@ void MainPaletteManager::upload_default_colormap(Rhi& rhi, Handle ctx) +void MainPaletteManager::upload_colormaps(Rhi& rhi, Handle ctx) { for (auto to_upload : colormaps_to_upload_) { @@ -279,7 +279,7 @@ rhi::Handle MainPaletteManager::find_extra_lighttable(srb2::NotNul return lighttables_.at(lighttable); } -void MainPaletteManager::transfer(Rhi& rhi, Handle ctx) +void MainPaletteManager::transfer(Rhi& rhi, Handle ctx) { upload_palette(rhi, ctx); upload_lighttables(rhi, ctx); @@ -327,7 +327,7 @@ void CommonResourcesManager::prepass(Rhi& rhi) } } -void CommonResourcesManager::transfer(Rhi& rhi, Handle ctx) +void CommonResourcesManager::transfer(Rhi& rhi, Handle ctx) { if (!init_) { @@ -382,7 +382,7 @@ void FlatTextureManager::prepass(Rhi& rhi) { } -void FlatTextureManager::transfer(Rhi& rhi, Handle ctx) +void FlatTextureManager::transfer(Rhi& rhi, Handle ctx) { std::vector> flat_data; for (auto flat_lump : to_upload_) diff --git a/src/hwr2/pass_resource_managers.hpp b/src/hwr2/pass_resource_managers.hpp index 11e7fad95..ff7cce2d2 100644 --- a/src/hwr2/pass_resource_managers.hpp +++ b/src/hwr2/pass_resource_managers.hpp @@ -37,7 +37,7 @@ public: virtual ~FramebufferManager(); virtual void prepass(rhi::Rhi& rhi) override; - virtual void transfer(rhi::Rhi& rhi, rhi::Handle ctx) override; + virtual void transfer(rhi::Rhi& rhi, rhi::Handle ctx) override; virtual void graphics(rhi::Rhi& rhi, rhi::Handle ctx) override; virtual void postpass(rhi::Rhi& rhi) override; @@ -83,17 +83,17 @@ class MainPaletteManager final : public Pass std::vector colormaps_to_upload_; std::vector lighttables_to_upload_; - void upload_palette(rhi::Rhi& rhi, rhi::Handle ctx); - void upload_lighttables(rhi::Rhi& rhi, rhi::Handle ctx); - void upload_default_colormap(rhi::Rhi& rhi, rhi::Handle ctx); - void upload_colormaps(rhi::Rhi& rhi, rhi::Handle ctx); + void upload_palette(rhi::Rhi& rhi, rhi::Handle ctx); + void upload_lighttables(rhi::Rhi& rhi, rhi::Handle ctx); + void upload_default_colormap(rhi::Rhi& rhi, rhi::Handle ctx); + void upload_colormaps(rhi::Rhi& rhi, rhi::Handle ctx); public: MainPaletteManager(); virtual ~MainPaletteManager(); virtual void prepass(rhi::Rhi& rhi) override; - virtual void transfer(rhi::Rhi& rhi, rhi::Handle ctx) override; + virtual void transfer(rhi::Rhi& rhi, rhi::Handle ctx) override; virtual void graphics(rhi::Rhi& rhi, rhi::Handle ctx) override; virtual void postpass(rhi::Rhi& rhi) override; @@ -120,7 +120,7 @@ public: virtual ~CommonResourcesManager(); virtual void prepass(rhi::Rhi& rhi) override; - virtual void transfer(rhi::Rhi& rhi, rhi::Handle ctx) override; + virtual void transfer(rhi::Rhi& rhi, rhi::Handle ctx) override; virtual void graphics(rhi::Rhi& rhi, rhi::Handle ctx) override; virtual void postpass(rhi::Rhi& rhi) override; @@ -153,7 +153,7 @@ public: virtual ~FlatTextureManager(); virtual void prepass(rhi::Rhi& rhi) override; - virtual void transfer(rhi::Rhi& rhi, rhi::Handle ctx) override; + virtual void transfer(rhi::Rhi& rhi, rhi::Handle ctx) override; virtual void graphics(rhi::Rhi& rhi, rhi::Handle ctx) override; virtual void postpass(rhi::Rhi& rhi) override; diff --git a/src/hwr2/pass_screenshot.cpp b/src/hwr2/pass_screenshot.cpp index 059b07c85..cff5cc99a 100644 --- a/src/hwr2/pass_screenshot.cpp +++ b/src/hwr2/pass_screenshot.cpp @@ -40,7 +40,7 @@ void ScreenshotPass::prepass(Rhi& rhi) doing_screenshot_ = takescreenshot || moviemode != MM_OFF; } -void ScreenshotPass::transfer(Rhi& rhi, Handle ctx) +void ScreenshotPass::transfer(Rhi& rhi, Handle ctx) { } diff --git a/src/hwr2/pass_screenshot.hpp b/src/hwr2/pass_screenshot.hpp index 79de8b654..36c386a29 100644 --- a/src/hwr2/pass_screenshot.hpp +++ b/src/hwr2/pass_screenshot.hpp @@ -32,7 +32,7 @@ public: virtual ~ScreenshotPass(); virtual void prepass(rhi::Rhi& rhi) override; - virtual void transfer(rhi::Rhi& rhi, rhi::Handle ctx) override; + virtual void transfer(rhi::Rhi& rhi, rhi::Handle ctx) override; virtual void graphics(rhi::Rhi& rhi, rhi::Handle ctx) override; virtual void postpass(rhi::Rhi& rhi) override; diff --git a/src/hwr2/pass_software.cpp b/src/hwr2/pass_software.cpp index 0a514cd9b..1b9cde048 100644 --- a/src/hwr2/pass_software.cpp +++ b/src/hwr2/pass_software.cpp @@ -77,7 +77,7 @@ void SoftwarePass::prepass(Rhi& rhi) } } -void SoftwarePass::transfer(Rhi& rhi, Handle ctx) +void SoftwarePass::transfer(Rhi& rhi, Handle ctx) { // Upload screen tcb::span screen_span; diff --git a/src/hwr2/pass_software.hpp b/src/hwr2/pass_software.hpp index 4e7b02405..ae733a816 100644 --- a/src/hwr2/pass_software.hpp +++ b/src/hwr2/pass_software.hpp @@ -34,7 +34,7 @@ public: virtual ~SoftwarePass(); virtual void prepass(rhi::Rhi& rhi) override; - virtual void transfer(rhi::Rhi& rhi, rhi::Handle ctx) override; + virtual void transfer(rhi::Rhi& rhi, rhi::Handle ctx) override; virtual void graphics(rhi::Rhi& rhi, rhi::Handle ctx) override; virtual void postpass(rhi::Rhi& rhi) override; diff --git a/src/hwr2/pass_twodee.cpp b/src/hwr2/pass_twodee.cpp index ed30706df..0281737fa 100644 --- a/src/hwr2/pass_twodee.cpp +++ b/src/hwr2/pass_twodee.cpp @@ -498,7 +498,7 @@ void TwodeePass::prepass(Rhi& rhi) } } -void TwodeePass::transfer(Rhi& rhi, Handle ctx) +void TwodeePass::transfer(Rhi& rhi, Handle ctx) { if (!ctx_ || !data_) { diff --git a/src/hwr2/pass_twodee.hpp b/src/hwr2/pass_twodee.hpp index 8c72fc92e..da5c2f66f 100644 --- a/src/hwr2/pass_twodee.hpp +++ b/src/hwr2/pass_twodee.hpp @@ -97,7 +97,7 @@ struct TwodeePass final : public Pass virtual void prepass(rhi::Rhi& rhi) override; - virtual void transfer(rhi::Rhi& rhi, rhi::Handle ctx) override; + virtual void transfer(rhi::Rhi& rhi, rhi::Handle ctx) override; virtual void graphics(rhi::Rhi& rhi, rhi::Handle ctx) override; diff --git a/src/hwr2/patch_atlas.cpp b/src/hwr2/patch_atlas.cpp index fe5f6229c..26e35ca4b 100644 --- a/src/hwr2/patch_atlas.cpp +++ b/src/hwr2/patch_atlas.cpp @@ -348,7 +348,7 @@ void PatchAtlasCache::prepass(Rhi& rhi) } } -void PatchAtlasCache::transfer(Rhi& rhi, Handle ctx) +void PatchAtlasCache::transfer(Rhi& rhi, Handle ctx) { SRB2_ASSERT(ready_for_lookup()); diff --git a/src/hwr2/patch_atlas.hpp b/src/hwr2/patch_atlas.hpp index 9707074b2..85b3b1162 100644 --- a/src/hwr2/patch_atlas.hpp +++ b/src/hwr2/patch_atlas.hpp @@ -125,7 +125,7 @@ public: PatchAtlas* find_patch(srb2::NotNull patch); virtual void prepass(rhi::Rhi& rhi) override; - virtual void transfer(rhi::Rhi& rhi, rhi::Handle ctx) override; + virtual void transfer(rhi::Rhi& rhi, rhi::Handle ctx) override; virtual void graphics(rhi::Rhi& rhi, rhi::Handle ctx) override; virtual void postpass(rhi::Rhi& rhi) override; }; diff --git a/src/rhi/gl3_core/gl3_core_rhi.cpp b/src/rhi/gl3_core/gl3_core_rhi.cpp index 7d6481f6d..960e4905b 100644 --- a/src/rhi/gl3_core/gl3_core_rhi.cpp +++ b/src/rhi/gl3_core/gl3_core_rhi.cpp @@ -624,16 +624,14 @@ void GlCoreRhi::destroy_texture(rhi::Handle handle) } void GlCoreRhi::update_texture( - Handle ctx, + Handle ctx, Handle texture, Rect region, srb2::rhi::PixelFormat data_format, tcb::span data ) { - SRB2_ASSERT(graphics_context_active_ == false); - SRB2_ASSERT(transfer_context_active_ == true); - SRB2_ASSERT(ctx.generation() == transfer_context_generation_); + SRB2_ASSERT(graphics_context_active_ == true); if (data.empty()) { @@ -715,15 +713,14 @@ void GlCoreRhi::destroy_buffer(rhi::Handle handle) } void GlCoreRhi::update_buffer( - rhi::Handle ctx, + rhi::Handle ctx, rhi::Handle handle, uint32_t offset, tcb::span data ) { - SRB2_ASSERT(graphics_context_active_ == false); - SRB2_ASSERT(transfer_context_active_ == true); - SRB2_ASSERT(ctx.generation() == transfer_context_generation_); + SRB2_ASSERT(graphics_context_active_ == true); + SRB2_ASSERT(ctx.generation() == graphics_context_generation_); if (data.empty()) { @@ -753,11 +750,10 @@ void GlCoreRhi::update_buffer( } rhi::Handle -GlCoreRhi::create_uniform_set(rhi::Handle ctx, const rhi::CreateUniformSetInfo& info) +GlCoreRhi::create_uniform_set(rhi::Handle ctx, const rhi::CreateUniformSetInfo& info) { - SRB2_ASSERT(graphics_context_active_ == false); - SRB2_ASSERT(transfer_context_active_ == true); - SRB2_ASSERT(ctx.generation() == transfer_context_generation_); + SRB2_ASSERT(graphics_context_active_ == true); + SRB2_ASSERT(ctx.generation() == graphics_context_generation_); GlCoreUniformSet uniform_set; @@ -770,14 +766,13 @@ GlCoreRhi::create_uniform_set(rhi::Handle ctx, const rhi:: } rhi::Handle GlCoreRhi::create_binding_set( - rhi::Handle ctx, + rhi::Handle ctx, Handle pipeline, const rhi::CreateBindingSetInfo& info ) { - SRB2_ASSERT(graphics_context_active_ == false); - SRB2_ASSERT(transfer_context_active_ == true); - SRB2_ASSERT(ctx.generation() == transfer_context_generation_); + SRB2_ASSERT(graphics_context_active_ == true); + SRB2_ASSERT(ctx.generation() == graphics_context_generation_); SRB2_ASSERT(pipeline_slab_.is_valid(pipeline) == true); auto& pl = pipeline_slab_[pipeline]; @@ -1222,25 +1217,6 @@ void GlCoreRhi::end_graphics(rhi::Handle handle) GL_ASSERT; } -rhi::Handle GlCoreRhi::begin_transfer() -{ - SRB2_ASSERT(graphics_context_active_ == false); - SRB2_ASSERT(transfer_context_active_ == false); - - transfer_context_generation_ += 1; - transfer_context_active_ = true; - - return rhi::Handle(0, transfer_context_generation_); -} - -void GlCoreRhi::end_transfer(rhi::Handle ctx) -{ - SRB2_ASSERT(graphics_context_active_ == false); - SRB2_ASSERT(transfer_context_active_ == true); - - transfer_context_active_ = false; -} - void GlCoreRhi::present() { SRB2_ASSERT(platform_ != nullptr); @@ -1661,7 +1637,6 @@ void GlCoreRhi::bind_binding_set(Handle ctx, Handle void GlCoreRhi::bind_index_buffer(Handle ctx, Handle buffer) { - SRB2_ASSERT(transfer_context_active_ == false); SRB2_ASSERT(graphics_context_active_ == true && graphics_context_generation_ == ctx.generation()); SRB2_ASSERT(current_render_pass_.has_value() == true && current_pipeline_.has_value() == true); diff --git a/src/rhi/gl3_core/gl3_core_rhi.hpp b/src/rhi/gl3_core/gl3_core_rhi.hpp index b5f499422..1284ea77d 100644 --- a/src/rhi/gl3_core/gl3_core_rhi.hpp +++ b/src/rhi/gl3_core/gl3_core_rhi.hpp @@ -123,10 +123,6 @@ struct GlCoreGraphicsContext : public rhi::GraphicsContext { }; -struct GlCoreTransferContext : public rhi::TransferContext -{ -}; - struct GlCoreActiveUniform { uint32_t type; @@ -159,10 +155,8 @@ class GlCoreRhi final : public Rhi std::optional> current_pipeline_; PrimitiveType current_primitive_type_ = PrimitiveType::kPoints; bool graphics_context_active_ = false; - bool transfer_context_active_ = false; uint32_t graphics_context_generation_ = 0; uint32_t index_buffer_offset_ = 0; - uint32_t transfer_context_generation_ = 0; uint8_t stencil_front_reference_ = 0; uint8_t stencil_front_compare_mask_ = 0xFF; @@ -193,26 +187,23 @@ public: virtual Rect get_renderbuffer_size(Handle renderbuffer) override; virtual uint32_t get_buffer_size(Handle buffer) override; - virtual Handle begin_transfer() override; - virtual void end_transfer(Handle handle) override; - virtual void update_buffer( - Handle ctx, + Handle ctx, Handle buffer, uint32_t offset, tcb::span data ) override; virtual void update_texture( - Handle ctx, + Handle ctx, Handle texture, Rect region, srb2::rhi::PixelFormat data_format, tcb::span data ) override; virtual Handle - create_uniform_set(Handle ctx, const CreateUniformSetInfo& info) override; + create_uniform_set(Handle ctx, const CreateUniformSetInfo& info) override; virtual Handle - create_binding_set(Handle ctx, Handle pipeline, const CreateBindingSetInfo& info) + create_binding_set(Handle ctx, Handle pipeline, const CreateBindingSetInfo& info) override; virtual Handle begin_graphics() override; diff --git a/src/rhi/rhi.hpp b/src/rhi/rhi.hpp index 20f0bb7ae..3587e2b26 100644 --- a/src/rhi/rhi.hpp +++ b/src/rhi/rhi.hpp @@ -569,9 +569,6 @@ struct BindingSet { }; -struct TransferContext -{ -}; struct GraphicsContext { }; @@ -607,26 +604,22 @@ struct Rhi virtual Rect get_renderbuffer_size(Handle renderbuffer) = 0; virtual uint32_t get_buffer_size(Handle buffer) = 0; - virtual Handle begin_transfer() = 0; - virtual void end_transfer(Handle handle) = 0; - - // Transfer Context functions virtual void update_buffer( - Handle ctx, + Handle ctx, Handle buffer, uint32_t offset, tcb::span data ) = 0; virtual void update_texture( - Handle ctx, + Handle ctx, Handle texture, Rect region, srb2::rhi::PixelFormat data_format, tcb::span data ) = 0; - virtual Handle create_uniform_set(Handle ctx, const CreateUniformSetInfo& info) = 0; + virtual Handle create_uniform_set(Handle ctx, const CreateUniformSetInfo& info) = 0; virtual Handle - create_binding_set(Handle ctx, Handle pipeline, const CreateBindingSetInfo& info) = 0; + create_binding_set(Handle ctx, Handle pipeline, const CreateBindingSetInfo& info) = 0; virtual Handle begin_graphics() = 0; virtual void end_graphics(Handle ctx) = 0; From 187e4a9442cfd2b2a40bc8c5bfe018a8f8ed0f6c Mon Sep 17 00:00:00 2001 From: Eidolon Date: Sat, 8 Jul 2023 16:37:26 -0500 Subject: [PATCH 07/16] rhi/gl: Loosen constraints on resource creation It will be safe to call many of these functions in Vulkan even if a context is active, but the contents of buffers and textures will be considered undefined until updated. --- src/rhi/gl3_core/gl3_core_rhi.cpp | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/src/rhi/gl3_core/gl3_core_rhi.cpp b/src/rhi/gl3_core/gl3_core_rhi.cpp index 960e4905b..5f3bda3b5 100644 --- a/src/rhi/gl3_core/gl3_core_rhi.cpp +++ b/src/rhi/gl3_core/gl3_core_rhi.cpp @@ -568,8 +568,6 @@ GlCoreRhi::~GlCoreRhi() = default; rhi::Handle GlCoreRhi::create_render_pass(const rhi::RenderPassDesc& desc) { - SRB2_ASSERT(graphics_context_active_ == false); - // GL has no formal render pass object GlCoreRenderPass pass; pass.desc = desc; @@ -578,15 +576,11 @@ rhi::Handle GlCoreRhi::create_render_pass(const rhi::RenderPass void GlCoreRhi::destroy_render_pass(rhi::Handle handle) { - SRB2_ASSERT(graphics_context_active_ == false); - render_pass_slab_.remove(handle); } rhi::Handle GlCoreRhi::create_texture(const rhi::TextureDesc& desc) { - SRB2_ASSERT(graphics_context_active_ == false); - GLenum internal_format = map_internal_texture_format(desc.format); SRB2_ASSERT(internal_format != GL_ZERO); GLenum format = GL_RGBA; @@ -615,8 +609,6 @@ rhi::Handle GlCoreRhi::create_texture(const rhi::TextureDesc& desc void GlCoreRhi::destroy_texture(rhi::Handle handle) { - SRB2_ASSERT(graphics_context_active_ == false); - SRB2_ASSERT(texture_slab_.is_valid(handle) == true); GlCoreTexture casted = texture_slab_.remove(handle); GLuint name = casted.texture; @@ -676,8 +668,6 @@ void GlCoreRhi::update_texture( rhi::Handle GlCoreRhi::create_buffer(const rhi::BufferDesc& desc) { - SRB2_ASSERT(graphics_context_active_ == false); - GLenum target = map_buffer_type(desc.type); SRB2_ASSERT(target != GL_ZERO); @@ -702,10 +692,7 @@ rhi::Handle GlCoreRhi::create_buffer(const rhi::BufferDesc& desc) void GlCoreRhi::destroy_buffer(rhi::Handle handle) { - SRB2_ASSERT(graphics_context_active_ == false); - SRB2_ASSERT(buffer_slab_.is_valid(handle) == true); - SRB2_ASSERT(graphics_context_active_ == false); GlCoreBuffer casted = buffer_slab_.remove(handle); GLuint name = casted.buffer; @@ -837,8 +824,6 @@ rhi::Handle GlCoreRhi::create_binding_set( rhi::Handle GlCoreRhi::create_renderbuffer(const rhi::RenderbufferDesc& desc) { - SRB2_ASSERT(graphics_context_active_ == false); - GLuint name = 0; gl_->GenRenderbuffers(1, &name); @@ -871,8 +856,6 @@ rhi::Handle GlCoreRhi::create_renderbuffer(const rhi::Renderb void GlCoreRhi::destroy_renderbuffer(rhi::Handle handle) { - SRB2_ASSERT(graphics_context_active_ == false); - SRB2_ASSERT(renderbuffer_slab_.is_valid(handle) == true); GlCoreRenderbuffer casted = renderbuffer_slab_.remove(handle); GLuint name = casted.renderbuffer; @@ -1187,8 +1170,6 @@ rhi::Handle GlCoreRhi::create_pipeline(const PipelineDesc& desc) void GlCoreRhi::destroy_pipeline(rhi::Handle handle) { - SRB2_ASSERT(graphics_context_active_ == false); - SRB2_ASSERT(pipeline_slab_.is_valid(handle) == true); GlCorePipeline casted = pipeline_slab_.remove(handle); GLuint vertex_shader = casted.vertex_shader; From 9112ac8bdca52d9e1d47730c98a27399558311da Mon Sep 17 00:00:00 2001 From: Eidolon Date: Sat, 8 Jul 2023 16:51:39 -0500 Subject: [PATCH 08/16] rhi/gl: Clear stencil buffer in default renderpass --- src/rhi/gl3_core/gl3_core_rhi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rhi/gl3_core/gl3_core_rhi.cpp b/src/rhi/gl3_core/gl3_core_rhi.cpp index 5f3bda3b5..b8144788f 100644 --- a/src/rhi/gl3_core/gl3_core_rhi.cpp +++ b/src/rhi/gl3_core/gl3_core_rhi.cpp @@ -1226,7 +1226,7 @@ void GlCoreRhi::begin_default_render_pass(Handle ctx, bool clea gl_->ClearColor(0.0f, 0.0f, 0.0f, 1.0f); gl_->ClearDepth(1.0f); gl_->ClearStencil(0); - gl_->Clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + gl_->Clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); GL_ASSERT; } From 4ad383721df15dd0044d9b52569983686b84b60a Mon Sep 17 00:00:00 2001 From: Lach Date: Tue, 11 Jul 2023 21:04:06 +1000 Subject: [PATCH 09/16] Add thing type number & binary conversion to symbol signs --- src/info.c | 2 +- src/p_setup.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/info.c b/src/info.c index 72720c807..e367e410b 100644 --- a/src/info.c +++ b/src/info.c @@ -26291,7 +26291,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = }, { // MT_SYMBOL - -1, // doomednum + 4095, // doomednum S_SYMBOL_0, // spawnstate 1000, // spawnhealth S_NULL, // seestate diff --git a/src/p_setup.c b/src/p_setup.c index f6f587e1b..0bd849557 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -7202,6 +7202,14 @@ static void P_ConvertBinaryThingTypes(void) case CEILING_SLOPE_THING: mapthings[i].args[0] = mapthings[i].extrainfo; break; + case 4095: // MT_SYMBOL + mapthings[i].args[0] = mapthings[i].extrainfo; + if (mapthings[i].options & MTF_OBJECTSPECIAL) + { + // Special = add 16 to the symbol type + mapthings[i].args[0] += 16; + } + break; default: break; } From 77750438ef32470df08cdd26f5526d32a65492a0 Mon Sep 17 00:00:00 2001 From: Lach Date: Tue, 11 Jul 2023 21:51:29 +1000 Subject: [PATCH 10/16] Change symbol thing type to 4094 --- src/info.c | 2 +- src/p_setup.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/info.c b/src/info.c index e367e410b..99041f6af 100644 --- a/src/info.c +++ b/src/info.c @@ -26291,7 +26291,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = }, { // MT_SYMBOL - 4095, // doomednum + 4094, // doomednum S_SYMBOL_0, // spawnstate 1000, // spawnhealth S_NULL, // seestate diff --git a/src/p_setup.c b/src/p_setup.c index 0bd849557..27b771df1 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -7202,7 +7202,7 @@ static void P_ConvertBinaryThingTypes(void) case CEILING_SLOPE_THING: mapthings[i].args[0] = mapthings[i].extrainfo; break; - case 4095: // MT_SYMBOL + case 4094: // MT_SYMBOL mapthings[i].args[0] = mapthings[i].extrainfo; if (mapthings[i].options & MTF_OBJECTSPECIAL) { From df940de4b08b83b0c7e603bc706388f34e37af9d Mon Sep 17 00:00:00 2001 From: AJ Martinez Date: Tue, 11 Jul 2023 20:17:17 -0700 Subject: [PATCH 11/16] MF_DRAWFROMFARAWAY Lost Colony signs --- src/info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/info.c b/src/info.c index 99041f6af..94974dde9 100644 --- a/src/info.c +++ b/src/info.c @@ -26313,7 +26313,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 0, // damage sfx_None, // activesound - MF_NOGRAVITY|MF_SCENERY|MF_NOCLIP|MF_NOCLIPTHING|MF_NOCLIPHEIGHT|MF_DONTENCOREMAP, // flags + MF_NOGRAVITY|MF_SCENERY|MF_NOCLIP|MF_DRAWFROMFARAWAY|MF_NOCLIPTHING|MF_NOCLIPHEIGHT|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, From 7aec2b0732acaacc9e8a6ea3aad195af6a9b8e32 Mon Sep 17 00:00:00 2001 From: VelocitOni Date: Sun, 16 Jul 2023 02:27:25 -0400 Subject: [PATCH 12/16] 10th frame of hitsparks added Added biggest frame of hitsparks, only 1 to go now. --- src/deh_tables.c | 2 ++ src/info.c | 2 ++ src/info.h | 2 ++ src/k_hitlag.h | 2 +- 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/deh_tables.c b/src/deh_tables.c index 59af77da5..da5a89db2 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -4605,6 +4605,8 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi "S_HITLAG_6", "S_HITLAG_8", "S_HITLAG_9", + "S_HITLAG_10", + // Broly Ki Orb "S_BROLY1", diff --git a/src/info.c b/src/info.c index 94974dde9..52982babe 100644 --- a/src/info.c +++ b/src/info.c @@ -581,6 +581,7 @@ char sprnames[NUMSPRITES + 1][5] = "HFX6", // Hitlag stage 6 "HFX8", // Hitlag stage 8 "HFX9", // Hitlag stage 9 + "HFXX", // Hitlag stage 10 // Kart Items "RSHE", // Rocket sneaker @@ -5320,6 +5321,7 @@ state_t states[NUMSTATES] = {SPR_HFX6, FF_FULLBRIGHT|FF_PAPERSPRITE|FF_ANIMATE, 6, {NULL}, 5, 1, S_NULL}, // S_HITLAG_6 {SPR_HFX8, FF_FULLBRIGHT|FF_PAPERSPRITE|FF_ANIMATE, 8, {NULL}, 7, 1, S_NULL}, // S_HITLAG_8 {SPR_HFX9, FF_FULLBRIGHT|FF_PAPERSPRITE|FF_ANIMATE, 9, {NULL}, 8, 1, S_NULL}, // S_HITLAG_9 + {SPR_HFXX, FF_FULLBRIGHT|FF_PAPERSPRITE|FF_ANIMATE, 10, {NULL}, 9, 1, S_NULL}, // S_HITLAG_10 // Broly Ki Orb {SPR_LSSJ, FF_REVERSESUBTRACT|FF_FULLBRIGHT, -1, {NULL}, 0, 0, S_BROLY2}, // S_BROLY1 diff --git a/src/info.h b/src/info.h index 7cd3cc354..2ac97cc1c 100644 --- a/src/info.h +++ b/src/info.h @@ -1132,6 +1132,7 @@ typedef enum sprite SPR_HFX6, // Hitlag stage 6 SPR_HFX8, // Hitlag stage 8 SPR_HFX9, // Hitlag stage 9 + SPR_HFXX, // Hitlag stage 10 // Kart Items SPR_RSHE, // Rocket sneaker @@ -5750,6 +5751,7 @@ typedef enum state S_HITLAG_6, S_HITLAG_8, S_HITLAG_9, + S_HITLAG_10, // Broly Ki Orb S_BROLY1, diff --git a/src/k_hitlag.h b/src/k_hitlag.h index 02dedfc2a..cace7a964 100644 --- a/src/k_hitlag.h +++ b/src/k_hitlag.h @@ -22,7 +22,7 @@ extern "C" { #define MAXHITLAGTICS (30) #define HITLAGJITTERS (FRACUNIT / 20) -#define NUM_HITLAG_STATES (8) +#define NUM_HITLAG_STATES (9) /*-------------------------------------------------- void K_AddHitLag(mobj_t *mo, INT32 tics, boolean fromDamage); From 6f31a6d4a8c04c59a1b1c1b6767b975e710bbbeb Mon Sep 17 00:00:00 2001 From: VelocitOni Date: Sun, 16 Jul 2023 03:31:03 -0400 Subject: [PATCH 13/16] Initializing the instawhip reject frames Setting it up to save the future coder headache --- src/deh_tables.c | 2 ++ src/info.c | 2 ++ src/info.h | 1 + 3 files changed, 5 insertions(+) diff --git a/src/deh_tables.c b/src/deh_tables.c index 59af77da5..43316331f 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -3303,6 +3303,7 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi "S_INSTAWHIP_RECHARGE2", "S_INSTAWHIP_RECHARGE3", "S_INSTAWHIP_RECHARGE4", + "S_INSTAWHIP_REJECT", "S_BLOCKRING", "S_BLOCKBODY", @@ -5407,6 +5408,7 @@ const char *const MOBJTYPE_LIST[] = { // array length left dynamic for sanity t "MT_INSTAWHIP", "MT_INSTAWHIP_RECHARGE", + "MT_INSTAWHIP_REJECT", "MT_BLOCKRING", "MT_BLOCKBODY", diff --git a/src/info.c b/src/info.c index 94974dde9..93ea8c521 100644 --- a/src/info.c +++ b/src/info.c @@ -558,6 +558,7 @@ char sprnames[NUMSPRITES + 1][5] = "IWHP", // Instawhip "WPRE", // Instawhip Recharge + "WPRJ", // Instawhip Reject "GRNG", // Guard ring "GBDY", // Guard body @@ -4022,6 +4023,7 @@ state_t states[NUMSTATES] = {SPR_NULL, 0, 0, {A_PlaySound}, sfx_s3ka0, 2, S_INSTAWHIP_RECHARGE3}, // S_INSTAWHIP_RECHARGE2 {SPR_WPRE, FF_FULLBRIGHT|FF_FLOORSPRITE|FF_ANIMATE|0, 36, {NULL}, 17, 2, S_INSTAWHIP_RECHARGE4}, // S_INSTAWHIP_RECHARGE3 {SPR_NULL, 0, 0, {A_PlaySound}, sfx_s3k7c, 2, S_NULL}, // S_INSTAWHIP_RECHARGE4 + {SPR_HFXX, FF_ANIMATE, 9, {NULL}, 8, 1, S_NULL}, // S_INSTAWHIP_REJECT {SPR_GRNG, FF_FULLBRIGHT|FF_PAPERSPRITE|0, -1, {NULL}, 0, 0, S_NULL}, // S_BLOCKRING {SPR_GBDY, FF_FULLBRIGHT|FF_ANIMATE|0, -1, {NULL}, 4, 2, S_NULL}, // S_BLOCKBODY diff --git a/src/info.h b/src/info.h index 7cd3cc354..10a862f7d 100644 --- a/src/info.h +++ b/src/info.h @@ -1109,6 +1109,7 @@ typedef enum sprite SPR_IWHP, // Instawhip SPR_WPRE, // Instawhip Recharge + SPR_WPRJ, // Instawhip Reject SPR_GRNG, // Guard ring SPR_GBDY, // Guard body From 51058c3c19fe61a7276c0a535507251c0eec4906 Mon Sep 17 00:00:00 2001 From: VelocitOni Date: Sun, 16 Jul 2023 03:43:10 -0400 Subject: [PATCH 14/16] Messed up sprite name Changed it from a duplicate hitlag sprite to instawhip-reject name --- src/info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/info.c b/src/info.c index 93ea8c521..735930d3b 100644 --- a/src/info.c +++ b/src/info.c @@ -4023,7 +4023,7 @@ state_t states[NUMSTATES] = {SPR_NULL, 0, 0, {A_PlaySound}, sfx_s3ka0, 2, S_INSTAWHIP_RECHARGE3}, // S_INSTAWHIP_RECHARGE2 {SPR_WPRE, FF_FULLBRIGHT|FF_FLOORSPRITE|FF_ANIMATE|0, 36, {NULL}, 17, 2, S_INSTAWHIP_RECHARGE4}, // S_INSTAWHIP_RECHARGE3 {SPR_NULL, 0, 0, {A_PlaySound}, sfx_s3k7c, 2, S_NULL}, // S_INSTAWHIP_RECHARGE4 - {SPR_HFXX, FF_ANIMATE, 9, {NULL}, 8, 1, S_NULL}, // S_INSTAWHIP_REJECT + {SPR_WPRJ, FF_ANIMATE, 9, {NULL}, 8, 1, S_NULL}, // S_INSTAWHIP_REJECT {SPR_GRNG, FF_FULLBRIGHT|FF_PAPERSPRITE|0, -1, {NULL}, 0, 0, S_NULL}, // S_BLOCKRING {SPR_GBDY, FF_FULLBRIGHT|FF_ANIMATE|0, -1, {NULL}, 4, 2, S_NULL}, // S_BLOCKBODY From 82c21f631fe8473cc8cb7747089d37a6609730fa Mon Sep 17 00:00:00 2001 From: VelocitOni Date: Sun, 16 Jul 2023 04:03:49 -0400 Subject: [PATCH 15/16] Added it in one more spot info.h, added a field for it in info.c Dunno where else to add it, still says it's not added to dehacked... --- src/info.c | 27 +++++++++++++++++++++++++++ src/info.h | 1 + 2 files changed, 28 insertions(+) diff --git a/src/info.c b/src/info.c index 735930d3b..ce66b379d 100644 --- a/src/info.c +++ b/src/info.c @@ -22863,6 +22863,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_INSTAWHIP_RECHARGE3 // raisestate }, + { // MT_INSTAWHIP_REJECT + -1, // doomednum + S_INSTAWHIP_REJECT, // spawnstate + 1000, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 0, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 0, // speed + 90*FRACUNIT, // radius + 90*FRACUNIT, // height + 0, // display offset + 100, // mass + 0, // damage + sfx_None, // activesound + MF_NOGRAVITY|MF_NOCLIPHEIGHT|MF_DONTENCOREMAP, // flags + S_NULL // raisestate + }, + { // MT_BLOCKRING -1, // doomednum S_BLOCKRING, // spawnstate diff --git a/src/info.h b/src/info.h index 10a862f7d..88cb87e1f 100644 --- a/src/info.h +++ b/src/info.h @@ -4433,6 +4433,7 @@ typedef enum state S_INSTAWHIP_RECHARGE2, S_INSTAWHIP_RECHARGE3, S_INSTAWHIP_RECHARGE4, + S_INSTAWHIP_REJECT, S_BLOCKRING, S_BLOCKBODY, From a43836a9ad24ea3864f41b76d776961978713672 Mon Sep 17 00:00:00 2001 From: VelocitOni Date: Sun, 16 Jul 2023 04:15:49 -0400 Subject: [PATCH 16/16] MT_INSTAWHIP_REJECT in info.h fuck FUCK fucvkfj UFCK SO MANY SPOTS --- src/info.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/info.h b/src/info.h index 88cb87e1f..5a0b8466b 100644 --- a/src/info.h +++ b/src/info.h @@ -6573,6 +6573,7 @@ typedef enum mobj_type MT_INSTAWHIP, MT_INSTAWHIP_RECHARGE, + MT_INSTAWHIP_REJECT, MT_BLOCKRING, MT_BLOCKBODY,