From 0a22f07751c58cc00838caa4de6bf0a086661b5c Mon Sep 17 00:00:00 2001 From: fickleheart Date: Mon, 11 Mar 2019 22:40:15 -0500 Subject: [PATCH 01/15] Update version and patch hash --- CMakeLists.txt | 2 +- appveyor.yml | 4 ++-- src/config.h.in | 4 ++-- src/doomdef.h | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 43142386d..3ce321e20 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.0) # DO NOT CHANGE THIS SRB2 STRING! Some variable names depend on this string. # Version change is fine. project(SRB2 - VERSION 1.0.2 + VERSION 1.0.4 LANGUAGES C) if(${PROJECT_SOURCE_DIR} MATCHES ${PROJECT_BINARY_DIR}) diff --git a/appveyor.yml b/appveyor.yml index e7ce1b2f7..10b658918 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 1.0.2.{branch}-{build} +version: 1.0.4.{branch}-{build} os: MinGW environment: @@ -29,7 +29,7 @@ environment: ############################## DPL_ENABLED: 0 DPL_TAG_ENABLED: 0 - DPL_INSTALLER_NAME: srb2kart-v102 + DPL_INSTALLER_NAME: srb2kart-v104 # Asset handling is barebones vs. Travis Deployer. We operate on 7z only. # Include the README files and the OpenGL batch in the main and patch archives. # The x86/x64 archives contain the DLL binaries. diff --git a/src/config.h.in b/src/config.h.in index a1f5d0a6e..0b66305c4 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -37,7 +37,7 @@ * Last updated 2015 / 05 / 03 - SRB2 v2.1.15 - srb2.srb * Last updated 2018 / 12 / 23 - SRB2 v2.1.22 - patch.dta * Last updated 2019 / 01 / 18 - Kart v1.0.2 - Main assets - * Last updated 2019 / 02 / 04 - Kart v1.0.3 - patch.kart + * Last updated 2019 / 03 / 11 - Kart v1.0.4 - patch.kart */ // Base SRB2 hashes @@ -52,7 +52,7 @@ #define ASSET_HASH_CHARS_KART "e2c428347dde52858a3dacd29fc5b964" #define ASSET_HASH_MAPS_KART "1335cd064656aedca359cfbb5233ac4a" #ifdef USE_PATCH_KART -#define ASSET_HASH_PATCH_KART "e06c1c90e5645c886026311964f8e1f5" +#define ASSET_HASH_PATCH_KART "440dd7b1e5c3ba27a727fed616f9c362" #endif #endif diff --git a/src/doomdef.h b/src/doomdef.h index d841b9cd3..6664ff51a 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -150,9 +150,9 @@ extern FILE *logstream; // we use comprevision and compbranch instead. #else #define VERSION 100 // Game version -#define SUBVERSION 3 // more precise version number -#define VERSIONSTRING "v1.0.3" -#define VERSIONSTRINGW L"v1.0.3" +#define SUBVERSION 4 // more precise version number +#define VERSIONSTRING "v1.0.4" +#define VERSIONSTRINGW L"v1.0.4" // Hey! If you change this, add 1 to the MODVERSION below! // Otherwise we can't force updates! #endif @@ -221,7 +221,7 @@ extern FILE *logstream; // it's only for detection of the version the player is using so the MS can alert them of an update. // Only set it higher, not lower, obviously. // Note that we use this to help keep internal testing in check; this is why v2.1.0 is not version "1". -#define MODVERSION 3 +#define MODVERSION 4 // Filter consvars by version // To version config.cfg, MAJOREXECVERSION is set equal to MODVERSION automatically. From b76201a0df9be64d680be4aff92ad360108e35b1 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Tue, 12 Mar 2019 07:34:47 -0500 Subject: [PATCH 02/15] Add missing deh entry for k_starpostflip --- src/dehacked.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/dehacked.c b/src/dehacked.c index 46fd207c9..cc81600af 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -8340,6 +8340,7 @@ static const char *const KARTSTUFF_LIST[] = { "NEXTCHECK", "WAYPOINT", "STARPOSTWP", + "STARPOSTFLIP", "RESPAWN", "DROPDASH", @@ -9354,6 +9355,12 @@ void DEH_Check(void) const size_t dehpowers = sizeof(POWERS_LIST)/sizeof(const char*); const size_t dehkartstuff = sizeof(KARTSTUFF_LIST)/sizeof(const char*); const size_t dehcolors = sizeof(COLOR_ENUMS)/sizeof(const char*); +#ifdef HAVE_BLUA + const size_t dehkartstuff = sizeof(KARTSTUFF_LIST)/sizeof(const char *); + + if (dehkartstuff != NUMKARTSTUFF) + I_Error("You forgot to update the Dehacked kartstuff list, you dolt!\n(%d props defined, versus %s in the Dehacked list)\n", NUMKARTSTUFF, sizeu1(dehstates)); +#endif if (dehstates != S_FIRSTFREESLOT) I_Error("You forgot to update the Dehacked states list, you dolt!\n(%d states defined, versus %s in the Dehacked list)\n", S_FIRSTFREESLOT, sizeu1(dehstates)); From 6456754c1b0ae4f078eabc7fa2df87469257c25b Mon Sep 17 00:00:00 2001 From: fickleheart Date: Tue, 12 Mar 2019 08:39:25 -0500 Subject: [PATCH 03/15] Oh, this was already here... --- src/dehacked.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index cc81600af..1c88fe832 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -9355,12 +9355,6 @@ void DEH_Check(void) const size_t dehpowers = sizeof(POWERS_LIST)/sizeof(const char*); const size_t dehkartstuff = sizeof(KARTSTUFF_LIST)/sizeof(const char*); const size_t dehcolors = sizeof(COLOR_ENUMS)/sizeof(const char*); -#ifdef HAVE_BLUA - const size_t dehkartstuff = sizeof(KARTSTUFF_LIST)/sizeof(const char *); - - if (dehkartstuff != NUMKARTSTUFF) - I_Error("You forgot to update the Dehacked kartstuff list, you dolt!\n(%d props defined, versus %s in the Dehacked list)\n", NUMKARTSTUFF, sizeu1(dehstates)); -#endif if (dehstates != S_FIRSTFREESLOT) I_Error("You forgot to update the Dehacked states list, you dolt!\n(%d states defined, versus %s in the Dehacked list)\n", S_FIRSTFREESLOT, sizeu1(dehstates)); From 95179ed1f3852a154ef8ecfcf31b0b16afd0a8e8 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sat, 16 Mar 2019 00:35:13 -0500 Subject: [PATCH 04/15] Update patch.kart hash again --- src/config.h.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config.h.in b/src/config.h.in index 0b66305c4..bd7e78619 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -52,7 +52,7 @@ #define ASSET_HASH_CHARS_KART "e2c428347dde52858a3dacd29fc5b964" #define ASSET_HASH_MAPS_KART "1335cd064656aedca359cfbb5233ac4a" #ifdef USE_PATCH_KART -#define ASSET_HASH_PATCH_KART "440dd7b1e5c3ba27a727fed616f9c362" +#define ASSET_HASH_PATCH_KART "b5f48e1abccfa47a5745199182e2fef4" #endif #endif From 932f73a1714c50c22f4ce4d53243ca98437e72ab Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sat, 16 Mar 2019 00:39:52 -0500 Subject: [PATCH 05/15] Cache colormaps everywhere to avoid memory leaks --- src/f_finale.c | 6 +++++- src/k_kart.c | 20 ++++++++++---------- src/m_menu.c | 24 ++++++++++++------------ src/r_draw.h | 2 ++ 4 files changed, 29 insertions(+), 23 deletions(-) diff --git a/src/f_finale.c b/src/f_finale.c index b863ea74b..fb67e9271 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -611,7 +611,7 @@ void F_CreditDrawer(void) if (credits_pics[i].colorize != SKINCOLOR_NONE) { - colormap = R_GetTranslationColormap(TC_RAINBOW, credits_pics[i].colorize, 0); + colormap = R_GetTranslationColormap(TC_RAINBOW, credits_pics[i].colorize, GTC_MENUCACHE); sc = FRACUNIT; // quick hack so I don't have to add another field to credits_pics } @@ -1103,6 +1103,10 @@ void F_StartWaitingPlayers(void) finalecount = 0; randskin = M_RandomKey(numskins); + + if (waitcolormap) + Z_Free(waitcolormap); + waitcolormap = R_GetTranslationColormap(randskin, skins[randskin].prefcolor, 0); for (i = 0; i < 2; i++) diff --git a/src/k_kart.c b/src/k_kart.c index 1190ab4ff..04901f86b 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -6989,7 +6989,7 @@ static void K_drawKartItem(void) } if (localcolor != SKINCOLOR_NONE) - colmap = R_GetTranslationColormap(colormode, localcolor, 0); + colmap = R_GetTranslationColormap(colormode, localcolor, GTC_CACHE); V_DrawScaledPatch(fx, fy, V_HUDTRANS|fflags, localbg); @@ -7651,7 +7651,7 @@ static void K_drawKartSpeedometer(void) static void K_drawKartBumpersOrKarma(void) { - UINT8 *colormap = R_GetTranslationColormap(TC_DEFAULT, stplyr->skincolor, 0); + UINT8 *colormap = R_GetTranslationColormap(TC_DEFAULT, stplyr->skincolor, GTC_CACHE); INT32 splitflags = K_calcSplitFlags(V_SNAPTOBOTTOM|V_SNAPTOLEFT); INT32 fx = 0, fy = 0, fflags = 0; boolean flipstring = false; // same as laps, used for splitscreen @@ -7859,7 +7859,7 @@ static void K_drawKartPlayerCheck(void) else if (x > 306) x = 306; - colormap = R_GetTranslationColormap(TC_DEFAULT, players[i].mo->color, 0); + colormap = R_GetTranslationColormap(TC_DEFAULT, players[i].mo->color, GTC_CACHE); V_DrawMappedPatch(x, CHEK_Y, V_HUDTRANS|splitflags, kp_check[pnum], colormap); } } @@ -8388,16 +8388,16 @@ static void K_drawKartFirstPerson(void) // drift sparks! if ((leveltime & 1) && (stplyr->kartstuff[k_driftcharge] >= dsthree)) - colmap = R_GetTranslationColormap(TC_RAINBOW, (UINT8)(1 + (leveltime % (MAXSKINCOLORS-1))), 0); + colmap = R_GetTranslationColormap(TC_RAINBOW, (UINT8)(1 + (leveltime % (MAXSKINCOLORS-1))), GTC_CACHE); else if ((leveltime & 1) && (stplyr->kartstuff[k_driftcharge] >= dstwo)) - colmap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_KETCHUP, 0); + colmap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_KETCHUP, GTC_CACHE); else if ((leveltime & 1) && (stplyr->kartstuff[k_driftcharge] >= dsone)) - colmap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_SAPPHIRE, 0); + colmap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_SAPPHIRE, GTC_CACHE); else #endif // invincibility/grow/shrink! if (stplyr->mo->colorized && stplyr->mo->color) - colmap = R_GetTranslationColormap(TC_RAINBOW, stplyr->mo->color, 0); + colmap = R_GetTranslationColormap(TC_RAINBOW, stplyr->mo->color, GTC_CACHE); } V_DrawFixedPatch(x, y, scale, splitflags, kp_fpview[target], colmap); @@ -8507,7 +8507,7 @@ static void K_drawInput(void) else { UINT8 *colormap; - colormap = R_GetTranslationColormap(0, stplyr->skincolor, 0); + colormap = R_GetTranslationColormap(0, stplyr->skincolor, GTC_CACHE); V_DrawFixedPatch(x<kartstuff[k_lapanimation]; - UINT8 *colormap = R_GetTranslationColormap(TC_DEFAULT, stplyr->skincolor, 0); + UINT8 *colormap = R_GetTranslationColormap(TC_DEFAULT, stplyr->skincolor, GTC_CACHE); V_DrawFixedPatch((BASEVIDWIDTH/2 + (32*max(0, stplyr->kartstuff[k_lapanimation]-76)))*FRACUNIT, (48 - (32*max(0, progress-76)))*FRACUNIT, @@ -8906,7 +8906,7 @@ void K_drawKartHUD(void) for (c = 1; c < MAXSKINCOLORS; c++) { - UINT8 *cm = R_GetTranslationColormap(TC_RAINBOW, c, 0); + UINT8 *cm = R_GetTranslationColormap(TC_RAINBOW, c, GTC_CACHE); V_DrawFixedPatch(x<>1, 0, facewantprefix[stplyr->skin], cm); x += 16; diff --git a/src/m_menu.c b/src/m_menu.c index 873c04a38..3b4e98fa6 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -3474,7 +3474,7 @@ static void M_DrawMapEmblems(INT32 mapnum, INT32 x, INT32 y) if (emblem->collected) V_DrawSmallMappedPatch(x, y, 0, W_CachePatchName(M_GetEmblemPatch(emblem), PU_CACHE), - R_GetTranslationColormap(TC_DEFAULT, M_GetEmblemColor(emblem), GTC_CACHE)); + R_GetTranslationColormap(TC_DEFAULT, M_GetEmblemColor(emblem), GTC_MENUCACHE)); else V_DrawSmallScaledPatch(x, y, 0, W_CachePatchName("NEEDIT", PU_CACHE)); @@ -3811,7 +3811,7 @@ static void M_DrawPauseMenu(void) if (emblem->collected) V_DrawSmallMappedPatch(40, 44 + (i*8), 0, W_CachePatchName(M_GetEmblemPatch(emblem), PU_CACHE), - R_GetTranslationColormap(TC_DEFAULT, M_GetEmblemColor(emblem), GTC_CACHE)); + R_GetTranslationColormap(TC_DEFAULT, M_GetEmblemColor(emblem), GTC_MENUCACHE)); else V_DrawSmallScaledPatch(40, 44 + (i*8), 0, W_CachePatchName("NEEDIT", PU_CACHE)); @@ -5359,7 +5359,7 @@ static void M_DrawEmblemHints(void) { collected = recommendedflags; V_DrawMappedPatch(12, 12+(28*j), 0, W_CachePatchName(M_GetEmblemPatch(emblem), PU_CACHE), - R_GetTranslationColormap(TC_DEFAULT, M_GetEmblemColor(emblem), GTC_CACHE)); + R_GetTranslationColormap(TC_DEFAULT, M_GetEmblemColor(emblem), GTC_MENUCACHE)); } else { @@ -5702,7 +5702,7 @@ static void M_DrawLoadGameData(void) V_DrawScaledPatch(SP_LoadDef.x,144+8,0,W_CachePatchName(skins[savegameinfo[saveSlotSelected].skinnum].face, PU_CACHE)); else { - UINT8 *colormap = R_GetTranslationColormap(savegameinfo[saveSlotSelected].skinnum, savegameinfo[saveSlotSelected].skincolor, 0); + UINT8 *colormap = R_GetTranslationColormap(savegameinfo[saveSlotSelected].skinnum, savegameinfo[saveSlotSelected].skincolor, GTC_MENUCACHE); V_DrawMappedPatch(SP_LoadDef.x,144+8,0,W_CachePatchName(skins[savegameinfo[saveSlotSelected].skinnum].face, PU_CACHE), colormap); } @@ -6392,7 +6392,7 @@ static void M_DrawStatsMaps(int location) if (exemblem->collected) V_DrawSmallMappedPatch(295, y, 0, W_CachePatchName(M_GetExtraEmblemPatch(exemblem), PU_CACHE), - R_GetTranslationColormap(TC_DEFAULT, M_GetExtraEmblemColor(exemblem), GTC_CACHE)); + R_GetTranslationColormap(TC_DEFAULT, M_GetExtraEmblemColor(exemblem), GTC_MENUCACHE)); else V_DrawSmallScaledPatch(295, y, 0, W_CachePatchName("NEEDIT", PU_CACHE)); @@ -6527,7 +6527,7 @@ void M_DrawTimeAttackMenu(void) // Character face! if (W_CheckNumForName(skins[cv_chooseskin.value-1].facewant) != LUMPERROR) { - UINT8 *colormap = R_GetTranslationColormap(cv_chooseskin.value-1, cv_playercolor.value, 0); + UINT8 *colormap = R_GetTranslationColormap(cv_chooseskin.value-1, cv_playercolor.value, GTC_MENUCACHE); V_DrawMappedPatch(BASEVIDWIDTH-x - SHORT(facewantprefix[cv_chooseskin.value-1]->width), y, 0, facewantprefix[cv_chooseskin.value-1], colormap); } @@ -6652,7 +6652,7 @@ void M_DrawTimeAttackMenu(void) if (em->collected) V_DrawMappedPatch(BASEVIDWIDTH - 64 - 24, y+48, 0, W_CachePatchName(M_GetEmblemPatch(em), PU_CACHE), - R_GetTranslationColormap(TC_DEFAULT, M_GetEmblemColor(em), GTC_CACHE)); + R_GetTranslationColormap(TC_DEFAULT, M_GetEmblemColor(em), GTC_MENUCACHE)); else V_DrawScaledPatch(BASEVIDWIDTH - 64 - 24, y+48, 0, W_CachePatchName("NEEDIT", PU_CACHE)); @@ -6812,7 +6812,7 @@ static boolean M_QuitTimeAttackMenu(void) if (em->collected) V_DrawSmallMappedPatch(160+88, yHeight, 0, W_CachePatchName(M_GetEmblemPatch(em), PU_CACHE), - R_GetTranslationColormap(TC_DEFAULT, M_GetEmblemColor(em), GTC_CACHE)); + R_GetTranslationColormap(TC_DEFAULT, M_GetEmblemColor(em), GTC_MENUCACHE)); else V_DrawSmallScaledPatch(160+88, yHeight, 0, W_CachePatchName("NEEDIT", PU_CACHE)); @@ -7886,7 +7886,7 @@ Update the maxplayers label... if (!trans && i > cv_splitplayers.value) trans = V_TRANSLUCENT; - colmap = R_GetTranslationColormap(pskin, pcol, 0); + colmap = R_GetTranslationColormap(pskin, pcol, GTC_MENUCACHE); V_DrawFixedPatch(x< Date: Sat, 16 Mar 2019 01:29:13 -0500 Subject: [PATCH 06/15] Remove dumb special case --- src/p_map.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index d33b9e068..256c9cef1 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -2787,8 +2787,7 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff) thing->eflags |= MFE_JUSTSTEPPEDDOWN; } #ifdef ESLOPE - // HACK TO FIX DSZ2: apply only if slopes are involved - else if (tmceilingslope && tmceilingz < thingtop && thingtop - tmceilingz <= maxstep) + else if (tmceilingz < thingtop && thingtop - tmceilingz <= maxstep) { thing->z = (thing->ceilingz = thingtop = tmceilingz) - thing->height; thing->eflags |= MFE_JUSTSTEPPEDDOWN; @@ -2801,8 +2800,7 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff) thing->eflags |= MFE_JUSTSTEPPEDDOWN; } #ifdef ESLOPE - // HACK TO FIX DSZ2: apply only if slopes are involved - else if (tmfloorslope && tmfloorz > thing->z && tmfloorz - thing->z <= maxstep) + else if (tmfloorz > thing->z && tmfloorz - thing->z <= maxstep) { thing->z = thing->floorz = tmfloorz; thing->eflags |= MFE_JUSTSTEPPEDDOWN; From 272640f49a6e76dce402dfc112fb4c678a9fb4d2 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sat, 16 Mar 2019 02:19:43 -0500 Subject: [PATCH 07/15] Allow reading ticcmd latency --- src/lua_playerlib.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lua_playerlib.c b/src/lua_playerlib.c index 1c37f4c45..73d5ecbc0 100644 --- a/src/lua_playerlib.c +++ b/src/lua_playerlib.c @@ -743,6 +743,8 @@ static int ticcmd_get(lua_State *L) lua_pushinteger(L, cmd->buttons); else if (fastcmp(field,"driftturn")) lua_pushinteger(L, cmd->driftturn); + else if (fastcmp(field,"latency")) + lua_pushinteger(L, cmd->latency); else return NOFIELD; From e59065960354a7b734f949668a380d8866c37281 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sat, 16 Mar 2019 12:22:11 -0500 Subject: [PATCH 08/15] Don't free this cached colormap! --- src/m_menu.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 3b4e98fa6..3ad076ff7 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -8324,8 +8324,6 @@ static void M_DrawSetupMultiPlayerMenu(void) } else V_DrawMappedPatch(mx+43, my+131, flags, patch, colormap); - - Z_Free(colormap); } #undef charw } From 93bd5b61c961aa069fdce811ae325ebd35389fce Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sat, 16 Mar 2019 14:56:56 -0500 Subject: [PATCH 09/15] Fix bad merge in map data archiving code --- src/p_saveg.c | 151 ++++++++++++++++++++++++-------------------------- 1 file changed, 73 insertions(+), 78 deletions(-) diff --git a/src/p_saveg.c b/src/p_saveg.c index 0f199f8c3..0061ee029 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -679,89 +679,84 @@ static void P_NetArchiveWorld(void) WRITEUINT16(put, 0xffff); - mld = W_CacheLumpNum(lastloadedmaplumpnum+ML_LINEDEFS, PU_CACHE); - msd = W_CacheLumpNum(lastloadedmaplumpnum+ML_SIDEDEFS, PU_CACHE); - if (mld && msd) + // do lines + for (i = 0; i < numlines; i++, mld++, li++) { - // do lines - for (i = 0; i < numlines; i++, mld++, li++) + diff = diff2 = 0; + + if (li->special != SHORT(mld->special)) + diff |= LD_SPECIAL; + + if (SHORT(mld->special) == 321 || SHORT(mld->special) == 322) // only reason li->callcount would be non-zero is if either of these are involved + diff |= LD_CLLCOUNT; + + if (li->sidenum[0] != 0xffff) { - diff = diff2 = 0; + si = &sides[li->sidenum[0]]; + if (si->textureoffset != SHORT(msd[li->sidenum[0]].textureoffset)<sidenum[0]].toptexture) != -1 + && si->toptexture != R_TextureNumForName(msd[li->sidenum[0]].toptexture)) + diff |= LD_S1TOPTEX; + if (R_CheckTextureNumForName(msd[li->sidenum[0]].bottomtexture) != -1 + && si->bottomtexture != R_TextureNumForName(msd[li->sidenum[0]].bottomtexture)) + diff |= LD_S1BOTTEX; + if (R_CheckTextureNumForName(msd[li->sidenum[0]].midtexture) != -1 + && si->midtexture != R_TextureNumForName(msd[li->sidenum[0]].midtexture)) + diff |= LD_S1MIDTEX; + } + if (li->sidenum[1] != 0xffff) + { + si = &sides[li->sidenum[1]]; + if (si->textureoffset != SHORT(msd[li->sidenum[1]].textureoffset)<sidenum[1]].toptexture) != -1 + && si->toptexture != R_TextureNumForName(msd[li->sidenum[1]].toptexture)) + diff2 |= LD_S2TOPTEX; + if (R_CheckTextureNumForName(msd[li->sidenum[1]].bottomtexture) != -1 + && si->bottomtexture != R_TextureNumForName(msd[li->sidenum[1]].bottomtexture)) + diff2 |= LD_S2BOTTEX; + if (R_CheckTextureNumForName(msd[li->sidenum[1]].midtexture) != -1 + && si->midtexture != R_TextureNumForName(msd[li->sidenum[1]].midtexture)) + diff2 |= LD_S2MIDTEX; + if (diff2) + diff |= LD_DIFF2; + } - if (li->special != SHORT(mld->special)) - diff |= LD_SPECIAL; + if (diff) + { + statline++; + WRITEINT16(put, i); + WRITEUINT8(put, diff); + if (diff & LD_DIFF2) + WRITEUINT8(put, diff2); + if (diff & LD_FLAG) + WRITEINT16(put, li->flags); + if (diff & LD_SPECIAL) + WRITEINT16(put, li->special); + if (diff & LD_CLLCOUNT) + WRITEINT16(put, li->callcount); - if (SHORT(mld->special) == 321 || SHORT(mld->special) == 322) // only reason li->callcount would be non-zero is if either of these are involved - diff |= LD_CLLCOUNT; + si = &sides[li->sidenum[0]]; + if (diff & LD_S1TEXOFF) + WRITEFIXED(put, si->textureoffset); + if (diff & LD_S1TOPTEX) + WRITEINT32(put, si->toptexture); + if (diff & LD_S1BOTTEX) + WRITEINT32(put, si->bottomtexture); + if (diff & LD_S1MIDTEX) + WRITEINT32(put, si->midtexture); - if (li->sidenum[0] != 0xffff) - { - si = &sides[li->sidenum[0]]; - if (si->textureoffset != SHORT(msd[li->sidenum[0]].textureoffset)<sidenum[0]].toptexture) != -1 - && si->toptexture != R_TextureNumForName(msd[li->sidenum[0]].toptexture)) - diff |= LD_S1TOPTEX; - if (R_CheckTextureNumForName(msd[li->sidenum[0]].bottomtexture) != -1 - && si->bottomtexture != R_TextureNumForName(msd[li->sidenum[0]].bottomtexture)) - diff |= LD_S1BOTTEX; - if (R_CheckTextureNumForName(msd[li->sidenum[0]].midtexture) != -1 - && si->midtexture != R_TextureNumForName(msd[li->sidenum[0]].midtexture)) - diff |= LD_S1MIDTEX; - } - if (li->sidenum[1] != 0xffff) - { - si = &sides[li->sidenum[1]]; - if (si->textureoffset != SHORT(msd[li->sidenum[1]].textureoffset)<sidenum[1]].toptexture) != -1 - && si->toptexture != R_TextureNumForName(msd[li->sidenum[1]].toptexture)) - diff2 |= LD_S2TOPTEX; - if (R_CheckTextureNumForName(msd[li->sidenum[1]].bottomtexture) != -1 - && si->bottomtexture != R_TextureNumForName(msd[li->sidenum[1]].bottomtexture)) - diff2 |= LD_S2BOTTEX; - if (R_CheckTextureNumForName(msd[li->sidenum[1]].midtexture) != -1 - && si->midtexture != R_TextureNumForName(msd[li->sidenum[1]].midtexture)) - diff2 |= LD_S2MIDTEX; - if (diff2) - diff |= LD_DIFF2; - } - - if (diff) - { - statline++; - WRITEINT16(put, i); - WRITEUINT8(put, diff); - if (diff & LD_DIFF2) - WRITEUINT8(put, diff2); - if (diff & LD_FLAG) - WRITEINT16(put, li->flags); - if (diff & LD_SPECIAL) - WRITEINT16(put, li->special); - if (diff & LD_CLLCOUNT) - WRITEINT16(put, li->callcount); - - si = &sides[li->sidenum[0]]; - if (diff & LD_S1TEXOFF) - WRITEFIXED(put, si->textureoffset); - if (diff & LD_S1TOPTEX) - WRITEINT32(put, si->toptexture); - if (diff & LD_S1BOTTEX) - WRITEINT32(put, si->bottomtexture); - if (diff & LD_S1MIDTEX) - WRITEINT32(put, si->midtexture); - - si = &sides[li->sidenum[1]]; - if (diff2 & LD_S2TEXOFF) - WRITEFIXED(put, si->textureoffset); - if (diff2 & LD_S2TOPTEX) - WRITEINT32(put, si->toptexture); - if (diff2 & LD_S2BOTTEX) - WRITEINT32(put, si->bottomtexture); - if (diff2 & LD_S2MIDTEX) - WRITEINT32(put, si->midtexture); - } + si = &sides[li->sidenum[1]]; + if (diff2 & LD_S2TEXOFF) + WRITEFIXED(put, si->textureoffset); + if (diff2 & LD_S2TOPTEX) + WRITEINT32(put, si->toptexture); + if (diff2 & LD_S2BOTTEX) + WRITEINT32(put, si->bottomtexture); + if (diff2 & LD_S2MIDTEX) + WRITEINT32(put, si->midtexture); } } WRITEUINT16(put, 0xffff); From 52deb3ea74435582b385b218a37958e3a084936a Mon Sep 17 00:00:00 2001 From: James R Date: Sat, 16 Mar 2019 15:42:18 -0700 Subject: [PATCH 10/15] Move change viewpoint control checking so it doesn't take precedence Notably over chat. --- src/g_game.c | 148 +++++++++++++++++++++++++-------------------------- 1 file changed, 74 insertions(+), 74 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index cf877664c..41ae140ad 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1823,80 +1823,6 @@ static INT32 spectatedelay, spectatedelay2, spectatedelay3, spectatedelay4 = 0; // boolean G_Responder(event_t *ev) { - // allow spy mode changes even during the demo - if (gamestate == GS_LEVEL && ev->type == ev_keydown - && (ev->data1 == KEY_F12 || ev->data1 == gamecontrol[gc_viewpoint][0] || ev->data1 == gamecontrol[gc_viewpoint][1])) - { - if (splitscreen || !netgame) - displayplayer = consoleplayer; - else - { - UINT8 i = 0; // spy mode - for (i = 0; i < MAXPLAYERS; i++) - { - displayplayer++; - if (displayplayer == MAXPLAYERS) - displayplayer = 0; - - if (displayplayer == consoleplayer) - break; // End loop - - if (!playeringame[displayplayer]) - continue; - - if (players[displayplayer].spectator) - continue; - - // SRB2Kart: Only go through players who are actually playing - if (players[displayplayer].exiting) - continue; - - if (players[displayplayer].pflags & PF_TIMEOVER) - continue; - - // I don't know if we want this actually, but I'll humor the suggestion anyway - if (G_BattleGametype()) - { - if (players[displayplayer].kartstuff[k_bumper] <= 0) - continue; - } - - // SRB2Kart: we have no team-based modes, YET... - /*if (G_GametypeHasTeams()) - { - if (players[consoleplayer].ctfteam - && players[displayplayer].ctfteam != players[consoleplayer].ctfteam) - continue; - } - else if (gametype == GT_HIDEANDSEEK) - { - if (players[consoleplayer].pflags & PF_TAGIT) - continue; - } - // Other Tag-based gametypes? - else if (G_TagGametype()) - { - if (!players[consoleplayer].spectator - && (players[consoleplayer].pflags & PF_TAGIT) != (players[displayplayer].pflags & PF_TAGIT)) - continue; - } - else if (G_GametypeHasSpectators() && G_BattleGametype()) - { - if (!players[consoleplayer].spectator) - continue; - }*/ - - break; - } - - // change statusbar also if playing back demo - if (singledemo) - ST_changeDemoView(); - - return true; - } - } - // any other key pops up menu if in demos if (gameaction == ga_nothing && !singledemo && ((demoplayback && !modeattacking && !titledemo) || gamestate == GS_TITLESCREEN)) @@ -1974,6 +1900,80 @@ boolean G_Responder(event_t *ev) if (HU_Responder(ev)) return true; // chat ate the event + // allow spy mode changes even during the demo + if (gamestate == GS_LEVEL && ev->type == ev_keydown + && (ev->data1 == KEY_F12 || ev->data1 == gamecontrol[gc_viewpoint][0] || ev->data1 == gamecontrol[gc_viewpoint][1])) + { + if (splitscreen || !netgame) + displayplayer = consoleplayer; + else + { + UINT8 i = 0; // spy mode + for (i = 0; i < MAXPLAYERS; i++) + { + displayplayer++; + if (displayplayer == MAXPLAYERS) + displayplayer = 0; + + if (displayplayer == consoleplayer) + break; // End loop + + if (!playeringame[displayplayer]) + continue; + + if (players[displayplayer].spectator) + continue; + + // SRB2Kart: Only go through players who are actually playing + if (players[displayplayer].exiting) + continue; + + if (players[displayplayer].pflags & PF_TIMEOVER) + continue; + + // I don't know if we want this actually, but I'll humor the suggestion anyway + if (G_BattleGametype()) + { + if (players[displayplayer].kartstuff[k_bumper] <= 0) + continue; + } + + // SRB2Kart: we have no team-based modes, YET... + /*if (G_GametypeHasTeams()) + { + if (players[consoleplayer].ctfteam + && players[displayplayer].ctfteam != players[consoleplayer].ctfteam) + continue; + } + else if (gametype == GT_HIDEANDSEEK) + { + if (players[consoleplayer].pflags & PF_TAGIT) + continue; + } + // Other Tag-based gametypes? + else if (G_TagGametype()) + { + if (!players[consoleplayer].spectator + && (players[consoleplayer].pflags & PF_TAGIT) != (players[displayplayer].pflags & PF_TAGIT)) + continue; + } + else if (G_GametypeHasSpectators() && G_BattleGametype()) + { + if (!players[consoleplayer].spectator) + continue; + }*/ + + break; + } + + // change statusbar also if playing back demo + if (singledemo) + ST_changeDemoView(); + + return true; + } + } + // update keys current state G_MapEventsToControls(ev); From 81669c937201d65f27923ab375646677a4cf6423 Mon Sep 17 00:00:00 2001 From: James R Date: Sat, 16 Mar 2019 15:50:16 -0700 Subject: [PATCH 11/15] Resume sounds on unpausing after a window re-focus --- src/sdl/i_video.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 2c5bf994b..56766fbb9 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -615,12 +615,12 @@ static void Impl_HandleWindowEvent(SDL_WindowEvent evt) { // Tell game we got focus back, resume music if necessary window_notinfocus = false; + if (!paused) - { I_ResumeSong(); //resume it - if (cv_gamesounds.value) - S_EnableSound(); - } + + if (cv_gamesounds.value) + S_EnableSound(); if (!firsttimeonmouse) { From 5c6f142da1ccfac5dabf30e6e69bbd9939c990fe Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sun, 17 Mar 2019 21:44:11 -0500 Subject: [PATCH 12/15] LAT --- src/k_kart.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 04901f86b..700758585 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -2546,14 +2546,14 @@ void K_SpawnKartExplosion(fixed_t x, fixed_t y, fixed_t z, fixed_t radius, INT32 // Spawns the purely visual explosion void K_SpawnMineExplosion(mobj_t *source, UINT8 color) { - INT32 i, radius, height; - mobj_t *smoldering = P_SpawnMobj(source->x, source->y, source->z, MT_SMOLDERING); - K_MatchGenericExtraFlags(smoldering, source); - mobj_t *dust; mobj_t *truc; INT32 speed, speed2; + INT32 i, radius, height; + mobj_t *smoldering = P_SpawnMobj(source->x, source->y, source->z, MT_SMOLDERING); + K_MatchGenericExtraFlags(smoldering, source); + smoldering->tics = TICRATE*3; radius = source->radius>>FRACBITS; height = source->height>>FRACBITS; From 7d14342a8f3125c059ac503f30835abd596fc528 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Mon, 18 Mar 2019 16:50:17 -0400 Subject: [PATCH 13/15] Update CMakeLists.txt, remove CMAKE_SIZEOF_VOID_P check --- CMakeLists.txt | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6eb065d04..11898db5c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,14 +54,6 @@ macro(copy_files_to_build_dir target dlllist_var) endif() endmacro() -# 64-bit check -if(${CMAKE_SIZEOF_VOID_P} EQUAL 8) - message(STATUS "Target is 64-bit") - set(SRB2_SYSTEM_BITS 64) -else() - set(SRB2_SYSTEM_BITS 32) -endif() - # OS macros if (UNIX) add_definitions(-DUNIXCOMMON) @@ -73,9 +65,6 @@ endif() if(${CMAKE_SYSTEM} MATCHES "Linux") add_definitions(-DLINUX) - if(${SRB2_SYSTEM_BITS} EQUAL 64) - add_definitions(-DLINUX64) - endif() endif() if(${CMAKE_SYSTEM} MATCHES "Darwin") From 4cb71746a7d9b2e8bb2c62792651c2b58cdf03e6 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Mon, 18 Mar 2019 23:58:31 -0400 Subject: [PATCH 14/15] Revert "Update CMakeLists.txt, remove CMAKE_SIZEOF_VOID_P check" This reverts commit 7d14342a8f3125c059ac503f30835abd596fc528. --- CMakeLists.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 11898db5c..6eb065d04 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,6 +54,14 @@ macro(copy_files_to_build_dir target dlllist_var) endif() endmacro() +# 64-bit check +if(${CMAKE_SIZEOF_VOID_P} EQUAL 8) + message(STATUS "Target is 64-bit") + set(SRB2_SYSTEM_BITS 64) +else() + set(SRB2_SYSTEM_BITS 32) +endif() + # OS macros if (UNIX) add_definitions(-DUNIXCOMMON) @@ -65,6 +73,9 @@ endif() if(${CMAKE_SYSTEM} MATCHES "Linux") add_definitions(-DLINUX) + if(${SRB2_SYSTEM_BITS} EQUAL 64) + add_definitions(-DLINUX64) + endif() endif() if(${CMAKE_SYSTEM} MATCHES "Darwin") From 727d9cae2330272a687132375ca5ec28aa8f2dea Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Tue, 19 Mar 2019 00:04:14 -0400 Subject: [PATCH 15/15] CMake: check if CMAKE_SIZEOF_VOID_P is defined on Mac? --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6eb065d04..75aa82f32 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,7 +55,8 @@ macro(copy_files_to_build_dir target dlllist_var) endmacro() # 64-bit check -if(${CMAKE_SIZEOF_VOID_P} EQUAL 8) +message(STATUS "CMAKE_SIZEOF_VOID_P=" ${CMAKE_SIZEOF_VOID_P}) +if(CMAKE_SIZEOF_VOID_P EQUAL 8) message(STATUS "Target is 64-bit") set(SRB2_SYSTEM_BITS 64) else()