From 53892a9eb1ec6df01edb57216f1438c014da8fac Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Fri, 23 Aug 2019 00:21:12 -0400 Subject: [PATCH 001/189] Work on new title card Even though it's not complete there's an issue where it would stop breifly during a fade. --- src/st_stuff.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/st_stuff.c b/src/st_stuff.c index c1a6d5add..7beec4423 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -1149,6 +1149,9 @@ void ST_drawLevelTitle(tic_t titletime) INT32 actnum = mapheaderinfo[gamemap-1]->actnum; INT32 lvlttly, zoney, lvlttlxpos, ttlnumxpos, zonexpos; INT32 subttlxpos = BASEVIDWIDTH/2; + patch_t *tzigzag = W_CachePatchName("TCARDFG1", PU_CACHE); + INT32 i; + INT32 height = (SHORT(tzigzag->height)); if (!(titletime > 2 && titletime-3 < 110)) return; @@ -1225,6 +1228,13 @@ void ST_drawLevelTitle(tic_t titletime) if (lvlttly+48 < 200) V_DrawCenteredString(subttlxpos, lvlttly+48, V_PERPLAYER|V_ALLOWLOWERCASE, subttl); + + for (i = -8; i < (BASEVIDHEIGHT/height) + 8; i++) + { + INT32 y = ((i*height) + (height - ((titletime)%height))); + //CONS_Printf("%d\n", y); + V_DrawFixedPatch(0, y< Date: Mon, 9 Sep 2019 23:31:48 -0300 Subject: [PATCH 002/189] Better fades --- src/d_main.c | 4 + src/f_finale.h | 17 ++++ src/f_wipe.c | 150 +++++++++++++++++++++++++++++-- src/hardware/hw_drv.h | 2 + src/hardware/hw_main.c | 5 ++ src/hardware/hw_main.h | 1 + src/hardware/r_opengl/r_opengl.c | 44 +++++++++ src/m_menu.c | 6 +- src/p_setup.c | 15 +++- src/r_data.c | 73 ++++++++++++++- src/r_data.h | 2 + src/r_state.h | 1 + src/sdl/hwsym_sdl.c | 1 + src/sdl/i_video.c | 1 + src/win32/win_dll.c | 2 + 15 files changed, 309 insertions(+), 15 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index 9fa506bee..499cde45e 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -461,6 +461,10 @@ static void D_Display(void) if (gamestate != GS_TIMEATTACK) CON_Drawer(); + // Running a wipe, but it doesn't freeze the game + if (WipeInAction && (!WipeFreezeGame)) + F_WipeTicker(); + M_Drawer(); // menu is drawn even on top of everything // focus lost moved to M_Drawer diff --git a/src/f_finale.h b/src/f_finale.h index d640abc8a..ccef4a362 100644 --- a/src/f_finale.h +++ b/src/f_finale.h @@ -108,11 +108,28 @@ void F_MenuPresTicker(boolean run); #define FORCEWIPEOFF -2 extern boolean WipeInAction; +extern boolean WipeFreezeGame; extern INT32 lastwipetic; +typedef enum +{ + WIPESTYLE_NORMAL, + WIPESTYLE_LEVEL +} wipestyle_t; +extern wipestyle_t wipestyle; + +typedef enum +{ + WSF_FADEOUT = 1, + WSF_FADEIN = 1<<1, + WSF_TOWHITE = 1<<2, +} wipestyleflags_t; +extern wipestyleflags_t wipestyleflags; + void F_WipeStartScreen(void); void F_WipeEndScreen(void); void F_RunWipe(UINT8 wipetype, boolean drawMenu); +void F_WipeTicker(void); tic_t F_GetWipeLength(UINT8 wipetype); boolean F_WipeExists(UINT8 wipetype); diff --git a/src/f_wipe.c b/src/f_wipe.c index 05229f844..cabcbb1a1 100644 --- a/src/f_wipe.c +++ b/src/f_wipe.c @@ -27,6 +27,13 @@ #include "d_main.h" #include "m_misc.h" // movie mode +#include "doomstat.h" +#include "st_stuff.h" + +#ifdef HAVE_BLUA +#include "lua_hud.h" // level title +#endif + #ifdef HWRENDER #include "hardware/hw_main.h" #endif @@ -82,14 +89,22 @@ UINT8 wipedefs[NUMWIPEDEFS] = { //-------------------------------------------------------------------------- boolean WipeInAction = false; +boolean WipeFreezeGame = true; INT32 lastwipetic = 0; +wipestyle_t wipestyle = WIPESTYLE_NORMAL; +wipestyleflags_t wipestyleflags = 0; + #ifndef NOWIPE static UINT8 *wipe_scr_start; //screen 3 static UINT8 *wipe_scr_end; //screen 4 static UINT8 *wipe_scr; //screen 0 (main drawing) static fixed_t paldiv = 0; +static UINT8 curwipetype; +static UINT8 curwipeframe; +static UINT8 maxwipeframe; + /** Create fademask_t from lump * * \param lump Lump name to get data from @@ -148,7 +163,10 @@ static fademask_t *F_GetFadeMask(UINT8 masknum, UINT8 scrnnum) { { // Determine pixel to use from fademask pcolor = &pMasterPalette[*lump++]; - *mask++ = FixedDiv((pcolor->s.red+1)<>FRACBITS; + if (wipestyle == WIPESTYLE_LEVEL) + *mask++ = pcolor->s.red/8; // 0-31 range + else + *mask++ = FixedDiv((pcolor->s.red+1)<>FRACBITS; } fm.xscale = FixedDiv(vid.width<lvlttl != '\0' +#ifdef HAVE_BLUA + && LUA_HudEnabled(hud_stagetitle) +#endif + ) + ST_drawLevelTitle(TICRATE); +} + /** Wipe ticker * * \param fademask pixels to change @@ -242,7 +273,7 @@ static void F_DoWipe(fademask_t *fademask) relativepos = (draw_linestart * vid.width) + draw_rowstart; draw_linestogo = draw_lineend - draw_linestart; - if (*mask == 0) + if ((*mask == 0) && (wipestyle == WIPESTYLE_NORMAL)) { // shortcut - memcpy source to work while (draw_linestogo--) @@ -251,7 +282,7 @@ static void F_DoWipe(fademask_t *fademask) relativepos += vid.width; } } - else if (*mask == 10) + else if ((*mask >= maxwipeframe) && (wipestyle == WIPESTYLE_NORMAL)) { // shortcut - memcpy target to work while (draw_linestogo--) @@ -262,8 +293,25 @@ static void F_DoWipe(fademask_t *fademask) } else { - // pointer to transtable that this mask would use - transtbl = transtables + ((9 - *mask)<drawroutine) diff --git a/src/p_setup.c b/src/p_setup.c index 65335be3f..51cb38fe0 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2679,6 +2679,7 @@ boolean P_SetupLevel(boolean skipprecip) // Cancel all d_main.c fadeouts (keep fade in though). wipegamestate = FORCEWIPEOFF; + wipestyleflags = 0; // Special stage fade to white // This is handled BEFORE sounds are stopped. @@ -2699,11 +2700,17 @@ boolean P_SetupLevel(boolean skipprecip) S_FadeOutStopMusic(MUSICRATE/4); //FixedMul(FixedDiv(F_GetWipeLength(wipedefs[wipe_speclevel_towhite])*NEWTICRATERATIO, NEWTICRATE), MUSICRATE) F_WipeStartScreen(); - V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 0); + wipestyleflags |= WSF_FADEOUT|WSF_TOWHITE; F_WipeEndScreen(); F_RunWipe(wipedefs[wipe_speclevel_towhite], false); + V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 0); + I_OsPolling(); + I_FinishUpdate(); // page flip or blit buffer + if (moviemode) + M_SaveFrame(); + nowtime = lastwipetic; // Hold on white for extra effect. @@ -2737,7 +2744,8 @@ boolean P_SetupLevel(boolean skipprecip) if (rendermode != render_none && !ranspecialwipe) { F_WipeStartScreen(); - V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); + wipestyleflags |= WSF_FADEOUT; + //V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); F_WipeEndScreen(); // for titlemap: run a specific wipe if specified @@ -3180,6 +3188,9 @@ boolean P_SetupLevel(boolean skipprecip) } // Stage title! + wipestyleflags |= WSF_FADEIN; + wipestyleflags &= ~WSF_FADEOUT; + WipeFreezeGame = false; if (rendermode != render_none && (!titlemapinaction) && ranspecialwipe != 2 diff --git a/src/r_data.c b/src/r_data.c index 6889bddde..2699cf599 100644 --- a/src/r_data.c +++ b/src/r_data.c @@ -112,6 +112,7 @@ INT32 *texturetranslation; sprcache_t *spritecachedinfo; lighttable_t *colormaps; +lighttable_t *fadecolormap = NULL; // for debugging/info purposes static size_t flatmemory, spritememory, texturememory; @@ -1294,18 +1295,82 @@ static void R_InitSpriteLumps(void) Z_Malloc(max_spritelumps*sizeof(*spritecachedinfo), PU_STATIC, &spritecachedinfo); } +// +// R_CreateFadeColormaps +// +static void R_CreateFadeColormaps(size_t len) +{ + UINT8 px, fade; + RGBA_t rgba; + INT32 r, g, b; + size_t i; + + fadecolormap = Z_MallocAlign(len*2, PU_STATIC, NULL, 8); + +#define GETCOLOR \ + px = colormaps[i%256]; \ + fade = (i/256) * 8; \ + rgba = V_GetColor(px); + + // to black + for (i = 0; i < len; i++) + { + // find pixel and fade amount + GETCOLOR; + + // subtractive color blending + r = rgba.s.red - fade*3; + g = rgba.s.green - fade*2; + b = rgba.s.blue - fade; + + // clamp values + if (r < 0) r = 0; + if (g < 0) g = 0; + if (b < 0) b = 0; + + // find nearest color in palette + fadecolormap[i] = NearestColor(r,g,b); + } + + // to white + for (i = len; i < len*2; i++) + { + // find pixel and fade amount + GETCOLOR; + + // additive color blending + r = rgba.s.red + fade*3; + g = rgba.s.green + fade*2; + b = rgba.s.blue + fade; + + // clamp values + if (r > 255) r = 255; + if (g > 255) g = 255; + if (b > 255) b = 255; + + // find nearest color in palette + fadecolormap[i] = NearestColor(r,g,b); + } +#undef GETCOLOR +} + // // R_InitColormaps // static void R_InitColormaps(void) { + size_t len; lumpnum_t lump; // Load in the light tables lump = W_GetNumForName("COLORMAP"); - colormaps = Z_MallocAlign(W_LumpLength (lump), PU_STATIC, NULL, 8); + len = W_LumpLength(lump); + colormaps = Z_MallocAlign(len, PU_STATIC, NULL, 8); W_ReadLump(lump, colormaps); + // Make colormap for fades + R_CreateFadeColormaps(len); + // Init Boom colormaps. R_ClearColormaps(); #ifdef EXTRACOLORMAPLUMPS @@ -1334,6 +1399,9 @@ void R_ReInitColormaps(UINT16 num) } W_ReadLumpHeader(lump, colormaps, W_LumpLength(basecolormaplump), 0U); + if (fadecolormap) + Z_Free(fadecolormap); + R_CreateFadeColormaps(W_LumpLength(lump)); // Init Boom colormaps. R_ClearColormaps(); @@ -1615,7 +1683,6 @@ extracolormap_t *R_ColormapForName(char *name) // static double deltas[256][3], map[256][3]; -static UINT8 NearestColor(UINT8 r, UINT8 g, UINT8 b); static int RoundUp(double number); lighttable_t *R_CreateLightTable(extracolormap_t *extra_colormap) @@ -2027,7 +2094,7 @@ extracolormap_t *R_AddColormaps(extracolormap_t *exc_augend, extracolormap_t *ex // Thanks to quake2 source! // utils3/qdata/images.c -static UINT8 NearestColor(UINT8 r, UINT8 g, UINT8 b) +UINT8 NearestColor(UINT8 r, UINT8 g, UINT8 b) { int dr, dg, db; int distortion, bestdistortion = 256 * 256 * 4, bestcolor = 0, i; diff --git a/src/r_data.h b/src/r_data.h index b6b0a16a1..77e615799 100644 --- a/src/r_data.h +++ b/src/r_data.h @@ -148,6 +148,8 @@ const char *R_NameForColormap(extracolormap_t *extra_colormap); #define R_PutRgbaRGB(r, g, b) (R_PutRgbaR(r) + R_PutRgbaG(g) + R_PutRgbaB(b)) #define R_PutRgbaRGBA(r, g, b, a) (R_PutRgbaRGB(r, g, b) + R_PutRgbaA(a)) +UINT8 NearestColor(UINT8 r, UINT8 g, UINT8 b); + extern INT32 numtextures; #endif diff --git a/src/r_state.h b/src/r_state.h index da9425bdf..977384926 100644 --- a/src/r_state.h +++ b/src/r_state.h @@ -38,6 +38,7 @@ typedef struct extern sprcache_t *spritecachedinfo; extern lighttable_t *colormaps; +extern lighttable_t *fadecolormap; // Boom colormaps. extern extracolormap_t *extra_colormaps; diff --git a/src/sdl/hwsym_sdl.c b/src/sdl/hwsym_sdl.c index 05ac6450e..a07d9eb03 100644 --- a/src/sdl/hwsym_sdl.c +++ b/src/sdl/hwsym_sdl.c @@ -98,6 +98,7 @@ void *hwSym(const char *funcName,void *handle) GETFUNC(StartScreenWipe); GETFUNC(EndScreenWipe); GETFUNC(DoScreenWipe); + GETFUNC(DoScreenWipeLevel); GETFUNC(DrawIntermissionBG); GETFUNC(MakeScreenTexture); GETFUNC(MakeScreenFinalTexture); diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 5a4fd7a02..998fae239 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -1519,6 +1519,7 @@ void I_StartupGraphics(void) HWD.pfnStartScreenWipe = hwSym("StartScreenWipe",NULL); HWD.pfnEndScreenWipe = hwSym("EndScreenWipe",NULL); HWD.pfnDoScreenWipe = hwSym("DoScreenWipe",NULL); + HWD.pfnDoScreenWipeLevel= hwSym("DoScreenWipeLevel",NULL); HWD.pfnDrawIntermissionBG=hwSym("DrawIntermissionBG",NULL); HWD.pfnMakeScreenTexture= hwSym("MakeScreenTexture",NULL); HWD.pfnMakeScreenFinalTexture=hwSym("MakeScreenFinalTexture",NULL); diff --git a/src/win32/win_dll.c b/src/win32/win_dll.c index 71eda0437..b6353f80d 100644 --- a/src/win32/win_dll.c +++ b/src/win32/win_dll.c @@ -121,6 +121,7 @@ static loadfunc_t hwdFuncTable[] = { {"StartScreenWipe@0", &hwdriver.pfnStartScreenWipe}, {"EndScreenWipe@0", &hwdriver.pfnEndScreenWipe}, {"DoScreenWipe@4", &hwdriver.pfnDoScreenWipe}, + {"DoScreenWipeLevel@0", &hwdriver.pfnDoScreenWipeLevel}, {"DrawIntermissionBG@0",&hwdriver.pfnDrawIntermissionBG}, {"MakeScreenTexture@0", &hwdriver.pfnMakeScreenTexture}, {"MakeScreenFinalTexture@0", &hwdriver.pfnMakeScreenFinalTexture}, @@ -152,6 +153,7 @@ static loadfunc_t hwdFuncTable[] = { {"StartScreenWipe", &hwdriver.pfnStartScreenWipe}, {"EndScreenWipe", &hwdriver.pfnEndScreenWipe}, {"DoScreenWipe", &hwdriver.pfnDoScreenWipe}, + {"DoScreenWipeLevel", &hwdriver.pfnDoScreenWipeLevel}, {"DrawIntermissionBG", &hwdriver.pfnDrawIntermissionBG}, {"MakeScreenTexture", &hwdriver.pfnMakeScreenTexture}, {"MakeScreenFinalTexture", &hwdriver.pfnMakeScreenFinalTexture}, From eb1b6eedeb69e579d5ef67f8d89669e4529a8183 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Tue, 10 Sep 2019 16:54:40 -0300 Subject: [PATCH 003/189] some adjusts --- src/f_finale.h | 7 +++++++ src/f_wipe.c | 15 ++++---------- src/r_data.c | 54 +++++++++++++++++++++++++++++++++++++++----------- 3 files changed, 53 insertions(+), 23 deletions(-) diff --git a/src/f_finale.h b/src/f_finale.h index ccef4a362..6f7087dbb 100644 --- a/src/f_finale.h +++ b/src/f_finale.h @@ -126,6 +126,13 @@ typedef enum } wipestyleflags_t; extern wipestyleflags_t wipestyleflags; +#define FADECOLORMAPDIV 8 +#define FADECOLORMAPROWS (256/FADECOLORMAPDIV) + +#define FADEREDFACTOR 20 +#define FADEGREENFACTOR 20 +#define FADEBLUEFACTOR 10 + void F_WipeStartScreen(void); void F_WipeEndScreen(void); void F_RunWipe(UINT8 wipetype, boolean drawMenu); diff --git a/src/f_wipe.c b/src/f_wipe.c index cabcbb1a1..f1d31f1f8 100644 --- a/src/f_wipe.c +++ b/src/f_wipe.c @@ -103,7 +103,6 @@ static fixed_t paldiv = 0; static UINT8 curwipetype; static UINT8 curwipeframe; -static UINT8 maxwipeframe; /** Create fademask_t from lump * @@ -164,7 +163,7 @@ static fademask_t *F_GetFadeMask(UINT8 masknum, UINT8 scrnnum) { // Determine pixel to use from fademask pcolor = &pMasterPalette[*lump++]; if (wipestyle == WIPESTYLE_LEVEL) - *mask++ = pcolor->s.red/8; // 0-31 range + *mask++ = pcolor->s.red / FADECOLORMAPDIV; else *mask++ = FixedDiv((pcolor->s.red+1)<>FRACBITS; } @@ -282,7 +281,7 @@ static void F_DoWipe(fademask_t *fademask) relativepos += vid.width; } } - else if ((*mask >= maxwipeframe) && (wipestyle == WIPESTYLE_NORMAL)) + else if ((*mask >= 10) && (wipestyle == WIPESTYLE_NORMAL)) { // shortcut - memcpy target to work while (draw_linestogo--) @@ -299,11 +298,11 @@ static void F_DoWipe(fademask_t *fademask) UINT8 *fade = fadecolormap; if (wipestyleflags & WSF_TOWHITE) - fade = fadecolormap + (32 * 256); + fade = fadecolormap + (FADECOLORMAPROWS * 256); nmask = *mask; if (wipestyleflags & WSF_FADEIN) - nmask = 31 - nmask; + nmask = (FADECOLORMAPROWS-1) - nmask; transtbl = fade + (nmask * 256); } @@ -406,15 +405,9 @@ void F_RunWipe(UINT8 wipetype, boolean drawMenu) // don't know where else to put this. // this any good? if (gamestate == GS_LEVEL || gamestate == GS_TITLESCREEN) - { wipestyle = WIPESTYLE_LEVEL; - maxwipeframe = 31; - } else - { wipestyle = WIPESTYLE_NORMAL; - maxwipeframe = 10; - } curwipetype = wipetype; curwipeframe = 0; diff --git a/src/r_data.c b/src/r_data.c index 2699cf599..3e167c45d 100644 --- a/src/r_data.c +++ b/src/r_data.c @@ -23,6 +23,7 @@ #include "z_zone.h" #include "p_setup.h" // levelflats #include "v_video.h" // pMasterPalette +#include "f_finale.h" // wipes #include "dehacked.h" #ifdef _WIN32 @@ -112,7 +113,7 @@ INT32 *texturetranslation; sprcache_t *spritecachedinfo; lighttable_t *colormaps; -lighttable_t *fadecolormap = NULL; +lighttable_t *fadecolormap; // for debugging/info purposes static size_t flatmemory, spritememory, texturememory; @@ -1298,30 +1299,58 @@ static void R_InitSpriteLumps(void) // // R_CreateFadeColormaps // -static void R_CreateFadeColormaps(size_t len) + +static void R_CreateFadeColormaps() { UINT8 px, fade; RGBA_t rgba; INT32 r, g, b; - size_t i; + size_t len, i; + len = (256 * FADECOLORMAPROWS); fadecolormap = Z_MallocAlign(len*2, PU_STATIC, NULL, 8); + for (i = 0; i < len*2; i++) + fadecolormap[i] = (i%256); + + // Load in the light tables, now 64k aligned for smokie... + { + lumpnum_t lump = W_CheckNumForName("FADECMAP"); + lumpnum_t wlump = W_CheckNumForName("FADEWMAP"); + + // to black + if (lump != LUMPERROR) + W_ReadLumpHeader(lump, fadecolormap, len, 0U); + // to white + if (wlump != LUMPERROR) + W_ReadLumpHeader(wlump, fadecolormap+len, len, 0U); + + // missing "to white" colormap lump + if (lump != LUMPERROR && wlump == LUMPERROR) + goto makewhite; + // missing "to black" colormap lump + else if (lump == LUMPERROR && wlump != LUMPERROR) + goto makeblack; + // both lumps found + else if (lump != LUMPERROR && wlump != LUMPERROR) + return; + } #define GETCOLOR \ px = colormaps[i%256]; \ - fade = (i/256) * 8; \ + fade = (i/256) * (256 / FADECOLORMAPROWS); \ rgba = V_GetColor(px); // to black + makeblack: for (i = 0; i < len; i++) { // find pixel and fade amount GETCOLOR; // subtractive color blending - r = rgba.s.red - fade*3; - g = rgba.s.green - fade*2; - b = rgba.s.blue - fade; + r = rgba.s.red - FADEREDFACTOR*fade/10; + g = rgba.s.green - FADEGREENFACTOR*fade/10; + b = rgba.s.blue - FADEBLUEFACTOR*fade/10; // clamp values if (r < 0) r = 0; @@ -1333,15 +1362,16 @@ static void R_CreateFadeColormaps(size_t len) } // to white + makewhite: for (i = len; i < len*2; i++) { // find pixel and fade amount GETCOLOR; // additive color blending - r = rgba.s.red + fade*3; - g = rgba.s.green + fade*2; - b = rgba.s.blue + fade; + r = rgba.s.red + FADEREDFACTOR*fade/10; + g = rgba.s.green + FADEGREENFACTOR*fade/10; + b = rgba.s.blue + FADEBLUEFACTOR*fade/10; // clamp values if (r > 255) r = 255; @@ -1369,7 +1399,7 @@ static void R_InitColormaps(void) W_ReadLump(lump, colormaps); // Make colormap for fades - R_CreateFadeColormaps(len); + R_CreateFadeColormaps(); // Init Boom colormaps. R_ClearColormaps(); @@ -1401,7 +1431,7 @@ void R_ReInitColormaps(UINT16 num) W_ReadLumpHeader(lump, colormaps, W_LumpLength(basecolormaplump), 0U); if (fadecolormap) Z_Free(fadecolormap); - R_CreateFadeColormaps(W_LumpLength(lump)); + R_CreateFadeColormaps(); // Init Boom colormaps. R_ClearColormaps(); From 00697caa6e40ea07fcb2f6fb78c18a770bd1d890 Mon Sep 17 00:00:00 2001 From: lachwright Date: Thu, 3 Oct 2019 12:49:46 +0800 Subject: [PATCH 004/189] Initial commit --- src/b_bot.c | 314 +++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 277 insertions(+), 37 deletions(-) diff --git a/src/b_bot.c b/src/b_bot.c index 17211b353..02ac6d1bc 100644 --- a/src/b_bot.c +++ b/src/b_bot.c @@ -24,12 +24,36 @@ static boolean lastForward = false; static boolean lastBlocked = false; static boolean blocked = false; +static boolean jump_last = false; +static boolean spin_last = false; +static UINT8 anxiety = 0; +static boolean panic = false; +static UINT8 flymode = 0; +static boolean spinmode = false; +static boolean thinkfly = false; +static mobj_t *overlay; + static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cmd) { boolean forward=false, backward=false, left=false, right=false, jump=false, spin=false; - angle_t angle; - INT16 rangle; - fixed_t dist; + + player_t *player = sonic->player, *bot = tails->player; + ticcmd_t *pcmd = &player->cmd; + boolean water = tails->eflags & MFE_UNDERWATER; + boolean flip = P_MobjFlip(tails); + boolean _2d = (tails->flags2 & MF2_TWOD) || twodlevel; + fixed_t scale = tails->scale; + + fixed_t dist = P_AproxDistance(sonic->x - tails->x, sonic->y - tails->y); + fixed_t zdist = flip * (sonic->z - tails->z); + angle_t ang = R_PointToAngle2(tails->x, tails->y, sonic->x, sonic->y); + fixed_t pmom = P_AproxDistance(sonic->momx, sonic->momy); + fixed_t bmom = P_AproxDistance(tails->momx, tails->momy); + fixed_t followmax = 128 * 8 *scale; + fixed_t followthres = 92 * scale; + fixed_t followmin = 32 * scale; + fixed_t comfortheight = 96 * scale; + fixed_t touchdist = 24 * scale; // We can't follow Sonic if he's not around! if (!sonic || sonic->health <= 0) @@ -58,46 +82,255 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm return; } - // Gather data about the environment - dist = P_AproxDistance(tails->x-sonic->x, tails->y-sonic->y); - if (tails->player->pflags & PF_STARTDASH) - angle = sonic->angle; + // Adapted from CobaltBW's tails_AI.wad + + // Check water + if (water) + { + followmin = 0; + followthres = 16*scale; + followmax >>= 1; + thinkfly = false; + } + + // Check anxiety + if (spinmode) + { + anxiety = 0; + panic = false; + } + else if (dist > followmax || zdist > comfortheight) + { + anxiety = min(anxiety + 2, 70); + if (anxiety >= 70) + panic = true; + } else - angle = R_PointToAngle2(tails->x, tails->y, sonic->x, sonic->y); - - // Decide which direction to turn - angle = (tails->angle - angle); - if (angle < ANGLE_180) { - right = true; // We need to turn right - rangle = AngleFixed(angle)>>FRACBITS; - } else { - left = true; // We need to turn left - rangle = 360-(AngleFixed(angle)>>FRACBITS); + { + anxiety = max(anxiety - 1, 0); + panic = false; } - - // Decide to move forward if you're finished turning - if (abs(rangle) < 10) { // We're facing the right way? - left = right = false; // Stop turning - forward = true; // and walk forward instead. + + // Orientation + if ((bot->pflags & (PF_SPINNING|PF_STARTDASH)) || flymode == 2) + { + tails->angle = sonic->angle; } - if (dist < (sonic->radius+tails->radius)*3) // We're close enough? - forward = false; // Stop walking. - - // Decide when to jump - if (!(tails->player->pflags & (PF_JUMPED|PF_JUMPDOWN))) { // We're not jumping yet... - if (forward && lastForward && blocked && lastBlocked) // We've been stopped by a wall or something - jump = true; // Try to jump up - } else if ((tails->player->pflags & (PF_JUMPDOWN|PF_JUMPED)) == (PF_JUMPDOWN|PF_JUMPED)) { // When we're already jumping... - if (lastForward && blocked) // We're still stuck on something? + else + { + tails->angle = ang; + } + + // ******** + // FLY MODE + // spinmode check + if (spinmode) + thinkfly = false; + else + { + // Activate co-op flight + if (thinkfly && player->pflags & PF_JUMPED) + { + if (!jump_last) + { + jump = true; + if (bot->pflags & PF_JUMPED) + { + flymode = 1; + thinkfly = false; + } + } + } + + // Check positioning + // Thinker for co-op flight + if (!(water || pmom || bmom) + && (dist < touchdist) + && !(pcmd->forwardmove || pcmd->sidemove || player->dashspeed) + && P_IsObjectOnGround(sonic) && P_IsObjectOnGround(tails) + && !(player->pflags & PF_STASIS)) + thinkfly = true; + else + thinkfly = false; + + // Ready for takeoff + if (flymode == 1) + { + thinkfly = false; + if (zdist < -64*scale || (flip * tails->momz) > scale) // Make sure we're not too high up + spin = true; + else if (!jump_last) + jump = true; + + // Abort if the player moves away or spins + if (dist > followthres || player->dashspeed) + flymode = 0; + + // Set carried state + if (bot->pflags & PF_THOKKED && flymode == 1 + && !P_IsObjectOnGround(sonic) + && dist < touchdist + && zdist < 32*scale + && flip * sonic->momz < 0) + { + P_SetTarget(&sonic->tracer, tails); + player->powers[pw_carry] = CR_PLAYER; + flymode = 2; + player->pflags &= ~PF_JUMPED; + } + } + // Read player inputs + else if (flymode == 2) + { + cmd->forwardmove = pcmd->forwardmove; + cmd->sidemove = pcmd->sidemove; + if (pcmd->buttons & BT_USE) + { + spin = true; + jump = false; + } + else if (!jump_last) + jump = true; + // End flymode + if (player->pflags & PF_JUMPED + || player->powers[pw_carry] != CR_PLAYER + || P_IsObjectOnGround(sonic)) + { + player->powers[pw_carry] = CR_NONE; + P_SetTarget(&sonic->tracer, NULL); + flymode = 0; + } + } + } + + if (flymode && P_IsObjectOnGround(tails) && !(pcmd->buttons & BT_JUMP)) + flymode = 0; + + // ******** + // SPINNING + if (panic || flymode || !(player->pflags & PF_SPINNING) || (player->pflags & PF_JUMPED)) + spinmode = false; + else + { + if (!_2d) + { + // Spindash + if (player->dashspeed) + { + if (dist < followthres && dist > touchdist) // Do positioning + { + tails->angle = ang; + cmd->forwardmove = 50; + spinmode = true; + } + else if (dist < touchdist && !bmom + && (!(bot->pflags & PF_SPINNING) || (bot->dashspeed && bot->pflags & PF_SPINNING))) + { + tails->angle = sonic->angle; + spin = true; + spinmode = true; + } + else + spinmode = 0; + } + // Spin + else if (player->dashspeed == bot->dashspeed && player->pflags & PF_SPINNING) + { + if (bot->pflags & PF_SPINNING || !spin_last) + { + spin = true; + tails->angle = sonic->angle; + cmd->forwardmove = MAXPLMOVE; + spinmode = true; + } + else + spinmode = false; + } + } + // 2D mode + else + { + if ((player->dashspeed && !bmom) || (player->dashspeed == bot->dashspeed && player->pflags & PF_SPINNING)) + { + spin = true; + spinmode = true; + } + } + } + + // ******** + // FOLLOW + if (!(flymode || spinmode)) + { + // Too far + if (panic || dist > followthres) + { + if (!_2d) + cmd->forwardmove = MAXPLMOVE; + else if (sonic->x > tails->x) + cmd->sidemove = MAXPLMOVE; + else + cmd->sidemove = -MAXPLMOVE; + } + // Within threshold + else if (!panic && dist > followmin && abs(zdist) < 192*scale) + { + if (!_2d) + cmd->forwardmove = FixedHypot(pcmd->forwardmove, pcmd->sidemove); + else + cmd->sidemove = pcmd->sidemove; + } + // Below min + else if (dist < followmin) + { + // Copy inputs + tails->angle = sonic->angle; + bot->drawangle = player->drawangle; + cmd->forwardmove = 8 * pcmd->forwardmove / 10; + cmd->sidemove = 8 * pcmd->sidemove / 10; + } + } + + // ******** + // JUMP + if (!(flymode || spinmode)) + { + // Flying catch-up + if (bot->pflags & PF_THOKKED) + { + cmd->forwardmove = min(50, dist/scale/8); + if (zdist < -64*scale) + spin = true; + else if (zdist > 0 && !jump_last) + jump = true; + } + + // Just landed + if (tails->eflags & MFE_JUSTHITFLOOR) + jump = false; + // Start jump + else if (!jump_last && !(bot->pflags & PF_JUMPED) && !(player->pflags & PF_SPINNING) + && ((zdist > 32*scale && player->pflags & PF_JUMPED) // Following + || (zdist > 64*scale && panic) // Vertical catch-up + || (bmom < scale>>3 && dist > followthres && !(bot->powers[pw_carry])) // Stopped & not in carry state + || (bot->pflags & PF_SPINNING && !(bot->pflags & PF_JUMPED)))) // Spinning + jump = true; + // Hold jump + else if (bot->pflags & PF_JUMPED && jump_last && tails->momz*flip > 0 && (zdist > 0 || panic)) jump = true; - if (sonic->floorz > tails->floorz) // He's still above us? Jump HIGHER, then! + // Start flying + else if (bot->pflags & PF_JUMPED && panic && !jump_last) jump = true; } - - // Decide when to spin - if (sonic->player->pflags & PF_STARTDASH - && (tails->player->pflags & PF_STARTDASH || (P_AproxDistance(tails->momx, tails->momy) < 2*FRACUNIT && !forward))) - spin = true; + + // ******** + // HISTORY + jump_last = jump; + spin_last = spin; + + // ******** + // Thinkfly overlay + // doing this later :P // Turn the virtual keypresses into ticcmd_t. B_KeysToTiccmd(tails, cmd, forward, backward, left, right, false, false, jump, spin); @@ -188,6 +421,13 @@ void B_KeysToTiccmd(mobj_t *mo, ticcmd_t *cmd, boolean forward, boolean backward cmd->sidemove -= MAXPLMOVE<>16; if (straferight) cmd->sidemove += MAXPLMOVE<>16; + + // cap inputs so the bot can't accelerate faster diagonally + angle_t angle = R_PointToAngle2(0, 0, cmd->sidemove << FRACBITS, cmd->forwardmove << FRACBITS); + INT32 maxforward = abs(P_ReturnThrustY(NULL, angle, MAXPLMOVE)); + INT32 maxside = abs(P_ReturnThrustX(NULL, angle, MAXPLMOVE)); + cmd->forwardmove = max(min(cmd->forwardmove, maxforward), -maxforward); + cmd->sidemove = max(min(cmd->sidemove, maxside), -maxside); } if (jump) cmd->buttons |= BT_JUMP; From b120193eb72ea66112e5a70c3b6a6c87d5a53056 Mon Sep 17 00:00:00 2001 From: lachwright Date: Sat, 5 Oct 2019 02:48:20 +0800 Subject: [PATCH 005/189] Fix AI angling --- src/b_bot.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/b_bot.c b/src/b_bot.c index 02ac6d1bc..be1d9dd60 100644 --- a/src/b_bot.c +++ b/src/b_bot.c @@ -114,11 +114,11 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm // Orientation if ((bot->pflags & (PF_SPINNING|PF_STARTDASH)) || flymode == 2) { - tails->angle = sonic->angle; + cmd->angleturn = (sonic->angle - tails->angle) >> FRACBITS; } else { - tails->angle = ang; + cmd->angleturn = (ang - tails->angle) >> FRACBITS; } // ******** @@ -219,14 +219,14 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm { if (dist < followthres && dist > touchdist) // Do positioning { - tails->angle = ang; + cmd->angleturn = (ang - tails->angle) >> FRACBITS; cmd->forwardmove = 50; spinmode = true; } else if (dist < touchdist && !bmom && (!(bot->pflags & PF_SPINNING) || (bot->dashspeed && bot->pflags & PF_SPINNING))) { - tails->angle = sonic->angle; + cmd->angleturn = (sonic->angle - tails->angle) >> FRACBITS; spin = true; spinmode = true; } @@ -239,7 +239,7 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm if (bot->pflags & PF_SPINNING || !spin_last) { spin = true; - tails->angle = sonic->angle; + cmd->angleturn = (sonic->angle - tails->angle) >> FRACBITS; cmd->forwardmove = MAXPLMOVE; spinmode = true; } @@ -284,7 +284,7 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm else if (dist < followmin) { // Copy inputs - tails->angle = sonic->angle; + cmd->angleturn = (sonic->angle - tails->angle) >> FRACBITS; bot->drawangle = player->drawangle; cmd->forwardmove = 8 * pcmd->forwardmove / 10; cmd->sidemove = 8 * pcmd->sidemove / 10; From b180fd7c91110295eaef89ad33962f5aa60fb7bc Mon Sep 17 00:00:00 2001 From: lachwright Date: Sat, 5 Oct 2019 03:02:27 +0800 Subject: [PATCH 006/189] Update to 9/25 Lua script --- src/b_bot.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/b_bot.c b/src/b_bot.c index be1d9dd60..7d6732365 100644 --- a/src/b_bot.c +++ b/src/b_bot.c @@ -223,11 +223,13 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm cmd->forwardmove = 50; spinmode = true; } - else if (dist < touchdist && !bmom - && (!(bot->pflags & PF_SPINNING) || (bot->dashspeed && bot->pflags & PF_SPINNING))) + else if (dist < touchdist) { - cmd->angleturn = (sonic->angle - tails->angle) >> FRACBITS; - spin = true; + if (!bmom && (!(bot->pflags & PF_SPINNING) || (bot->dashspeed && bot->pflags & PF_SPINNING))) + { + cmd->angleturn = (sonic->angle - tails->angle) >> FRACBITS; + spin = true; + } spinmode = true; } else From 00d76bd9efed243bb7dbf49cd46a10c4a5cf038a Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Tue, 5 Nov 2019 12:10:42 -0300 Subject: [PATCH 007/189] fix fades for real --- src/d_main.c | 2 +- src/f_finale.c | 15 +++---- src/f_finale.h | 2 + src/f_wipe.c | 21 ++++++++-- src/hardware/hw_main.c | 94 +++++++++++++++++++++++------------------- src/hardware/hw_main.h | 3 +- src/p_setup.c | 18 ++++++-- 7 files changed, 97 insertions(+), 58 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index 24d026827..6d1335d36 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -267,7 +267,7 @@ static void D_Display(void) && wipetypepre != UINT8_MAX) { F_WipeStartScreen(); - V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); + F_WipeColorFill(31); F_WipeEndScreen(); F_RunWipe(wipetypepre, gamestate != GS_TIMEATTACK && gamestate != GS_TITLESCREEN); } diff --git a/src/f_finale.c b/src/f_finale.c index eb1415042..b9a2cfc9b 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -763,7 +763,7 @@ void F_IntroDrawer(void) if (rendermode != render_none) { F_WipeStartScreen(); - V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); + F_WipeColorFill(31); F_WipeEndScreen(); F_RunWipe(99,true); } @@ -773,10 +773,11 @@ void F_IntroDrawer(void) else if (intro_scenenum == 10) { // The only fade to white in the entire damn game. + // (not true) if (rendermode != render_none) { F_WipeStartScreen(); - V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 0); + F_WipeColorFill(0); F_WipeEndScreen(); F_RunWipe(99,true); } @@ -786,7 +787,7 @@ void F_IntroDrawer(void) if (rendermode != render_none) { F_WipeStartScreen(); - V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); + F_WipeColorFill(31); F_WipeEndScreen(); F_RunWipe(99,true); } @@ -833,7 +834,7 @@ void F_IntroDrawer(void) patch_t *radar = W_CachePatchName("RADAR", PU_CACHE); F_WipeStartScreen(); - V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); + F_WipeColorFill(31); V_DrawScaledPatch(0, 0, 0, radar); W_UnlockCachedPatch(radar); V_DrawString(8, 128, 0, cutscene_disptext); @@ -846,7 +847,7 @@ void F_IntroDrawer(void) patch_t *grass = W_CachePatchName("SGRASS5", PU_CACHE); F_WipeStartScreen(); - V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); + F_WipeColorFill(31); V_DrawScaledPatch(0, 0, 0, grass); W_UnlockCachedPatch(grass); V_DrawString(8, 128, 0, cutscene_disptext); @@ -859,7 +860,7 @@ void F_IntroDrawer(void) patch_t *confront = W_CachePatchName("CONFRONT", PU_CACHE); F_WipeStartScreen(); - V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); + F_WipeColorFill(31); V_DrawSmallScaledPatch(0, 0, 0, confront); W_UnlockCachedPatch(confront); V_DrawString(8, 128, 0, cutscene_disptext); @@ -872,7 +873,7 @@ void F_IntroDrawer(void) patch_t *sdo = W_CachePatchName("SONICDO2", PU_CACHE); F_WipeStartScreen(); - V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); + F_WipeColorFill(31); V_DrawSmallScaledPatch(0, 0, 0, sdo); W_UnlockCachedPatch(sdo); V_DrawString(224, 8, 0, cutscene_disptext); diff --git a/src/f_finale.h b/src/f_finale.h index 0619a7e74..4766af652 100644 --- a/src/f_finale.h +++ b/src/f_finale.h @@ -138,6 +138,8 @@ void F_WipeStartScreen(void); void F_WipeEndScreen(void); void F_RunWipe(UINT8 wipetype, boolean drawMenu); void F_WipeTicker(void); +void F_WipeTitleCard(void); +void F_WipeColorFill(UINT8 color); tic_t F_GetWipeLength(UINT8 wipetype); boolean F_WipeExists(UINT8 wipetype); diff --git a/src/f_wipe.c b/src/f_wipe.c index e67e7e3ad..8b69f39ca 100644 --- a/src/f_wipe.c +++ b/src/f_wipe.c @@ -103,6 +103,7 @@ static fixed_t paldiv = 0; static UINT8 curwipetype; static UINT8 curwipeframe; +static UINT8 wipecolorfill = 31; /** Create fademask_t from lump * @@ -186,7 +187,7 @@ static fademask_t *F_GetFadeMask(UINT8 masknum, UINT8 scrnnum) { return NULL; } -static void F_WipeTitleCard(void) +void F_WipeTitleCard(void) { if (wipestyle == WIPESTYLE_LEVEL && (!titlemapinaction) @@ -199,6 +200,12 @@ static void F_WipeTitleCard(void) ST_drawLevelTitle(TICRATE); } +void F_WipeColorFill(UINT8 color) +{ + wipecolorfill = color; + V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, wipecolorfill); +} + /** Wipe ticker * * \param fademask pixels to change @@ -430,10 +437,17 @@ void F_RunWipe(UINT8 wipetype, boolean drawMenu) #ifdef HWRENDER if (rendermode == render_opengl) - HWR_DoWipe(wipetype, wipeframe-1); // send in the wipe type and wipeframe because we need to cache the graphic + { + // send in the wipe type and wipe frame because we need to cache the graphic + if (wipestyle == WIPESTYLE_LEVEL) + HWR_DoTintedWipe(wipetype, wipeframe-1); + else + HWR_DoWipe(wipetype, wipeframe-1); + } else #endif F_DoWipe(fmask); + I_OsPolling(); I_UpdateNoBlit(); @@ -473,8 +487,9 @@ void F_WipeTicker(void) } #ifdef HWRENDER + // send in the wipe type and wipe frame because we need to cache the graphic if (rendermode == render_opengl) - HWR_DoWipeLevel(curwipetype, curwipeframe-1); + HWR_DoLevelWipe(curwipetype, curwipeframe-1, wipecolorfill); // also send the wipe color else #endif F_DoWipe(fmask); diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 92def01a9..9d1c2d219 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -39,6 +39,7 @@ #include "../st_stuff.h" #include "../i_system.h" #include "../m_cheat.h" +#include "../f_finale.h" #ifdef ESLOPE #include "../p_slopes.h" #endif @@ -6991,73 +6992,82 @@ void HWR_DrawIntermissionBG(void) HWD.pfnDrawIntermissionBG(); } -void HWR_DoWipe(UINT8 wipenum, UINT8 scrnnum) +// +// hwr mode wipes +// +static char wipelumpname[9]; +static lumpnum_t wipelumpnum; + +// puts wipe lumpname in wipename[9] +static boolean check_wipe(UINT8 wipenum, UINT8 scrnnum) { - static char lumpname[9] = "FADEmmss"; - lumpnum_t lumpnum; size_t lsize; - if (wipenum > 99 || scrnnum > 99) // not a valid wipe number - return; // shouldn't end up here really, the loop should've stopped running beforehand + // write FADE prefix into wipelumpname + strncpy(wipelumpname, "FADEmmss", 8); - // puts the numbers into the lumpname - sprintf(&lumpname[4], "%.2hu%.2hu", (UINT16)wipenum, (UINT16)scrnnum); - lumpnum = W_CheckNumForName(lumpname); + // not a valid wipe number + if (wipenum > 99 || scrnnum > 99) + return false; // shouldn't end up here really, the loop should've stopped running beforehand - if (lumpnum == LUMPERROR) // again, shouldn't be here really - return; + // puts the numbers into the wipename + sprintf(&wipelumpname[4], "%.2hu%.2hu", (UINT16)wipenum, (UINT16)scrnnum); + wipelumpnum = W_CheckNumForName(wipelumpname); - lsize = W_LumpLength(lumpnum); + // again, shouldn't be here really + if (wipelumpnum == LUMPERROR) + return false; + lsize = W_LumpLength(wipelumpnum); if (!(lsize == 256000 || lsize == 64000 || lsize == 16000 || lsize == 4000)) { - CONS_Alert(CONS_WARNING, "Fade mask lump %s of incorrect size, ignored\n", lumpname); - return; // again, shouldn't get here if it is a bad size + CONS_Alert(CONS_WARNING, "Fade mask lump %s of incorrect size, ignored\n", wipelumpname); + return false; // again, shouldn't get here if it is a bad size } - HWR_GetFadeMask(lumpnum); + return true; +} +void HWR_DoWipe(UINT8 wipenum, UINT8 scrnnum) +{ + if (!check_wipe(wipenum, scrnnum)) + return; + + HWR_GetFadeMask(wipelumpnum); HWD.pfnDoScreenWipe(HWRWipeCounter); // Still send in wipecounter since old stuff might not support multitexturing HWRWipeCounter += 0.05f; // increase opacity of end screen - if (HWRWipeCounter > 1.0f) HWRWipeCounter = 1.0f; } -void HWR_DoWipeLevel(UINT8 wipenum, UINT8 scrnnum) +void HWR_DoTintedWipe(UINT8 wipenum, UINT8 scrnnum) { - static char lumpname[9] = "FADEmmss"; - lumpnum_t lumpnum; - size_t lsize; - - if (wipenum > 99 || scrnnum > 99) // not a valid wipe number - return; // shouldn't end up here really, the loop should've stopped running beforehand - - // puts the numbers into the lumpname - sprintf(&lumpname[4], "%.2hu%.2hu", (UINT16)wipenum, (UINT16)scrnnum); - lumpnum = W_CheckNumForName(lumpname); - - if (lumpnum == LUMPERROR) // again, shouldn't be here really + if (!check_wipe(wipenum, scrnnum)) return; - lsize = W_LumpLength(lumpnum); - - if (!(lsize == 256000 || lsize == 64000 || lsize == 16000 || lsize == 4000)) - { - CONS_Alert(CONS_WARNING, "Fade mask lump %s of incorrect size, ignored\n", lumpname); - return; // again, shouldn't get here if it is a bad size - } - - HWR_EndScreenWipe(); - V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); - HWR_StartScreenWipe(); - HWR_GetFadeMask(lumpnum); - - HWD.pfnDoScreenWipeLevel(); + HWR_GetFadeMask(wipelumpnum); + HWD.pfnDoScreenWipe(HWRWipeCounter); HWRWipeCounter += 0.05f; // increase opacity of end screen + if (HWRWipeCounter > 1.0f) + HWRWipeCounter = 1.0f; +} +void HWR_DoLevelWipe(UINT8 wipenum, UINT8 scrnnum, UINT8 wipecolorfill) +{ + if (!check_wipe(wipenum, scrnnum)) + return; + + HWR_EndScreenWipe(); + V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, wipecolorfill); + HWR_StartScreenWipe(); + HWR_GetFadeMask(wipelumpnum); + + HWD.pfnDoScreenWipeLevel(); + F_WipeTitleCard(); + + HWRWipeCounter += 0.05f; // increase opacity of end screen if (HWRWipeCounter > 1.0f) HWRWipeCounter = 1.0f; } diff --git a/src/hardware/hw_main.h b/src/hardware/hw_main.h index 6d340ec6b..e1cb01444 100644 --- a/src/hardware/hw_main.h +++ b/src/hardware/hw_main.h @@ -67,7 +67,8 @@ void HWR_StartScreenWipe(void); void HWR_EndScreenWipe(void); void HWR_DrawIntermissionBG(void); void HWR_DoWipe(UINT8 wipenum, UINT8 scrnnum); -void HWR_DoWipeLevel(UINT8 wipenum, UINT8 scrnnum); +void HWR_DoTintedWipe(UINT8 wipenum, UINT8 scrnnum); +void HWR_DoLevelWipe(UINT8 wipenum, UINT8 scrnnum, UINT8 wipecolorfill); void HWR_MakeScreenFinalTexture(void); void HWR_DrawScreenFinalTexture(int width, int height); diff --git a/src/p_setup.c b/src/p_setup.c index 1223c85d0..ea619c641 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2691,10 +2691,15 @@ boolean P_SetupLevel(boolean skipprecip) F_WipeStartScreen(); wipestyleflags |= WSF_FADEOUT|WSF_TOWHITE; +#ifdef HWRENDER + // uh.......... + if (rendermode == render_opengl) + F_WipeColorFill(0); +#endif + F_WipeEndScreen(); F_RunWipe(wipedefs[wipe_speclevel_towhite], false); - V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 0); I_OsPolling(); I_FinishUpdate(); // page flip or blit buffer if (moviemode) @@ -2734,7 +2739,12 @@ boolean P_SetupLevel(boolean skipprecip) { F_WipeStartScreen(); wipestyleflags |= WSF_FADEOUT; - //V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); + +#ifdef HWRENDER + // uh.......... + if (rendermode == render_opengl) + F_WipeColorFill(31); +#endif F_WipeEndScreen(); // for titlemap: run a specific wipe if specified @@ -3130,7 +3140,7 @@ boolean P_SetupLevel(boolean skipprecip) // Remove the loading shit from the screen if (rendermode != render_none && !titlemapinaction) - V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, levelfadecol); + F_WipeColorFill(levelfadecol); if (precache || dedicated) R_PrecacheLevel(); @@ -3203,7 +3213,7 @@ boolean P_SetupLevel(boolean skipprecip) I_Sleep(); lasttime = nowtime; - V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, levelfadecol); + F_WipeColorFill(levelfadecol); stplyr = &players[consoleplayer]; ST_drawLevelTitle(nowtime - starttime); if (splitscreen) From 5ebb90cdd6c6b35ced01d274d6e7b199c4e9cd58 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Tue, 5 Nov 2019 12:28:01 -0300 Subject: [PATCH 008/189] tweak fade colormaps just a little bit --- src/f_finale.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/f_finale.h b/src/f_finale.h index 4766af652..def8232b0 100644 --- a/src/f_finale.h +++ b/src/f_finale.h @@ -130,8 +130,8 @@ extern wipestyleflags_t wipestyleflags; #define FADECOLORMAPDIV 8 #define FADECOLORMAPROWS (256/FADECOLORMAPDIV) -#define FADEREDFACTOR 20 -#define FADEGREENFACTOR 20 +#define FADEREDFACTOR 15 +#define FADEGREENFACTOR 15 #define FADEBLUEFACTOR 10 void F_WipeStartScreen(void); From 044d3fd3253ed7ee16b360c169ade1340c29a75d Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Tue, 5 Nov 2019 12:31:50 -0300 Subject: [PATCH 009/189] Update hw_main.c --- src/hardware/hw_main.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 9d1c2d219..3c56f7da7 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -6999,7 +6999,7 @@ static char wipelumpname[9]; static lumpnum_t wipelumpnum; // puts wipe lumpname in wipename[9] -static boolean check_wipe(UINT8 wipenum, UINT8 scrnnum) +static boolean HWR_WipeCheck(UINT8 wipenum, UINT8 scrnnum) { size_t lsize; @@ -7030,7 +7030,7 @@ static boolean check_wipe(UINT8 wipenum, UINT8 scrnnum) void HWR_DoWipe(UINT8 wipenum, UINT8 scrnnum) { - if (!check_wipe(wipenum, scrnnum)) + if (!HWR_WipeCheck(wipenum, scrnnum)) return; HWR_GetFadeMask(wipelumpnum); @@ -7043,20 +7043,13 @@ void HWR_DoWipe(UINT8 wipenum, UINT8 scrnnum) void HWR_DoTintedWipe(UINT8 wipenum, UINT8 scrnnum) { - if (!check_wipe(wipenum, scrnnum)) - return; - - HWR_GetFadeMask(wipelumpnum); - HWD.pfnDoScreenWipe(HWRWipeCounter); - - HWRWipeCounter += 0.05f; // increase opacity of end screen - if (HWRWipeCounter > 1.0f) - HWRWipeCounter = 1.0f; + // It does the same thing + HWR_DoWipe(wipenum, scrnnum); } void HWR_DoLevelWipe(UINT8 wipenum, UINT8 scrnnum, UINT8 wipecolorfill) { - if (!check_wipe(wipenum, scrnnum)) + if (!HWR_WipeCheck(wipenum, scrnnum)) return; HWR_EndScreenWipe(); From 800052a746a953f3f05ee13c6429b5a0589073ab Mon Sep 17 00:00:00 2001 From: lachwright Date: Wed, 6 Nov 2019 13:59:53 +0800 Subject: [PATCH 010/189] WIP update to latest version of Lua script, halted because script inconsistencies still exist --- src/b_bot.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/b_bot.c b/src/b_bot.c index fdccd08a4..e4c3a2110 100644 --- a/src/b_bot.c +++ b/src/b_bot.c @@ -36,24 +36,25 @@ static mobj_t *overlay; static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cmd) { boolean forward=false, backward=false, left=false, right=false, jump=false, spin=false; - + player_t *player = sonic->player, *bot = tails->player; ticcmd_t *pcmd = &player->cmd; boolean water = tails->eflags & MFE_UNDERWATER; boolean flip = P_MobjFlip(tails); boolean _2d = (tails->flags2 & MF2_TWOD) || twodlevel; fixed_t scale = tails->scale; - + fixed_t dist = P_AproxDistance(sonic->x - tails->x, sonic->y - tails->y); fixed_t zdist = flip * (sonic->z - tails->z); angle_t ang = R_PointToAngle2(tails->x, tails->y, sonic->x, sonic->y); fixed_t pmom = P_AproxDistance(sonic->momx, sonic->momy); fixed_t bmom = P_AproxDistance(tails->momx, tails->momy); - fixed_t followmax = 128 * 8 *scale; - fixed_t followthres = 92 * scale; + fixed_t followmax = 128 * 8 * scale; // Max follow distance before AI begins to enter "panic" state + fixed_t followthres = 92 * scale; // Distance that AI will try to reach fixed_t followmin = 32 * scale; fixed_t comfortheight = 96 * scale; fixed_t touchdist = 24 * scale; + boolean stalled = (bmom < scale >> 1) && dist > followthres; // Helps to see if the AI is having trouble catching up // We can't follow Sonic if he's not around! if (!sonic || sonic->health <= 0) @@ -83,7 +84,7 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm } // Adapted from CobaltBW's tails_AI.wad - + // Check water if (water) { @@ -92,14 +93,14 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm followmax >>= 1; thinkfly = false; } - + // Check anxiety if (spinmode) { anxiety = 0; panic = false; } - else if (dist > followmax || zdist > comfortheight) + else if (dist > followmax || zdist > comfortheight || stalled) { anxiety = min(anxiety + 2, 70); if (anxiety >= 70) @@ -110,7 +111,7 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm anxiety = max(anxiety - 1, 0); panic = false; } - + // Orientation if ((bot->pflags & (PF_SPINNING|PF_STARTDASH)) || flymode == 2) { @@ -120,7 +121,7 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm { cmd->angleturn = (ang - tails->angle) >> FRACBITS; } - + // ******** // FLY MODE // spinmode check @@ -141,7 +142,7 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm } } } - + // Check positioning // Thinker for co-op flight if (!(water || pmom || bmom) From 76488d835f850a135ee8aee006749385d03b8bf6 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Thu, 14 Nov 2019 21:31:20 -0300 Subject: [PATCH 011/189] F_WipeColorFill --- src/d_main.c | 2 +- src/f_finale.h | 4 +++- src/f_wipe.c | 8 +------- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index a8b96d651..47ecb5fbf 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -448,7 +448,7 @@ static void D_Display(void) framecount = 0; demostarttime = I_GetTime(); } - + wipetypepost = -1; } else diff --git a/src/f_finale.h b/src/f_finale.h index e096690a1..6fd94d9c0 100644 --- a/src/f_finale.h +++ b/src/f_finale.h @@ -166,12 +166,14 @@ extern wipestyleflags_t wipestyleflags; #define FADEGREENFACTOR 15 #define FADEBLUEFACTOR 10 +extern UINT8 wipecolorfill; + void F_WipeStartScreen(void); void F_WipeEndScreen(void); void F_RunWipe(UINT8 wipetype, boolean drawMenu); void F_WipeTicker(void); void F_WipeTitleCard(void); -void F_WipeColorFill(UINT8 color); +#define F_WipeColorFill(c) V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, (wipecolorfill = c)) tic_t F_GetWipeLength(UINT8 wipetype); boolean F_WipeExists(UINT8 wipetype); diff --git a/src/f_wipe.c b/src/f_wipe.c index 8b69f39ca..b5b60403e 100644 --- a/src/f_wipe.c +++ b/src/f_wipe.c @@ -103,7 +103,7 @@ static fixed_t paldiv = 0; static UINT8 curwipetype; static UINT8 curwipeframe; -static UINT8 wipecolorfill = 31; +UINT8 wipecolorfill = 31; /** Create fademask_t from lump * @@ -200,12 +200,6 @@ void F_WipeTitleCard(void) ST_drawLevelTitle(TICRATE); } -void F_WipeColorFill(UINT8 color) -{ - wipecolorfill = color; - V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, wipecolorfill); -} - /** Wipe ticker * * \param fademask pixels to change From 88fb22d688da8371e6eb03bb3358ded3570c1a6a Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Thu, 14 Nov 2019 22:14:40 -0300 Subject: [PATCH 012/189] Yeah, yeah... --- src/d_clisrv.c | 8 ++++++++ src/d_clisrv.h | 1 + src/p_inter.c | 4 ++++ src/p_user.c | 7 +++++++ 4 files changed, 20 insertions(+) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index a92619a34..446eef928 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -610,6 +610,11 @@ static inline void resynch_write_player(resynch_pak *rsp, const size_t i) rsp->health = LONG(players[i].mo->health); rsp->angle = (angle_t)LONG(players[i].mo->angle); +#ifdef ROTSPRITE + rsp->rollangle = (angle_t)LONG(players[i].mo->rollangle); +#else + rsp->rollangle = 0; +#endif rsp->x = LONG(players[i].mo->x); rsp->y = LONG(players[i].mo->y); rsp->z = LONG(players[i].mo->z); @@ -760,6 +765,9 @@ static void resynch_read_player(resynch_pak *rsp) //At this point, the player should have a body, whether they were respawned or not. P_UnsetThingPosition(players[i].mo); players[i].mo->angle = (angle_t)LONG(rsp->angle); +#ifdef ROTSPRITE + players[i].mo->rollangle = (angle_t)LONG(rsp->rollangle); +#endif players[i].mo->eflags = (UINT16)SHORT(rsp->eflags); players[i].mo->flags = LONG(rsp->flags); players[i].mo->flags2 = LONG(rsp->flags2); diff --git a/src/d_clisrv.h b/src/d_clisrv.h index d7c210895..5f09d0262 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -255,6 +255,7 @@ typedef struct INT32 health; angle_t angle; + angle_t rollangle; fixed_t x; fixed_t y; fixed_t z; diff --git a/src/p_inter.c b/src/p_inter.c index b0a401b10..0c707f837 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -3002,6 +3002,10 @@ static inline void P_NiGHTSDamage(mobj_t *target, mobj_t *source) P_SetPlayerMobjState(target, S_PLAY_NIGHTS_STUN); S_StartSound(target, sfx_nghurt); +#ifdef ROTSPRITE + player->mo->rollangle = 0; +#endif + if (oldnightstime > 10*TICRATE && player->nightstime < 10*TICRATE) { diff --git a/src/p_user.c b/src/p_user.c index 3c481e7e2..760f9a42d 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -636,6 +636,10 @@ static void P_DeNightserizePlayer(player_t *player) player->marebonuslap = 0; player->flyangle = 0; player->anotherflyangle = 0; +#ifdef ROTSPRITE + player->mo->rollangle = 0; +#endif + P_SetTarget(&player->mo->target, NULL); P_SetTarget(&player->axis1, P_SetTarget(&player->axis2, NULL)); @@ -762,6 +766,9 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime) player->secondjump = 0; player->flyangle = 0; player->anotherflyangle = 0; +#ifdef ROTSPRITE + player->mo->rollangle = 0; +#endif player->powers[pw_shield] = SH_NONE; player->powers[pw_super] = 0; From 66001cc73c66f027ff4db8d6a12851c400559a4a Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 15 Nov 2019 12:47:21 +0000 Subject: [PATCH 013/189] Resolve #288. * Fix off-by-one error I caused in the skin randomisation selection. * Clean up signcolour set to never go outside of valid entry range. * Fix the preventing-console-spam mechanism for invalid sprites viewed in-game by only setting the state's sprite/frame to S_UNKNOWN's if the object's sprite/frame is currenly equal to the state's. --- src/p_enemy.c | 59 ++++++++++++++++++++------------------------------ src/r_things.c | 24 ++++++++++---------- 2 files changed, 35 insertions(+), 48 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index eedbecaa7..374160d41 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -5121,7 +5121,7 @@ void A_SignPlayer(mobj_t *actor) return; #endif - if (actor->tracer == NULL || locvar1 < -3 || locvar1 >= numskins) + if (actor->tracer == NULL || locvar1 < -3 || locvar1 >= numskins || signcolor >= MAXTRANSLATIONS) return; // if no face overlay, spawn one @@ -5148,26 +5148,9 @@ void A_SignPlayer(mobj_t *actor) if (signcolor) ; else if ((actor->target->player->skincolor == skin->prefcolor) && (skin->prefoppositecolor)) // Set it as the skin's preferred oppositecolor? - { signcolor = skin->prefoppositecolor; - /* - If you're here from the comment above Color_Opposite, - the following line is the one which is dependent on the - array being symmetrical. It gets the opposite of the - opposite of your desired colour just so it can get the - brightness frame for the End Sign. It's not a great - design choice, but it's constant time array access and - the idea that the colours should be OPPOSITES is kind - of in the name. If you have a better idea, feel free - to let me know. ~toast 2016/07/20 - */ - signframe += (15 - Color_Opposite[Color_Opposite[skin->prefoppositecolor - 1][0] - 1][1]); - } else if (actor->target->player->skincolor) // Set the sign to be an appropriate background color for this player's skincolor. - { signcolor = Color_Opposite[actor->target->player->skincolor - 1][0]; - signframe += (15 - Color_Opposite[actor->target->player->skincolor - 1][1]); - } else signcolor = SKINCOLOR_NONE; } @@ -5188,10 +5171,10 @@ void A_SignPlayer(mobj_t *actor) skinnum = P_RandomKey(skincount); for (skincount = 0; skincount < numskins; skincount++) { - if (skincheck(skincount)) - skinnum++; if (skincount > skinnum) break; + if (skincheck(skincount)) + skinnum++; } } else // otherwise, advance 1 skin @@ -5203,42 +5186,46 @@ void A_SignPlayer(mobj_t *actor) skin = &skins[skinnum]; } else // specific skin - { skin = &skins[locvar1]; - } facecolor = skin->prefcolor; if (signcolor) ; else if (skin->prefoppositecolor) - { signcolor = skin->prefoppositecolor; - } - else - { + else if (facecolor) signcolor = Color_Opposite[facecolor - 1][0]; - } - signframe += (15 - Color_Opposite[Color_Opposite[signcolor - 1][0] - 1][1]); } - if (skin != NULL && skin->sprites[SPR2_SIGN].numframes) // player face + if (skin && skin->sprites[SPR2_SIGN].numframes) // player face { ov->color = facecolor; ov->skin = skin; P_SetMobjState(ov, actor->info->seestate); // S_PLAY_SIGN - actor->tracer->color = signcolor; - actor->tracer->frame = signframe; } else // Eggman face { ov->color = SKINCOLOR_NONE; P_SetMobjState(ov, actor->info->meleestate); // S_EGGMANSIGN - if (signcolor) - actor->tracer->color = signcolor; - else - actor->tracer->color = signcolor = SKINCOLOR_CARBON; - actor->tracer->frame = signframe += (15 - Color_Opposite[Color_Opposite[signcolor - 1][0] - 1][1]); + if (!signcolor) + signcolor = SKINCOLOR_CARBON; } + + actor->tracer->color = signcolor; + /* + If you're here from the comment above Color_Opposite, + the following line is the one which is dependent on the + array being symmetrical. It gets the opposite of the + opposite of your desired colour just so it can get the + brightness frame for the End Sign. It's not a great + design choice, but it's constant time array access and + the idea that the colours should be OPPOSITES is kind + of in the name. If you have a better idea, feel free + to let me know. ~toast 2016/07/20 + */ + if (signcolor && signcolor < MAXSKINCOLORS) + signframe += (15 - Color_Opposite[Color_Opposite[signcolor - 1][0] - 1][1]); + actor->tracer->frame = signframe; } // Function: A_OverlayThink diff --git a/src/r_things.c b/src/r_things.c index ae3c47db4..c89d87bf4 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1196,20 +1196,20 @@ static void R_ProjectSprite(mobj_t *thing) #ifdef ROTSPRITE sprinfo = NULL; #endif - } - if (rot >= sprdef->numframes) - { - CONS_Alert(CONS_ERROR, M_GetText("R_ProjectSprite: invalid sprite frame %s/%s for %s\n"), - sizeu1(rot), sizeu2(sprdef->numframes), sprnames[thing->sprite]); - thing->sprite = states[S_UNKNOWN].sprite; - thing->frame = states[S_UNKNOWN].frame; - sprdef = &sprites[thing->sprite]; - rot = thing->frame&FF_FRAMEMASK; - if (!thing->skin) + if (rot >= sprdef->numframes) { - thing->state->sprite = thing->sprite; - thing->state->frame = thing->frame; + CONS_Alert(CONS_ERROR, M_GetText("R_ProjectSprite: invalid sprite frame %s/%s for %s\n"), + sizeu1(rot), sizeu2(sprdef->numframes), sprnames[thing->sprite]); + if (thing->sprite == thing->state->sprite && thing->frame == thing->state->frame) + { + thing->state->sprite = states[S_UNKNOWN].sprite; + thing->state->frame = states[S_UNKNOWN].frame; + } + thing->sprite = states[S_UNKNOWN].sprite; + thing->frame = states[S_UNKNOWN].frame; + sprdef = &sprites[thing->sprite]; + rot = thing->frame&FF_FRAMEMASK; } } From d91d07da5b28332f46a9e7478722a892b7b8a174 Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 15 Nov 2019 13:10:41 +0000 Subject: [PATCH 014/189] Fix Metal Sonic not correctly flipping with gravity. (Doesn't require a new Metal recording.) --- src/g_game.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/g_game.c b/src/g_game.c index 63caaa15c..d1a9909e3 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -5194,7 +5194,10 @@ void G_ReadMetalTic(mobj_t *metal) { // But wait, there's more! xziptic = READUINT8(metal_p); if (xziptic & EZT_FLIP) + { metal->eflags ^= MFE_VERTICALFLIP; + metal->flags2 ^= MF2_OBJECTFLIP; + } if (xziptic & EZT_SCALE) { metal->destscale = READFIXED(metal_p); From ff62a0732a7f8d9f61b885dd3a3771507ca7d0d8 Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Fri, 15 Nov 2019 15:35:28 +0100 Subject: [PATCH 015/189] Let players move after completing the level This only takes effect in co-op, and can be disabled with "exitmove off" --- src/d_netcmd.c | 16 ++++++++++++++++ src/d_netcmd.h | 2 +- src/d_player.h | 1 + src/dehacked.c | 1 + src/g_game.c | 25 +++++++++++++++++++++++++ src/g_game.h | 1 + src/lua_baselib.c | 20 ++++++++++++++++++++ src/p_local.h | 1 + src/p_spec.c | 2 +- src/p_user.c | 35 ++++++++++++++++++++++++++++++++--- 10 files changed, 99 insertions(+), 5 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index b14f92b33..a5191331a 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -87,6 +87,7 @@ static void JoinTimeout_OnChange(void); static void CoopStarposts_OnChange(void); static void CoopLives_OnChange(void); +static void ExitMove_OnChange(void); static void Ringslinger_OnChange(void); static void Gravity_OnChange(void); @@ -355,9 +356,12 @@ consvar_t cv_cooplives = {"cooplives", "Avoid Game Over", CV_NETVAR|CV_CALL|CV_C static CV_PossibleValue_t advancemap_cons_t[] = {{0, "Off"}, {1, "Next"}, {2, "Random"}, {0, NULL}}; consvar_t cv_advancemap = {"advancemap", "Next", CV_NETVAR, advancemap_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; + static CV_PossibleValue_t playersforexit_cons_t[] = {{0, "One"}, {1, "1/4"}, {2, "Half"}, {3, "3/4"}, {4, "All"}, {0, NULL}}; consvar_t cv_playersforexit = {"playersforexit", "All", CV_NETVAR, playersforexit_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_exitmove = {"exitmove", "On", CV_NETVAR|CV_CALL, CV_OnOff, ExitMove_OnChange, 0, NULL, NULL, 0, 0, NULL}; + consvar_t cv_runscripts = {"runscripts", "Yes", 0, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_pause = {"pausepermission", "Server", CV_NETVAR, pause_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; @@ -511,6 +515,7 @@ void D_RegisterServerCommands(void) CV_RegisterVar(&cv_inttime); CV_RegisterVar(&cv_advancemap); CV_RegisterVar(&cv_playersforexit); + CV_RegisterVar(&cv_exitmove); CV_RegisterVar(&cv_timelimit); CV_RegisterVar(&cv_playbackspeed); CV_RegisterVar(&cv_forceskin); @@ -3634,6 +3639,17 @@ static void CoopLives_OnChange(void) } } +static void ExitMove_OnChange(void) +{ + if (!(netgame || multiplayer) || gametype != GT_COOP) + return; + + if (cv_exitmove.value) + CONS_Printf(M_GetText("Players can now move after completing the level.\n")); + else + CONS_Printf(M_GetText("Players can no longer move after completing the level.\n")); +} + UINT32 timelimitintics = 0; /** Deals with a timelimit change by printing the change to the console. diff --git a/src/d_netcmd.h b/src/d_netcmd.h index e789e5b50..d3d73602c 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -96,7 +96,7 @@ extern consvar_t cv_recycler; extern consvar_t cv_itemfinder; -extern consvar_t cv_inttime, cv_coopstarposts, cv_cooplives, cv_advancemap, cv_playersforexit; +extern consvar_t cv_inttime, cv_coopstarposts, cv_cooplives, cv_advancemap, cv_playersforexit, cv_exitmove; extern consvar_t cv_overtime; extern consvar_t cv_startinglives; diff --git a/src/d_player.h b/src/d_player.h index f2fdda050..3ec46c352 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -150,6 +150,7 @@ typedef enum /*** misc ***/ PF_FORCESTRAFE = 1<<28, // Turning inputs are translated into strafing inputs PF_CANCARRY = 1<<29, // Can carry another player? + PF_FINISHED = 1<<30, // The player finished the level. NOT the same as exiting // up to 1<<31 is free } pflags_t; diff --git a/src/dehacked.c b/src/dehacked.c index 34ee1f170..39e3dafe8 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -8298,6 +8298,7 @@ static const char *const PLAYERFLAG_LIST[] = { /*** misc ***/ "FORCESTRAFE", // Translate turn inputs into strafe inputs "CANCARRY", // Can carry? + "FINISHED", NULL // stop loop here. }; diff --git a/src/g_game.c b/src/g_game.c index e2f43e4f2..9efebcd68 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2831,6 +2831,31 @@ void G_AddPlayer(INT32 playernum) P_DoPlayerExit(p); } +boolean G_EnoughPlayersFinished(void) +{ + UINT8 numneeded = (G_IsSpecialStage(gamemap) ? 4 : cv_playersforexit.value); + INT32 total = 0; + INT32 exiting = 0; + INT32 i; + + for (i = 0; i < MAXPLAYERS; i++) + { + if (!playeringame[i] || players[i].spectator || players[i].bot) + continue; + if (players[i].lives <= 0) + continue; + + total++; + if (players[i].pflags & PF_FINISHED) + exiting++; + } + + if (exiting) + return exiting * 4 / total >= numneeded; + else + return false; +} + void G_ExitLevel(void) { if (gamestate == GS_LEVEL) diff --git a/src/g_game.h b/src/g_game.h index 198cbc396..f96d83c33 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -186,6 +186,7 @@ boolean G_GametypeHasSpectators(void); boolean G_RingSlingerGametype(void); boolean G_PlatformGametype(void); boolean G_TagGametype(void); +boolean G_EnoughPlayersFinished(void); void G_ExitLevel(void); void G_NextLevel(void); void G_Continue(void); diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 8f173e32e..45021b5ad 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -1160,6 +1160,17 @@ static int lib_pElementalFire(lua_State *L) return 0; } +static int lib_pDoPlayerFinish(lua_State *L) +{ + player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); + NOHUD + INLEVEL + if (!player) + return LUA_ErrInvalid(L, "player_t"); + P_DoPlayerFinish(player); + return 0; +} + static int lib_pDoPlayerExit(lua_State *L) { player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); @@ -2632,6 +2643,13 @@ static int lib_gSetCustomExitVars(lua_State *L) return 0; } +static int lib_gEnoughPlayersFinished(lua_State *L) +{ + INLEVEL + lua_pushboolean(L, G_EnoughPlayersFinished()); + return 1; +} + static int lib_gExitLevel(lua_State *L) { int n = lua_gettop(L); // Num arguments @@ -2827,6 +2845,7 @@ static luaL_Reg lib[] = { {"P_DoBubbleBounce",lib_pDoBubbleBounce}, {"P_BlackOw",lib_pBlackOw}, {"P_ElementalFire",lib_pElementalFire}, + {"P_DoPlayerFinish",lib_pDoPlayerFinish}, {"P_DoPlayerExit",lib_pDoPlayerExit}, {"P_InstaThrust",lib_pInstaThrust}, {"P_ReturnThrustX",lib_pReturnThrustX}, @@ -2938,6 +2957,7 @@ static luaL_Reg lib[] = { {"G_BuildMapName",lib_gBuildMapName}, {"G_DoReborn",lib_gDoReborn}, {"G_SetCustomExitVars",lib_gSetCustomExitVars}, + {"G_EnoughPlayersFinished",lib_gEnoughPlayersFinished}, {"G_ExitLevel",lib_gExitLevel}, {"G_IsSpecialStage",lib_gIsSpecialStage}, {"G_GametypeUsesLives",lib_gGametypeUsesLives}, diff --git a/src/p_local.h b/src/p_local.h index 02f497850..fd41d2bfa 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -172,6 +172,7 @@ void P_ElementalFire(player_t *player, boolean cropcircle); void P_DoPityCheck(player_t *player); void P_PlayerThink(player_t *player); void P_PlayerAfterThink(player_t *player); +void P_DoPlayerFinish(player_t *player); void P_DoPlayerExit(player_t *player); void P_NightserizePlayer(player_t *player, INT32 ptime); diff --git a/src/p_spec.c b/src/p_spec.c index 7b23ecbe7..5e22696b3 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -4645,7 +4645,7 @@ DoneSection2: { INT32 lineindex; - P_DoPlayerExit(player); + P_DoPlayerFinish(player); P_SetupSignExit(player); // important: use sector->tag on next line instead of player->mo->subsector->tag diff --git a/src/p_user.c b/src/p_user.c index 561183cd5..12d91204e 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2124,6 +2124,30 @@ void P_SpawnSpinMobj(player_t *player, mobjtype_t type) P_SetTarget(&mobj->target, player->mo); // the one thing P_SpawnGhostMobj doesn't do } +/** Called when \p player finishes the level. + * + * Only use for cases where the player should be able to move + * while waiting for others to finish. Otherwise, use P_DoPlayerExit(). + * + * In single player or if ::cv_exitmove is disabled, this will also cause + * P_PlayerThink() to call P_DoPlayerExit(), so you do not need to + * make a special cases for those. + * + * \param player The player who finished the level. + * \sa P_DoPlayerExit + * + */ +void P_DoPlayerFinish(player_t *player) +{ + if (player->pflags & PF_FINISHED) + return; + + player->pflags |= PF_FINISHED; + + if (netgame) + CONS_Printf(M_GetText("%s has completed the level.\n"), player_names[player-players]); +} + // // P_DoPlayerExit // @@ -2161,9 +2185,6 @@ void P_DoPlayerExit(player_t *player) player->powers[pw_underwater] = 0; player->powers[pw_spacetime] = 0; P_RestoreMusic(player); - - if (playeringame[player-players] && netgame && !circuitmap) - CONS_Printf(M_GetText("%s has completed the level.\n"), player_names[player-players]); } #define SPACESPECIAL 12 @@ -11285,6 +11306,14 @@ void P_PlayerThink(player_t *player) } } + if (player->pflags & PF_FINISHED) + { + if (cv_exitmove.value && !G_EnoughPlayersFinished()) + player->exiting = 0; + else + P_DoPlayerExit(player); + } + // check water content, set stuff in mobj P_MobjCheckWater(player->mo); From 892f6eca27775d11a44ada4cf0ce013aba890674 Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 15 Nov 2019 14:52:34 +0000 Subject: [PATCH 016/189] Make ACZ3's slapstick signpost taller (resolves #267). --- src/dehacked.c | 1 + src/info.c | 7 ++++--- src/info.h | 1 + src/p_enemy.c | 15 ++++++++++++--- src/p_map.c | 25 +++++++++++++------------ 5 files changed, 31 insertions(+), 18 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index fff9dbee8..ead4ce1be 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -5343,6 +5343,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_FSGNA", "S_FSGNB", "S_FSGNC", + "S_FSGND", // Black Eggman (Boss 7) "S_BLACKEGG_STND", diff --git a/src/info.c b/src/info.c index ed29fe2bf..daa9ae61b 100644 --- a/src/info.c +++ b/src/info.c @@ -1487,6 +1487,7 @@ state_t states[NUMSTATES] = {SPR_FSGN, 0|FF_PAPERSPRITE, -1, {NULL}, 0, 0, S_NULL}, // S_FSGNA {SPR_FSGN, 1|FF_PAPERSPRITE, -1, {NULL}, 0, 0, S_NULL}, // S_FSGNB {SPR_FSGN, 2|FF_PAPERSPRITE, -1, {NULL}, 0, 0, S_NULL}, // S_FSGNC + {SPR_FSGN, 3|FF_PAPERSPRITE, -1, {NULL}, 0, 0, S_NULL}, // S_FSGND // Black Eggman (Boss 7) {SPR_BRAK, 0, 1, {A_SetReactionTime}, 0, 0, S_BLACKEGG_STND2}, // S_BLACKEGG_STND @@ -6115,11 +6116,11 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL, // meleestate S_NULL, // missilestate S_FSGNC, // deathstate - S_NULL, // xdeathstate + S_FSGND, // xdeathstate sfx_None, // deathsound 0, // speed - 124*FRACUNIT, // radius - 640*FRACUNIT, // height + 74*FRACUNIT, // radius + 320*FRACUNIT, // height 0, // display offset 0, // mass 0, // damage diff --git a/src/info.h b/src/info.h index bbb6a21fc..5dac56529 100644 --- a/src/info.h +++ b/src/info.h @@ -1657,6 +1657,7 @@ typedef enum state S_FSGNA, S_FSGNB, S_FSGNC, + S_FSGND, // Black Eggman (Boss 7) S_BLACKEGG_STND, diff --git a/src/p_enemy.c b/src/p_enemy.c index eedbecaa7..03f9c6b42 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -4070,19 +4070,28 @@ bossjustdie: mobj_t *pole = P_SpawnMobj( mo->tracer->x - P_ReturnThrustX(mo->tracer, mo->tracer->angle, speed*time), mo->tracer->y - P_ReturnThrustY(mo->tracer, mo->tracer->angle, speed*time), - mo->tracer->floorz + 4*FRACUNIT, + mo->tracer->floorz + (256+1)*FRACUNIT, MT_FSGNB); P_SetTarget(&pole->tracer, P_SpawnMobj( + pole->x, pole->y, + pole->z - 256*FRACUNIT, + MT_FSGNB)); + P_SetTarget(&pole->tracer->tracer, P_SpawnMobj( pole->x + P_ReturnThrustX(pole, mo->tracer->angle, FRACUNIT), pole->y + P_ReturnThrustY(pole, mo->tracer->angle, FRACUNIT), pole->z + 256*FRACUNIT, MT_FSGNA)); - pole->angle = mo->tracer->angle; - pole->tracer->angle = pole->angle - ANGLE_90; + pole->tracer->flags |= MF_NOCLIPTHING; + P_SetScale(pole, (pole->destscale = 2*FRACUNIT)); + P_SetScale(pole->tracer, (pole->tracer->destscale = 2*FRACUNIT)); + pole->angle = pole->tracer->angle = mo->tracer->angle; + pole->tracer->tracer->angle = pole->angle - ANGLE_90; pole->momx = P_ReturnThrustX(pole, pole->angle, speed); pole->momy = P_ReturnThrustY(pole, pole->angle, speed); pole->tracer->momx = pole->momx; pole->tracer->momy = pole->momy; + pole->tracer->tracer->momx = pole->momx; + pole->tracer->tracer->momy = pole->momy; } } else diff --git a/src/p_map.c b/src/p_map.c index bb56a50b1..26aeca7d0 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -661,31 +661,32 @@ static void P_SlapStick(mobj_t *fang, mobj_t *pole) momx2 = fang->momx/dist; momy2 = fang->momy/dist; - pole->tracer->momx = momx1 + (dist-1)*momx2; - pole->tracer->momy = momy1 + (dist-1)*momy2; + pole->tracer->tracer->momx = momx1 + (dist-1)*momx2; + pole->tracer->tracer->momy = momy1 + (dist-1)*momy2; fang->momx = (dist-1)*momx1 + momx2; fang->momy = (dist-1)*momy1 + momy2; #undef dist - P_SetMobjState(pole, pole->info->deathstate); - - P_SetObjectMomZ(pole->tracer, 6*FRACUNIT, false); - pole->tracer->flags &= ~(MF_NOGRAVITY|MF_NOCLIP); - pole->tracer->movedir = ANGLE_67h; - if ((R_PointToAngle(fang->x - pole->tracer->x, fang->y - pole->tracer->y) - pole->angle) > ANGLE_180) - pole->tracer->movedir = InvAngle(pole->tracer->movedir); + P_SetObjectMomZ(pole->tracer->tracer, 6*FRACUNIT, false); + pole->tracer->tracer->flags &= ~(MF_NOGRAVITY|MF_NOCLIP); + pole->tracer->tracer->movedir = ANGLE_67h; + if ((R_PointToAngle(fang->x - pole->tracer->tracer->x, fang->y - pole->tracer->tracer->y) - pole->angle) > ANGLE_180) + pole->tracer->tracer->movedir = InvAngle(pole->tracer->movedir); P_SetObjectMomZ(fang, 14*FRACUNIT, false); fang->flags |= MF_NOGRAVITY|MF_NOCLIP; P_SetMobjState(fang, fang->info->xdeathstate); - pole->tracer->tics = pole->tics = fang->tics; + pole->tracer->tracer->tics = pole->tracer->tics = pole->tics = fang->tics; var1 = var2 = 0; - A_Scream(pole->tracer); + A_Scream(pole->tracer->tracer); S_StartSound(fang, sfx_altdi1); + P_SetTarget(&pole->tracer->tracer, NULL); + P_SetMobjState(pole->tracer, pole->info->xdeathstate); P_SetTarget(&pole->tracer, NULL); + P_SetMobjState(pole, pole->info->deathstate); } static void P_PlayerBarrelCollide(mobj_t *toucher, mobj_t *barrel) @@ -1089,7 +1090,7 @@ static boolean PIT_CheckThing(mobj_t *thing) return true; // overhead if (thing->z + thing->height < tmthing->z) return true; // underneath - if (!thing->tracer) + if (!thing->tracer || !thing->tracer->tracer) return true; P_SlapStick(tmthing, thing); // no return value was used in the original prototype script at this point, From 52bd4b05e1d4d74083e6c50331df07363e92e73d Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 15 Nov 2019 15:20:36 +0000 Subject: [PATCH 017/189] * Make the Egg Capsule only explode for one second, but have the number of explosions (and flickies) multiplied 1.5 times. * If the player is spindashing when the level is exited, they will un-spindash. (Currently you get stuck in charging) --- src/p_inter.c | 2 +- src/p_mobj.c | 6 +++--- src/p_user.c | 5 +++++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/p_inter.c b/src/p_inter.c index b0a401b10..4f1b5c5bb 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2741,7 +2741,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget case MT_EGGTRAP: // Time for birdies! Yaaaaaaaay! - target->fuse = TICRATE*2; + target->fuse = TICRATE; break; case MT_MINECART: diff --git a/src/p_mobj.c b/src/p_mobj.c index 5d6a8a10f..2fff12fa4 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8227,7 +8227,7 @@ void P_MobjThinker(mobj_t *mobj) mobj->flags2 ^= MF2_DONTDRAW; break; case MT_EGGTRAP: // Egg Capsule animal release - if (mobj->fuse > 0 && mobj->fuse < 2*TICRATE-(TICRATE/7)) + if (mobj->fuse > 0)// && mobj->fuse < TICRATE-(TICRATE/7)) { INT32 i; fixed_t x,y,z; @@ -8236,9 +8236,9 @@ void P_MobjThinker(mobj_t *mobj) mobj_t *flicky; z = mobj->subsector->sector->floorheight + FRACUNIT + (P_RandomKey(64)<x + FixedMul(FINESINE(fa),ns); y = mobj->y + FixedMul(FINECOSINE(fa),ns); diff --git a/src/p_user.c b/src/p_user.c index 3c481e7e2..f992ae679 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2158,6 +2158,11 @@ void P_DoPlayerExit(player_t *player) player->pflags |= P_GetJumpFlags(player); P_SetPlayerMobjState(player->mo, S_PLAY_JUMP); } + else if (player->pflags & PF_STARTDASH) + { + player->pflags &= ~PF_STARTDASH; + P_SetPlayerMobjState(player->mo, S_PLAY_STND); + } player->powers[pw_underwater] = 0; player->powers[pw_spacetime] = 0; P_RestoreMusic(player); From efa609d3665a4c9e70ebc52e7fa1a68a3c13a155 Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 15 Nov 2019 15:58:25 +0000 Subject: [PATCH 018/189] Ending music and associated. * Play the good or bad ending track, instead of perfect silence. * Fade out the credits music over 5 seconds when the credits go to the evaluation (timed to have finished just before the "you unlocked this!" jingle). --- src/f_finale.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/f_finale.c b/src/f_finale.c index 108385adb..d925f4689 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -1385,6 +1385,8 @@ boolean F_CreditResponder(event_t *event) void F_StartGameEvaluation(void) { + S_FadeOutStopMusic(5*MUSICRATE); + // Credits option in secrets menu if (cursaveslot == -1) { @@ -1638,7 +1640,7 @@ void F_StartEnding(void) gameaction = ga_nothing; paused = false; CON_ToggleOff(); - S_StopMusic(); // todo: placeholder + S_StopMusic(); S_StopSounds(); finalecount = -10; // what? this totally isn't a hack. why are you asking? @@ -1719,6 +1721,9 @@ void F_EndingTicker(void) return; } + if (finalecount == -8) + S_ChangeMusicInternal((goodending ? "_endg" : "_endb"), false); + if (goodending && finalecount == INFLECTIONPOINT) // time to swap some assets { endegrk[0] = W_CachePatchName("ENDEGRK2", PU_LEVEL); From 98712ad703539ea064accb6170f40df354637963 Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 15 Nov 2019 16:39:22 +0000 Subject: [PATCH 019/189] Resolve #291. --- src/p_user.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 3c481e7e2..266ee4734 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -7701,9 +7701,9 @@ void P_ElementalFire(player_t *player, boolean cropcircle) I_Assert(!P_MobjWasRemoved(player->mo)); if (player->mo->eflags & MFE_VERTICALFLIP) - ground = player->mo->ceilingz - FixedMul(mobjinfo[MT_SPINFIRE].height, player->mo->scale); + ground = player->mo->ceilingz - FixedMul(mobjinfo[MT_SPINFIRE].height - 1, player->mo->scale); else - ground = player->mo->floorz; + ground = player->mo->floorz + 1; if (cropcircle) { From c15ee6501589112105e4875bb05b1adb292648b3 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Fri, 15 Nov 2019 18:21:12 -0300 Subject: [PATCH 020/189] LEVELWIPES --- src/d_main.c | 6 ++++-- src/doomdef.h | 3 +++ src/f_finale.h | 2 +- src/f_wipe.c | 20 ++++++++++++++------ src/hardware/hw_main.c | 2 ++ src/m_menu.c | 2 +- src/p_setup.c | 2 +- 7 files changed, 26 insertions(+), 11 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index 47ecb5fbf..011e38e2a 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -417,9 +417,11 @@ static void D_Display(void) if (gamestate != GS_TIMEATTACK) CON_Drawer(); - // Running a wipe, but it doesn't freeze the game - if (WipeInAction && (!WipeFreezeGame)) +#ifdef LEVELWIPES + // Running a level wipe + if (WipeInAction && WipeInLevel) F_WipeTicker(); +#endif M_Drawer(); // menu is drawn even on top of everything // focus lost moved to M_Drawer diff --git a/src/doomdef.h b/src/doomdef.h index 511dad858..8cf9e5d09 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -628,6 +628,9 @@ extern const char *compdate, *comptime, *comprevision, *compbranch; #define ROTANGLES 24 // Needs to be a divisor of 360 (45, 60, 90, 120...) #define ROTANGDIFF (360 / ROTANGLES) +/// Level wipes +//#define LEVELWIPES + #ifndef HAVE_PNG #define NO_PNG_LUMPS #endif diff --git a/src/f_finale.h b/src/f_finale.h index 6fd94d9c0..ba4afec42 100644 --- a/src/f_finale.h +++ b/src/f_finale.h @@ -141,7 +141,7 @@ void F_MenuPresTicker(boolean run); #define FORCEWIPEOFF -2 extern boolean WipeInAction; -extern boolean WipeFreezeGame; +extern boolean WipeInLevel; extern INT32 lastwipetic; typedef enum diff --git a/src/f_wipe.c b/src/f_wipe.c index b5b60403e..203d7c08d 100644 --- a/src/f_wipe.c +++ b/src/f_wipe.c @@ -89,7 +89,7 @@ UINT8 wipedefs[NUMWIPEDEFS] = { //-------------------------------------------------------------------------- boolean WipeInAction = false; -boolean WipeFreezeGame = true; +boolean WipeInLevel = false; INT32 lastwipetic = 0; wipestyle_t wipestyle = WIPESTYLE_NORMAL; @@ -273,7 +273,7 @@ static void F_DoWipe(fademask_t *fademask) relativepos = (draw_linestart * vid.width) + draw_rowstart; draw_linestogo = draw_lineend - draw_linestart; - if ((*mask == 0) && (wipestyle == WIPESTYLE_NORMAL)) + if (*mask == 0) { // shortcut - memcpy source to work while (draw_linestogo--) @@ -282,7 +282,7 @@ static void F_DoWipe(fademask_t *fademask) relativepos += vid.width; } } - else if ((*mask >= 10) && (wipestyle == WIPESTYLE_NORMAL)) + else if (*mask >= ((wipestyle == WIPESTYLE_LEVEL) ? FADECOLORMAPROWS : 10)) { // shortcut - memcpy target to work while (draw_linestogo--) @@ -412,8 +412,10 @@ void F_RunWipe(UINT8 wipetype, boolean drawMenu) curwipetype = wipetype; curwipeframe = 0; - if (!WipeFreezeGame) +#ifdef LEVELWIPES + if (WipeInLevel) return; +#endif // lastwipetic should either be 0 or the tic we last wiped // on for fade-to-black @@ -454,13 +456,17 @@ void F_RunWipe(UINT8 wipetype, boolean drawMenu) M_SaveFrame(); } WipeInAction = false; - WipeFreezeGame = true; + WipeInLevel = false; #endif } // Works On My Machine seal of approval void F_WipeTicker(void) { +#ifndef NOWIPE +#ifndef LEVELWIPES + WipeInAction = false; +#else fademask_t *fmask; // Wait, what? @@ -476,7 +482,7 @@ void F_WipeTicker(void) { // stop WipeInAction = false; - WipeFreezeGame = true; + WipeInLevel = false; return; } @@ -487,6 +493,8 @@ void F_WipeTicker(void) else #endif F_DoWipe(fmask); +#endif +#endif } /** Returns tic length of wipe diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index fb45ca4f7..4cb407621 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -7079,6 +7079,7 @@ void HWR_DoTintedWipe(UINT8 wipenum, UINT8 scrnnum) void HWR_DoLevelWipe(UINT8 wipenum, UINT8 scrnnum, UINT8 wipecolorfill) { +#ifdef LEVELWIPES if (!HWR_WipeCheck(wipenum, scrnnum)) return; @@ -7089,6 +7090,7 @@ void HWR_DoLevelWipe(UINT8 wipenum, UINT8 scrnnum, UINT8 wipecolorfill) HWD.pfnDoScreenWipeLevel(); F_WipeTitleCard(); +#endif } void HWR_MakeScreenFinalTexture(void) diff --git a/src/m_menu.c b/src/m_menu.c index 098f34b97..28799a9c3 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -3364,7 +3364,7 @@ boolean M_Responder(event_t *ev) void M_Drawer(void) { boolean wipe = WipeInAction; - if (!WipeFreezeGame) + if (WipeInLevel) wipe = false; if (currentMenu == &MessageDef) diff --git a/src/p_setup.c b/src/p_setup.c index 77fb3b511..60e507e86 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -3247,7 +3247,7 @@ boolean P_SetupLevel(boolean skipprecip) // Stage title! wipestyleflags |= WSF_FADEIN; wipestyleflags &= ~WSF_FADEOUT; - WipeFreezeGame = false; + WipeInLevel = true; if (rendermode != render_none && (!titlemapinaction) && ranspecialwipe != 2 From f55b0f52caaa92a0ebae40f8561e62d578b7840b Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Fri, 15 Nov 2019 18:53:32 -0300 Subject: [PATCH 021/189] Accidental missing (void) --- src/r_data.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/r_data.c b/src/r_data.c index 04c85b39f..574c4e194 100644 --- a/src/r_data.c +++ b/src/r_data.c @@ -1461,7 +1461,7 @@ static void R_InitSpriteLumps(void) // R_CreateFadeColormaps // -static void R_CreateFadeColormaps() +static void R_CreateFadeColormaps(void) { UINT8 px, fade; RGBA_t rgba; From 7ba76200593f39c398680158fc1f2f9a0a310258 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Fri, 15 Nov 2019 18:58:45 -0300 Subject: [PATCH 022/189] Shadowed declaration and unused parameters --- src/hardware/hw_main.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 4cb407621..45d1cdf27 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -7077,14 +7077,18 @@ void HWR_DoTintedWipe(UINT8 wipenum, UINT8 scrnnum) HWR_DoWipe(wipenum, scrnnum); } -void HWR_DoLevelWipe(UINT8 wipenum, UINT8 scrnnum, UINT8 wipecolorfill) +void HWR_DoLevelWipe(UINT8 wipenum, UINT8 scrnnum, UINT8 colfill) { -#ifdef LEVELWIPES +#ifndef LEVELWIPES + (void)wipenum; + (void)scrnnum; + (void)colfill; +#else if (!HWR_WipeCheck(wipenum, scrnnum)) return; HWR_EndScreenWipe(); - V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, wipecolorfill); + V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, colfill); HWR_StartScreenWipe(); HWR_GetFadeMask(wipelumpnum); From 41835e07ea82b9d3f0bcd8ca7319049b2d49a1e7 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Fri, 15 Nov 2019 19:04:40 -0300 Subject: [PATCH 023/189] I don't get it --- src/hardware/hw_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 45d1cdf27..0a12c9660 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -7029,10 +7029,10 @@ void HWR_DrawIntermissionBG(void) // // hwr mode wipes // -static char wipelumpname[9]; +static char wipelumpname[10]; static lumpnum_t wipelumpnum; -// puts wipe lumpname in wipename[9] +// puts wipe lumpname in wipename[10] static boolean HWR_WipeCheck(UINT8 wipenum, UINT8 scrnnum) { size_t lsize; From 5b0730839b6f443144676e591ffaa30842d87ae3 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Fri, 15 Nov 2019 19:09:02 -0300 Subject: [PATCH 024/189] Move scope of wipelumpname --- src/hardware/hw_main.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 0a12c9660..4cba4cfad 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -7029,24 +7029,21 @@ void HWR_DrawIntermissionBG(void) // // hwr mode wipes // -static char wipelumpname[10]; static lumpnum_t wipelumpnum; // puts wipe lumpname in wipename[10] static boolean HWR_WipeCheck(UINT8 wipenum, UINT8 scrnnum) { + static char lumpname[10] = "FADEmmss"; size_t lsize; - // write FADE prefix into wipelumpname - strncpy(wipelumpname, "FADEmmss", 8); - // not a valid wipe number if (wipenum > 99 || scrnnum > 99) return false; // shouldn't end up here really, the loop should've stopped running beforehand // puts the numbers into the wipename - sprintf(&wipelumpname[4], "%.2hu%.2hu", (UINT16)wipenum, (UINT16)scrnnum); - wipelumpnum = W_CheckNumForName(wipelumpname); + sprintf(&lumpname[4], "%.2hu%.2hu", (UINT16)wipenum, (UINT16)scrnnum); + wipelumpnum = W_CheckNumForName(lumpname); // again, shouldn't be here really if (wipelumpnum == LUMPERROR) @@ -7055,7 +7052,7 @@ static boolean HWR_WipeCheck(UINT8 wipenum, UINT8 scrnnum) lsize = W_LumpLength(wipelumpnum); if (!(lsize == 256000 || lsize == 64000 || lsize == 16000 || lsize == 4000)) { - CONS_Alert(CONS_WARNING, "Fade mask lump %s of incorrect size, ignored\n", wipelumpname); + CONS_Alert(CONS_WARNING, "Fade mask lump %s of incorrect size, ignored\n", lumpname); return false; // again, shouldn't get here if it is a bad size } From 55c42d9cb789cbdbcfce858fab2f9ca90780bca4 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Fri, 15 Nov 2019 19:36:25 -0300 Subject: [PATCH 025/189] Small mistake --- src/f_finale.h | 2 +- src/f_wipe.c | 32 ++++++++++++++++++++++++-------- src/hardware/hw_main.c | 2 +- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/src/f_finale.h b/src/f_finale.h index ba4afec42..d28ed0b01 100644 --- a/src/f_finale.h +++ b/src/f_finale.h @@ -172,7 +172,7 @@ void F_WipeStartScreen(void); void F_WipeEndScreen(void); void F_RunWipe(UINT8 wipetype, boolean drawMenu); void F_WipeTicker(void); -void F_WipeTitleCard(void); +void F_WipeStageTitle(void); #define F_WipeColorFill(c) V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, (wipecolorfill = c)) tic_t F_GetWipeLength(UINT8 wipetype); boolean F_WipeExists(UINT8 wipetype); diff --git a/src/f_wipe.c b/src/f_wipe.c index 203d7c08d..8e767932f 100644 --- a/src/f_wipe.c +++ b/src/f_wipe.c @@ -18,6 +18,7 @@ #include "r_draw.h" // transtable #include "p_pspr.h" // tr_transxxx +#include "p_local.h" #include "w_wad.h" #include "z_zone.h" @@ -25,6 +26,7 @@ #include "m_menu.h" #include "console.h" #include "d_main.h" +#include "g_game.h" #include "m_misc.h" // movie mode #include "doomstat.h" @@ -187,17 +189,27 @@ static fademask_t *F_GetFadeMask(UINT8 masknum, UINT8 scrnnum) { return NULL; } -void F_WipeTitleCard(void) +/** Draw the stage title. + */ +void F_WipeStageTitle(void) { if (wipestyle == WIPESTYLE_LEVEL - && (!titlemapinaction) - && (wipestyleflags & WSF_FADEIN) - && *mapheaderinfo[gamemap-1]->lvlttl != '\0' + && (!titlemapinaction) + && (wipestyleflags & WSF_FADEIN) + && *mapheaderinfo[gamemap-1]->lvlttl != '\0' #ifdef HAVE_BLUA - && LUA_HudEnabled(hud_stagetitle) + && LUA_HudEnabled(hud_stagetitle) #endif - ) + ) + { + stplyr = &players[consoleplayer]; ST_drawLevelTitle(TICRATE); + if (splitscreen) + { + stplyr = &players[secondarydisplayplayer]; + ST_drawLevelTitle(TICRATE); + } + } } /** Wipe ticker @@ -344,7 +356,8 @@ static void F_DoWipe(fademask_t *fademask) free(scrxpos); free(scrypos); } - F_WipeTitleCard(); + if (wipestyle == WIPESTYLE_LEVEL) + F_WipeStageTitle(); } #endif @@ -460,7 +473,8 @@ void F_RunWipe(UINT8 wipetype, boolean drawMenu) #endif } -// Works On My Machine seal of approval +/** Run and display the fade with the level. + */ void F_WipeTicker(void) { #ifndef NOWIPE @@ -524,6 +538,8 @@ tic_t F_GetWipeLength(UINT8 wipetype) #endif } +/** Does the specified wipe exist? + */ boolean F_WipeExists(UINT8 wipetype) { #ifdef NOWIPE diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 4cba4cfad..a6863f8d8 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -7090,7 +7090,7 @@ void HWR_DoLevelWipe(UINT8 wipenum, UINT8 scrnnum, UINT8 colfill) HWR_GetFadeMask(wipelumpnum); HWD.pfnDoScreenWipeLevel(); - F_WipeTitleCard(); + F_WipeStageTitle(); #endif } From 12e8c11382ab41593292417b333d0c060c258593 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Fri, 15 Nov 2019 19:40:58 -0300 Subject: [PATCH 026/189] Update hw_main.c --- src/hardware/hw_main.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index a6863f8d8..52bdbcf5a 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -7031,10 +7031,10 @@ void HWR_DrawIntermissionBG(void) // static lumpnum_t wipelumpnum; -// puts wipe lumpname in wipename[10] +// puts wipe lumpname in wipename[9] static boolean HWR_WipeCheck(UINT8 wipenum, UINT8 scrnnum) { - static char lumpname[10] = "FADEmmss"; + static char lumpname[9] = "FADEmmss"; size_t lsize; // not a valid wipe number @@ -7042,7 +7042,10 @@ static boolean HWR_WipeCheck(UINT8 wipenum, UINT8 scrnnum) return false; // shouldn't end up here really, the loop should've stopped running beforehand // puts the numbers into the wipename - sprintf(&lumpname[4], "%.2hu%.2hu", (UINT16)wipenum, (UINT16)scrnnum); + lumpname[4] = '0'+(wipenum/10); + lumpname[5] = '0'+(wipenum%10); + lumpname[6] = '0'+(scrnnum/10); + lumpname[7] = '0'+(scrnnum%10); wipelumpnum = W_CheckNumForName(lumpname); // again, shouldn't be here really From 5dc494da16d32782bbecf4f3e2f72c4a202385cc Mon Sep 17 00:00:00 2001 From: Nev3r Date: Sun, 17 Mar 2019 21:44:24 +0100 Subject: [PATCH 027/189] Mapname lowercase support (#146) * Moved levelname parsing to before where uppercase conversion occurs. * Extended titlecard font range. * Replaced misc. "ZONE" strings with "Zone" for titlecard purposes. * Don't convert to uppercase when rendering the titlecard name. Signed-off-by: Nev3r --- src/dehacked.c | 14 ++++++++------ src/g_game.c | 2 +- src/hu_stuff.h | 2 +- src/st_stuff.c | 6 +++--- src/v_video.c | 6 +++--- 5 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index fff9dbee8..371ac06bf 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -1201,6 +1201,14 @@ static void readlevelheader(MYFILE *f, INT32 num) word2 = tmp += 2; i = atoi(word2); // used for numerical settings + + if (fastcmp(word, "LEVELNAME")) + { + deh_strlcpy(mapheaderinfo[num-1]->lvlttl, word2, + sizeof(mapheaderinfo[num-1]->lvlttl), va("Level header %d: levelname", num)); + strlcpy(mapheaderinfo[num-1]->selectheading, word2, sizeof(mapheaderinfo[num-1]->selectheading)); // not deh_ so only complains once + continue; + } // CHEAP HACK: move this over here for lowercase subtitles if (fastcmp(word, "SUBTITLE")) { @@ -1344,12 +1352,6 @@ static void readlevelheader(MYFILE *f, INT32 num) } // Strings that can be truncated - else if (fastcmp(word, "LEVELNAME")) - { - deh_strlcpy(mapheaderinfo[num-1]->lvlttl, word2, - sizeof(mapheaderinfo[num-1]->lvlttl), va("Level header %d: levelname", num)); - strlcpy(mapheaderinfo[num-1]->selectheading, word2, sizeof(mapheaderinfo[num-1]->selectheading)); // not deh_ so only complains once - } else if (fastcmp(word, "SELECTHEADING")) { deh_strlcpy(mapheaderinfo[num-1]->selectheading, word2, diff --git a/src/g_game.c b/src/g_game.c index 63caaa15c..dd630ab66 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -4031,7 +4031,7 @@ char *G_BuildMapTitle(INT32 mapnum) len += strlen(mapheaderinfo[mapnum-1]->lvlttl); if (!(mapheaderinfo[mapnum-1]->levelflags & LF_NOZONE)) { - zonetext = M_GetText("ZONE"); + zonetext = M_GetText("Zone"); len += strlen(zonetext) + 1; // ' ' + zonetext } if (actnum > 0) diff --git a/src/hu_stuff.h b/src/hu_stuff.h index 55b61d4b7..9936232ff 100644 --- a/src/hu_stuff.h +++ b/src/hu_stuff.h @@ -28,7 +28,7 @@ // Level title font #define LT_FONTSTART '!' // the first font characters -#define LT_FONTEND 'Z' // the last font characters +#define LT_FONTEND 'z' // the last font characters #define LT_FONTSIZE (LT_FONTEND - LT_FONTSTART + 1) #define CRED_FONTSTART '!' // the first font character diff --git a/src/st_stuff.c b/src/st_stuff.c index 3fbee27e4..475886097 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -1177,7 +1177,7 @@ void ST_drawLevelTitle(tic_t titletime) lvlttlxpos -= V_LevelActNumWidth(actnum); ttlnumxpos = lvlttlxpos + V_LevelNameWidth(lvlttl); - zonexpos = ttlnumxpos - V_LevelNameWidth(M_GetText("ZONE")); + zonexpos = ttlnumxpos - V_LevelNameWidth(M_GetText("Zone")); ttlnumxpos++; if (lvlttlxpos < 0) @@ -1204,7 +1204,7 @@ void ST_drawLevelTitle(tic_t titletime) else { fixed_t z = ((titletime - 105)<levelflags & LF_NOZONE)) - V_DrawLevelTitle(zonexpos, zoney, V_PERPLAYER, M_GetText("ZONE")); + V_DrawLevelTitle(zonexpos, zoney, V_PERPLAYER, M_GetText("Zone")); if (lvlttly+48 < 200) V_DrawCenteredString(subttlxpos, lvlttly+48, V_PERPLAYER|V_ALLOWLOWERCASE, subttl); diff --git a/src/v_video.c b/src/v_video.c index 44e80c9f5..de03fdfc4 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -2899,7 +2899,7 @@ void V_DrawLevelTitle(INT32 x, INT32 y, INT32 option, const char *string) continue; } - c = toupper(*ch) - LT_FONTSTART; + c = *ch - LT_FONTSTART; if (c < 0 || c >= LT_FONTSIZE || !lt_font[c]) { cx += 16*dupx; @@ -2934,7 +2934,7 @@ INT32 V_LevelNameWidth(const char *string) { if (string[i] & 0x80) continue; - c = toupper(string[i]) - LT_FONTSTART; + c = string[i] - LT_FONTSTART; if (c < 0 || c >= LT_FONTSIZE || !lt_font[c]) w += 16; else @@ -2953,7 +2953,7 @@ INT32 V_LevelNameHeight(const char *string) for (i = 0; i < strlen(string); i++) { - c = toupper(string[i]) - LT_FONTSTART; + c = string[i] - LT_FONTSTART; if (c < 0 || c >= LT_FONTSIZE || !lt_font[c]) continue; From fdd681ab720fa894e5bee475bb654c17fa5fb2dc Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 17 Nov 2019 14:14:38 +0000 Subject: [PATCH 028/189] Since I had to tweak this branch to do the scrapped changing-to-title-music-at-a-different-time thing (since it was too late, and too late is WAY worse than too early): Have the credits music fade out over a shorter time when going to the title screen (vs going to evaluation), as opposed to stopping entirely. --- src/f_finale.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/f_finale.c b/src/f_finale.c index d925f4689..547a9e240 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -1385,15 +1385,16 @@ boolean F_CreditResponder(event_t *event) void F_StartGameEvaluation(void) { - S_FadeOutStopMusic(5*MUSICRATE); - // Credits option in secrets menu if (cursaveslot == -1) { + S_FadeOutStopMusic(2*MUSICRATE); F_StartGameEnd(); return; } + S_FadeOutStopMusic(5*MUSICRATE); + G_SetGamestate(GS_EVALUATION); // Just in case they're open ... somehow @@ -2153,7 +2154,6 @@ void F_StartGameEnd(void) gameaction = ga_nothing; paused = false; CON_ToggleOff(); - S_StopMusic(); S_StopSounds(); // In case menus are still up?!! From 76897b560f766a04107a7aeec483973886d5620c Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 17 Nov 2019 14:56:05 +0000 Subject: [PATCH 029/189] Update end tally and sound test to accomodate new title font. --- src/m_menu.c | 4 ++-- src/y_inter.c | 28 ++++++++++++++-------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 47ca7ccd4..f2f478155 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -7175,7 +7175,7 @@ static void M_DrawSoundTest(void) titl = va("%s - ", curplaying->title); } else - titl = "NONE - "; + titl = "None - "; i = V_LevelNameWidth(titl); @@ -7189,7 +7189,7 @@ static void M_DrawSoundTest(void) while (x > y) { x -= i; - V_DrawLevelTitle(x, 24, 0, titl); + V_DrawLevelTitle(x, 22, 0, titl); } if (curplaying) diff --git a/src/y_inter.c b/src/y_inter.c index 21e4bc56e..a4b39c55b 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -399,10 +399,10 @@ void Y_IntermissionDrawer(void) // draw the "got through act" lines and act number V_DrawLevelTitle(data.coop.passedx1, 49, 0, data.coop.passed1); - V_DrawLevelTitle(data.coop.passedx2, 49+V_LevelNameHeight(data.coop.passed2)+2, 0, data.coop.passed2); + V_DrawLevelTitle(data.coop.passedx2, 49+V_LevelNameHeight(data.coop.passed1)+2, 0, data.coop.passed2); if (data.coop.actnum) - V_DrawLevelActNum(244, 57, 0, data.coop.actnum); + V_DrawLevelActNum(244, 58, 0, data.coop.actnum); bonusy = 150; // Total @@ -1384,21 +1384,21 @@ void Y_StartIntermission(void) // too long so just show "YOU GOT THROUGH THE ACT" if (strlen(skins[players[consoleplayer].skin].realname) > 13) { - strcpy(data.coop.passed1, "YOU GOT"); - strcpy(data.coop.passed2, (mapheaderinfo[gamemap-1]->actnum) ? "THROUGH ACT" : "THROUGH THE ACT"); + strcpy(data.coop.passed1, "you got"); + strcpy(data.coop.passed2, (mapheaderinfo[gamemap-1]->actnum) ? "through act" : "through the act"); } // long enough that "X GOT" won't fit so use "X PASSED THE ACT" else if (strlen(skins[players[consoleplayer].skin].realname) > 8) { strcpy(data.coop.passed1, skins[players[consoleplayer].skin].realname); - strcpy(data.coop.passed2, (mapheaderinfo[gamemap-1]->actnum) ? "PASSED ACT" : "PASSED THE ACT"); + strcpy(data.coop.passed2, (mapheaderinfo[gamemap-1]->actnum) ? "passed act" : "passed the act"); } // length is okay for normal use else { - snprintf(data.coop.passed1, sizeof data.coop.passed1, "%s GOT", + snprintf(data.coop.passed1, sizeof data.coop.passed1, "%s got", skins[players[consoleplayer].skin].realname); - strcpy(data.coop.passed2, (mapheaderinfo[gamemap-1]->actnum) ? "THROUGH ACT" : "THROUGH THE ACT"); + strcpy(data.coop.passed2, (mapheaderinfo[gamemap-1]->actnum) ? "through act" : "through the act"); } // set X positions @@ -1498,7 +1498,7 @@ void Y_StartIntermission(void) // set up the "got through act" message according to skin name if (stagefailed) { - strcpy(data.spec.passed2, "SPECIAL STAGE"); + strcpy(data.spec.passed2, "Special Stage"); data.spec.passed1[0] = '\0'; } else if (ALL7EMERALDS(emeralds)) @@ -1507,13 +1507,13 @@ void Y_StartIntermission(void) sizeof data.spec.passed1, "%s", skins[players[consoleplayer].skin].realname); data.spec.passed1[sizeof data.spec.passed1 - 1] = '\0'; - strcpy(data.spec.passed2, "GOT THEM ALL!"); + strcpy(data.spec.passed2, "got them all!"); if (players[consoleplayer].charflags & SF_SUPER) { - strcpy(data.spec.passed3, "CAN NOW BECOME"); + strcpy(data.spec.passed3, "can now become"); snprintf(data.spec.passed4, - sizeof data.spec.passed4, "SUPER %s", + sizeof data.spec.passed4, "Super %s", skins[players[consoleplayer].skin].realname); data.spec.passed4[sizeof data.spec.passed4 - 1] = '\0'; } @@ -1523,13 +1523,13 @@ void Y_StartIntermission(void) if (strlen(skins[players[consoleplayer].skin].realname) <= SKINNAMESIZE-5) { snprintf(data.spec.passed1, - sizeof data.spec.passed1, "%s GOT", + sizeof data.spec.passed1, "%s got", skins[players[consoleplayer].skin].realname); data.spec.passed1[sizeof data.spec.passed1 - 1] = '\0'; } else - strcpy(data.spec.passed1, "YOU GOT"); - strcpy(data.spec.passed2, "A CHAOS EMERALD"); + strcpy(data.spec.passed1, "You got"); + strcpy(data.spec.passed2, "a Chaos Emerald"); if (P_GetNextEmerald() > 6) { data.spec.passed2[15] = '?'; From 5909b85627079d03c00f52c9d1c45b8c48fd44e8 Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 17 Nov 2019 15:20:20 +0000 Subject: [PATCH 030/189] Fix overlapping on You Can Now Become Super Sonic screen. --- src/y_inter.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/y_inter.c b/src/y_inter.c index a4b39c55b..2b1ac2704 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -485,14 +485,14 @@ void Y_IntermissionDrawer(void) if (drawsection == 1) { - const char *ringtext = "\x82" "50 RINGS, NO SHIELD"; - const char *tut1text = "\x82" "PRESS " "\x80" "SPIN"; - const char *tut2text = "\x82" "MID-" "\x80" "JUMP"; - ttheight = 16; + const char *ringtext = "\x82" "50 rings, no shield"; + const char *tut1text = "\x82" "press " "\x80" "spin"; + const char *tut2text = "\x82" "mid-" "\x80" "jump"; + ttheight = 8; V_DrawLevelTitle(data.spec.passedx1 + xoffset1, ttheight, 0, data.spec.passed1); - ttheight += V_LevelNameHeight(data.spec.passed3) + 2; + ttheight += V_LevelNameHeight(data.spec.passed1) + 2; V_DrawLevelTitle(data.spec.passedx3 + xoffset2, ttheight, 0, data.spec.passed3); - ttheight += V_LevelNameHeight(data.spec.passed4) + 2; + ttheight += V_LevelNameHeight(data.spec.passed3) + 2; V_DrawLevelTitle(data.spec.passedx4 + xoffset3, ttheight, 0, data.spec.passed4); ttheight = 108; @@ -509,7 +509,7 @@ void Y_IntermissionDrawer(void) { ttheight = 24; V_DrawLevelTitle(data.spec.passedx1 + xoffset1, ttheight, 0, data.spec.passed1); - ttheight += V_LevelNameHeight(data.spec.passed2) + 2; + ttheight += V_LevelNameHeight(data.spec.passed1) + 2; V_DrawLevelTitle(data.spec.passedx2 + xoffset2, ttheight, 0, data.spec.passed2); } else From 8ce054a7c8efd143d2d28fae72175f1266c99416 Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 17 Nov 2019 15:55:22 +0000 Subject: [PATCH 031/189] Align to base rather than top. --- src/y_inter.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/y_inter.c b/src/y_inter.c index 2b1ac2704..48d08a02e 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -399,10 +399,13 @@ void Y_IntermissionDrawer(void) // draw the "got through act" lines and act number V_DrawLevelTitle(data.coop.passedx1, 49, 0, data.coop.passed1); - V_DrawLevelTitle(data.coop.passedx2, 49+V_LevelNameHeight(data.coop.passed1)+2, 0, data.coop.passed2); + { + INT32 h = V_LevelNameHeight(data.coop.passed2); + V_DrawLevelTitle(data.coop.passedx2, 49+h+2, 0, data.coop.passed2); - if (data.coop.actnum) - V_DrawLevelActNum(244, 58, 0, data.coop.actnum); + if (data.coop.actnum) + V_DrawLevelActNum(244, 42+h, 0, data.coop.actnum); + } bonusy = 150; // Total @@ -490,16 +493,16 @@ void Y_IntermissionDrawer(void) const char *tut2text = "\x82" "mid-" "\x80" "jump"; ttheight = 8; V_DrawLevelTitle(data.spec.passedx1 + xoffset1, ttheight, 0, data.spec.passed1); - ttheight += V_LevelNameHeight(data.spec.passed1) + 2; - V_DrawLevelTitle(data.spec.passedx3 + xoffset2, ttheight, 0, data.spec.passed3); ttheight += V_LevelNameHeight(data.spec.passed3) + 2; + V_DrawLevelTitle(data.spec.passedx3 + xoffset2, ttheight, 0, data.spec.passed3); + ttheight += V_LevelNameHeight(data.spec.passed4) + 2; V_DrawLevelTitle(data.spec.passedx4 + xoffset3, ttheight, 0, data.spec.passed4); ttheight = 108; V_DrawLevelTitle(BASEVIDWIDTH/2 + xoffset4 - (V_LevelNameWidth(ringtext)/2), ttheight, 0, ringtext); - ttheight += V_LevelNameHeight(ringtext) + 2; - V_DrawLevelTitle(BASEVIDWIDTH/2 + xoffset5 - (V_LevelNameWidth(tut1text)/2), ttheight, 0, tut1text); ttheight += V_LevelNameHeight(tut1text) + 2; + V_DrawLevelTitle(BASEVIDWIDTH/2 + xoffset5 - (V_LevelNameWidth(tut1text)/2), ttheight, 0, tut1text); + ttheight += V_LevelNameHeight(tut2text) + 2; V_DrawLevelTitle(BASEVIDWIDTH/2 + xoffset6 - (V_LevelNameWidth(tut2text)/2), ttheight, 0, tut2text); } else @@ -509,7 +512,7 @@ void Y_IntermissionDrawer(void) { ttheight = 24; V_DrawLevelTitle(data.spec.passedx1 + xoffset1, ttheight, 0, data.spec.passed1); - ttheight += V_LevelNameHeight(data.spec.passed1) + 2; + ttheight += V_LevelNameHeight(data.spec.passed2) + 2; V_DrawLevelTitle(data.spec.passedx2 + xoffset2, ttheight, 0, data.spec.passed2); } else From 0c98fb746ca395b9440f387699a61491ff82049a Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 17 Nov 2019 18:04:02 +0000 Subject: [PATCH 032/189] Add some NiGHTS animations which default to normal player sprite2s to the existing player->panim set list, which makes Tails' tails appear due to how P_DoTailsOverlay is coded (assuming the skin is Tails, requiring them to have SPR2_NFLY available). --- src/p_mobj.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/p_mobj.c b/src/p_mobj.c index 5d6a8a10f..3479f2f0f 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -246,6 +246,7 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state) { case S_PLAY_STND: case S_PLAY_WAIT: + case S_PLAY_NIGHTS_STAND: player->panim = PA_IDLE; break; case S_PLAY_EDGE: @@ -254,6 +255,7 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state) case S_PLAY_WALK: case S_PLAY_SKID: case S_PLAY_FLOAT: + case S_PLAY_NIGHTS_FLOAT: player->panim = PA_WALK; break; case S_PLAY_RUN: @@ -269,6 +271,7 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state) break; case S_PLAY_ROLL: //case S_PLAY_SPINDASH: -- everyone can ROLL thanks to zoom tubes... + case S_PLAY_NIGHTS_ATTACK: player->panim = PA_ROLL; break; case S_PLAY_JUMP: From ef5558af97ea44c963bb14fc4c1f139a7c1c7b07 Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 17 Nov 2019 20:34:25 +0000 Subject: [PATCH 033/189] Hardcode DrT's FHZ improvements. Puttin' the FREEZE in feature freeze amirite haha --- src/dehacked.c | 4 ++++ src/info.c | 44 +++++++++++++++++++++++++++++++++++++------- src/info.h | 4 ++++ src/sounds.c | 2 +- 4 files changed, 46 insertions(+), 8 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index fff9dbee8..8d59f33ae 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -7497,6 +7497,9 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_POPHAT_SHOOT1", "S_POPHAT_SHOOT2", "S_POPHAT_SHOOT3", + "S_POPHAT_SHOOT4", + "S_POPSHOT", + "S_POPSHOT_TRAIL", "S_HIVEELEMENTAL_LOOK", "S_HIVEELEMENTAL_PREPARE1", @@ -8361,6 +8364,7 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_PENGUINATOR", "MT_POPHAT", "MT_POPSHOT", + "MT_POPSHOT_TRAIL", "MT_HIVEELEMENTAL", "MT_BUMBLEBORE", diff --git a/src/info.c b/src/info.c index ed29fe2bf..9373b67d8 100644 --- a/src/info.c +++ b/src/info.c @@ -3722,9 +3722,12 @@ state_t states[NUMSTATES] = {SPR_PENG, 0, 5, {A_FaceTarget}, 0, 0, S_PENGUINATOR_LOOK}, // S_PENGUINATOR_SLIDE5 {SPR_POPH, 0, 2, {A_Look}, (2048<<16)|1, 0, S_POPHAT_LOOK}, // S_POPHAT_LOOK - {SPR_POPH, 1, 2, {A_LobShot}, MT_POPSHOT, (70<<16)|60, S_POPHAT_SHOOT2}, // S_POPHAT_SHOOT1 - {SPR_POPH, 2, 1, {NULL}, 0, 0, S_POPHAT_SHOOT3}, // S_POPHAT_SHOOT2 - {SPR_POPH, 0, 57, {NULL}, 0, 0, S_POPHAT_LOOK}, // S_POPHAT_SHOOT3 + {SPR_POPH, 1, 0, {A_MultiShotDist}, (MT_SPINDUST<<16)|4, 24, S_POPHAT_SHOOT2}, // S_POPHAT_SHOOT1 + {SPR_POPH, 1, 2, {A_LobShot}, MT_POPSHOT, (70<<16)|60, S_POPHAT_SHOOT3}, // S_POPHAT_SHOOT2 + {SPR_POPH, 2, 1, {NULL}, 0, 0, S_POPHAT_SHOOT4}, // S_POPHAT_SHOOT3 + {SPR_POPH, 0, 57, {NULL}, 0, 0, S_POPHAT_LOOK}, // S_POPHAT_SHOOT4 + {SPR_POPH, 3, 3, {A_SpawnObjectRelative}, 0, MT_POPSHOT_TRAIL, S_POPSHOT}, // S_POPSHOT + {SPR_NULL, 0, 2, {NULL}, 0, 0, S_SPINDUST1}, // S_POPSHOT_TRAIL {SPR_HIVE, 0, 5, {A_Look}, 1, 1, S_HIVEELEMENTAL_LOOK}, // S_HIVEELEMENTAL_LOOK {SPR_HIVE, 0, 14, {A_PlaySound}, sfx_s3k76, 1, S_HIVEELEMENTAL_PREPARE2}, // S_HIVEELEMENTAL_PREPARE1 @@ -19989,10 +19992,10 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = { // MT_POPSHOT -1, // doomednum - S_ROCKCRUMBLEI, // spawnstate + S_POPSHOT, // spawnstate 1, // spawnhealth S_NULL, // seestate - sfx_cannon, // seesound + sfx_kc4c, // seesound 0, // reactiontime sfx_None, // attacksound S_NULL, // painstate @@ -20000,9 +20003,9 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_XPLD1, // deathstate + S_SONIC3KBOSSEXPLOSION1, // deathstate S_NULL, // xdeathstate - sfx_pop, // deathsound + sfx_cybdth, // deathsound 0, // speed 16*FRACUNIT, // radius 32*FRACUNIT, // height @@ -20014,6 +20017,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, + { // MT_POPSHOT_TRAIL + -1, // doomednum + S_POPSHOT_TRAIL,// 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 + 4*FRACUNIT, // speed + 4*FRACUNIT, // radius + 4*FRACUNIT, // height + 0, // display offset + 4, // mass + 0, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIPHEIGHT|MF_NOCLIP, // flags + S_NULL // raisestate + }, + { // MT_HIVEELEMENTAL 127, // doomednum S_HIVEELEMENTAL_LOOK, // spawnstate diff --git a/src/info.h b/src/info.h index bbb6a21fc..622f86f23 100644 --- a/src/info.h +++ b/src/info.h @@ -3812,6 +3812,9 @@ typedef enum state S_POPHAT_SHOOT1, S_POPHAT_SHOOT2, S_POPHAT_SHOOT3, + S_POPHAT_SHOOT4, + S_POPSHOT, + S_POPSHOT_TRAIL, S_HIVEELEMENTAL_LOOK, S_HIVEELEMENTAL_PREPARE1, @@ -4698,6 +4701,7 @@ typedef enum mobj_type MT_PENGUINATOR, MT_POPHAT, MT_POPSHOT, + MT_POPSHOT_TRAIL, MT_HIVEELEMENTAL, MT_BUMBLEBORE, diff --git a/src/sounds.c b/src/sounds.c index b067903b1..ba2402eb9 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -779,7 +779,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"kc49", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, {"kc4a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, {"kc4b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, - {"kc4c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, + {"kc4c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Pop-shot"}, {"kc4d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Power up"}, {"kc4e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, {"kc4f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, From b721c035f8e30891c73a844319547a44fc93adbc Mon Sep 17 00:00:00 2001 From: lachwright Date: Mon, 18 Nov 2019 05:23:59 +0800 Subject: [PATCH 034/189] Add Dragonbomber enemy --- src/dehacked.c | 26 ++++++++ src/hardware/hw_light.c | 1 + src/info.c | 128 ++++++++++++++++++++++++++++++++++++++++ src/info.h | 27 +++++++++ src/p_enemy.c | 102 ++++++++++++++++++++++++++++++++ src/p_inter.c | 11 ++++ src/p_mobj.c | 77 ++++++++++++++++++++++++ 7 files changed, 372 insertions(+) diff --git a/src/dehacked.c b/src/dehacked.c index fff9dbee8..5e29c8def 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -2781,6 +2781,9 @@ static actionpointer_t actionpointers[] = {{A_PterabyteHover}, "A_PTERABYTEHOVER"}, {{A_RolloutSpawn}, "A_ROLLOUTSPAWN"}, {{A_RolloutRock}, "A_ROLLOUTROCK"}, + {{A_DragonbomberSpawn}, "A_DRAGONBOMERSPAWN"}, + {{A_DragonWing}, "A_DRAGONWING"}, + {{A_DragonSegment}, "A_DRAGONSEGMENT"}, {{NULL}, "NONE"}, // This NULL entry must be the last in the list @@ -5041,6 +5044,25 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_PTERABYTE_SWOOPDOWN", "S_PTERABYTE_SWOOPUP", + // Dragonbomber + "S_DRAGONBOMBER", + "S_DRAGONWING1", + "S_DRAGONWING2", + "S_DRAGONWING3", + "S_DRAGONWING4", + "S_DRAGONTAIL_LOADED", + "S_DRAGONTAIL_EMPTY", + "S_DRAGONTAIL_EMPTYLOOP", + "S_DRAGONTAIL_RELOAD", + "S_DRAGONMINE", + "S_DRAGONMINE_LAND", + "S_DRAGONMINE_GROUND1", + "S_DRAGONMINE_FLASH1", + "S_DRAGONMINE_LOOP1", + "S_DRAGONMINE_GROUND2", + "S_DRAGONMINE_FLASH2", + "S_DRAGONMINE_LOOP2", + // Boss Explosion "S_BOSSEXPLODE", @@ -7712,6 +7734,10 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_PTERABYTESPAWNER", // Pterabyte spawner "MT_PTERABYTEWAYPOINT", // Pterabyte waypoint "MT_PTERABYTE", // Pterabyte + "MT_DRAGONBOMBER", // Dragonbomber + "MT_DRAGONWING", // Dragonbomber wing + "MT_DRAGONTAIL", // Dragonbomber tail segment + "MT_DRAGONMINE", // Dragonbomber mine // Generic Boss Items "MT_BOSSEXPLODE", diff --git a/src/hardware/hw_light.c b/src/hardware/hw_light.c index 491cb739f..8cd8143eb 100644 --- a/src/hardware/hw_light.c +++ b/src/hardware/hw_light.c @@ -184,6 +184,7 @@ light_t *t_lspr[NUMSPRITES] = &lspr[NOLIGHT], // SPR_CANG &lspr[NOLIGHT], // SPR_PYRE &lspr[NOLIGHT], // SPR_PTER + &lspr[NOLIGHT], // SPR_DRAB // Generic Boos Items &lspr[JETLIGHT_L], // SPR_JETF // Boss jet fumes diff --git a/src/info.c b/src/info.c index ed29fe2bf..52b04f4a0 100644 --- a/src/info.c +++ b/src/info.c @@ -72,6 +72,7 @@ char sprnames[NUMSPRITES + 1][5] = "CANG", // Canarivore gas "PYRE", // Pyre Fly "PTER", // Pterabyte + "DRAB", // Dragonbomber // Generic Boss Items "JETF", // Boss jet fumes @@ -1163,6 +1164,25 @@ state_t states[NUMSTATES] = {SPR_PTER, 4, 1, {NULL}, 0, 0, S_PTERABYTE_SWOOPDOWN}, // S_PTERABYTE_SWOOPDOWN {SPR_PTER, 0, 1, {NULL}, 0, 0, S_PTERABYTE_SWOOPUP}, // S_PTERABYTE_SWOOPUP + // Dragonbomber + {SPR_DRAB, 0, -1, {A_DragonbomberSpawn}, 6, 0, S_NULL}, // S_DRAGONBOMBER + {SPR_DRAB, FF_PAPERSPRITE|7, 1, {A_DragonWing}, 0, 0, S_DRAGONWING2}, // S_DRAGONWING1 + {SPR_DRAB, FF_PAPERSPRITE|8, 1, {A_DragonWing}, 0, 0, S_DRAGONWING3}, // S_DRAGONWING2 + {SPR_DRAB, FF_PAPERSPRITE|9, 1, {A_DragonWing}, 0, 0, S_DRAGONWING4}, // S_DRAGONWING3 + {SPR_DRAB, FF_PAPERSPRITE|10, 1, {A_DragonWing}, 0, 0, S_DRAGONWING1}, // S_DRAGONWING4 + {SPR_DRAB, 1, 1, {A_DragonSegment}, 0, 0, S_DRAGONTAIL_LOADED}, // S_DRAGONTAIL_LOADED + {SPR_DRAB, 2, 1, {A_DragonSegment}, 0, 0, S_DRAGONTAIL_EMPTYLOOP}, // S_DRAGONTAIL_EMPTY + {SPR_DRAB, 2, 0, {A_Repeat}, 3*TICRATE, S_DRAGONTAIL_EMPTY, S_DRAGONTAIL_RELOAD}, // S_DRAGONTAIL_EMPTYLOOP + {SPR_DRAB, 1, 0, {A_PlayActiveSound}, 0, 0, S_DRAGONTAIL_LOADED}, // S_DRAGONTAIL_RELOAD + {SPR_DRAB, 3, 1, {A_MinusCheck}, S_DRAGONMINE_LAND, 0, S_DRAGONMINE}, // S_DRAGONMINE + {SPR_DRAB, 4, 2, {A_PlayActiveSound}, 0, 0, S_DRAGONMINE_GROUND1}, // S_DRAGONMINE_LAND + {SPR_DRAB, 5, 11, {NULL}, 0, 0, S_DRAGONMINE_FLASH1}, // S_DRAGONMINE_GROUND1 + {SPR_DRAB, FF_FULLBRIGHT|6, 1, {A_PlayAttackSound}, 0, 0, S_DRAGONMINE_LOOP1}, // S_DRAGONMINE_FLASH1 + {SPR_DRAB, 5, 0, {A_Repeat}, 4, S_DRAGONMINE_GROUND1, S_DRAGONMINE_GROUND2}, // S_DRAGONMINE_LOOP1 + {SPR_DRAB, 5, 3, {NULL}, 0, 0, S_DRAGONMINE_FLASH2}, // S_DRAGONMINE_GROUND2 + {SPR_DRAB, FF_FULLBRIGHT|6, 1, {A_PlayAttackSound}, 0, 0, S_DRAGONMINE_LOOP2}, // S_DRAGONMINE_FLASH2 + {SPR_DRAB, 5, 0, {A_Repeat}, 5, S_DRAGONMINE_GROUND2, S_DEATHSTATE}, // S_DRAGONMINE_LOOP2 + // Boss Explosion {SPR_BOM2, FF_FULLBRIGHT|FF_ANIMATE, (5*7), {NULL}, 6, 5, S_NULL}, // S_BOSSEXPLODE @@ -5238,6 +5258,114 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, + { // MT_DRAGONBOMBER + 137, // doomednum + S_DRAGONBOMBER, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 0, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + 6, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_XPLD_FLICKY, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 10*FRACUNIT, // speed + 28*FRACUNIT, // radius + 48*FRACUNIT, // height + 0, // display offset + 100, // mass + 0, // damage + sfx_None, // activesound + MF_SPECIAL|MF_SHOOTABLE|MF_ENEMY|MF_NOGRAVITY|MF_BOUNCE|MF_RUNSPAWNFUNC, // flags + S_NULL // raisestate + }, + + { // MT_DRAGONWING + -1, // doomednum + S_DRAGONWING1, // 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_XPLD_FLICKY, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 0, // speed + 12*FRACUNIT, // radius + 12*FRACUNIT, // height + 0, // display offset + 100, // mass + 0, // damage + sfx_None, // activesound + MF_NOGRAVITY|MF_SCENERY|MF_NOBLOCKMAP|MF_NOCLIP, // flags + S_NULL // raisestate + }, + + { // MT_DRAGONTAIL + -1, // doomednum + S_DRAGONTAIL_LOADED, // spawnstate + 1000, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 0, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + MT_DRAGONMINE, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_XPLD1, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 0, // speed + 20*FRACUNIT, // radius + 40*FRACUNIT, // height + 0, // display offset + 100, // mass + 0, // damage + sfx_tink, // activesound + MF_NOGRAVITY|MF_SLIDEME|MF_PAIN, // flags + S_DRAGONTAIL_EMPTY // raisestate + }, + + { // MT_DRAGONMINE + -1, // doomednum + S_DRAGONMINE, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_s3k76, // seesound + 0, // reactiontime + sfx_s3k89, // attacksound + S_NULL, // painstate + 6, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_TNTBARREL_EXPL1, // deathstate + S_NULL, // xdeathstate + sfx_s3k6e, // deathsound + 0, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 100, // mass + 0, // damage + sfx_s3k5d, // activesound + MF_SPECIAL|MF_SHOOTABLE, // flags + S_NULL // raisestate + }, + { // MT_BOSSEXPLODE -1, // doomednum S_BOSSEXPLODE, // spawnstate diff --git a/src/info.h b/src/info.h index bbb6a21fc..7838b4f71 100644 --- a/src/info.h +++ b/src/info.h @@ -282,6 +282,9 @@ void A_SpawnPterabytes(); void A_PterabyteHover(); void A_RolloutSpawn(); void A_RolloutRock(); +void A_DragonbomberSpawn(); +void A_DragonWing(); +void A_DragonSegment(); // ratio of states to sprites to mobj types is roughly 6 : 1 : 1 #define NUMMOBJFREESLOTS 512 @@ -334,6 +337,7 @@ typedef enum sprite SPR_CANG, // Canarivore gas SPR_PYRE, // Pyre Fly SPR_PTER, // Pterabyte + SPR_DRAB, // Dragonbomber // Generic Boss Items SPR_JETF, // Boss jet fumes @@ -1355,6 +1359,25 @@ typedef enum state S_PTERABYTE_SWOOPDOWN, S_PTERABYTE_SWOOPUP, + // Dragonbomber + S_DRAGONBOMBER, + S_DRAGONWING1, + S_DRAGONWING2, + S_DRAGONWING3, + S_DRAGONWING4, + S_DRAGONTAIL_LOADED, + S_DRAGONTAIL_EMPTY, + S_DRAGONTAIL_EMPTYLOOP, + S_DRAGONTAIL_RELOAD, + S_DRAGONMINE, + S_DRAGONMINE_LAND, + S_DRAGONMINE_GROUND1, + S_DRAGONMINE_FLASH1, + S_DRAGONMINE_LOOP1, + S_DRAGONMINE_GROUND2, + S_DRAGONMINE_FLASH2, + S_DRAGONMINE_LOOP2, + // Boss Explosion S_BOSSEXPLODE, @@ -4049,6 +4072,10 @@ typedef enum mobj_type MT_PTERABYTESPAWNER, // Pterabyte spawner MT_PTERABYTEWAYPOINT, // Pterabyte waypoint MT_PTERABYTE, // Pterabyte + MT_DRAGONBOMBER, // Dragonbomber + MT_DRAGONWING, // Dragonbomber wing + MT_DRAGONTAIL, // Dragonbomber tail segment + MT_DRAGONMINE, // Dragonbomber mine // Generic Boss Items MT_BOSSEXPLODE, diff --git a/src/p_enemy.c b/src/p_enemy.c index eedbecaa7..18da9c7e6 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -312,6 +312,9 @@ void A_SpawnPterabytes(mobj_t *actor); void A_PterabyteHover(mobj_t *actor); void A_RolloutSpawn(mobj_t *actor); void A_RolloutRock(mobj_t *actor); +void A_DragonbomberSpawn(mobj_t *actor); +void A_DragonWing(mobj_t *actor); +void A_DragonSegment(mobj_t *actor); //for p_enemy.c @@ -14597,3 +14600,102 @@ void A_RolloutRock(mobj_t *actor) actor->flags2 ^= MF2_DONTDRAW; } + +// Function: A_DragonbomberSpawn +// +// Description: Spawns the body parts for Dragonbomber +// +// var1 = Tail segments to spawn +// var2 = unused +// +void A_DragonbomberSpawn(mobj_t *actor) +{ + INT32 locvar1 = var1; + INT32 locvar2 = var2; + UINT8 i; + mobj_t *mo = actor; + + #ifdef HAVE_BLUA + if (LUA_CallAction("A_DragonbomberSpawn", actor)) + return; + #endif + + for (i = 0; i < var1; i++) // spawn tail segments + { + mobj_t *segment; + fixed_t x, y; + x = P_ReturnThrustX(mo, mo->angle, -mo->radius << 1); + y = P_ReturnThrustY(mo, mo->angle, -mo->radius << 1); + segment = P_SpawnMobjFromMobj(mo, x, y, 0, MT_DRAGONTAIL); + P_SetTarget(&segment->target, mo); + P_SetTarget(&mo->tracer, segment); + segment->angle = mo->angle; + mo = segment; + } + for (i = 0; i < 2; i++) // spawn wings + { + mo = P_SpawnMobjFromMobj(actor, 0, 0, 0, MT_DRAGONWING); + P_SetTarget(&mo->target, actor); + mo->movedir = ANGLE_90 + i * ANGLE_180; + } +} + +// Function: A_DragonWing +// +// Description: Moves actor such that it is placed away from its target at a distance equal to the target's radius in the direction of its target's angle. +// The actor's movedir can be used to offset the angle. +// +// var1 = unused +// var2 = unused +// +void A_DragonWing(mobj_t *actor) +{ + INT32 locvar1 = var1; + INT32 locvar2 = var2; + mobj_t *target = actor->target; + fixed_t x, y; + + #ifdef HAVE_BLUA + if (LUA_CallAction("A_DragonSegment", actor)) + return; + #endif + + if (target == NULL || !target->health) + { + P_RemoveMobj(actor); + return; + } + actor->angle = target->angle + actor->movedir; + x = target->x + P_ReturnThrustX(actor, actor->angle, -target->radius); + y = target->y + P_ReturnThrustY(actor, actor->angle, -target->radius); + P_TeleportMove(actor, x, y, target->z); +} + +// Function: A_DragonSegment +// +// Description: Moves actor such that it is placed away from its target at an absolute distance equal to the sum of the two mobjs' radii. +// +// var1 = unused +// var2 = unused +// +void A_DragonSegment(mobj_t *actor) +{ + INT32 locvar1 = var1; + INT32 locvar2 = var2; + mobj_t *target = actor->target; + fixed_t dist = P_AproxDistance(P_AproxDistance(actor->x - target->x, actor->y - target->y), actor->z - target->z); + fixed_t radius = actor->radius + target->radius; + angle_t hangle = R_PointToAngle2(target->x, target->y, actor->x, actor->y); + angle_t zangle = R_PointToAngle2(0, target->z, dist, actor->z); + fixed_t hdist = P_ReturnThrustX(target, zangle, radius); + fixed_t xdist = P_ReturnThrustX(target, hangle, hdist); + fixed_t ydist = P_ReturnThrustY(target, hangle, hdist); + fixed_t zdist = P_ReturnThrustY(target, zangle, radius); + + #ifdef HAVE_BLUA + if (LUA_CallAction("A_DragonSegment", actor)) + return; + #endif + + P_TeleportMove(actor, target->x + xdist, target->y + ydist, target->z + zdist); +} \ No newline at end of file diff --git a/src/p_inter.c b/src/p_inter.c index b0a401b10..7da987815 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2678,6 +2678,17 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget target->flags = (target->flags|MF_NOCLIPHEIGHT) & ~MF_NOGRAVITY; break; + case MT_DRAGONBOMBER: + { + mobj_t *segment = target; + while (segment->tracer != NULL) + { + P_KillMobj(segment->tracer, NULL, NULL, 0); + segment = segment->tracer; + } + break; + } + case MT_EGGMOBILE3: { mobj_t *mo2; diff --git a/src/p_mobj.c b/src/p_mobj.c index 5d6a8a10f..dd960f5ad 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -9622,6 +9622,83 @@ void P_MobjThinker(mobj_t *mobj) } break; } + case MT_DRAGONBOMBER: + { +#define DRAGONTURNSPEED ANG2 + mobj->movecount = (mobj->movecount + 9) % 360; + P_SetObjectMomZ(mobj, 4*FINESINE(((mobj->movecount*ANG1) >> ANGLETOFINESHIFT) & FINEMASK), false); + if (mobj->threshold > 0) // are we dropping mines? + { + mobj->threshold--; + if (mobj->threshold == 0) // if the timer hits 0, look for a mine to drop! + { + mobj_t *segment = mobj; + while (segment->tracer != NULL && segment->tracer->state == &states[segment->tracer->info->spawnstate]) + { + segment = segment->tracer; + } + if (segment != mobj) // found an unactivated segment? + { + mobj_t *mine = P_SpawnMobjFromMobj(segment, 0, 0, 0, segment->info->painchance); + mine->angle = segment->angle; + P_InstaThrust(mine, mobj->angle, P_AproxDistance(mobj->momx, mobj->momy)); + P_SetObjectMomZ(mine, -2*FRACUNIT, true); + S_StartSound(mine, mine->info->seesound); + P_SetMobjState(segment, segment->info->raisestate); + mobj->threshold = mobj->info->painchance; + } + } + } + if (mobj->target != NULL) // Are we chasing a player? + { + CONS_Printf("%s\n", "Chase state"); + fixed_t dist = P_AproxDistance(mobj->x - mobj->target->x, mobj->y - mobj->target->y); + if (dist > 2000 * mobj->scale) // Not anymore! + P_SetTarget(&mobj->target, NULL); + else + { + fixed_t vspeed = FixedMul(mobj->info->speed >> 3, mobj->scale); + fixed_t z = mobj->target->z + (mobj->height >> 1) + (mobj->flags & MFE_VERTICALFLIP ? -128*mobj->scale : 128*mobj->scale + mobj->target->height); + angle_t diff = R_PointToAngle2(mobj->x, mobj->y, mobj->target->x, mobj->target->y) - mobj->angle; + if (diff > ANGLE_180) + mobj->angle -= DRAGONTURNSPEED; + else + mobj->angle += DRAGONTURNSPEED; + if (!mobj->threshold && dist < 512 * mobj->scale) // Close enough to drop bombs + { + mobj->threshold = mobj->info->painchance; + } + mobj->momz += max(min(z - mobj->z, vspeed), -vspeed); + } + } + else // Can we find a player to chase? + { + CONS_Printf("%s\n", "Search state"); + if (mobj->tracer == NULL || mobj->tracer->state != &states[mobj->tracer->info->spawnstate] + || !P_LookForPlayers(mobj, true, false, 2000*mobj->scale)) // if not, circle around the spawnpoint + { + if (!mobj->spawnpoint) // unless we don't have one, in which case uhhh just circle around wherever we currently are I guess?? + mobj->angle += DRAGONTURNSPEED; + else + { + fixed_t vspeed = FixedMul(mobj->info->speed >> 3, mobj->scale); + fixed_t x = mobj->spawnpoint->x << FRACBITS; + fixed_t y = mobj->spawnpoint->y << FRACBITS; + fixed_t z = mobj->spawnpoint->z << FRACBITS; + fixed_t dist = P_AproxDistance(mobj->x - x, mobj->y - y); + angle_t diff = R_PointToAngle2(mobj->x, mobj->y, x, y) - mobj->angle; + if (diff > ANGLE_180) + mobj->angle -= DRAGONTURNSPEED; + else + mobj->angle += DRAGONTURNSPEED; + mobj->momz += max(min(z - mobj->z, vspeed), -vspeed); + } + } + } + P_InstaThrust(mobj, mobj->angle, FixedMul(mobj->info->speed, mobj->scale)); +#undef DRAGONTURNSPEED + } + break; case MT_SPINFIRE: if (mobj->flags & MF_NOGRAVITY) { From 5cafed5c7202bb6562cf2902ce7c7e663d50d91f Mon Sep 17 00:00:00 2001 From: lachwright Date: Mon, 18 Nov 2019 05:30:14 +0800 Subject: [PATCH 035/189] Make rollout rocks more friendly --- src/p_map.c | 1 - src/p_user.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index bb56a50b1..53ca81335 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1020,7 +1020,6 @@ static boolean PIT_CheckThing(mobj_t *thing) if ((thing->flags & MF_PUSHABLE) // not carrying a player && (tmthing->player->powers[pw_carry] == CR_NONE) // player is not already riding something && ((tmthing->eflags & MFE_VERTICALFLIP) == (thing->eflags & MFE_VERTICALFLIP)) - && (P_AproxDistance(thing->x - tmthing->x, thing->y - tmthing->y) < (thing->radius)) && (P_MobjFlip(tmthing)*tmthing->momz <= 0) && ((!(tmthing->eflags & MFE_VERTICALFLIP) && abs(thing->z + thing->height - tmthing->z) < (thing->height>>2)) || (tmthing->eflags & MFE_VERTICALFLIP && abs(tmthing->z + tmthing->height - thing->z) < (thing->height>>2)))) diff --git a/src/p_user.c b/src/p_user.c index 3c481e7e2..d8afd2bd5 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -4391,7 +4391,7 @@ void P_DoJump(player_t *player, boolean soundandstate) } else if (player->powers[pw_carry] == CR_ROLLOUT) { - player->mo->momz = 9*FRACUNIT + player->mo->tracer->momz; + player->mo->momz = 9*FRACUNIT; player->powers[pw_carry] = CR_NONE; player->mo->tracer->flags |= MF_PUSHABLE; P_SetTarget(&player->mo->tracer->tracer, NULL); From cf53e255eb009c03d19bda215a876ace2c1bc811 Mon Sep 17 00:00:00 2001 From: lachwright Date: Mon, 18 Nov 2019 05:31:26 +0800 Subject: [PATCH 036/189] Remove tester console prints --- src/p_mobj.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index dd960f5ad..a76dd7e4c 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -9651,7 +9651,6 @@ void P_MobjThinker(mobj_t *mobj) } if (mobj->target != NULL) // Are we chasing a player? { - CONS_Printf("%s\n", "Chase state"); fixed_t dist = P_AproxDistance(mobj->x - mobj->target->x, mobj->y - mobj->target->y); if (dist > 2000 * mobj->scale) // Not anymore! P_SetTarget(&mobj->target, NULL); @@ -9673,7 +9672,6 @@ void P_MobjThinker(mobj_t *mobj) } else // Can we find a player to chase? { - CONS_Printf("%s\n", "Search state"); if (mobj->tracer == NULL || mobj->tracer->state != &states[mobj->tracer->info->spawnstate] || !P_LookForPlayers(mobj, true, false, 2000*mobj->scale)) // if not, circle around the spawnpoint { From 4cc1b2b327481ae2cfa19690d04f8c23356a5cf4 Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 17 Nov 2019 22:18:46 +0000 Subject: [PATCH 037/189] Disable the GL sprite shadows behind a #define. Reasoning: * They're horribly broken (they completely ignore slopes). * A similar final demo GL-only feature (coronas) has been completely disabled. * Nobody's going to bugfix them before release because not even the devteam's resident GL users use them. * They look ugly. --- src/hardware/hw_main.c | 8 ++++++++ src/r_main.c | 8 ++++++++ src/r_main.h | 7 ++++++- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index f9e26733e..ea82d919b 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -4068,6 +4068,7 @@ static gr_vissprite_t *HWR_NewVisSprite(void) return HWR_GetVisSprite(gr_visspritecount++); } +#ifdef GLBADSHADOWS // Finds a floor through which light does not pass. static fixed_t HWR_OpaqueFloorAtPos(fixed_t x, fixed_t y, fixed_t z, fixed_t height) { @@ -4098,6 +4099,7 @@ static fixed_t HWR_OpaqueFloorAtPos(fixed_t x, fixed_t y, fixed_t z, fixed_t hei return floorz; } +#endif //#ifdef GLBADSHADOWS // // HWR_DoCulling @@ -4139,6 +4141,7 @@ static boolean HWR_DoCulling(line_t *cullheight, line_t *viewcullheight, float v return false; } +#ifdef GLBADSHADOWS static void HWR_DrawSpriteShadow(gr_vissprite_t *spr, GLPatch_t *gpatch, float this_scale) { FOutVector swallVerts[4]; @@ -4311,6 +4314,7 @@ static void HWR_DrawSpriteShadow(gr_vissprite_t *spr, GLPatch_t *gpatch, float t HWD.pfnDrawPolygon(&sSurf, swallVerts, 4, PF_Translucent|PF_Modulated|PF_Clip); } } +#endif //#ifdef GLBADSHADOWS // This is expecting a pointer to an array containing 4 wallVerts for a sprite static void HWR_RotateSpritePolyToAim(gr_vissprite_t *spr, FOutVector *wallVerts) @@ -4386,6 +4390,7 @@ static void HWR_SplitSprite(gr_vissprite_t *spr) //Hurdler: 25/04/2000: now support colormap in hardware mode HWR_GetMappedPatch(gpatch, spr->colormap); +#ifdef GLBADSHADOWS // Draw shadow BEFORE sprite if (cv_shadow.value // Shadows enabled && (spr->mobj->flags & (MF_SCENERY|MF_SPAWNCEILING|MF_NOGRAVITY)) != (MF_SCENERY|MF_SPAWNCEILING|MF_NOGRAVITY) // Ceiling scenery have no shadow. @@ -4401,6 +4406,7 @@ static void HWR_SplitSprite(gr_vissprite_t *spr) //////////////////// HWR_DrawSpriteShadow(spr, gpatch, this_scale); } +#endif //#ifdef GLBADSHADOWS baseWallVerts[0].x = baseWallVerts[3].x = spr->x1; baseWallVerts[2].x = baseWallVerts[1].x = spr->x2; @@ -4788,6 +4794,7 @@ static void HWR_DrawSprite(gr_vissprite_t *spr) //Hurdler: 25/04/2000: now support colormap in hardware mode HWR_GetMappedPatch(gpatch, spr->colormap); +#ifdef GLBADSHADOWS // Draw shadow BEFORE sprite if (cv_shadow.value // Shadows enabled && (spr->mobj->flags & (MF_SCENERY|MF_SPAWNCEILING|MF_NOGRAVITY)) != (MF_SCENERY|MF_SPAWNCEILING|MF_NOGRAVITY) // Ceiling scenery have no shadow. @@ -4803,6 +4810,7 @@ static void HWR_DrawSprite(gr_vissprite_t *spr) //////////////////// HWR_DrawSpriteShadow(spr, gpatch, this_scale); } +#endif //#ifdef GLBADSHADOWS // if it has a dispoffset, push it a little towards the camera if (spr->dispoffset) { diff --git a/src/r_main.c b/src/r_main.c index 3ed509af5..5e758e52a 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -123,8 +123,12 @@ consvar_t cv_chasecam2 = {"chasecam2", "On", CV_CALL, CV_OnOff, ChaseCam2_OnChan consvar_t cv_flipcam = {"flipcam", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo, FlipCam_OnChange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_flipcam2 = {"flipcam2", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo, FlipCam2_OnChange, 0, NULL, NULL, 0, 0, NULL}; +#if defined(FLOORSPLATS) || defined(GLBADSHADOWS) consvar_t cv_shadow = {"shadow", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +#endif //#if defined(FLOORSPLATS) || defined(GLBADSHADOWS) +#ifdef GLBADSHADOWS consvar_t cv_shadowoffs = {"offsetshadows", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +#endif //#ifdef GLBADSHADOWS consvar_t cv_skybox = {"skybox", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_allowmlook = {"allowmlook", "Yes", CV_NETVAR, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_showhud = {"showhud", "Yes", CV_CALL, CV_YesNo, R_SetViewSize, 0, NULL, NULL, 0, 0, NULL}; @@ -1172,8 +1176,12 @@ void R_RegisterEngineStuff(void) CV_RegisterVar(&cv_chasecam); CV_RegisterVar(&cv_chasecam2); +#if defined(FLOORSPLATS) || defined(GLBADSHADOWS) CV_RegisterVar(&cv_shadow); +#endif //#if defined(FLOORSPLATS) || defined(GLBADSHADOWS) +#ifdef GLBADSHADOWS CV_RegisterVar(&cv_shadowoffs); +#endif //#ifdef GLBADSHADOWS CV_RegisterVar(&cv_skybox); CV_RegisterVar(&cv_cam_dist); diff --git a/src/r_main.h b/src/r_main.h index 2c9b5cc3d..ae74ee067 100644 --- a/src/r_main.h +++ b/src/r_main.h @@ -76,7 +76,12 @@ extern consvar_t cv_showhud, cv_translucenthud; extern consvar_t cv_homremoval; extern consvar_t cv_chasecam, cv_chasecam2; extern consvar_t cv_flipcam, cv_flipcam2; -extern consvar_t cv_shadow, cv_shadowoffs; +#if defined(FLOORSPLATS) || defined(GLBADSHADOWS) +extern consvar_t cv_shadow; +#endif +#ifdef GLBADSHADOWS +extern conscar_t cv_shadowoffs; +#endif //#ifdef GLBADSHADOWS extern consvar_t cv_translucency; extern consvar_t cv_drawdist, cv_drawdist_nights, cv_drawdist_precip; extern consvar_t cv_skybox; From 6c98a150be8cf1dc16119d1f380f0f4b0342f36d Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Sun, 17 Nov 2019 23:44:48 +0100 Subject: [PATCH 038/189] Show the exit icon for finished players --- src/hu_stuff.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 428656bf2..9b7c281c8 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -2443,7 +2443,7 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I V_DrawSmallScaledPatch(x-32, y-4, 0, tagico); } - if (players[tab[i].num].exiting) + if (players[tab[i].num].exiting || (players[tab[i].num].pflags & PF_FINISHED)) V_DrawSmallScaledPatch(x - SHORT(exiticon->width)/2 - 1, y-3, 0, exiticon); if (gametype == GT_RACE) @@ -2747,7 +2747,7 @@ void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scoreline else if (G_TagGametype() && players[tab[i].num].pflags & PF_TAGIT) V_DrawSmallScaledPatch(x-28, y-4, 0, tagico); - if (players[tab[i].num].exiting) + if (players[tab[i].num].exiting || (players[tab[i].num].pflags & PF_FINISHED)) V_DrawSmallScaledPatch(x - SHORT(exiticon->width)/2 - 1, y-3, 0, exiticon); // Draw emeralds From 688bf0158d11dcd427c247cac99b6dbb430e22df Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Sun, 17 Nov 2019 23:46:34 +0100 Subject: [PATCH 039/189] Disable Tails carrying for players who completed the level To avoid trolls... --- src/p_map.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/p_map.c b/src/p_map.c index bb56a50b1..82403b947 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -592,6 +592,9 @@ static void P_DoTailsCarry(player_t *sonic, player_t *tails) if (!(tails->pflags & PF_CANCARRY)) return; + if (sonic->pflags & PF_FINISHED) + return; + if (tails->bot == 1) return; From 24744d07e401b8783810e7aa83799f4b0371964a Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Sun, 17 Nov 2019 23:52:51 +0100 Subject: [PATCH 040/189] Disable exitmove by default --- src/d_netcmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 124bbb9b4..eac90f658 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -360,7 +360,7 @@ consvar_t cv_advancemap = {"advancemap", "Next", CV_NETVAR, advancemap_cons_t, N static CV_PossibleValue_t playersforexit_cons_t[] = {{0, "One"}, {1, "1/4"}, {2, "Half"}, {3, "3/4"}, {4, "All"}, {0, NULL}}; consvar_t cv_playersforexit = {"playersforexit", "All", CV_NETVAR, playersforexit_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_exitmove = {"exitmove", "On", CV_NETVAR|CV_CALL, CV_OnOff, ExitMove_OnChange, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_exitmove = {"exitmove", "Off", CV_NETVAR|CV_CALL, CV_OnOff, ExitMove_OnChange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_runscripts = {"runscripts", "Yes", 0, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; From 64939816fb6aa9a1e2d36a7a8355b219d970ef85 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Sun, 17 Nov 2019 21:25:17 -0300 Subject: [PATCH 041/189] Fireball --- src/dehacked.c | 11 ++++------ src/info.c | 57 +++++++++++++++++++++++++++++++++++--------------- src/info.h | 11 ++++------ src/p_map.c | 5 +++++ src/p_mobj.c | 7 +++++++ src/p_user.c | 4 ++-- src/sounds.c | 2 ++ src/sounds.h | 2 ++ 8 files changed, 66 insertions(+), 33 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index fff9dbee8..aed796625 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -7322,13 +7322,9 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_FIREFLOWER2", "S_FIREFLOWER3", "S_FIREFLOWER4", - "S_FIREBALL1", - "S_FIREBALL2", - "S_FIREBALL3", - "S_FIREBALL4", - "S_FIREBALLEXP1", - "S_FIREBALLEXP2", - "S_FIREBALLEXP3", + "S_FIREBALL", + "S_FIREBALLTRAIL1", + "S_FIREBALLTRAIL2", "S_SHELL", "S_PUMA_START1", "S_PUMA_START2", @@ -8317,6 +8313,7 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_BLUEGOOMBA", "MT_FIREFLOWER", "MT_FIREBALL", + "MT_FIREBALLTRAIL", "MT_SHELL", "MT_PUMA", "MT_PUMATRAIL", diff --git a/src/info.c b/src/info.c index ed29fe2bf..3acdf2e47 100644 --- a/src/info.c +++ b/src/info.c @@ -3527,13 +3527,9 @@ state_t states[NUMSTATES] = {SPR_FFWR, 3, 3, {NULL}, 0, 0, S_FIREFLOWER1}, // S_FIREFLOWER4 // Thrown Mario Fireball - {SPR_FBLL, FF_FULLBRIGHT, 3, {NULL}, 0, 0, S_FIREBALL2}, // S_FIREBALL1 - {SPR_FBLL, FF_FULLBRIGHT|1, 3, {NULL}, 0, 0, S_FIREBALL3}, // S_FIREBALL2 - {SPR_FBLL, FF_FULLBRIGHT|2, 3, {NULL}, 0, 0, S_FIREBALL4}, // S_FIREBALL3 - {SPR_FBLL, FF_FULLBRIGHT|3, 3, {NULL}, 0, 0, S_FIREBALL1}, // S_FIREBALL4 - {SPR_FBLL, FF_FULLBRIGHT|4, 3, {NULL}, 0, 0, S_FIREBALLEXP2}, // S_FIREBALLEXP1 - {SPR_FBLL, FF_FULLBRIGHT|5, 3, {NULL}, 0, 0, S_FIREBALLEXP3}, // S_FIREBALLEXP2 - {SPR_FBLL, FF_FULLBRIGHT|6, 3, {NULL}, 0, 0, S_NULL}, // S_FIREBALLEXP3 + {SPR_FBLL, FF_FULLBRIGHT, 1, {A_SpawnObjectRelative}, 0, MT_FIREBALLTRAIL, S_FIREBALL}, // S_FIREBALL + {SPR_FBLL, 1|FF_FULLBRIGHT|FF_TRANS50, 1, {A_SetScale}, FRACUNIT*3/4, 0, S_FIREBALLTRAIL2}, // S_FIREBALLTRAIL1 + {SPR_FBLL, 1|FF_FULLBRIGHT|FF_TRANS50, 8, {A_SetScale}, FRACUNIT/6, 1, S_NULL}, // S_FIREBALLTRAIL2 // Turtle Shell {SPR_SHLL, 0, -1, {NULL}, 0, 0, S_NULL}, // S_SHELL @@ -18910,31 +18906,58 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = { // MT_FIREBALL -1, // doomednum - S_FIREBALL1, // spawnstate + S_FIREBALL, // spawnstate 1000, // spawnhealth - S_FIREBALLEXP1, // seestate - sfx_None, // seesound + S_NULL, // seestate + sfx_fbll, // seesound 8, // reactiontime sfx_None, // attacksound S_NULL, // painstate 0, // painchance sfx_None, // painsound - S_FIREBALLEXP1, // meleestate - S_FIREBALLEXP1, // missilestate - S_FIREBALLEXP1, // deathstate - S_FIREBALLEXP1, // xdeathstate - sfx_mario1, // deathsound - 10*FRACUNIT, // speed + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_fblldi, // deathsound + 40*FRACUNIT, // speed 4*FRACUNIT, // radius 8*FRACUNIT, // height 0, // display offset DMG_FIRE, // mass 1, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_FIRE|MF_MISSILE, // flags + MF_FIRE|MF_BOUNCE|MF_MISSILE, // flags S_NULL // raisestate }, + { // MT_FIREBALLTRAIL + -1, // doomednum + S_FIREBALLTRAIL1, // 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 + 16*FRACUNIT, // radius + 16*FRACUNIT, // height + 0, // display offset + 0, // mass + 1, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIP|MF_RUNSPAWNFUNC, // flags + S_NULL // raisestate + }, + { // MT_SHELL 1804, // doomednum S_SHELL, // spawnstate diff --git a/src/info.h b/src/info.h index bbb6a21fc..a0c793adc 100644 --- a/src/info.h +++ b/src/info.h @@ -3637,13 +3637,9 @@ typedef enum state S_FIREFLOWER2, S_FIREFLOWER3, S_FIREFLOWER4, - S_FIREBALL1, - S_FIREBALL2, - S_FIREBALL3, - S_FIREBALL4, - S_FIREBALLEXP1, - S_FIREBALLEXP2, - S_FIREBALLEXP3, + S_FIREBALL, + S_FIREBALLTRAIL1, + S_FIREBALLTRAIL2, S_SHELL, S_PUMA_START1, S_PUMA_START2, @@ -4654,6 +4650,7 @@ typedef enum mobj_type MT_BLUEGOOMBA, MT_FIREFLOWER, MT_FIREBALL, + MT_FIREBALLTRAIL, MT_SHELL, MT_PUMA, MT_PUMATRAIL, diff --git a/src/p_map.c b/src/p_map.c index bb56a50b1..70fd58f06 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1301,6 +1301,11 @@ static boolean PIT_CheckThing(mobj_t *thing) return false; } + // Fireball touched an enemy + // Don't bounce though, just despawn right there + if ((tmthing->type == MT_FIREBALL) && (thing->flags & MF_ENEMY)) + P_KillMobj(tmthing, NULL, NULL, 0); + // damage / explode if (tmthing->flags & MF_ENEMY) // An actual ENEMY! (Like the deton, for example) P_DamageMobj(thing, tmthing, tmthing, 1, 0); diff --git a/src/p_mobj.c b/src/p_mobj.c index 5d6a8a10f..431592a06 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8690,6 +8690,13 @@ void P_MobjThinker(mobj_t *mobj) case MT_KOOPA: P_KoopaThinker(mobj); break; + case MT_FIREBALL: + if (P_AproxDistance(mobj->momx, mobj->momy) <= 16*FRACUNIT) // Once fireballs lose enough speed, kill them + { + P_KillMobj(mobj, NULL, NULL, 0); + return; + } + break; case MT_REDRING: if (((mobj->z < mobj->floorz) || (mobj->z + mobj->height > mobj->ceilingz)) && mobj->flags & MF_MISSILE) diff --git a/src/p_user.c b/src/p_user.c index 3c481e7e2..9f85c5905 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3993,12 +3993,12 @@ static void P_DoFiring(player_t *player, ticcmd_t *cmd) if (player->pflags & PF_ATTACKDOWN || player->climbing || (G_TagGametype() && !(player->pflags & PF_TAGIT))) return; - if ((player->powers[pw_shield] & SH_STACK) == SH_FIREFLOWER) + if (((player->powers[pw_shield] & SH_STACK) == SH_FIREFLOWER) && !(player->weapondelay)) { player->pflags |= PF_ATTACKDOWN; mo = P_SpawnPlayerMissile(player->mo, MT_FIREBALL, 0); P_InstaThrust(mo, player->mo->angle, ((mo->info->speed>>FRACBITS)*player->mo->scale) + player->speed); - S_StartSound(player->mo, sfx_mario7); + P_SetWeaponDelay(player, TICRATE); // Short delay between fireballs so you can't spam them everywhere return; } diff --git a/src/sounds.c b/src/sounds.c index b067903b1..4fa2089a5 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -277,6 +277,8 @@ sfxinfo_t S_sfx[NUMSFX] = {"mario9", true, 120, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Emerging power-up"}, {"marioa", true, 192, 0, -1, NULL, 0, -1, -1, LUMPERROR, "One-up"}, {"thwomp", true, 127, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Thwomp"}, + {"fbll", false, 32, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Fireball throw"}, + {"fblldi", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Fireball hit"}, // Black Eggman {"bebomb", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Big explosion"}, diff --git a/src/sounds.h b/src/sounds.h index d48deb540..7859dfb18 100644 --- a/src/sounds.h +++ b/src/sounds.h @@ -326,6 +326,8 @@ typedef enum sfx_mario9, sfx_marioa, sfx_thwomp, + sfx_fbll, + sfx_fblldi, // Black Eggman sfx_bebomb, From 635e121bfcd9740e0f01449295413788d53234cb Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Sun, 17 Nov 2019 21:33:59 -0300 Subject: [PATCH 042/189] Restore old sound effect --- src/info.c | 4 ++-- src/p_user.c | 1 + src/sounds.c | 2 -- src/sounds.h | 2 -- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/info.c b/src/info.c index 3acdf2e47..50980a9c3 100644 --- a/src/info.c +++ b/src/info.c @@ -18909,7 +18909,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_FIREBALL, // spawnstate 1000, // spawnhealth S_NULL, // seestate - sfx_fbll, // seesound + sfx_None, // seesound 8, // reactiontime sfx_None, // attacksound S_NULL, // painstate @@ -18919,7 +18919,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL, // missilestate S_NULL, // deathstate S_NULL, // xdeathstate - sfx_fblldi, // deathsound + sfx_None, // deathsound 40*FRACUNIT, // speed 4*FRACUNIT, // radius 8*FRACUNIT, // height diff --git a/src/p_user.c b/src/p_user.c index 9f85c5905..ffcf1e074 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3998,6 +3998,7 @@ static void P_DoFiring(player_t *player, ticcmd_t *cmd) player->pflags |= PF_ATTACKDOWN; mo = P_SpawnPlayerMissile(player->mo, MT_FIREBALL, 0); P_InstaThrust(mo, player->mo->angle, ((mo->info->speed>>FRACBITS)*player->mo->scale) + player->speed); + S_StartSound(player->mo, sfx_mario7); P_SetWeaponDelay(player, TICRATE); // Short delay between fireballs so you can't spam them everywhere return; } diff --git a/src/sounds.c b/src/sounds.c index 4fa2089a5..b067903b1 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -277,8 +277,6 @@ sfxinfo_t S_sfx[NUMSFX] = {"mario9", true, 120, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Emerging power-up"}, {"marioa", true, 192, 0, -1, NULL, 0, -1, -1, LUMPERROR, "One-up"}, {"thwomp", true, 127, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Thwomp"}, - {"fbll", false, 32, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Fireball throw"}, - {"fblldi", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Fireball hit"}, // Black Eggman {"bebomb", false, 64, 64, -1, NULL, 0, -1, -1, LUMPERROR, "Big explosion"}, diff --git a/src/sounds.h b/src/sounds.h index 7859dfb18..d48deb540 100644 --- a/src/sounds.h +++ b/src/sounds.h @@ -326,8 +326,6 @@ typedef enum sfx_mario9, sfx_marioa, sfx_thwomp, - sfx_fbll, - sfx_fblldi, // Black Eggman sfx_bebomb, From 2584241a44e492b4006c492e28ce04175a961685 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Sun, 17 Nov 2019 20:22:47 -0500 Subject: [PATCH 043/189] Better ping implementation. --- src/d_clisrv.c | 45 +++++++++++++++++++++++++++++++++++------- src/d_clisrv.h | 7 ++++--- src/d_netcmd.c | 10 ++++++++++ src/d_netcmd.h | 3 +++ src/djgppdos/i_video.c | 3 +++ src/hu_stuff.c | 2 +- src/hu_stuff.h | 2 +- src/m_menu.c | 41 +++++++++++++++++++------------------- src/screen.c | 11 +++++++++++ src/screen.h | 1 + src/sdl/i_video.c | 3 +++ src/win32/win_vid.c | 3 +++ 12 files changed, 99 insertions(+), 32 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 92196219d..5668ab6b3 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -90,6 +90,7 @@ SINT8 nodetoplayer[MAXNETNODES]; SINT8 nodetoplayer2[MAXNETNODES]; // say the numplayer for this node if any (splitscreen) UINT8 playerpernode[MAXNETNODES]; // used specialy for scplitscreen boolean nodeingame[MAXNETNODES]; // set false as nodes leave game +tic_t servermaxping = 800; // server's max ping. Defaults to 800 static tic_t nettics[MAXNETNODES]; // what tic the client have received static tic_t supposedtics[MAXNETNODES]; // nettics prevision for smaller packet static UINT8 nodewaiting[MAXNETNODES]; @@ -4208,10 +4209,12 @@ static void HandlePacketFromPlayer(SINT8 node) //Update client ping table from the server. if (client) { - INT32 i; + UINT8 i; for (i = 0; i < MAXPLAYERS; i++) if (playeringame[i]) playerpingtable[i] = (tic_t)netbuffer->u.pingtable[i]; + + servermaxping = (tic_t)netbuffer->u.pingtable[MAXPLAYERS]; } break; @@ -4733,6 +4736,14 @@ void TryRunTics(tic_t realtics) } } +/* +Ping Update except better: +We call this once per second and check for people's pings. If their ping happens to be too high, we increment some timer and kick them out. +If they're not lagging, decrement the timer by 1. Of course, reset all of this if they leave. +*/ + +static INT32 pingtimeout[MAXPLAYERS]; + static inline void PingUpdate(void) { INT32 i; @@ -4753,6 +4764,8 @@ static inline void PingUpdate(void) laggers[i] = true; numlaggers++; } + else + pingtimeout[i] = 0; } //kick lagging players... unless everyone but the server's ping sucks. @@ -4763,12 +4776,27 @@ static inline void PingUpdate(void) { if (playeringame[i] && laggers[i]) { - char buf[2]; + pingtimeout[i]++; + if (pingtimeout[i] > cv_pingtimeout.value) +// ok your net has been bad for too long, you deserve to die. + { + char buf[2]; - buf[0] = (char)i; - buf[1] = KICK_MSG_PING_HIGH; - SendNetXCmd(XD_KICK, &buf, 2); + pingtimeout[i] = 0; + + buf[0] = (char)i; + buf[1] = KICK_MSG_PING_HIGH; + SendNetXCmd(XD_KICK, &buf, 2); + } } + /* + you aren't lagging, + but you aren't free yet. + In case you'll keep spiking, + we just make the timer go back down. (Very unstable net must still get kicked). + */ + else + pingtimeout[i] = (pingtimeout[i] == 0 ? 0 : pingtimeout[i]-1); } } } @@ -4783,10 +4811,13 @@ static inline void PingUpdate(void) realpingtable[i] = 0; //Reset each as we go. } + // send the server's maxping as last element of our ping table. This is useful to let us know when we're about to get kicked. + netbuffer->u.pingtable[MAXPLAYERS] = cv_maxping.value; + //send out our ping packets for (i = 0; i < MAXNETNODES; i++) if (nodeingame[i]) - HSendPacket(i, true, 0, sizeof(INT32) * MAXPLAYERS); + HSendPacket(i, true, 0, sizeof(INT32) * (MAXPLAYERS+1)); pingmeasurecount = 1; //Reset count } @@ -4816,7 +4847,7 @@ void NetUpdate(void) if (server) { - if (netgame && !(gametime % 255)) + if (netgame && !(gametime % 35)) // update once per second. PingUpdate(); // update node latency values so we can take an average later. for (i = 0; i < MAXPLAYERS; i++) diff --git a/src/d_clisrv.h b/src/d_clisrv.h index d7c210895..b85bbfab6 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -423,9 +423,9 @@ typedef struct serverrefuse_pak serverrefuse; // 65025 bytes (somehow I feel like those values are garbage...) askinfo_pak askinfo; // 61 bytes msaskinfo_pak msaskinfo; // 22 bytes - plrinfo playerinfo[MAXPLAYERS]; // 1152 bytes (I'd say 36~38) - plrconfig playerconfig[MAXPLAYERS]; // (up to) 896 bytes (welp they ARE) - UINT32 pingtable[MAXPLAYERS]; // 128 bytes + plrinfo playerinfo[MAXPLAYERS]; // 576 bytes(?) + plrconfig playerconfig[MAXPLAYERS]; // (up to) 528 bytes(?) + UINT32 pingtable[MAXPLAYERS+1]; // 68 bytes } u; // This is needed to pack diff packet types data together } ATTRPACK doomdata_t; @@ -487,6 +487,7 @@ extern tic_t jointimeout; extern UINT16 pingmeasurecount; extern UINT32 realpingtable[MAXPLAYERS]; extern UINT32 playerpingtable[MAXPLAYERS]; +extern tic_t servermaxping; extern consvar_t cv_joinnextround, cv_allownewplayer, cv_maxplayers, cv_resynchattempts, cv_blamecfail, cv_maxsend, cv_noticedownload, cv_downloadspeed; diff --git a/src/d_netcmd.c b/src/d_netcmd.c index d750c81f2..f52008aa9 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -341,6 +341,14 @@ consvar_t cv_nettimeout = {"nettimeout", "350", CV_CALL|CV_SAVE, nettimeout_cons static CV_PossibleValue_t jointimeout_cons_t[] = {{5*TICRATE, "MIN"}, {60*TICRATE, "MAX"}, {0, NULL}}; consvar_t cv_jointimeout = {"jointimeout", "350", CV_CALL|CV_SAVE, jointimeout_cons_t, JoinTimeout_OnChange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_maxping = {"maxping", "0", CV_SAVE, CV_Unsigned, NULL, 0, NULL, NULL, 0, 0, NULL}; + +static CV_PossibleValue_t pingtimeout_cons_t[] = {{8, "MIN"}, {120, "MAX"}, {0, NULL}}; +consvar_t cv_pingtimeout = {"pingtimeout", "10", CV_SAVE, pingtimeout_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; + +// show your ping on the HUD next to framerate. Defaults to warning only (shows up if your ping is > maxping) +static CV_PossibleValue_t showping_cons_t[] = {{0, "Off"}, {1, "Always"}, {2, "Warning"}, {0, NULL}}; +consvar_t cv_showping = {"showping", "Warning", CV_SAVE, showping_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; + // Intermission time Tails 04-19-2002 static CV_PossibleValue_t inttime_cons_t[] = {{0, "MIN"}, {3600, "MAX"}, {0, NULL}}; consvar_t cv_inttime = {"inttime", "10", CV_NETVAR, inttime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; @@ -577,6 +585,8 @@ void D_RegisterServerCommands(void) CV_RegisterVar(&cv_skipmapcheck); CV_RegisterVar(&cv_sleep); CV_RegisterVar(&cv_maxping); + CV_RegisterVar(&cv_pingtimeout); + CV_RegisterVar(&cv_showping); #ifdef SEENAMES CV_RegisterVar(&cv_allowseenames); diff --git a/src/d_netcmd.h b/src/d_netcmd.h index 4821aff46..b88d8c7bb 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -106,6 +106,9 @@ extern consvar_t cv_ringslinger, cv_soundtest; extern consvar_t cv_specialrings, cv_powerstones, cv_matchboxes, cv_competitionboxes; extern consvar_t cv_maxping; +extern consvar_t cv_pingtimeout; +extern consvar_t cv_showping; + extern consvar_t cv_skipmapcheck; diff --git a/src/djgppdos/i_video.c b/src/djgppdos/i_video.c index 6a7641174..56570b7bf 100644 --- a/src/djgppdos/i_video.c +++ b/src/djgppdos/i_video.c @@ -98,6 +98,9 @@ void I_FinishUpdate (void) if (cv_ticrate.value) SCR_DisplayTicRate(); + if (cv_showping.value && netgame && consoleplayer != serverplayer) + SCR_DisplayLocalPing(); + //blast it to the screen // this code sucks //memcpy(dascreen,screens[0],screenwidth*screenheight); diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 90f4ceedf..d022abd58 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -2322,7 +2322,7 @@ void HU_Erase(void) // // HU_drawPing // -void HU_drawPing(INT32 x, INT32 y, INT32 ping, boolean notext) +void HU_drawPing(INT32 x, INT32 y, UINT32 ping, boolean notext) { UINT8 numbars = 1; // how many ping bars do we draw? UINT8 barcolor = 35; // color we use for the bars (green, yellow or red) diff --git a/src/hu_stuff.h b/src/hu_stuff.h index 55b61d4b7..0860abb48 100644 --- a/src/hu_stuff.h +++ b/src/hu_stuff.h @@ -113,7 +113,7 @@ void HU_Drawer(void); char HU_dequeueChatChar(void); void HU_Erase(void); void HU_clearChatChars(void); -void HU_drawPing(INT32 x, INT32 y, INT32 ping, boolean notext); // Lat': Ping drawer for scoreboard. +void HU_drawPing(INT32 x, INT32 y, UINT32 ping, boolean notext); // Lat': Ping drawer for scoreboard. void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 whiteplayer); void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer); void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 whiteplayer); diff --git a/src/m_menu.c b/src/m_menu.c index 47ca7ccd4..13f21cd95 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1224,32 +1224,33 @@ static menuitem_t OP_VideoOptionsMenu[] = NULL, "HUD Transparency", &cv_translucenthud, 66}, {IT_STRING | IT_CVAR, NULL, "Score/Time/Rings", &cv_timetic, 71}, {IT_STRING | IT_CVAR, NULL, "Show Powerups", &cv_powerupdisplay, 76}, + {IT_STRING | IT_CVAR, NULL, "Local ping display", &cv_showping, 81}, // shows ping next to framerate if we want to. #ifdef SEENAMES - {IT_STRING | IT_CVAR, NULL, "Show player names", &cv_seenames, 81}, + {IT_STRING | IT_CVAR, NULL, "Show player names", &cv_seenames, 86}, #endif - {IT_HEADER, NULL, "Console", NULL, 90}, - {IT_STRING | IT_CVAR, NULL, "Background color", &cons_backcolor, 96}, - {IT_STRING | IT_CVAR, NULL, "Text Size", &cv_constextsize, 101}, + {IT_HEADER, NULL, "Console", NULL, 95}, + {IT_STRING | IT_CVAR, NULL, "Background color", &cons_backcolor, 101}, + {IT_STRING | IT_CVAR, NULL, "Text Size", &cv_constextsize, 106}, - {IT_HEADER, NULL, "Chat", NULL, 110}, - {IT_STRING | IT_CVAR, NULL, "Chat Mode", &cv_consolechat, 116}, - {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Chat Box Width", &cv_chatwidth, 121}, - {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Chat Box Height", &cv_chatheight, 126}, - {IT_STRING | IT_CVAR, NULL, "Message Fadeout Time", &cv_chattime, 131}, - {IT_STRING | IT_CVAR, NULL, "Chat Notifications", &cv_chatnotifications, 136}, - {IT_STRING | IT_CVAR, NULL, "Spam Protection", &cv_chatspamprotection, 141}, - {IT_STRING | IT_CVAR, NULL, "Chat background tint", &cv_chatbacktint, 146}, + {IT_HEADER, NULL, "Chat", NULL, 115}, + {IT_STRING | IT_CVAR, NULL, "Chat Mode", &cv_consolechat, 121}, + {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Chat Box Width", &cv_chatwidth, 126}, + {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Chat Box Height", &cv_chatheight, 131}, + {IT_STRING | IT_CVAR, NULL, "Message Fadeout Time", &cv_chattime, 136}, + {IT_STRING | IT_CVAR, NULL, "Chat Notifications", &cv_chatnotifications, 141}, + {IT_STRING | IT_CVAR, NULL, "Spam Protection", &cv_chatspamprotection, 146}, + {IT_STRING | IT_CVAR, NULL, "Chat background tint", &cv_chatbacktint, 151}, - {IT_HEADER, NULL, "Level", NULL, 155}, - {IT_STRING | IT_CVAR, NULL, "Draw Distance", &cv_drawdist, 161}, - {IT_STRING | IT_CVAR, NULL, "Weather Draw Dist.", &cv_drawdist_precip, 166}, - {IT_STRING | IT_CVAR, NULL, "NiGHTS Hoop Draw Dist.", &cv_drawdist_nights, 171}, + {IT_HEADER, NULL, "Level", NULL, 160}, + {IT_STRING | IT_CVAR, NULL, "Draw Distance", &cv_drawdist, 166}, + {IT_STRING | IT_CVAR, NULL, "Weather Draw Dist.", &cv_drawdist_precip, 171}, + {IT_STRING | IT_CVAR, NULL, "NiGHTS Hoop Draw Dist.", &cv_drawdist_nights, 176}, - {IT_HEADER, NULL, "Diagnostic", NULL, 180}, - {IT_STRING | IT_CVAR, NULL, "Show FPS", &cv_ticrate, 186}, - {IT_STRING | IT_CVAR, NULL, "Clear Before Redraw", &cv_homremoval, 191}, - {IT_STRING | IT_CVAR, NULL, "Show \"FOCUS LOST\"", &cv_showfocuslost, 196}, + {IT_HEADER, NULL, "Diagnostic", NULL, 184}, + {IT_STRING | IT_CVAR, NULL, "Show FPS", &cv_ticrate, 190}, + {IT_STRING | IT_CVAR, NULL, "Clear Before Redraw", &cv_homremoval, 195}, + {IT_STRING | IT_CVAR, NULL, "Show \"FOCUS LOST\"", &cv_showfocuslost, 200}, }; static menuitem_t OP_VideoModeMenu[] = diff --git a/src/screen.c b/src/screen.c index f1d91de66..659532303 100644 --- a/src/screen.c +++ b/src/screen.c @@ -428,6 +428,17 @@ void SCR_DisplayTicRate(void) lasttic = ontic; } +void SCR_DisplayLocalPing(void) +{ + UINT32 ping = playerpingtable[consoleplayer]; // consoleplayer's ping is everyone's ping in a splitnetgame :P + if (cv_showping.value == 1 || (cv_showping.value == 2 && servermaxping && ping > servermaxping)) // only show 2 (warning) if our ping is at a bad level + { + INT32 dispy = cv_ticrate.value ? 181 : 190; + HU_drawPing(307, dispy, ping, true); + } +} + + void SCR_ClosedCaptions(void) { UINT8 i; diff --git a/src/screen.h b/src/screen.h index 79f21e8e4..6f03612c4 100644 --- a/src/screen.h +++ b/src/screen.h @@ -167,5 +167,6 @@ FUNCMATH boolean SCR_IsAspectCorrect(INT32 width, INT32 height); // move out to main code for consistency void SCR_DisplayTicRate(void); void SCR_ClosedCaptions(void); +void SCR_DisplayLocalPing(void); #undef DNWH #endif //__SCREEN_H__ diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index fb0f4b2ba..f22c79eca 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -1180,6 +1180,9 @@ void I_FinishUpdate(void) { if (cv_ticrate.value) SCR_DisplayTicRate(); + + if (cv_showping.value && netgame && consoleplayer != serverplayer) + SCR_DisplayLocalPing(); } if (rendermode == render_soft && screens[0]) diff --git a/src/win32/win_vid.c b/src/win32/win_vid.c index 11c7a6744..39a60cd93 100644 --- a/src/win32/win_vid.c +++ b/src/win32/win_vid.c @@ -371,6 +371,9 @@ void I_FinishUpdate(void) if (cv_ticrate.value) SCR_DisplayTicRate(); + if (cv_showping.value && netgame && consoleplayer != serverplayer) + SCR_DisplayLocalPing(); + // if (bDIBMode) { From b4987636fedb68476ca8eb9a2fc36086b2d35411 Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Mon, 18 Nov 2019 03:27:39 +0100 Subject: [PATCH 044/189] Add missing checks for PF_FINISHED in HUD code --- src/st_stuff.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/st_stuff.c b/src/st_stuff.c index 3fbee27e4..0a79da12c 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -2106,7 +2106,7 @@ static void ST_drawTextHUD(void) textHUDdraw(M_GetText("\x82""FIRE:""\x80 Enter game")) } - if (gametype == GT_COOP && (!stplyr->spectator || (!(maptol & TOL_NIGHTS) && G_IsSpecialStage(gamemap))) && stplyr->exiting) + if (gametype == GT_COOP && (!stplyr->spectator || (!(maptol & TOL_NIGHTS) && G_IsSpecialStage(gamemap))) && (stplyr->exiting || (stplyr->pflags & PF_FINISHED))) { UINT8 numneeded = (G_IsSpecialStage(gamemap) ? 4 : cv_playersforexit.value); if (numneeded) @@ -2121,7 +2121,7 @@ static void ST_drawTextHUD(void) continue; total++; - if (players[i].exiting) + if (players[i].exiting || (players[i].pflags & PF_FINISHED)) exiting++; } From ac7d07c9da1c6d556f5cfc63f70b32d2484eab9c Mon Sep 17 00:00:00 2001 From: lachwright Date: Mon, 18 Nov 2019 10:35:56 +0800 Subject: [PATCH 045/189] Prevent mines from sliding upon touching the ground --- src/dehacked.c | 15 ++++++++------- src/info.c | 33 +++++++++++++++++---------------- src/info.h | 15 ++++++++------- 3 files changed, 33 insertions(+), 30 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 5e29c8def..9a96945c5 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -5055,13 +5055,14 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_DRAGONTAIL_EMPTYLOOP", "S_DRAGONTAIL_RELOAD", "S_DRAGONMINE", - "S_DRAGONMINE_LAND", - "S_DRAGONMINE_GROUND1", - "S_DRAGONMINE_FLASH1", - "S_DRAGONMINE_LOOP1", - "S_DRAGONMINE_GROUND2", - "S_DRAGONMINE_FLASH2", - "S_DRAGONMINE_LOOP2", + "S_DRAGONMINE_LAND1", + "S_DRAGONMINE_LAND2", + "S_DRAGONMINE_SLOWFLASH1", + "S_DRAGONMINE_SLOWFLASH2", + "S_DRAGONMINE_SLOWLOOP", + "S_DRAGONMINE_FASTFLASH1", + "S_DRAGONMINE_FASTFLASH2", + "S_DRAGONMINE_FASTLOOP", // Boss Explosion "S_BOSSEXPLODE", diff --git a/src/info.c b/src/info.c index 52b04f4a0..6124dc14e 100644 --- a/src/info.c +++ b/src/info.c @@ -1165,23 +1165,24 @@ state_t states[NUMSTATES] = {SPR_PTER, 0, 1, {NULL}, 0, 0, S_PTERABYTE_SWOOPUP}, // S_PTERABYTE_SWOOPUP // Dragonbomber - {SPR_DRAB, 0, -1, {A_DragonbomberSpawn}, 6, 0, S_NULL}, // S_DRAGONBOMBER - {SPR_DRAB, FF_PAPERSPRITE|7, 1, {A_DragonWing}, 0, 0, S_DRAGONWING2}, // S_DRAGONWING1 - {SPR_DRAB, FF_PAPERSPRITE|8, 1, {A_DragonWing}, 0, 0, S_DRAGONWING3}, // S_DRAGONWING2 - {SPR_DRAB, FF_PAPERSPRITE|9, 1, {A_DragonWing}, 0, 0, S_DRAGONWING4}, // S_DRAGONWING3 - {SPR_DRAB, FF_PAPERSPRITE|10, 1, {A_DragonWing}, 0, 0, S_DRAGONWING1}, // S_DRAGONWING4 - {SPR_DRAB, 1, 1, {A_DragonSegment}, 0, 0, S_DRAGONTAIL_LOADED}, // S_DRAGONTAIL_LOADED - {SPR_DRAB, 2, 1, {A_DragonSegment}, 0, 0, S_DRAGONTAIL_EMPTYLOOP}, // S_DRAGONTAIL_EMPTY + {SPR_DRAB, 0, -1, {A_DragonbomberSpawn}, 6, 0, S_NULL}, // S_DRAGONBOMBER + {SPR_DRAB, FF_PAPERSPRITE|7, 1, {A_DragonWing}, 0, 0, S_DRAGONWING2}, // S_DRAGONWING1 + {SPR_DRAB, FF_PAPERSPRITE|8, 1, {A_DragonWing}, 0, 0, S_DRAGONWING3}, // S_DRAGONWING2 + {SPR_DRAB, FF_PAPERSPRITE|9, 1, {A_DragonWing}, 0, 0, S_DRAGONWING4}, // S_DRAGONWING3 + {SPR_DRAB, FF_PAPERSPRITE|10, 1, {A_DragonWing}, 0, 0, S_DRAGONWING1}, // S_DRAGONWING4 + {SPR_DRAB, 1, 1, {A_DragonSegment}, 0, 0, S_DRAGONTAIL_LOADED}, // S_DRAGONTAIL_LOADED + {SPR_DRAB, 2, 1, {A_DragonSegment}, 0, 0, S_DRAGONTAIL_EMPTYLOOP}, // S_DRAGONTAIL_EMPTY {SPR_DRAB, 2, 0, {A_Repeat}, 3*TICRATE, S_DRAGONTAIL_EMPTY, S_DRAGONTAIL_RELOAD}, // S_DRAGONTAIL_EMPTYLOOP - {SPR_DRAB, 1, 0, {A_PlayActiveSound}, 0, 0, S_DRAGONTAIL_LOADED}, // S_DRAGONTAIL_RELOAD - {SPR_DRAB, 3, 1, {A_MinusCheck}, S_DRAGONMINE_LAND, 0, S_DRAGONMINE}, // S_DRAGONMINE - {SPR_DRAB, 4, 2, {A_PlayActiveSound}, 0, 0, S_DRAGONMINE_GROUND1}, // S_DRAGONMINE_LAND - {SPR_DRAB, 5, 11, {NULL}, 0, 0, S_DRAGONMINE_FLASH1}, // S_DRAGONMINE_GROUND1 - {SPR_DRAB, FF_FULLBRIGHT|6, 1, {A_PlayAttackSound}, 0, 0, S_DRAGONMINE_LOOP1}, // S_DRAGONMINE_FLASH1 - {SPR_DRAB, 5, 0, {A_Repeat}, 4, S_DRAGONMINE_GROUND1, S_DRAGONMINE_GROUND2}, // S_DRAGONMINE_LOOP1 - {SPR_DRAB, 5, 3, {NULL}, 0, 0, S_DRAGONMINE_FLASH2}, // S_DRAGONMINE_GROUND2 - {SPR_DRAB, FF_FULLBRIGHT|6, 1, {A_PlayAttackSound}, 0, 0, S_DRAGONMINE_LOOP2}, // S_DRAGONMINE_FLASH2 - {SPR_DRAB, 5, 0, {A_Repeat}, 5, S_DRAGONMINE_GROUND2, S_DEATHSTATE}, // S_DRAGONMINE_LOOP2 + {SPR_DRAB, 1, 0, {A_PlayActiveSound}, 0, 0, S_DRAGONTAIL_LOADED}, // S_DRAGONTAIL_RELOAD + {SPR_DRAB, 3, 1, {A_MinusCheck}, S_DRAGONMINE_LAND1, 0, S_DRAGONMINE}, // S_DRAGONMINE + {SPR_DRAB, 4, 0, {A_PlayActiveSound}, 0, 0, S_DRAGONMINE_LAND2}, // S_DRAGONMINE_LAND1 + {SPR_DRAB, 4, 2, {A_Thrust}, 0, 1, S_DRAGONMINE_SLOWFLASH1}, // S_DRAGONMINE_LAND2 + {SPR_DRAB, 5, 11, {NULL}, 0, 0, S_DRAGONMINE_SLOWFLASH2}, // S_DRAGONMINE_SLOWFLASH1 + {SPR_DRAB, FF_FULLBRIGHT|6, 1, {A_PlayAttackSound}, 0, 0, S_DRAGONMINE_SLOWLOOP}, // S_DRAGONMINE_SLOWFLASH2 + {SPR_DRAB, 5, 0, {A_Repeat}, 4, S_DRAGONMINE_SLOWFLASH1, S_DRAGONMINE_FASTFLASH1}, // S_DRAGONMINE_SLOWLOOP + {SPR_DRAB, 5, 3, {NULL}, 0, 0, S_DRAGONMINE_FASTFLASH2}, // S_DRAGONMINE_FASTFLASH1 + {SPR_DRAB, FF_FULLBRIGHT|6, 1, {A_PlayAttackSound}, 0, 0, S_DRAGONMINE_FASTLOOP}, // S_DRAGONMINE_FASTFLASH2 + {SPR_DRAB, 5, 0, {A_Repeat}, 5, S_DRAGONMINE_FASTFLASH1, S_DEATHSTATE}, // S_DRAGONMINE_FASTLOOP // Boss Explosion {SPR_BOM2, FF_FULLBRIGHT|FF_ANIMATE, (5*7), {NULL}, 6, 5, S_NULL}, // S_BOSSEXPLODE diff --git a/src/info.h b/src/info.h index 7838b4f71..03494dd62 100644 --- a/src/info.h +++ b/src/info.h @@ -1370,13 +1370,14 @@ typedef enum state S_DRAGONTAIL_EMPTYLOOP, S_DRAGONTAIL_RELOAD, S_DRAGONMINE, - S_DRAGONMINE_LAND, - S_DRAGONMINE_GROUND1, - S_DRAGONMINE_FLASH1, - S_DRAGONMINE_LOOP1, - S_DRAGONMINE_GROUND2, - S_DRAGONMINE_FLASH2, - S_DRAGONMINE_LOOP2, + S_DRAGONMINE_LAND1, + S_DRAGONMINE_LAND2, + S_DRAGONMINE_SLOWFLASH1, + S_DRAGONMINE_SLOWFLASH2, + S_DRAGONMINE_SLOWLOOP, + S_DRAGONMINE_FASTFLASH1, + S_DRAGONMINE_FASTFLASH2, + S_DRAGONMINE_FASTLOOP, // Boss Explosion S_BOSSEXPLODE, From 22421b10315ba95b70a4d5c0de473e4ba9dddf42 Mon Sep 17 00:00:00 2001 From: James R Date: Sun, 17 Nov 2019 18:52:05 -0800 Subject: [PATCH 046/189] Snapping for showping, so it doesn't jump way up on non-green --- src/hu_stuff.c | 21 +++++++++++---------- src/hu_stuff.h | 2 +- src/screen.c | 2 +- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index d022abd58..9a703c656 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -2322,13 +2322,14 @@ void HU_Erase(void) // // HU_drawPing // -void HU_drawPing(INT32 x, INT32 y, UINT32 ping, boolean notext) +void HU_drawPing(INT32 x, INT32 y, UINT32 ping, boolean notext, INT32 flags) { UINT8 numbars = 1; // how many ping bars do we draw? UINT8 barcolor = 35; // color we use for the bars (green, yellow or red) SINT8 i = 0; SINT8 yoffset = 6; - INT32 dx = x+1 - (V_SmallStringWidth(va("%dms", ping), V_ALLOWLOWERCASE)/2); + INT32 dx = x+1 - (V_SmallStringWidth(va("%dms", ping), + V_ALLOWLOWERCASE|flags)/2); if (ping < 128) { @@ -2342,13 +2343,13 @@ void HU_drawPing(INT32 x, INT32 y, UINT32 ping, boolean notext) } if (!notext || vid.width >= 640) // how sad, we're using a shit resolution. - V_DrawSmallString(dx, y+4, V_ALLOWLOWERCASE, va("%dms", ping)); + V_DrawSmallString(dx, y+4, V_ALLOWLOWERCASE|flags, va("%dms", ping)); for (i=0; (i<3); i++) // Draw the ping bar { - V_DrawFill(x+2 *(i-1), y+yoffset-4, 2, 8-yoffset, 31); + V_DrawFill(x+2 *(i-1), y+yoffset-4, 2, 8-yoffset, 31|flags); if (i < numbars) - V_DrawFill(x+2 *(i-1), y+yoffset-3, 1, 8-yoffset-1, barcolor); + V_DrawFill(x+2 *(i-1), y+yoffset-3, 1, 8-yoffset-1, barcolor|flags); yoffset -= 2; } @@ -2379,7 +2380,7 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I if (!splitscreen) // don't draw it on splitscreen, { if (!(tab[i].num == serverplayer)) - HU_drawPing(x+ 253, y+2, playerpingtable[tab[i].num], false); + HU_drawPing(x+ 253, y+2, playerpingtable[tab[i].num], false, 0); //else // V_DrawSmallString(x+ 246, y+4, V_YELLOWMAP, "SERVER"); } @@ -2578,7 +2579,7 @@ static void HU_Draw32TeamTabRankings(playersort_t *tab, INT32 whiteplayer) if (!splitscreen) { if (!(tab[i].num == serverplayer)) - HU_drawPing(x+ 135, y+3, playerpingtable[tab[i].num], true); + HU_drawPing(x+ 135, y+3, playerpingtable[tab[i].num], true, 0); //else //V_DrawSmallString(x+ 129, y+4, V_YELLOWMAP, "HOST"); } @@ -2702,7 +2703,7 @@ void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer) if (!splitscreen) { if (!(tab[i].num == serverplayer)) - HU_drawPing(x+ 113, y+2, playerpingtable[tab[i].num], false); + HU_drawPing(x+ 113, y+2, playerpingtable[tab[i].num], false, 0); //else // V_DrawSmallString(x+ 94, y+4, V_YELLOWMAP, "SERVER"); } @@ -2733,7 +2734,7 @@ void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scoreline strlcpy(name, tab[i].name, 7); if (!(tab[i].num == serverplayer)) - HU_drawPing(x+ 113, y+2, playerpingtable[tab[i].num], false); + HU_drawPing(x+ 113, y+2, playerpingtable[tab[i].num], false, 0); //else // V_DrawSmallString(x+ 94, y+4, V_YELLOWMAP, "SERVER"); @@ -2841,7 +2842,7 @@ static void HU_Draw32TabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scor if (!splitscreen) // don't draw it on splitscreen, { if (!(tab[i].num == serverplayer)) - HU_drawPing(x+ 135, y+3, playerpingtable[tab[i].num], true); + HU_drawPing(x+ 135, y+3, playerpingtable[tab[i].num], true, 0); //else // V_DrawSmallString(x+ 129, y+4, V_YELLOWMAP, "HOST"); } diff --git a/src/hu_stuff.h b/src/hu_stuff.h index 0860abb48..79d8e1e61 100644 --- a/src/hu_stuff.h +++ b/src/hu_stuff.h @@ -113,7 +113,7 @@ void HU_Drawer(void); char HU_dequeueChatChar(void); void HU_Erase(void); void HU_clearChatChars(void); -void HU_drawPing(INT32 x, INT32 y, UINT32 ping, boolean notext); // Lat': Ping drawer for scoreboard. +void HU_drawPing(INT32 x, INT32 y, UINT32 ping, boolean notext, INT32 flags); // Lat': Ping drawer for scoreboard. void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 whiteplayer); void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer); void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 whiteplayer); diff --git a/src/screen.c b/src/screen.c index 659532303..1a08caacf 100644 --- a/src/screen.c +++ b/src/screen.c @@ -434,7 +434,7 @@ void SCR_DisplayLocalPing(void) if (cv_showping.value == 1 || (cv_showping.value == 2 && servermaxping && ping > servermaxping)) // only show 2 (warning) if our ping is at a bad level { INT32 dispy = cv_ticrate.value ? 181 : 190; - HU_drawPing(307, dispy, ping, true); + HU_drawPing(307, dispy, ping, true, V_SNAPTORIGHT | V_SNAPTOBOTTOM); } } From b05dec5294d71e515bacd434f8de7f92f7f6b7a0 Mon Sep 17 00:00:00 2001 From: James R Date: Sun, 17 Nov 2019 18:53:17 -0800 Subject: [PATCH 047/189] Shift ping display in scores HUD up, so it aligns with the bottom of player name --- src/hu_stuff.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 9a703c656..86378dfd3 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -2380,7 +2380,7 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I if (!splitscreen) // don't draw it on splitscreen, { if (!(tab[i].num == serverplayer)) - HU_drawPing(x+ 253, y+2, playerpingtable[tab[i].num], false, 0); + HU_drawPing(x+ 253, y, playerpingtable[tab[i].num], false, 0); //else // V_DrawSmallString(x+ 246, y+4, V_YELLOWMAP, "SERVER"); } @@ -2579,7 +2579,7 @@ static void HU_Draw32TeamTabRankings(playersort_t *tab, INT32 whiteplayer) if (!splitscreen) { if (!(tab[i].num == serverplayer)) - HU_drawPing(x+ 135, y+3, playerpingtable[tab[i].num], true, 0); + HU_drawPing(x+ 135, y+1, playerpingtable[tab[i].num], true, 0); //else //V_DrawSmallString(x+ 129, y+4, V_YELLOWMAP, "HOST"); } @@ -2703,7 +2703,7 @@ void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer) if (!splitscreen) { if (!(tab[i].num == serverplayer)) - HU_drawPing(x+ 113, y+2, playerpingtable[tab[i].num], false, 0); + HU_drawPing(x+ 113, y, playerpingtable[tab[i].num], false, 0); //else // V_DrawSmallString(x+ 94, y+4, V_YELLOWMAP, "SERVER"); } @@ -2734,7 +2734,7 @@ void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scoreline strlcpy(name, tab[i].name, 7); if (!(tab[i].num == serverplayer)) - HU_drawPing(x+ 113, y+2, playerpingtable[tab[i].num], false, 0); + HU_drawPing(x+ 113, y, playerpingtable[tab[i].num], false, 0); //else // V_DrawSmallString(x+ 94, y+4, V_YELLOWMAP, "SERVER"); @@ -2842,7 +2842,7 @@ static void HU_Draw32TabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scor if (!splitscreen) // don't draw it on splitscreen, { if (!(tab[i].num == serverplayer)) - HU_drawPing(x+ 135, y+3, playerpingtable[tab[i].num], true, 0); + HU_drawPing(x+ 135, y+1, playerpingtable[tab[i].num], true, 0); //else // V_DrawSmallString(x+ 129, y+4, V_YELLOWMAP, "HOST"); } From 4439d29ed79bac91122caa71fc5e35c175785fce Mon Sep 17 00:00:00 2001 From: James R Date: Sun, 17 Nov 2019 18:53:48 -0800 Subject: [PATCH 048/189] Shift showping display up a bit --- src/screen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/screen.c b/src/screen.c index 1a08caacf..a1f6b7f55 100644 --- a/src/screen.c +++ b/src/screen.c @@ -433,7 +433,7 @@ void SCR_DisplayLocalPing(void) UINT32 ping = playerpingtable[consoleplayer]; // consoleplayer's ping is everyone's ping in a splitnetgame :P if (cv_showping.value == 1 || (cv_showping.value == 2 && servermaxping && ping > servermaxping)) // only show 2 (warning) if our ping is at a bad level { - INT32 dispy = cv_ticrate.value ? 181 : 190; + INT32 dispy = cv_ticrate.value ? 180 : 189; HU_drawPing(307, dispy, ping, true, V_SNAPTORIGHT | V_SNAPTOBOTTOM); } } From bf4dbead748acbc66b4abefa5891f31419314f31 Mon Sep 17 00:00:00 2001 From: lachwright Date: Mon, 18 Nov 2019 11:22:27 +0800 Subject: [PATCH 049/189] Update to latest script version --- src/b_bot.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/b_bot.c b/src/b_bot.c index e4c3a2110..fd70f88c2 100644 --- a/src/b_bot.c +++ b/src/b_bot.c @@ -153,7 +153,7 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm thinkfly = true; else thinkfly = false; - + // Ready for takeoff if (flymode == 1) { @@ -180,7 +180,7 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm player->pflags &= ~PF_JUMPED; } } - // Read player inputs + // Read player inputs while carrying else if (flymode == 2) { cmd->forwardmove = pcmd->forwardmove; @@ -203,10 +203,10 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm } } } - + if (flymode && P_IsObjectOnGround(tails) && !(pcmd->buttons & BT_JUMP)) flymode = 0; - + // ******** // SPINNING if (panic || flymode || !(player->pflags & PF_SPINNING) || (player->pflags & PF_JUMPED)) @@ -234,7 +234,7 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm spinmode = true; } else - spinmode = 0; + spinmode = false; } // Spin else if (player->dashspeed == bot->dashspeed && player->pflags & PF_SPINNING) @@ -253,14 +253,15 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm // 2D mode else { - if ((player->dashspeed && !bmom) || (player->dashspeed == bot->dashspeed && player->pflags & PF_SPINNING)) + if (((player->dashspeed && !bmom) || (player->dashspeed == bot->dashspeed && (player->pflags & PF_SPINNING))) + && ((bot->pflags & PF_SPINNING) || !spin_last)) { spin = true; spinmode = true; } } } - + // ******** // FOLLOW if (!(flymode || spinmode)) @@ -288,7 +289,7 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm { // Copy inputs cmd->angleturn = (sonic->angle - tails->angle) >> FRACBITS; - bot->drawangle = player->drawangle; + bot->drawangle = ang; cmd->forwardmove = 8 * pcmd->forwardmove / 10; cmd->sidemove = 8 * pcmd->sidemove / 10; } @@ -301,21 +302,22 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm // Flying catch-up if (bot->pflags & PF_THOKKED) { - cmd->forwardmove = min(50, dist/scale/8); + cmd->forwardmove = min(MAXPLMOVE, (dist/scale)>>3); if (zdist < -64*scale) spin = true; else if (zdist > 0 && !jump_last) jump = true; } - + // Just landed if (tails->eflags & MFE_JUSTHITFLOOR) jump = false; // Start jump - else if (!jump_last && !(bot->pflags & PF_JUMPED) && !(player->pflags & PF_SPINNING) + else if (!jump_last && !(bot->pflags & PF_JUMPED) //&& !(player->pflags & PF_SPINNING) && ((zdist > 32*scale && player->pflags & PF_JUMPED) // Following || (zdist > 64*scale && panic) // Vertical catch-up - || (bmom < scale>>3 && dist > followthres && !(bot->powers[pw_carry])) // Stopped & not in carry state + || (stalled && anxiety > 20 && bot->powers[pw_carry] == CR_NONE) + //|| (bmom < scale>>3 && dist > followthres && !(bot->powers[pw_carry])) // Stopped & not in carry state || (bot->pflags & PF_SPINNING && !(bot->pflags & PF_JUMPED)))) // Spinning jump = true; // Hold jump @@ -325,12 +327,12 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm else if (bot->pflags & PF_JUMPED && panic && !jump_last) jump = true; } - + // ******** // HISTORY jump_last = jump; spin_last = spin; - + // ******** // Thinkfly overlay // doing this later :P From 52a24e0bc42a157e049dbb0e6dc453f6576cdc9c Mon Sep 17 00:00:00 2001 From: lachwright Date: Mon, 18 Nov 2019 13:30:07 +0800 Subject: [PATCH 050/189] Allow AI Tails to carry the player --- src/b_bot.c | 38 ++++++++++++++++++++------------------ src/p_map.c | 3 --- src/p_user.c | 7 +++++-- 3 files changed, 25 insertions(+), 23 deletions(-) diff --git a/src/b_bot.c b/src/b_bot.c index fd70f88c2..e1c3cf387 100644 --- a/src/b_bot.c +++ b/src/b_bot.c @@ -33,6 +33,17 @@ static boolean spinmode = false; static boolean thinkfly = false; static mobj_t *overlay; +static inline void B_ResetAI() +{ + jump_last = false; + spin_last = false; + anxiety = 0; + panic = false; + flymode = 0; + spinmode = false; + thinkfly = false; +} + static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cmd) { boolean forward=false, backward=false, left=false, right=false, jump=false, spin=false; @@ -135,11 +146,9 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm if (!jump_last) { jump = true; - if (bot->pflags & PF_JUMPED) - { - flymode = 1; - thinkfly = false; - } + flymode = 1; + thinkfly = false; + bot->pflags |= PF_CANCARRY; } } @@ -168,14 +177,8 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm flymode = 0; // Set carried state - if (bot->pflags & PF_THOKKED && flymode == 1 - && !P_IsObjectOnGround(sonic) - && dist < touchdist - && zdist < 32*scale - && flip * sonic->momz < 0) + if (player->powers[pw_carry] == CR_PLAYER && sonic->tracer == tails) { - P_SetTarget(&sonic->tracer, tails); - player->powers[pw_carry] = CR_PLAYER; flymode = 2; player->pflags &= ~PF_JUMPED; } @@ -193,12 +196,9 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm else if (!jump_last) jump = true; // End flymode - if (player->pflags & PF_JUMPED - || player->powers[pw_carry] != CR_PLAYER + if (player->powers[pw_carry] != CR_PLAYER || P_IsObjectOnGround(sonic)) { - player->powers[pw_carry] = CR_NONE; - P_SetTarget(&sonic->tracer, NULL); flymode = 0; } } @@ -379,7 +379,7 @@ void B_BuildTiccmd(player_t *player, ticcmd_t *cmd) void B_KeysToTiccmd(mobj_t *mo, ticcmd_t *cmd, boolean forward, boolean backward, boolean left, boolean right, boolean strafeleft, boolean straferight, boolean jump, boolean spin) { // don't try to do stuff if your sonic is in a minecart or something - if (players[consoleplayer].powers[pw_carry]) + if (players[consoleplayer].powers[pw_carry] && players[consoleplayer].powers[pw_carry] != CR_PLAYER) return; // Turn the virtual keypresses into ticcmd_t. if (twodlevel || mo->flags2 & MF2_TWOD) { @@ -462,7 +462,7 @@ boolean B_CheckRespawn(player_t *player) // If he's doing any of these things, he probably doesn't want to see us. if (sonic->player->pflags & (PF_GLIDING|PF_SLIDING|PF_BOUNCING) || (sonic->player->panim != PA_IDLE && sonic->player->panim != PA_WALK) - || (sonic->player->powers[pw_carry])) + || (sonic->player->powers[pw_carry] && sonic->player->powers[pw_carry] != CR_PLAYER)) return false; // Low ceiling, do not want! @@ -497,6 +497,8 @@ void B_RespawnBot(INT32 playernum) if (!sonic || sonic->health <= 0) return; + B_ResetAI(); + player->bot = 1; P_SpawnPlayer(playernum); tails = player->mo; diff --git a/src/p_map.c b/src/p_map.c index bb56a50b1..29ad6bcbc 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -592,9 +592,6 @@ static void P_DoTailsCarry(player_t *sonic, player_t *tails) if (!(tails->pflags & PF_CANCARRY)) return; - if (tails->bot == 1) - return; - if ((sonic->mo->eflags & MFE_VERTICALFLIP) != (tails->mo->eflags & MFE_VERTICALFLIP)) return; // Both should be in same gravity diff --git a/src/p_user.c b/src/p_user.c index 3c481e7e2..6b4de4598 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -5295,7 +5295,10 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd) player->powers[pw_tailsfly] = tailsflytics + 1; // Set the fly timer player->pflags &= ~(PF_JUMPED|PF_NOJUMPDAMAGE|PF_SPINNING|PF_STARTDASH); - player->pflags |= (PF_THOKKED|PF_CANCARRY); + if (player->bot == 1) + player->pflags |= PF_THOKKED; + else + player->pflags |= (PF_THOKKED|PF_CANCARRY); } break; case CA_GLIDEANDCLIMB: @@ -12276,7 +12279,7 @@ void P_PlayerAfterThink(player_t *player) player->mo->momz = tails->momz; } - if (gametype == GT_COOP) + if (gametype == GT_COOP && (!tails->player || tails->player->bot != 1)) { player->mo->angle = tails->angle; From 70051bd794e96b882ef5a23a2656321da9bce0eb Mon Sep 17 00:00:00 2001 From: lachwright Date: Mon, 18 Nov 2019 13:37:09 +0800 Subject: [PATCH 051/189] Don't let the bot decide to fly if it doesn't have the ability to fly --- src/b_bot.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/b_bot.c b/src/b_bot.c index e1c3cf387..ce7807321 100644 --- a/src/b_bot.c +++ b/src/b_bot.c @@ -158,7 +158,8 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm && (dist < touchdist) && !(pcmd->forwardmove || pcmd->sidemove || player->dashspeed) && P_IsObjectOnGround(sonic) && P_IsObjectOnGround(tails) - && !(player->pflags & PF_STASIS)) + && !(player->pflags & PF_STASIS) + && bot->charability == CA_FLY) thinkfly = true; else thinkfly = false; @@ -324,7 +325,7 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm else if (bot->pflags & PF_JUMPED && jump_last && tails->momz*flip > 0 && (zdist > 0 || panic)) jump = true; // Start flying - else if (bot->pflags & PF_JUMPED && panic && !jump_last) + else if (bot->pflags & PF_JUMPED && panic && !jump_last && bot->charability == CA_FLY) jump = true; } From bb67b24143da5b9d4fd050ecb8f3cfba2abf39a6 Mon Sep 17 00:00:00 2001 From: lachwright Date: Mon, 18 Nov 2019 15:17:27 +0800 Subject: [PATCH 052/189] Add flight indicator --- src/b_bot.c | 15 ++++++++++++++- src/dehacked.c | 2 ++ src/hardware/hw_light.c | 1 + src/info.c | 4 ++++ src/info.h | 3 +++ 5 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/b_bot.c b/src/b_bot.c index ce7807321..d3fc25aa6 100644 --- a/src/b_bot.c +++ b/src/b_bot.c @@ -336,7 +336,20 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm // ******** // Thinkfly overlay - // doing this later :P + if (thinkfly) + { + if (overlay == NULL) + { + overlay = P_SpawnMobjFromMobj(tails, 0, 0, 0, MT_OVERLAY); + P_SetTarget(&overlay->target, tails); + P_SetMobjState(overlay, S_FLIGHTINDICATOR); + } + } + else if (overlay != NULL) + { + P_RemoveMobj(overlay); + overlay = NULL; + } // Turn the virtual keypresses into ticcmd_t. B_KeysToTiccmd(tails, cmd, forward, backward, left, right, false, false, jump, spin); diff --git a/src/dehacked.c b/src/dehacked.c index fff9dbee8..cce596289 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -7139,6 +7139,8 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_FOUR2", "S_FIVE2", + "S_FLIGHTINDICATOR", + "S_LOCKON1", "S_LOCKON2", "S_LOCKON3", diff --git a/src/hardware/hw_light.c b/src/hardware/hw_light.c index 491cb739f..09545f28f 100644 --- a/src/hardware/hw_light.c +++ b/src/hardware/hw_light.c @@ -505,6 +505,7 @@ light_t *t_lspr[NUMSPRITES] = // Game Indicators &lspr[NOLIGHT], // SPR_SCOR &lspr[NOLIGHT], // SPR_DRWN + &lspr[NOLIGHT], // SPR_FLII &lspr[NOLIGHT], // SPR_LCKN &lspr[NOLIGHT], // SPR_TTAG &lspr[NOLIGHT], // SPR_GFLG diff --git a/src/info.c b/src/info.c index ed29fe2bf..125babd7d 100644 --- a/src/info.c +++ b/src/info.c @@ -402,6 +402,7 @@ char sprnames[NUMSPRITES + 1][5] = // Game Indicators "SCOR", // Score logo "DRWN", // Drowning Timer + "FLII", // Flight indicator "LCKN", // Target "TTAG", // Tag Sign "GFLG", // Got Flag sign @@ -3319,6 +3320,9 @@ state_t states[NUMSTATES] = {SPR_DRWN, 10, 40, {NULL}, 0, 0, S_NULL}, // S_FOUR2 {SPR_DRWN, 11, 40, {NULL}, 0, 0, S_NULL}, // S_FIVE2 + // Flight indicator + {SPR_FLII, FF_FULLBRIGHT|FF_ANIMATE|0, -1, {NULL}, 4, 4, S_NULL}, // S_FLIGHTINDICATOR + {SPR_LCKN, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_NULL}, // S_LOCKON1 {SPR_LCKN, 1|FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_NULL}, // S_LOCKON2 {SPR_LCKN, 2|FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_NULL}, // S_LOCKON3 diff --git a/src/info.h b/src/info.h index bbb6a21fc..16e535384 100644 --- a/src/info.h +++ b/src/info.h @@ -664,6 +664,7 @@ typedef enum sprite // Game Indicators SPR_SCOR, // Score logo SPR_DRWN, // Drowning Timer + SPR_FLII, // AI flight indicator SPR_LCKN, // Target SPR_TTAG, // Tag Sign SPR_GFLG, // Got Flag sign @@ -3454,6 +3455,8 @@ typedef enum state S_FOUR2, S_FIVE2, + S_FLIGHTINDICATOR, + S_LOCKON1, S_LOCKON2, S_LOCKON3, From f682de3f1b429c38cf8db428bb6ee2528075a4bb Mon Sep 17 00:00:00 2001 From: lachwright Date: Mon, 18 Nov 2019 15:55:55 +0800 Subject: [PATCH 053/189] Fix controllable flight ending when player hits the ground while being carried by Tailsbot --- src/b_bot.c | 4 +--- src/p_user.c | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/b_bot.c b/src/b_bot.c index d3fc25aa6..0740dba4e 100644 --- a/src/b_bot.c +++ b/src/b_bot.c @@ -181,7 +181,6 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm if (player->powers[pw_carry] == CR_PLAYER && sonic->tracer == tails) { flymode = 2; - player->pflags &= ~PF_JUMPED; } } // Read player inputs while carrying @@ -197,8 +196,7 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm else if (!jump_last) jump = true; // End flymode - if (player->powers[pw_carry] != CR_PLAYER - || P_IsObjectOnGround(sonic)) + if (player->powers[pw_carry] != CR_PLAYER) { flymode = 0; } diff --git a/src/p_user.c b/src/p_user.c index 6b4de4598..837d7d75c 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -8367,7 +8367,7 @@ static void P_MovePlayer(player_t *player) // Tails Put-Put noise if (player->charability == CA_FLY - && player->bot != 1 + && (player->pflags & PF_CANCARRY) && !(player->mo->eflags & MFE_UNDERWATER) && leveltime % 10 == 0 && !player->spectator) From 4c432c376e335b3f8fcd2fe2171dc534f16092e3 Mon Sep 17 00:00:00 2001 From: lachwright Date: Mon, 18 Nov 2019 16:22:12 +0800 Subject: [PATCH 054/189] Make camera use signpost's ground z coordinate instead of the player's z coordinate --- src/p_user.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 3c481e7e2..c17d708ba 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -9889,10 +9889,20 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall pviewheight = FixedMul(41*player->height/48, mo->scale); - if (mo->eflags & MFE_VERTICALFLIP) - z = mo->z + mo->height - pviewheight - camheight + distz; + if (sign) + { + if (mo->eflags & MFE_VERTICALFLIP) + z = sign->ceilingz - pviewheight - camheight; + else + z = sign->floorz + pviewheight + camheight; + } else - z = mo->z + pviewheight + camheight + distz; + { + if (mo->eflags & MFE_VERTICALFLIP) + z = mo->z + mo->height - pviewheight - camheight; + else + z = mo->z + pviewheight + camheight; + } // move camera down to move under lower ceilings newsubsec = R_IsPointInSubsector(((mo->x>>FRACBITS) + (thiscam->x>>FRACBITS))<<(FRACBITS-1), ((mo->y>>FRACBITS) + (thiscam->y>>FRACBITS))<<(FRACBITS-1)); From 27fcaf0f93f4a5cb3976f64537f446c9b7d8c85a Mon Sep 17 00:00:00 2001 From: lachwright Date: Mon, 18 Nov 2019 16:26:15 +0800 Subject: [PATCH 055/189] Whoops, deleted a little too much by accident --- src/p_user.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index c17d708ba..bcb01dc02 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -9899,9 +9899,9 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall else { if (mo->eflags & MFE_VERTICALFLIP) - z = mo->z + mo->height - pviewheight - camheight; + z = mo->z + mo->height - pviewheight - camheight + distz; else - z = mo->z + pviewheight + camheight; + z = mo->z + pviewheight + camheight + distz; } // move camera down to move under lower ceilings From 280d151d76af04cc8118c3ce20a851885d787e76 Mon Sep 17 00:00:00 2001 From: lachwright Date: Mon, 18 Nov 2019 22:36:25 +0800 Subject: [PATCH 056/189] Allow positive momentum retention when jumping off rollout rocks --- src/p_user.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/p_user.c b/src/p_user.c index d8afd2bd5..305e167b1 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -4392,6 +4392,8 @@ void P_DoJump(player_t *player, boolean soundandstate) else if (player->powers[pw_carry] == CR_ROLLOUT) { player->mo->momz = 9*FRACUNIT; + if (P_MobjFlip(player->mo->tracer)*player->mo->tracer->momz > 0) + player->mo->momz += player->mo->tracer->momz; player->powers[pw_carry] = CR_NONE; player->mo->tracer->flags |= MF_PUSHABLE; P_SetTarget(&player->mo->tracer->tracer, NULL); From 6c98dde73642036e60d4bf751a54a8d26f1238c7 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Mon, 18 Nov 2019 11:39:54 -0300 Subject: [PATCH 057/189] stuff --- src/d_main.c | 11 +- src/f_finale.h | 5 + src/f_wipe.c | 21 +++ src/g_game.c | 2 +- src/hardware/hw_draw.c | 12 +- src/lua_hudlib.c | 11 +- src/p_setup.c | 33 +---- src/st_stuff.c | 293 ++++++++++++++++++++++++++++++----------- src/st_stuff.h | 16 ++- src/v_video.c | 21 +-- 10 files changed, 297 insertions(+), 128 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index ebc618be8..9ffed4461 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -435,6 +435,15 @@ static void D_Display(void) if (rendermode != render_none) { F_WipeEndScreen(); + // Funny. + if (WipeStageTitle && st_overlay) + { + lt_ticker--; + lt_lasttic = lt_ticker; + ST_preLevelTitleCardLoop(0, false); + V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, levelfadecol); + F_WipeStartScreen(); + } F_RunWipe(wipetypepost, gamestate != GS_TIMEATTACK && gamestate != GS_TITLESCREEN); } @@ -444,7 +453,7 @@ static void D_Display(void) framecount = 0; demostarttime = I_GetTime(); } - + wipetypepost = -1; } else diff --git a/src/f_finale.h b/src/f_finale.h index 3fa7106a9..a2a96f2de 100644 --- a/src/f_finale.h +++ b/src/f_finale.h @@ -141,8 +141,13 @@ void F_MenuPresTicker(boolean run); #define FORCEWIPEOFF -2 extern boolean WipeInAction; +extern boolean WipeStageTitle; extern INT32 lastwipetic; +// Don't know where else to place this constant +// But this file seems appropriate +#define PRELEVELTIME 24 // frames in tics + void F_WipeStartScreen(void); void F_WipeEndScreen(void); void F_RunWipe(UINT8 wipetype, boolean drawMenu); diff --git a/src/f_wipe.c b/src/f_wipe.c index 05229f844..d048037d8 100644 --- a/src/f_wipe.c +++ b/src/f_wipe.c @@ -18,6 +18,7 @@ #include "r_draw.h" // transtable #include "p_pspr.h" // tr_transxxx +#include "st_stuff.h" #include "w_wad.h" #include "z_zone.h" @@ -31,6 +32,10 @@ #include "hardware/hw_main.h" #endif +#ifdef HAVE_BLUA +#include "lua_hud.h" +#endif + #if NUMSCREENS < 5 #define NOWIPE // do not enable wipe image post processing for ARM, SH and MIPS CPUs #endif @@ -82,6 +87,7 @@ UINT8 wipedefs[NUMWIPEDEFS] = { //-------------------------------------------------------------------------- boolean WipeInAction = false; +boolean WipeStageTitle = false; INT32 lastwipetic = 0; #ifndef NOWIPE @@ -366,6 +372,19 @@ void F_RunWipe(UINT8 wipetype, boolean drawMenu) else #endif F_DoWipe(fmask); + + // draw level title + if ((WipeStageTitle && st_overlay) + && *mapheaderinfo[gamemap-1]->lvlttl != '\0' +#ifdef HAVE_BLUA + && LUA_HudEnabled(hud_stagetitle) +#endif + ) + { + ST_runTitleCard(); + ST_drawWipeTitleCard(); + } + I_OsPolling(); I_UpdateNoBlit(); @@ -377,7 +396,9 @@ void F_RunWipe(UINT8 wipetype, boolean drawMenu) if (moviemode) M_SaveFrame(); } + WipeInAction = false; + WipeStageTitle = false; #endif } diff --git a/src/g_game.c b/src/g_game.c index 63caaa15c..2119c3fe0 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1992,7 +1992,7 @@ void G_Ticker(boolean run) if (titledemo) F_TitleDemoTicker(); P_Ticker(run); // tic the game - ST_Ticker(); + ST_Ticker(run); F_TextPromptTicker(); AM_Ticker(); HU_Ticker(); diff --git a/src/hardware/hw_draw.c b/src/hardware/hw_draw.c index e493dafac..4519e1280 100644 --- a/src/hardware/hw_draw.c +++ b/src/hardware/hw_draw.c @@ -380,9 +380,9 @@ void HWR_DrawStretchyFixedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t { FSurfaceInfo Surf; Surf.FlatColor.s.red = Surf.FlatColor.s.green = Surf.FlatColor.s.blue = 0xff; - if (alphalevel == 13) Surf.FlatColor.s.alpha = softwaretranstogl_lo[cv_translucenthud.value]; - else if (alphalevel == 14) Surf.FlatColor.s.alpha = softwaretranstogl[cv_translucenthud.value]; - else if (alphalevel == 15) Surf.FlatColor.s.alpha = softwaretranstogl_hi[cv_translucenthud.value]; + if (alphalevel == 13) Surf.FlatColor.s.alpha = softwaretranstogl_lo[st_translucency]; + else if (alphalevel == 14) Surf.FlatColor.s.alpha = softwaretranstogl[st_translucency]; + else if (alphalevel == 15) Surf.FlatColor.s.alpha = softwaretranstogl_hi[st_translucency]; else Surf.FlatColor.s.alpha = softwaretranstogl[10-alphalevel]; flags |= PF_Modulated; HWD.pfnDrawPolygon(&Surf, v, 4, flags); @@ -538,9 +538,9 @@ void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscal { FSurfaceInfo Surf; Surf.FlatColor.s.red = Surf.FlatColor.s.green = Surf.FlatColor.s.blue = 0xff; - if (alphalevel == 13) Surf.FlatColor.s.alpha = softwaretranstogl_lo[cv_translucenthud.value]; - else if (alphalevel == 14) Surf.FlatColor.s.alpha = softwaretranstogl[cv_translucenthud.value]; - else if (alphalevel == 15) Surf.FlatColor.s.alpha = softwaretranstogl_hi[cv_translucenthud.value]; + if (alphalevel == 13) Surf.FlatColor.s.alpha = softwaretranstogl_lo[st_translucency]; + else if (alphalevel == 14) Surf.FlatColor.s.alpha = softwaretranstogl[st_translucency]; + else if (alphalevel == 15) Surf.FlatColor.s.alpha = softwaretranstogl_hi[st_translucency]; else Surf.FlatColor.s.alpha = softwaretranstogl[10-alphalevel]; flags |= PF_Modulated; HWD.pfnDrawPolygon(&Surf, v, 4, flags); diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index 62be61283..f12bb9ec5 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -910,9 +910,17 @@ static int libd_RandomChance(lua_State *L) return 1; } -// 30/10/18 Lat': Get cv_translucenthud's value for HUD rendering as a normal V_xxTRANS int +// 30/10/18 Lat': Get st_translucency's value for HUD rendering as a normal V_xxTRANS int // Could as well be thrown in global vars for ease of access but I guess it makes sense for it to be a HUD fn static int libd_getlocaltransflag(lua_State *L) +{ + HUDONLY + lua_pushinteger(L, (10-st_translucency)*V_10TRANS); + return 1; +} + +// Get cv_translucenthud's value for HUD rendering as a normal V_xxTRANS int +static int libd_getusertransflag(lua_State *L) { HUDONLY lua_pushinteger(L, (10-cv_translucenthud.value)*V_10TRANS); // A bit weird that it's called "translucenthud" yet 10 is fully opaque :V @@ -954,6 +962,7 @@ static luaL_Reg lib_draw[] = { {"dupy", libd_dupy}, {"renderer", libd_renderer}, {"localTransFlag", libd_getlocaltransflag}, + {"userTransFlag", libd_getusertransflag}, {NULL, NULL} }; diff --git a/src/p_setup.c b/src/p_setup.c index 461c81b05..736141ea0 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -3227,8 +3227,10 @@ boolean P_SetupLevel(boolean skipprecip) } // Stage title! + WipeStageTitle = (!titlemapinaction); + ST_startTitleCard(); if (rendermode != render_none - && (!titlemapinaction) + && WipeStageTitle && ranspecialwipe != 2 && *mapheaderinfo[gamemap-1]->lvlttl != '\0' #ifdef HAVE_BLUA @@ -3236,33 +3238,8 @@ boolean P_SetupLevel(boolean skipprecip) #endif ) { - tic_t starttime = I_GetTime(); - tic_t endtime = starttime + (10*NEWTICRATERATIO); - tic_t nowtime = starttime; - tic_t lasttime = starttime; - while (nowtime < endtime) - { - // draw loop - while (!((nowtime = I_GetTime()) - lasttime)) - I_Sleep(); - lasttime = nowtime; - - V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, levelfadecol); - stplyr = &players[consoleplayer]; - ST_drawLevelTitle(nowtime - starttime); - if (splitscreen) - { - stplyr = &players[secondarydisplayplayer]; - ST_drawLevelTitle(nowtime - starttime); - } - - I_OsPolling(); - I_UpdateNoBlit(); - I_FinishUpdate(); // page flip or blit buffer - - if (moviemode) // make sure we save frames for the white hold too - M_SaveFrame(); - } + ST_runTitleCard(); + ST_runPreLevelTitleCard(lt_ticker); } return true; diff --git a/src/st_stuff.c b/src/st_stuff.c index 884477377..86a87c543 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -186,14 +186,18 @@ boolean ST_SameTeam(player_t *a, player_t *b) static boolean st_stopped = true; -void ST_Ticker(void) +void ST_Ticker(boolean run) { if (st_stopped) return; + + if (run) + ST_runTitleCard(); } // 0 is default, any others are special palettes. INT32 st_palette = 0; +INT32 st_translucency = 0; void ST_doPaletteStuff(void) { @@ -818,7 +822,7 @@ static void ST_drawLivesArea(void) face = superprefix[stplyr->skin]; V_DrawSmallMappedPatch(hudinfo[HUD_LIVES].x, hudinfo[HUD_LIVES].y, hudinfo[HUD_LIVES].f|V_PERPLAYER|V_HUDTRANS, face, colormap); - if (cv_translucenthud.value == 10 && stplyr->powers[pw_super] == 1 && stplyr->mo->tracer) + if (st_translucency == 10 && stplyr->powers[pw_super] == 1 && stplyr->mo->tracer) { INT32 v_supertrans = (stplyr->mo->tracer->frame & FF_TRANSMASK) >> FF_TRANSSHIFT; if (v_supertrans < 10) @@ -1160,20 +1164,132 @@ static void ST_drawInput(void) V_DrawThinString(x, y, hudinfo[HUD_LIVES].f|((leveltime & 4) ? V_YELLOWMAP : V_REDMAP), "BAD DEMO!!"); } -void ST_drawLevelTitle(tic_t titletime) +static patch_t *lt_patches[3]; +static INT32 lt_scroll = 0; +static INT32 lt_mom = 0; +static INT32 lt_zigzag = 0; + +tic_t lt_ticker = 0, lt_lasttic = 0; +tic_t lt_exitticker = 0, lt_endtime = 0; + +// +// Load the graphics for the title card. +// +static void ST_cacheLevelTitle(void) +{ + SINT8 bonustype = mapheaderinfo[gamemap-1]->bonustype; + if ((bonustype != 1) && (bonustype != 2)) + { + lt_patches[0] = (patch_t *)W_CachePatchName("LTACTBLU", PU_HUDGFX); + lt_patches[1] = (patch_t *)W_CachePatchName("LTZIGZAG", PU_HUDGFX); + lt_patches[2] = (patch_t *)W_CachePatchName("LTZZTEXT", PU_HUDGFX); + } + else // boss map + { + lt_patches[0] = (patch_t *)W_CachePatchName("LTACTRED", PU_HUDGFX); + lt_patches[1] = (patch_t *)W_CachePatchName("LTZIGRED", PU_HUDGFX); + lt_patches[2] = (patch_t *)W_CachePatchName("LTZZWARN", PU_HUDGFX); + } +} + +// +// Start the title card. +// +void ST_startTitleCard(void) +{ + ST_cacheLevelTitle(); + lt_ticker = lt_exitticker = lt_lasttic = 0; + lt_endtime = 2*TICRATE; + lt_scroll = BASEVIDWIDTH * FRACUNIT; + lt_zigzag = -((lt_patches[1])->width * FRACUNIT); + lt_mom = 0; +} + +// +// What happens before drawing the title card. +// Which is just setting the HUD translucency. +// +void ST_preDrawTitleCard(void) +{ + if (lt_ticker >= (lt_endtime + TICRATE)) + return; + + if (!lt_exitticker) + st_translucency = 0; + else + st_translucency = max(0, min((INT32)lt_exitticker-4, cv_translucenthud.value)); +} + +// +// Run the title card. +// Called from ST_Ticker. +// +void ST_runTitleCard(void) +{ + if (lt_ticker >= (lt_endtime + TICRATE)) + return; + + if (!(paused || P_AutoPause())) + { + // tick + lt_ticker++; + if (lt_ticker >= lt_endtime) + lt_exitticker++; + + // scroll to screen (level title) + if (!lt_exitticker) + { + if (abs(lt_scroll) > FRACUNIT) + lt_scroll -= (lt_scroll>>2); + else + lt_scroll = 0; + } + // scroll away from screen (level title) + else + { + lt_mom -= FRACUNIT*6; + lt_scroll += lt_mom; + } + + // scroll to screen (zigzag) + if (!lt_exitticker) + { + if (abs(lt_zigzag) > FRACUNIT) + lt_zigzag -= (lt_zigzag>>2); + else + lt_zigzag = 0; + } + // scroll away from screen (zigzag) + else + lt_zigzag += lt_mom; + } +} + +// +// Draw the title card itself. +// +void ST_drawTitleCard(void) { char *lvlttl = mapheaderinfo[gamemap-1]->lvlttl; char *subttl = mapheaderinfo[gamemap-1]->subttl; INT32 actnum = mapheaderinfo[gamemap-1]->actnum; - INT32 lvlttly, zoney, lvlttlxpos, ttlnumxpos, zonexpos; + INT32 lvlttlxpos, ttlnumxpos, zonexpos; INT32 subttlxpos = BASEVIDWIDTH/2; - patch_t *tzigzag = W_CachePatchName("TCARDFG1", PU_CACHE); - INT32 i; - INT32 height = (SHORT(tzigzag->height)); + INT32 ttlscroll = FixedInt(lt_scroll); + INT32 zzticker; + patch_t *actpat, *zigzag, *zztext; - if (!(titletime > 2 && titletime-3 < 110)) + if (lt_ticker >= (lt_endtime + TICRATE)) return; + if ((lt_ticker-lt_lasttic) > 1) + lt_ticker = lt_lasttic+1; + + ST_cacheLevelTitle(); + actpat = lt_patches[0]; + zigzag = lt_patches[1]; + zztext = lt_patches[2]; + lvlttlxpos = ((BASEVIDWIDTH/2) - (V_LevelNameWidth(lvlttl)/2)); if (actnum > 0) @@ -1186,72 +1302,78 @@ void ST_drawLevelTitle(tic_t titletime) if (lvlttlxpos < 0) lvlttlxpos = 0; -#if 0 // toaster's experiment. srb2&toast.exe one day, maybe? Requires stuff below to be converted to fixed point. -#define MIDTTLY 79 -#define MIDZONEY 105 -#define MIDDIFF 4 - - if (titletime < 10) - { - fixed_t z = ((titletime - 3)<height, V_SNAPTOTOP|V_SNAPTOLEFT, zigzag); + V_DrawScaledPatch(FixedInt(lt_zigzag), (zigzag->height-zzticker) % zigzag->height, V_SNAPTOTOP|V_SNAPTOLEFT, zigzag); + V_DrawScaledPatch(FixedInt(lt_zigzag), (-zigzag->height+zzticker) % zztext->height, V_SNAPTOTOP|V_SNAPTOLEFT, zztext); + V_DrawScaledPatch(FixedInt(lt_zigzag), (zzticker) % zztext->height, V_SNAPTOTOP|V_SNAPTOLEFT, zztext); if (actnum) - V_DrawLevelActNum(ttlnumxpos, zoney, V_PERPLAYER, actnum); - - V_DrawLevelTitle(lvlttlxpos, lvlttly, V_PERPLAYER, lvlttl); - - if (!(mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE)) - V_DrawLevelTitle(zonexpos, zoney, V_PERPLAYER, M_GetText("ZONE")); - - if (lvlttly+48 < 200) - V_DrawCenteredString(subttlxpos, lvlttly+48, V_PERPLAYER|V_ALLOWLOWERCASE, subttl); - - for (i = -8; i < (BASEVIDHEIGHT/height) + 8; i++) { - INT32 y = ((i*height) + (height - ((titletime)%height))); - //CONS_Printf("%d\n", y); - V_DrawFixedPatch(0, y<levelflags & LF_NOZONE)) + V_DrawLevelTitle(zonexpos + ttlscroll, 104, V_PERPLAYER, M_GetText("ZONE")); + V_DrawCenteredString(subttlxpos - ttlnumxpos, 128, V_PERPLAYER|V_ALLOWLOWERCASE, subttl); + + lt_lasttic = lt_ticker; +} + +// +// Drawer for ST_runPreLevelTitleCard. +// +void ST_preLevelTitleCardLoop(tic_t ticker, boolean update) +{ + V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, levelfadecol); + if (ticker < PRELEVELTIME-1) + ST_drawWipeTitleCard(); + + I_OsPolling(); + I_UpdateNoBlit(); + if (update) + I_FinishUpdate(); // page flip or blit buffer + + if (moviemode) // make sure we save frames for the white hold too + M_SaveFrame(); +} + +// +// Run the title card before fading in to the level. +// +void ST_runPreLevelTitleCard(tic_t ticker) +{ + tic_t starttime = I_GetTime(); + tic_t endtime = starttime + (PRELEVELTIME*NEWTICRATERATIO); + tic_t nowtime = starttime; + tic_t lasttime = starttime; + while (nowtime < endtime) + { + // draw loop + while (!((nowtime = I_GetTime()) - lasttime)) + I_Sleep(); + lasttime = nowtime; + ST_runTitleCard(); + ST_preLevelTitleCardLoop(ticker, true); + } +} + +// +// Draw the title card while on a wipe. +// Also used in ST_runPreLevelTitleCard. +// +void ST_drawWipeTitleCard(void) +{ + stplyr = &players[consoleplayer]; + ST_preDrawTitleCard(); + ST_drawTitleCard(); + if (splitscreen) + { + stplyr = &players[secondarydisplayplayer]; + ST_preDrawTitleCard(); + ST_drawTitleCard(); } } @@ -2404,12 +2526,29 @@ static void ST_doItemFinderIconsAndSound(void) S_StartSound(NULL, sfx_emfind); } +// // Draw the status bar overlay, customisable: the user chooses which // kind of information to overlay // static void ST_overlayDrawer(void) { - //hu_showscores = auto hide score/time/rings when tab rankings are shown + // Decide whether to draw the stage title or not + boolean stagetitle = false; + + // Check for a valid level title + // If the HUD is enabled + // And, if Lua is running, if the HUD library has the stage title enabled + if (*mapheaderinfo[gamemap-1]->lvlttl != '\0' && !(hu_showscores && (netgame || multiplayer)) +#ifdef HAVE_BLUA + && LUA_HudEnabled(hud_stagetitle) +#endif + ) + { + stagetitle = true; + ST_preDrawTitleCard(); + } + + // hu_showscores = auto hide score/time/rings when tab rankings are shown if (!(hu_showscores && (netgame || multiplayer))) { if ((maptol & TOL_NIGHTS || G_IsSpecialStage(gamemap)) && @@ -2560,12 +2699,8 @@ static void ST_overlayDrawer(void) #endif // draw level title Tails - if (*mapheaderinfo[gamemap-1]->lvlttl != '\0' && !(hu_showscores && (netgame || multiplayer)) -#ifdef HAVE_BLUA - && LUA_HudEnabled(hud_stagetitle) -#endif - ) - ST_drawLevelTitle(timeinmap+70); + if (stagetitle && (!WipeInAction) && (!WipeStageTitle)) + ST_drawTitleCard(); if (!hu_showscores && (netgame || multiplayer) #ifdef HAVE_BLUA @@ -2641,6 +2776,8 @@ void ST_Drawer(void) } } + st_translucency = cv_translucenthud.value; + if (st_overlay) { // No deadview! diff --git a/src/st_stuff.h b/src/st_stuff.h index aaf01ca15..7c23d4f94 100644 --- a/src/st_stuff.h +++ b/src/st_stuff.h @@ -24,7 +24,7 @@ // // Called by main loop. -void ST_Ticker(void); +void ST_Ticker(boolean run); // Called by main loop. void ST_Drawer(void); @@ -47,8 +47,17 @@ void ST_ReloadSkinFaceGraphics(void); void ST_doPaletteStuff(void); -// level title draw -void ST_drawLevelTitle(tic_t titletime); +// title card +void ST_startTitleCard(void); +void ST_preDrawTitleCard(void); +void ST_runTitleCard(void); +void ST_drawTitleCard(void); +void ST_preLevelTitleCardLoop(tic_t ticker, boolean update); +void ST_runPreLevelTitleCard(tic_t ticker); +void ST_drawWipeTitleCard(void); + +extern tic_t lt_ticker, lt_lasttic; +extern tic_t lt_exitticker, lt_endtime; // return if player a is in the same team as player b boolean ST_SameTeam(player_t *a, player_t *b); @@ -59,6 +68,7 @@ boolean ST_SameTeam(player_t *a, player_t *b); extern boolean st_overlay; // sb overlay on or off when fullscreen extern INT32 st_palette; // 0 is default, any others are special palettes. +extern INT32 st_translucency; extern lumpnum_t st_borderpatchnum; // patches, also used in intermission diff --git a/src/v_video.c b/src/v_video.c index 44e80c9f5..a9f60fff1 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -18,6 +18,7 @@ #include "p_local.h" // stplyr #include "g_game.h" // players #include "v_video.h" +#include "st_stuff.h" #include "hu_stuff.h" #include "r_draw.h" #include "console.h" @@ -574,11 +575,11 @@ void V_DrawStretchyFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, fixed_t vsca if ((alphalevel = ((scrn & V_ALPHAMASK) >> V_ALPHASHIFT))) { if (alphalevel == 13) - alphalevel = hudminusalpha[cv_translucenthud.value]; + alphalevel = hudminusalpha[st_translucency]; else if (alphalevel == 14) - alphalevel = 10 - cv_translucenthud.value; + alphalevel = 10 - st_translucency; else if (alphalevel == 15) - alphalevel = hudplusalpha[cv_translucenthud.value]; + alphalevel = hudplusalpha[st_translucency]; if (alphalevel >= 10) return; // invis @@ -874,11 +875,11 @@ void V_DrawCroppedPatch(fixed_t x, fixed_t y, fixed_t pscale, INT32 scrn, patch_ if ((alphalevel = ((scrn & V_ALPHAMASK) >> V_ALPHASHIFT))) { if (alphalevel == 13) - alphalevel = hudminusalpha[cv_translucenthud.value]; + alphalevel = hudminusalpha[st_translucency]; else if (alphalevel == 14) - alphalevel = 10 - cv_translucenthud.value; + alphalevel = 10 - st_translucency; else if (alphalevel == 15) - alphalevel = hudplusalpha[cv_translucenthud.value]; + alphalevel = hudplusalpha[st_translucency]; if (alphalevel >= 10) return; // invis @@ -1393,11 +1394,11 @@ void V_DrawFillConsoleMap(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c) if ((alphalevel = ((c & V_ALPHAMASK) >> V_ALPHASHIFT))) { if (alphalevel == 13) - alphalevel = hudminusalpha[cv_translucenthud.value]; + alphalevel = hudminusalpha[st_translucency]; else if (alphalevel == 14) - alphalevel = 10 - cv_translucenthud.value; + alphalevel = 10 - st_translucency; else if (alphalevel == 15) - alphalevel = hudplusalpha[cv_translucenthud.value]; + alphalevel = hudplusalpha[st_translucency]; if (alphalevel >= 10) return; // invis @@ -2964,7 +2965,7 @@ INT32 V_LevelNameHeight(const char *string) return w; } -// For ST_drawLevelTitle +// For ST_drawTitleCard // Returns the width of the act num patch INT32 V_LevelActNumWidth(INT32 num) { From 9d17614c553b620aafa089af047ee8e129e4460e Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Mon, 18 Nov 2019 11:42:45 -0300 Subject: [PATCH 058/189] arg --- src/p_setup.c | 2 +- src/st_stuff.c | 4 ++-- src/st_stuff.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/p_setup.c b/src/p_setup.c index 736141ea0..21c24e2f4 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -3239,7 +3239,7 @@ boolean P_SetupLevel(boolean skipprecip) ) { ST_runTitleCard(); - ST_runPreLevelTitleCard(lt_ticker); + ST_runPreLevelTitleCard(lt_ticker, true); } return true; diff --git a/src/st_stuff.c b/src/st_stuff.c index 86a87c543..74e9d40da 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -1343,7 +1343,7 @@ void ST_preLevelTitleCardLoop(tic_t ticker, boolean update) // // Run the title card before fading in to the level. // -void ST_runPreLevelTitleCard(tic_t ticker) +void ST_runPreLevelTitleCard(tic_t ticker, boolean update) { tic_t starttime = I_GetTime(); tic_t endtime = starttime + (PRELEVELTIME*NEWTICRATERATIO); @@ -1356,7 +1356,7 @@ void ST_runPreLevelTitleCard(tic_t ticker) I_Sleep(); lasttime = nowtime; ST_runTitleCard(); - ST_preLevelTitleCardLoop(ticker, true); + ST_preLevelTitleCardLoop(ticker, update); } } diff --git a/src/st_stuff.h b/src/st_stuff.h index 7c23d4f94..5897a48b0 100644 --- a/src/st_stuff.h +++ b/src/st_stuff.h @@ -53,7 +53,7 @@ void ST_preDrawTitleCard(void); void ST_runTitleCard(void); void ST_drawTitleCard(void); void ST_preLevelTitleCardLoop(tic_t ticker, boolean update); -void ST_runPreLevelTitleCard(tic_t ticker); +void ST_runPreLevelTitleCard(tic_t ticker, boolean update); void ST_drawWipeTitleCard(void); extern tic_t lt_ticker, lt_lasttic; From f786a8dbf63b1dec51550070466e7742de68f9fb Mon Sep 17 00:00:00 2001 From: lachwright Date: Mon, 18 Nov 2019 22:57:26 +0800 Subject: [PATCH 059/189] Important fixes & mine lob speed reduction --- src/p_enemy.c | 3 ++- src/p_mobj.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index 18da9c7e6..32695fcae 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -14656,7 +14656,7 @@ void A_DragonWing(mobj_t *actor) fixed_t x, y; #ifdef HAVE_BLUA - if (LUA_CallAction("A_DragonSegment", actor)) + if (LUA_CallAction("A_DragonWing", actor)) return; #endif @@ -14697,5 +14697,6 @@ void A_DragonSegment(mobj_t *actor) return; #endif + actor->angle = hangle; P_TeleportMove(actor, target->x + xdist, target->y + ydist, target->z + zdist); } \ No newline at end of file diff --git a/src/p_mobj.c b/src/p_mobj.c index a76dd7e4c..dbba83c8a 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -9633,7 +9633,7 @@ void P_MobjThinker(mobj_t *mobj) if (mobj->threshold == 0) // if the timer hits 0, look for a mine to drop! { mobj_t *segment = mobj; - while (segment->tracer != NULL && segment->tracer->state == &states[segment->tracer->info->spawnstate]) + while (segment->tracer != NULL && !P_MobjWasRemoved(segment->tracer) && segment->tracer->state == &states[segment->tracer->info->spawnstate]) { segment = segment->tracer; } @@ -9641,7 +9641,7 @@ void P_MobjThinker(mobj_t *mobj) { mobj_t *mine = P_SpawnMobjFromMobj(segment, 0, 0, 0, segment->info->painchance); mine->angle = segment->angle; - P_InstaThrust(mine, mobj->angle, P_AproxDistance(mobj->momx, mobj->momy)); + P_InstaThrust(mine, mobj->angle, P_AproxDistance(mobj->momx, mobj->momy) >> 1); P_SetObjectMomZ(mine, -2*FRACUNIT, true); S_StartSound(mine, mine->info->seesound); P_SetMobjState(segment, segment->info->raisestate); From 4ea35130764555dc84fda380723e9a23616d2a99 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Mon, 18 Nov 2019 12:56:41 -0300 Subject: [PATCH 060/189] Organize --- src/d_main.c | 5 ++++- src/g_game.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ src/g_game.h | 3 ++- src/p_setup.c | 10 ++++------ src/st_stuff.c | 39 +++++++++++++-------------------------- src/st_stuff.h | 3 +-- 6 files changed, 68 insertions(+), 36 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index 9ffed4461..475aa6531 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -180,6 +180,9 @@ void D_ProcessEvents(void) if (M_ScreenshotResponder(ev)) continue; // ate the event + if (WipeStageTitle) + continue; + if (gameaction == ga_nothing && gamestate == GS_TITLESCREEN) { if (cht_Responder(ev)) @@ -440,7 +443,7 @@ static void D_Display(void) { lt_ticker--; lt_lasttic = lt_ticker; - ST_preLevelTitleCardLoop(0, false); + ST_preLevelTitleCardDrawer(0, false); V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, levelfadecol); F_WipeStartScreen(); } diff --git a/src/g_game.c b/src/g_game.c index 2119c3fe0..3b38c367d 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1703,6 +1703,50 @@ void G_DoLoadLevel(boolean resetplayer) CON_ClearHUD(); } +// +// Start the title card. +// +void G_StartTitleCard(void) +{ + // clear the hud + CON_ClearHUD(); + + // prepare status bar + ST_startTitleCard(); + + // start the title card + WipeStageTitle = (!titlemapinaction); +} + +// +// Run the title card before fading in to the level. +// +void G_PreLevelTitleCard(tic_t ticker, boolean update) +{ + tic_t starttime = I_GetTime(); + tic_t endtime = starttime + (PRELEVELTIME*NEWTICRATERATIO); + tic_t nowtime = starttime; + tic_t lasttime = starttime; + while (nowtime < endtime) + { + // draw loop + while (!((nowtime = I_GetTime()) - lasttime)) + I_Sleep(); + lasttime = nowtime; + + // Run some bullshit whatever + D_ProcessEvents(); + + ST_runTitleCard(); + ST_preLevelTitleCardDrawer(ticker, update); + + if (moviemode) + M_SaveFrame(); + if (takescreenshot) // Only take screenshots after drawing. + M_DoScreenShot(); + } +} + INT32 pausedelay = 0; boolean pausebreakkey = false; static INT32 camtoggledelay, camtoggledelay2 = 0; diff --git a/src/g_game.h b/src/g_game.h index 2489ff097..782b8ff5e 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -140,7 +140,8 @@ void G_SpawnPlayer(INT32 playernum, boolean starpost); void G_DeferedInitNew(boolean pultmode, const char *mapname, INT32 pickedchar, boolean SSSG, boolean FLS); void G_DoLoadLevel(boolean resetplayer); - +void G_StartTitleCard(void); +void G_PreLevelTitleCard(tic_t ticker, boolean update); void G_DeferedPlayDemo(const char *demo); // Can be called by the startup code or M_Responder, calls P_SetupLevel. diff --git a/src/p_setup.c b/src/p_setup.c index 21c24e2f4..f143193c9 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -3227,8 +3227,9 @@ boolean P_SetupLevel(boolean skipprecip) } // Stage title! - WipeStageTitle = (!titlemapinaction); - ST_startTitleCard(); + G_StartTitleCard(); + + // Can the title card actually run, though? if (rendermode != render_none && WipeStageTitle && ranspecialwipe != 2 @@ -3237,10 +3238,7 @@ boolean P_SetupLevel(boolean skipprecip) && LUA_HudEnabled(hud_stagetitle) #endif ) - { - ST_runTitleCard(); - ST_runPreLevelTitleCard(lt_ticker, true); - } + G_PreLevelTitleCard(lt_ticker, true); return true; } diff --git a/src/st_stuff.c b/src/st_stuff.c index 74e9d40da..c555c8b66 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -23,6 +23,7 @@ #include "v_video.h" #include "z_zone.h" #include "hu_stuff.h" +#include "console.h" #include "s_sound.h" #include "i_system.h" #include "m_menu.h" @@ -1197,7 +1198,10 @@ static void ST_cacheLevelTitle(void) // void ST_startTitleCard(void) { + // cache every HUD patch used ST_cacheLevelTitle(); + + // initialize HUD variables lt_ticker = lt_exitticker = lt_lasttic = 0; lt_endtime = 2*TICRATE; lt_scroll = BASEVIDWIDTH * FRACUNIT; @@ -1323,9 +1327,9 @@ void ST_drawTitleCard(void) } // -// Drawer for ST_runPreLevelTitleCard. +// Drawer for G_PreLevelTitleCard. // -void ST_preLevelTitleCardLoop(tic_t ticker, boolean update) +void ST_preLevelTitleCardDrawer(tic_t ticker, boolean update) { V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, levelfadecol); if (ticker < PRELEVELTIME-1) @@ -1335,34 +1339,11 @@ void ST_preLevelTitleCardLoop(tic_t ticker, boolean update) I_UpdateNoBlit(); if (update) I_FinishUpdate(); // page flip or blit buffer - - if (moviemode) // make sure we save frames for the white hold too - M_SaveFrame(); -} - -// -// Run the title card before fading in to the level. -// -void ST_runPreLevelTitleCard(tic_t ticker, boolean update) -{ - tic_t starttime = I_GetTime(); - tic_t endtime = starttime + (PRELEVELTIME*NEWTICRATERATIO); - tic_t nowtime = starttime; - tic_t lasttime = starttime; - while (nowtime < endtime) - { - // draw loop - while (!((nowtime = I_GetTime()) - lasttime)) - I_Sleep(); - lasttime = nowtime; - ST_runTitleCard(); - ST_preLevelTitleCardLoop(ticker, update); - } } // // Draw the title card while on a wipe. -// Also used in ST_runPreLevelTitleCard. +// Also used in G_PreLevelTitleCard. // void ST_drawWipeTitleCard(void) { @@ -1375,6 +1356,12 @@ void ST_drawWipeTitleCard(void) ST_preDrawTitleCard(); ST_drawTitleCard(); } + + // Draw on top of the title card, + // which is already on top of the wipe + // What a mess + CON_Drawer(); + M_Drawer(); } static void ST_drawPowerupHUD(void) diff --git a/src/st_stuff.h b/src/st_stuff.h index 5897a48b0..7130855c6 100644 --- a/src/st_stuff.h +++ b/src/st_stuff.h @@ -52,8 +52,7 @@ void ST_startTitleCard(void); void ST_preDrawTitleCard(void); void ST_runTitleCard(void); void ST_drawTitleCard(void); -void ST_preLevelTitleCardLoop(tic_t ticker, boolean update); -void ST_runPreLevelTitleCard(tic_t ticker, boolean update); +void ST_preLevelTitleCardDrawer(tic_t ticker, boolean update); void ST_drawWipeTitleCard(void); extern tic_t lt_ticker, lt_lasttic; From e40bf85a6f301e3f207bd3b17374c35027d2173b Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Mon, 18 Nov 2019 13:50:44 -0300 Subject: [PATCH 061/189] lua --- src/f_wipe.c | 6 +----- src/g_game.c | 4 ++++ src/lua_hud.h | 1 + src/lua_hudlib.c | 41 ++++++++++++++++++++++++++++++++++++++++- src/p_setup.c | 3 --- src/st_stuff.c | 22 ++++++++++++++++------ src/st_stuff.h | 1 - 7 files changed, 62 insertions(+), 16 deletions(-) diff --git a/src/f_wipe.c b/src/f_wipe.c index d048037d8..9adbcbc02 100644 --- a/src/f_wipe.c +++ b/src/f_wipe.c @@ -375,11 +375,7 @@ void F_RunWipe(UINT8 wipetype, boolean drawMenu) // draw level title if ((WipeStageTitle && st_overlay) - && *mapheaderinfo[gamemap-1]->lvlttl != '\0' -#ifdef HAVE_BLUA - && LUA_HudEnabled(hud_stagetitle) -#endif - ) + && *mapheaderinfo[gamemap-1]->lvlttl != '\0') { ST_runTitleCard(); ST_drawWipeTitleCard(); diff --git a/src/g_game.c b/src/g_game.c index 3b38c367d..a4dc16b95 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -47,6 +47,10 @@ #include "m_cond.h" // condition sets #include "md5.h" // demo checksums +#ifdef HAVE_BLUA +#include "lua_hud.h" +#endif + gameaction_t gameaction; gamestate_t gamestate = GS_NULL; UINT8 ultimatemode = false; diff --git a/src/lua_hud.h b/src/lua_hud.h index 7f928f7c4..d1adef7dc 100644 --- a/src/lua_hud.h +++ b/src/lua_hud.h @@ -43,3 +43,4 @@ boolean LUA_HudEnabled(enum hud option); void LUAh_GameHUD(player_t *stplyr); void LUAh_ScoresHUD(void); void LUAh_TitleHUD(void); +void LUAh_TitleCardHUD(player_t *stplyr); diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index f12bb9ec5..9b12dd3c0 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -92,12 +92,14 @@ static const char *const patch_opt[] = { enum hudhook { hudhook_game = 0, hudhook_scores, - hudhook_title + hudhook_title, + hudhook_titlecard }; static const char *const hudhook_opt[] = { "game", "scores", "title", + "titlecard", NULL}; // alignment types for v.drawString @@ -1052,6 +1054,9 @@ int LUA_HudLib(lua_State *L) lua_newtable(L); lua_rawseti(L, -2, 4); // HUD[3] = title rendering functions array + + lua_newtable(L); + lua_rawseti(L, -2, 5); // HUD[4] = title card rendering functions array lua_setfield(L, LUA_REGISTRYINDEX, "HUD"); luaL_newmetatable(L, META_HUDINFO); @@ -1189,4 +1194,38 @@ void LUAh_TitleHUD(void) hud_running = false; } +void LUAh_TitleCardHUD(player_t *stplayr) +{ + if (!gL || !(hudAvailable & (1<lvlttl != '\0' -#ifdef HAVE_BLUA - && LUA_HudEnabled(hud_stagetitle) -#endif ) G_PreLevelTitleCard(lt_ticker, true); diff --git a/src/st_stuff.c b/src/st_stuff.c index c555c8b66..00371a6e8 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -1210,7 +1210,7 @@ void ST_startTitleCard(void) } // -// What happens before drawing the title card. +// What happens before drawing the status bar. // Which is just setting the HUD translucency. // void ST_preDrawTitleCard(void) @@ -1283,8 +1283,17 @@ void ST_drawTitleCard(void) INT32 zzticker; patch_t *actpat, *zigzag, *zztext; +#ifdef HAVE_BLUA + if (!LUA_HudEnabled(hud_stagetitle)) + goto luahook; +#endif + if (lt_ticker >= (lt_endtime + TICRATE)) +#ifdef HAVE_BLUA + goto luahook; +#else return; +#endif if ((lt_ticker-lt_lasttic) > 1) lt_ticker = lt_lasttic+1; @@ -1324,6 +1333,11 @@ void ST_drawTitleCard(void) V_DrawCenteredString(subttlxpos - ttlnumxpos, 128, V_PERPLAYER|V_ALLOWLOWERCASE, subttl); lt_lasttic = lt_ticker; + +#ifdef HAVE_BLUA +luahook: + LUAh_TitleCardHUD(stplyr); +#endif } // @@ -2525,11 +2539,7 @@ static void ST_overlayDrawer(void) // Check for a valid level title // If the HUD is enabled // And, if Lua is running, if the HUD library has the stage title enabled - if (*mapheaderinfo[gamemap-1]->lvlttl != '\0' && !(hu_showscores && (netgame || multiplayer)) -#ifdef HAVE_BLUA - && LUA_HudEnabled(hud_stagetitle) -#endif - ) + if (*mapheaderinfo[gamemap-1]->lvlttl != '\0' && !(hu_showscores && (netgame || multiplayer))) { stagetitle = true; ST_preDrawTitleCard(); diff --git a/src/st_stuff.h b/src/st_stuff.h index 7130855c6..e6e8bec12 100644 --- a/src/st_stuff.h +++ b/src/st_stuff.h @@ -49,7 +49,6 @@ void ST_doPaletteStuff(void); // title card void ST_startTitleCard(void); -void ST_preDrawTitleCard(void); void ST_runTitleCard(void); void ST_drawTitleCard(void); void ST_preLevelTitleCardDrawer(tic_t ticker, boolean update); From 6920d20a0f5ee4c14b96f330e4a994a1fadef4ca Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Mon, 18 Nov 2019 14:08:47 -0300 Subject: [PATCH 062/189] map header option --- src/dehacked.c | 8 ++++++++ src/doomstat.h | 1 + src/f_wipe.c | 1 + src/g_game.c | 8 ++++++++ src/p_setup.c | 18 ++++++++++++------ src/st_stuff.c | 2 +- 6 files changed, 31 insertions(+), 7 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index fff9dbee8..250bfb4b7 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -1573,6 +1573,13 @@ static void readlevelheader(MYFILE *f, INT32 num) else mapheaderinfo[num-1]->levelflags &= ~LF_MIXNIGHTSCOUNTDOWN; } + else if (fastcmp(word, "NOTITLECARD")) + { + if (i || word2[0] == 'T' || word2[0] == 'Y') + mapheaderinfo[num-1]->levelflags |= LF_NOTITLECARD; + else + mapheaderinfo[num-1]->levelflags &= ~LF_NOTITLECARD; + } // Individual triggers for menu flags else if (fastcmp(word, "HIDDEN")) @@ -9012,6 +9019,7 @@ struct { {"LF_NOZONE",LF_NOZONE}, {"LF_SAVEGAME",LF_SAVEGAME}, {"LF_MIXNIGHTSCOUNTDOWN",LF_MIXNIGHTSCOUNTDOWN}, + {"LF_NOTITLECARD",LF_NOTITLECARD}, // And map flags {"LF2_HIDEINMENU",LF2_HIDEINMENU}, {"LF2_HIDEINSTATS",LF2_HIDEINSTATS}, diff --git a/src/doomstat.h b/src/doomstat.h index 7d06f03e2..d9c9b92ac 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -349,6 +349,7 @@ typedef struct #define LF_NOZONE 16 ///< Don't include "ZONE" on level title #define LF_SAVEGAME 32 ///< Save the game upon loading this level #define LF_MIXNIGHTSCOUNTDOWN 64 ///< Play sfx_timeup instead of music change for NiGHTS countdown +#define LF_NOTITLECARD 128 ///< Don't start the title card #define LF2_HIDEINMENU 1 ///< Hide in the multiplayer menu #define LF2_HIDEINSTATS 2 ///< Hide in the statistics screen diff --git a/src/f_wipe.c b/src/f_wipe.c index 9adbcbc02..d3786c69f 100644 --- a/src/f_wipe.c +++ b/src/f_wipe.c @@ -375,6 +375,7 @@ void F_RunWipe(UINT8 wipetype, boolean drawMenu) // draw level title if ((WipeStageTitle && st_overlay) + && !(mapheaderinfo[gamemap-1]->levelflags & LF_NOTITLECARD) && *mapheaderinfo[gamemap-1]->lvlttl != '\0') { ST_runTitleCard(); diff --git a/src/g_game.c b/src/g_game.c index a4dc16b95..c16c28489 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1712,6 +1712,14 @@ void G_DoLoadLevel(boolean resetplayer) // void G_StartTitleCard(void) { + // The title card has been disabled for this map. + // Oh well. + if (mapheaderinfo[gamemap-1]->levelflags & LF_NOTITLECARD) + { + WipeStageTitle = false; + return; + } + // clear the hud CON_ClearHUD(); diff --git a/src/p_setup.c b/src/p_setup.c index fc88a5e5e..34a7c1437 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -3226,15 +3226,21 @@ boolean P_SetupLevel(boolean skipprecip) #endif } - // Stage title! + // No render mode, stop here. + if (rendermode == render_none) + return true; + + // Title card! G_StartTitleCard(); // Can the title card actually run, though? - if (rendermode != render_none - && WipeStageTitle - && ranspecialwipe != 2 - && *mapheaderinfo[gamemap-1]->lvlttl != '\0' - ) + if (!WipeStageTitle) + return true; + if (ranspecialwipe == 2) + return true; + + // If so... + if ((!(mapheaderinfo[gamemap-1]->levelflags & LF_NOTITLECARD)) && (*mapheaderinfo[gamemap-1]->lvlttl != '\0')) G_PreLevelTitleCard(lt_ticker, true); return true; diff --git a/src/st_stuff.c b/src/st_stuff.c index 00371a6e8..504fa3b8e 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -2539,7 +2539,7 @@ static void ST_overlayDrawer(void) // Check for a valid level title // If the HUD is enabled // And, if Lua is running, if the HUD library has the stage title enabled - if (*mapheaderinfo[gamemap-1]->lvlttl != '\0' && !(hu_showscores && (netgame || multiplayer))) + if (!(mapheaderinfo[gamemap-1]->levelflags & LF_NOTITLECARD) && *mapheaderinfo[gamemap-1]->lvlttl != '\0' && !(hu_showscores && (netgame || multiplayer))) { stagetitle = true; ST_preDrawTitleCard(); From 444953d0bbb12260834c435410aec6a186787e6e Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Mon, 18 Nov 2019 14:32:34 -0300 Subject: [PATCH 063/189] oh sh --- src/st_stuff.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/st_stuff.c b/src/st_stuff.c index 504fa3b8e..8abf52af4 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -1370,12 +1370,6 @@ void ST_drawWipeTitleCard(void) ST_preDrawTitleCard(); ST_drawTitleCard(); } - - // Draw on top of the title card, - // which is already on top of the wipe - // What a mess - CON_Drawer(); - M_Drawer(); } static void ST_drawPowerupHUD(void) From 85f1b847e96bf4955ef1f15c5c072ec1db04ed1d Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Mon, 18 Nov 2019 15:04:40 -0300 Subject: [PATCH 064/189] LF_WARNINGTITLE --- src/dehacked.c | 8 ++++++++ src/doomstat.h | 3 ++- src/st_stuff.c | 3 +-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 250bfb4b7..a58595c5c 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -1573,6 +1573,13 @@ static void readlevelheader(MYFILE *f, INT32 num) else mapheaderinfo[num-1]->levelflags &= ~LF_MIXNIGHTSCOUNTDOWN; } + else if (fastcmp(word, "WARNINGTITLE")) + { + if (i || word2[0] == 'T' || word2[0] == 'Y') + mapheaderinfo[num-1]->levelflags |= LF_WARNINGTITLE; + else + mapheaderinfo[num-1]->levelflags &= ~LF_WARNINGTITLE; + } else if (fastcmp(word, "NOTITLECARD")) { if (i || word2[0] == 'T' || word2[0] == 'Y') @@ -9020,6 +9027,7 @@ struct { {"LF_SAVEGAME",LF_SAVEGAME}, {"LF_MIXNIGHTSCOUNTDOWN",LF_MIXNIGHTSCOUNTDOWN}, {"LF_NOTITLECARD",LF_NOTITLECARD}, + {"LF_WARNINGTITLE",LF_WARNINGTITLE}, // And map flags {"LF2_HIDEINMENU",LF2_HIDEINMENU}, {"LF2_HIDEINSTATS",LF2_HIDEINSTATS}, diff --git a/src/doomstat.h b/src/doomstat.h index d9c9b92ac..84939a8db 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -349,7 +349,8 @@ typedef struct #define LF_NOZONE 16 ///< Don't include "ZONE" on level title #define LF_SAVEGAME 32 ///< Save the game upon loading this level #define LF_MIXNIGHTSCOUNTDOWN 64 ///< Play sfx_timeup instead of music change for NiGHTS countdown -#define LF_NOTITLECARD 128 ///< Don't start the title card +#define LF_WARNINGTITLE 128 ///< WARNING! WARNING! WARNING! WARNING! +#define LF_NOTITLECARD 256 ///< Don't start the title card #define LF2_HIDEINMENU 1 ///< Hide in the multiplayer menu #define LF2_HIDEINSTATS 2 ///< Hide in the statistics screen diff --git a/src/st_stuff.c b/src/st_stuff.c index 8abf52af4..e314a4cb3 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -1178,8 +1178,7 @@ tic_t lt_exitticker = 0, lt_endtime = 0; // static void ST_cacheLevelTitle(void) { - SINT8 bonustype = mapheaderinfo[gamemap-1]->bonustype; - if ((bonustype != 1) && (bonustype != 2)) + if (mapheaderinfo[gamemap-1]->levelflags & LF_WARNINGTITLE) { lt_patches[0] = (patch_t *)W_CachePatchName("LTACTBLU", PU_HUDGFX); lt_patches[1] = (patch_t *)W_CachePatchName("LTZIGZAG", PU_HUDGFX); From 5c55c86dd22cdd108f8741c8081da3aef90f944b Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Mon, 18 Nov 2019 15:06:07 -0300 Subject: [PATCH 065/189] invert conditional --- src/st_stuff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/st_stuff.c b/src/st_stuff.c index e314a4cb3..56ffabe6b 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -1178,7 +1178,7 @@ tic_t lt_exitticker = 0, lt_endtime = 0; // static void ST_cacheLevelTitle(void) { - if (mapheaderinfo[gamemap-1]->levelflags & LF_WARNINGTITLE) + if (!(mapheaderinfo[gamemap-1]->levelflags & LF_WARNINGTITLE)) { lt_patches[0] = (patch_t *)W_CachePatchName("LTACTBLU", PU_HUDGFX); lt_patches[1] = (patch_t *)W_CachePatchName("LTZIGZAG", PU_HUDGFX); From cf24b57d8f43b1e07dc5f9dd459921346ff45b13 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Mon, 18 Nov 2019 15:12:55 -0300 Subject: [PATCH 066/189] perplayer --- src/st_stuff.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/st_stuff.c b/src/st_stuff.c index 56ffabe6b..50b69191f 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -1315,14 +1315,14 @@ void ST_drawTitleCard(void) lvlttlxpos = 0; zzticker = lt_ticker; - V_DrawScaledPatch(FixedInt(lt_zigzag), (-zzticker) % zigzag->height, V_SNAPTOTOP|V_SNAPTOLEFT, zigzag); - V_DrawScaledPatch(FixedInt(lt_zigzag), (zigzag->height-zzticker) % zigzag->height, V_SNAPTOTOP|V_SNAPTOLEFT, zigzag); - V_DrawScaledPatch(FixedInt(lt_zigzag), (-zigzag->height+zzticker) % zztext->height, V_SNAPTOTOP|V_SNAPTOLEFT, zztext); - V_DrawScaledPatch(FixedInt(lt_zigzag), (zzticker) % zztext->height, V_SNAPTOTOP|V_SNAPTOLEFT, zztext); + V_DrawScaledPatch(FixedInt(lt_zigzag), (-zzticker) % zigzag->height, V_PERPLAYER|V_SNAPTOTOP|V_SNAPTOLEFT, zigzag); + V_DrawScaledPatch(FixedInt(lt_zigzag), (zigzag->height-zzticker) % zigzag->height, V_PERPLAYER|V_SNAPTOTOP|V_SNAPTOLEFT, zigzag); + V_DrawScaledPatch(FixedInt(lt_zigzag), (-zigzag->height+zzticker) % zztext->height, V_PERPLAYER|V_SNAPTOTOP|V_SNAPTOLEFT, zztext); + V_DrawScaledPatch(FixedInt(lt_zigzag), (zzticker) % zztext->height, V_PERPLAYER|V_SNAPTOTOP|V_SNAPTOLEFT, zztext); if (actnum) { - V_DrawScaledPatch(ttlnumxpos + ttlscroll, 104 - ttlscroll, 0, actpat); + V_DrawScaledPatch(ttlnumxpos + ttlscroll, 104 - ttlscroll, V_PERPLAYER, actpat); V_DrawLevelActNum(ttlnumxpos + ttlscroll, 104, V_PERPLAYER, actnum); } From 29792c7a2b3a7aa2834a26be8eea1031afce191e Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Mon, 18 Nov 2019 15:13:31 -0300 Subject: [PATCH 067/189] missing prototype --- src/st_stuff.c | 2 +- src/st_stuff.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/st_stuff.c b/src/st_stuff.c index 50b69191f..2ca3c3f5c 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -1209,7 +1209,7 @@ void ST_startTitleCard(void) } // -// What happens before drawing the status bar. +// What happens before drawing the title card. // Which is just setting the HUD translucency. // void ST_preDrawTitleCard(void) diff --git a/src/st_stuff.h b/src/st_stuff.h index e6e8bec12..33ffa957a 100644 --- a/src/st_stuff.h +++ b/src/st_stuff.h @@ -51,6 +51,7 @@ void ST_doPaletteStuff(void); void ST_startTitleCard(void); void ST_runTitleCard(void); void ST_drawTitleCard(void); +void ST_preDrawTitleCard(void); void ST_preLevelTitleCardDrawer(tic_t ticker, boolean update); void ST_drawWipeTitleCard(void); From b7f2b74d9a2a5afa7a35a16942b8a5af2b7b785b Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Mon, 18 Nov 2019 15:18:27 -0300 Subject: [PATCH 068/189] V_PERPLAYER did exactly what I did not want it to do so I'll disable these elements --- src/st_stuff.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/st_stuff.c b/src/st_stuff.c index 2ca3c3f5c..f1bdf04f5 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -1314,15 +1314,19 @@ void ST_drawTitleCard(void) if (lvlttlxpos < 0) lvlttlxpos = 0; - zzticker = lt_ticker; - V_DrawScaledPatch(FixedInt(lt_zigzag), (-zzticker) % zigzag->height, V_PERPLAYER|V_SNAPTOTOP|V_SNAPTOLEFT, zigzag); - V_DrawScaledPatch(FixedInt(lt_zigzag), (zigzag->height-zzticker) % zigzag->height, V_PERPLAYER|V_SNAPTOTOP|V_SNAPTOLEFT, zigzag); - V_DrawScaledPatch(FixedInt(lt_zigzag), (-zigzag->height+zzticker) % zztext->height, V_PERPLAYER|V_SNAPTOTOP|V_SNAPTOLEFT, zztext); - V_DrawScaledPatch(FixedInt(lt_zigzag), (zzticker) % zztext->height, V_PERPLAYER|V_SNAPTOTOP|V_SNAPTOLEFT, zztext); + if (!splitscreen) + { + zzticker = lt_ticker; + V_DrawScaledPatch(FixedInt(lt_zigzag), (-zzticker) % zigzag->height, V_SNAPTOTOP|V_SNAPTOLEFT, zigzag); + V_DrawScaledPatch(FixedInt(lt_zigzag), (zigzag->height-zzticker) % zigzag->height, V_SNAPTOTOP|V_SNAPTOLEFT, zigzag); + V_DrawScaledPatch(FixedInt(lt_zigzag), (-zigzag->height+zzticker) % zztext->height, V_SNAPTOTOP|V_SNAPTOLEFT, zztext); + V_DrawScaledPatch(FixedInt(lt_zigzag), (zzticker) % zztext->height, V_SNAPTOTOP|V_SNAPTOLEFT, zztext); + } if (actnum) { - V_DrawScaledPatch(ttlnumxpos + ttlscroll, 104 - ttlscroll, V_PERPLAYER, actpat); + if (!splitscreen) + V_DrawScaledPatch(ttlnumxpos + ttlscroll, 104 - ttlscroll, 0, actpat); V_DrawLevelActNum(ttlnumxpos + ttlscroll, 104, V_PERPLAYER, actnum); } From dc70a24b308127cf18434070e05fe31f299e0a7b Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Mon, 18 Nov 2019 15:32:48 -0300 Subject: [PATCH 069/189] restore zigzags --- src/st_stuff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/st_stuff.c b/src/st_stuff.c index f1bdf04f5..09f809ddc 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -1314,7 +1314,7 @@ void ST_drawTitleCard(void) if (lvlttlxpos < 0) lvlttlxpos = 0; - if (!splitscreen) + if (!splitscreen || (splitscreen && stplyr == &players[displayplayer])) { zzticker = lt_ticker; V_DrawScaledPatch(FixedInt(lt_zigzag), (-zzticker) % zigzag->height, V_SNAPTOTOP|V_SNAPTOLEFT, zigzag); From 508fdb493b08d9938f15044f3c88f8c93ee2f4a8 Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 18 Nov 2019 19:22:51 +0000 Subject: [PATCH 070/189] compilation fixes (no review yet, currently just about to have dinner) --- src/b_bot.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/b_bot.c b/src/b_bot.c index 0740dba4e..badc36b27 100644 --- a/src/b_bot.c +++ b/src/b_bot.c @@ -33,7 +33,7 @@ static boolean spinmode = false; static boolean thinkfly = false; static mobj_t *overlay; -static inline void B_ResetAI() +static inline void B_ResetAI(void) { jump_last = false; spin_last = false; @@ -429,6 +429,7 @@ void B_KeysToTiccmd(mobj_t *mo, ticcmd_t *cmd, boolean forward, boolean backward cmd->sidemove += MAXPLMOVE<>16; } } else { + angle_t angle; if (forward) cmd->forwardmove += MAXPLMOVE<>16; if (backward) @@ -443,7 +444,7 @@ void B_KeysToTiccmd(mobj_t *mo, ticcmd_t *cmd, boolean forward, boolean backward cmd->sidemove += MAXPLMOVE<>16; // cap inputs so the bot can't accelerate faster diagonally - angle_t angle = R_PointToAngle2(0, 0, cmd->sidemove << FRACBITS, cmd->forwardmove << FRACBITS); + angle = R_PointToAngle2(0, 0, cmd->sidemove << FRACBITS, cmd->forwardmove << FRACBITS); INT32 maxforward = abs(P_ReturnThrustY(NULL, angle, MAXPLMOVE)); INT32 maxside = abs(P_ReturnThrustX(NULL, angle, MAXPLMOVE)); cmd->forwardmove = max(min(cmd->forwardmove, maxforward), -maxforward); From efac76f8335c25242fdb76a69ab15cca153c8890 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Mon, 18 Nov 2019 15:39:41 -0500 Subject: [PATCH 071/189] Merge branch 'public_next' into 'master' --- src/d_netfil.c | 4 ++-- src/lua_playerlib.c | 4 ++-- src/m_argv.c | 3 ++- src/m_fixed.h | 9 +-------- src/m_misc.c | 12 ++++++++++++ src/m_misc.h | 2 ++ src/w_wad.c | 12 ++++++------ 7 files changed, 27 insertions(+), 19 deletions(-) diff --git a/src/d_netfil.c b/src/d_netfil.c index 5e7f59310..bd7089609 100644 --- a/src/d_netfil.c +++ b/src/d_netfil.c @@ -716,7 +716,7 @@ void SV_FileSendTicker(void) if (ram) M_Memcpy(p->data, &f->id.ram[transfer[i].position], size); else if (fread(p->data, 1, size, transfer[i].currentfile) != size) - I_Error("SV_FileSendTicker: can't read %s byte on %s at %d because %s", sizeu1(size), f->id.filename, transfer[i].position, strerror(ferror(transfer[i].currentfile))); + I_Error("SV_FileSendTicker: can't read %s byte on %s at %d because %s", sizeu1(size), f->id.filename, transfer[i].position, M_FileError(transfer[i].currentfile)); p->position = LONG(transfer[i].position); // Put flag so receiver knows the total size if (transfer[i].position + size == f->size) @@ -794,7 +794,7 @@ void Got_Filetxpak(void) // We can receive packet in the wrong order, anyway all os support gaped file fseek(file->file, pos, SEEK_SET); if (fwrite(netbuffer->u.filetxpak.data,size,1,file->file) != 1) - I_Error("Can't write to %s: %s\n",filename, strerror(ferror(file->file))); + I_Error("Can't write to %s: %s\n",filename, M_FileError(file->file)); file->currentsize += size; // Finished? diff --git a/src/lua_playerlib.c b/src/lua_playerlib.c index b1222ce67..6bda1988a 100644 --- a/src/lua_playerlib.c +++ b/src/lua_playerlib.c @@ -744,7 +744,7 @@ static int power_get(lua_State *L) UINT16 *powers = *((UINT16 **)luaL_checkudata(L, 1, META_POWERS)); powertype_t p = luaL_checkinteger(L, 2); if (p >= NUMPOWERS) - return luaL_error(L, LUA_QL("powertype_t") " cannot be %u", p); + return luaL_error(L, LUA_QL("powertype_t") " cannot be %d", (INT16)p); lua_pushinteger(L, powers[p]); return 1; } @@ -756,7 +756,7 @@ static int power_set(lua_State *L) powertype_t p = luaL_checkinteger(L, 2); UINT16 i = (UINT16)luaL_checkinteger(L, 3); if (p >= NUMPOWERS) - return luaL_error(L, LUA_QL("powertype_t") " cannot be %u", p); + return luaL_error(L, LUA_QL("powertype_t") " cannot be %d", (INT16)p); if (hud_running) return luaL_error(L, "Do not alter player_t in HUD rendering code!"); powers[p] = i; diff --git a/src/m_argv.c b/src/m_argv.c index 117ec7833..bb43ad57c 100644 --- a/src/m_argv.c +++ b/src/m_argv.c @@ -16,6 +16,7 @@ #include "doomdef.h" #include "command.h" #include "m_argv.h" +#include "m_misc.h" /** \brief number of arg */ @@ -161,7 +162,7 @@ void M_FindResponseFile(void) if (!file) I_Error("No more free memory for the response file"); if (fread(file, size, 1, handle) != 1) - I_Error("Couldn't read response file because %s", strerror(ferror(handle))); + I_Error("Couldn't read response file because %s", M_FileError(handle)); fclose(handle); // keep all the command line arguments following @responsefile diff --git a/src/m_fixed.h b/src/m_fixed.h index 370633c1f..08bc95884 100644 --- a/src/m_fixed.h +++ b/src/m_fixed.h @@ -201,14 +201,7 @@ FUNCMATH FUNCINLINE static ATTRINLINE fixed_t FixedDiv(fixed_t a, fixed_t b) */ FUNCMATH FUNCINLINE static ATTRINLINE fixed_t FixedRem(fixed_t x, fixed_t y) { - const boolean n = x < 0; - x = abs(x); - while (x >= y) - x -= y; - if (n) - return -x; - else - return x; + return x % y; } /** \brief The FixedSqrt function diff --git a/src/m_misc.c b/src/m_misc.c index 20d5f1de4..5cfb20f0f 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -23,6 +23,8 @@ #include #endif +#include + // Extended map support. #include @@ -2441,3 +2443,13 @@ void M_SetupMemcpy(void) M_Memcpy = cpu_cpy; #endif } + +/** Return the appropriate message for a file error or end of file. +*/ +const char *M_FileError(FILE *fp) +{ + if (ferror(fp)) + return strerror(errno); + else + return "end-of-file"; +} diff --git a/src/m_misc.h b/src/m_misc.h index 7038e3e48..c37865ff3 100644 --- a/src/m_misc.h +++ b/src/m_misc.h @@ -94,6 +94,8 @@ void strcatbf(char *s1, const char *s2, const char *s3); void M_SetupMemcpy(void); +const char *M_FileError(FILE *handle); + // counting bits, for weapon ammo code, usually FUNCMATH UINT8 M_CountBits(UINT32 num, UINT8 size); diff --git a/src/w_wad.c b/src/w_wad.c index c3f38e737..0cd2175ec 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -383,7 +383,7 @@ static lumpinfo_t* ResGetLumpsWad (FILE* handle, UINT16* nlmp, const char* filen // read the header if (fread(&header, 1, sizeof header, handle) < sizeof header) { - CONS_Alert(CONS_ERROR, M_GetText("Can't read wad header because %s\n"), strerror(ferror(handle))); + CONS_Alert(CONS_ERROR, M_GetText("Can't read wad header because %s\n"), M_FileError(handle)); return NULL; } @@ -406,7 +406,7 @@ static lumpinfo_t* ResGetLumpsWad (FILE* handle, UINT16* nlmp, const char* filen if (fseek(handle, header.infotableofs, SEEK_SET) == -1 || fread(fileinfo, 1, i, handle) < i) { - CONS_Alert(CONS_ERROR, M_GetText("Corrupt wadfile directory (%s)\n"), strerror(ferror(handle))); + CONS_Alert(CONS_ERROR, M_GetText("Corrupt wadfile directory (%s)\n"), M_FileError(handle)); free(fileinfov); return NULL; } @@ -427,7 +427,7 @@ static lumpinfo_t* ResGetLumpsWad (FILE* handle, UINT16* nlmp, const char* filen handle) < sizeof realsize) { I_Error("corrupt compressed file: %s; maybe %s", /// \todo Avoid the bailout? - filename, strerror(ferror(handle))); + filename, M_FileError(handle)); } realsize = LONG(realsize); if (realsize != 0) @@ -565,7 +565,7 @@ static lumpinfo_t* ResGetLumpsZip (FILE* handle, UINT16* nlmp) fseek(handle, -4, SEEK_CUR); if (fread(&zend, 1, sizeof zend, handle) < sizeof zend) { - CONS_Alert(CONS_ERROR, "Corrupt central directory (%s)\n", strerror(ferror(handle))); + CONS_Alert(CONS_ERROR, "Corrupt central directory (%s)\n", M_FileError(handle)); return NULL; } numlumps = zend.entries; @@ -582,7 +582,7 @@ static lumpinfo_t* ResGetLumpsZip (FILE* handle, UINT16* nlmp) if (fread(zentry, 1, sizeof(zentry_t), handle) < sizeof(zentry_t)) { - CONS_Alert(CONS_ERROR, "Failed to read central directory (%s)\n", strerror(ferror(handle))); + CONS_Alert(CONS_ERROR, "Failed to read central directory (%s)\n", M_FileError(handle)); Z_Free(lumpinfo); free(zentries); return NULL; @@ -602,7 +602,7 @@ static lumpinfo_t* ResGetLumpsZip (FILE* handle, UINT16* nlmp) fullname = malloc(zentry->namelen + 1); if (fgets(fullname, zentry->namelen + 1, handle) != fullname) { - CONS_Alert(CONS_ERROR, "Unable to read lumpname (%s)\n", strerror(ferror(handle))); + CONS_Alert(CONS_ERROR, "Unable to read lumpname (%s)\n", M_FileError(handle)); Z_Free(lumpinfo); free(zentries); free(fullname); From ab705122531ab387bb88d0409f77ccd63075cffd Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 18 Nov 2019 22:05:05 +0000 Subject: [PATCH 072/189] As requested by MotorRoach and doublechecked with MascaraSnake, DrT's Minus resprite. --- src/dehacked.c | 8 -------- src/info.c | 26 +++++++++----------------- src/info.h | 8 -------- 3 files changed, 9 insertions(+), 33 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index be897b952..d3c0e9af0 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -4970,18 +4970,10 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_MINUS_UPWARD2", "S_MINUS_UPWARD3", "S_MINUS_UPWARD4", - "S_MINUS_UPWARD5", - "S_MINUS_UPWARD6", - "S_MINUS_UPWARD7", - "S_MINUS_UPWARD8", "S_MINUS_DOWNWARD1", "S_MINUS_DOWNWARD2", "S_MINUS_DOWNWARD3", "S_MINUS_DOWNWARD4", - "S_MINUS_DOWNWARD5", - "S_MINUS_DOWNWARD6", - "S_MINUS_DOWNWARD7", - "S_MINUS_DOWNWARD8", // Minus dirt "S_MINUSDIRT1", diff --git a/src/info.c b/src/info.c index b88d02932..4fb57c81d 100644 --- a/src/info.c +++ b/src/info.c @@ -1071,23 +1071,15 @@ state_t states[NUMSTATES] = {SPR_MNUD, 2|FF_ANIMATE, 5, {NULL}, 1, 2, S_MINUS_BURST4}, // S_MINUS_BURST3 {SPR_MNUD, 3|FF_ANIMATE, 5, {NULL}, 1, 2, S_MINUS_BURST5}, // S_MINUS_BURST4 {SPR_MNUD, 4|FF_ANIMATE, 5, {NULL}, 1, 2, S_MINUSDIRT2}, // S_MINUS_BURST5 - {SPR_MNUS, 0, 1, {A_MinusPopup}, 0, 0, S_MINUS_UPWARD1}, // S_MINUS_POPUP - {SPR_MNUS, 0, 1, {A_MinusCheck}, 0, 0, S_MINUS_UPWARD2}, // S_MINUS_UPWARD1 - {SPR_MNUS, 1, 1, {A_MinusCheck}, 0, 0, S_MINUS_UPWARD3}, // S_MINUS_UPWARD2 - {SPR_MNUS, 2, 1, {A_MinusCheck}, 0, 0, S_MINUS_UPWARD4}, // S_MINUS_UPWARD3 - {SPR_MNUS, 3, 1, {A_MinusCheck}, 0, 0, S_MINUS_UPWARD5}, // S_MINUS_UPWARD4 - {SPR_MNUS, 4, 1, {A_MinusCheck}, 0, 0, S_MINUS_UPWARD6}, // S_MINUS_UPWARD5 - {SPR_MNUS, 5, 1, {A_MinusCheck}, 0, 0, S_MINUS_UPWARD7}, // S_MINUS_UPWARD6 - {SPR_MNUS, 6, 1, {A_MinusCheck}, 0, 0, S_MINUS_UPWARD8}, // S_MINUS_UPWARD7 - {SPR_MNUS, 7, 1, {A_MinusCheck}, 0, 0, S_MINUS_UPWARD1}, // S_MINUS_UPWARD8 - {SPR_MNUS, 8, 1, {A_MinusCheck}, 0, 0, S_MINUS_DOWNWARD2}, // S_MINUS_DOWNWARD1 - {SPR_MNUS, 9, 1, {A_MinusCheck}, 0, 0, S_MINUS_DOWNWARD3}, // S_MINUS_DOWNWARD2 - {SPR_MNUS, 10, 1, {A_MinusCheck}, 0, 0, S_MINUS_DOWNWARD4}, // S_MINUS_DOWNWARD3 - {SPR_MNUS, 11, 1, {A_MinusCheck}, 0, 0, S_MINUS_DOWNWARD5}, // S_MINUS_DOWNWARD4 - {SPR_MNUS, 12, 1, {A_MinusCheck}, 0, 0, S_MINUS_DOWNWARD6}, // S_MINUS_DOWNWARD5 - {SPR_MNUS, 13, 1, {A_MinusCheck}, 0, 0, S_MINUS_DOWNWARD7}, // S_MINUS_DOWNWARD6 - {SPR_MNUS, 14, 1, {A_MinusCheck}, 0, 0, S_MINUS_DOWNWARD8}, // S_MINUS_DOWNWARD7 - {SPR_MNUS, 15, 1, {A_MinusCheck}, 0, 0, S_MINUS_DOWNWARD1}, // S_MINUS_DOWNWARD8 + {SPR_MNUS, 3, 1, {A_MinusPopup}, 0, 0, S_MINUS_UPWARD1}, // S_MINUS_POPUP + {SPR_MNUS, 0, 1, {A_MinusCheck}, 0, S_MINUS_DOWNWARD1, S_MINUS_UPWARD2}, // S_MINUS_UPWARD1 + {SPR_MNUS, 1, 1, {A_MinusCheck}, 0, S_MINUS_DOWNWARD2, S_MINUS_UPWARD3}, // S_MINUS_UPWARD2 + {SPR_MNUS, 2, 1, {A_MinusCheck}, 0, S_MINUS_DOWNWARD3, S_MINUS_UPWARD4}, // S_MINUS_UPWARD3 + {SPR_MNUS, 3, 1, {A_MinusCheck}, 0, S_MINUS_DOWNWARD4, S_MINUS_UPWARD1}, // S_MINUS_UPWARD4 + {SPR_MNUS, 4, 1, {A_MinusCheck}, 0, 0, S_MINUS_DOWNWARD2}, // S_MINUS_DOWNWARD1 + {SPR_MNUS, 5, 1, {A_MinusCheck}, 0, 0, S_MINUS_DOWNWARD3}, // S_MINUS_DOWNWARD2 + {SPR_MNUS, 6, 1, {A_MinusCheck}, 0, 0, S_MINUS_DOWNWARD4}, // S_MINUS_DOWNWARD3 + {SPR_MNUS, 7, 1, {A_MinusCheck}, 0, 0, S_MINUS_DOWNWARD1}, // S_MINUS_DOWNWARD4 {SPR_MNUD, FF_ANIMATE, 6, {NULL}, 1, 5, S_MINUSDIRT2}, // S_MINUSDIRT1 {SPR_MNUD, 5, 8, {NULL}, 3, 5, S_MINUSDIRT3}, // S_MINUSDIRT2 diff --git a/src/info.h b/src/info.h index fd9c45a1a..494276212 100644 --- a/src/info.h +++ b/src/info.h @@ -1268,18 +1268,10 @@ typedef enum state S_MINUS_UPWARD2, S_MINUS_UPWARD3, S_MINUS_UPWARD4, - S_MINUS_UPWARD5, - S_MINUS_UPWARD6, - S_MINUS_UPWARD7, - S_MINUS_UPWARD8, S_MINUS_DOWNWARD1, S_MINUS_DOWNWARD2, S_MINUS_DOWNWARD3, S_MINUS_DOWNWARD4, - S_MINUS_DOWNWARD5, - S_MINUS_DOWNWARD6, - S_MINUS_DOWNWARD7, - S_MINUS_DOWNWARD8, // Minus dirt S_MINUSDIRT1, From 5eaa3fc3f8a828fa1d29e6eca328eba009e359c1 Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 18 Nov 2019 22:07:29 +0000 Subject: [PATCH 073/189] Left this in by mistake. --- src/info.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/info.c b/src/info.c index 4fb57c81d..b169f660b 100644 --- a/src/info.c +++ b/src/info.c @@ -1072,10 +1072,10 @@ state_t states[NUMSTATES] = {SPR_MNUD, 3|FF_ANIMATE, 5, {NULL}, 1, 2, S_MINUS_BURST5}, // S_MINUS_BURST4 {SPR_MNUD, 4|FF_ANIMATE, 5, {NULL}, 1, 2, S_MINUSDIRT2}, // S_MINUS_BURST5 {SPR_MNUS, 3, 1, {A_MinusPopup}, 0, 0, S_MINUS_UPWARD1}, // S_MINUS_POPUP - {SPR_MNUS, 0, 1, {A_MinusCheck}, 0, S_MINUS_DOWNWARD1, S_MINUS_UPWARD2}, // S_MINUS_UPWARD1 - {SPR_MNUS, 1, 1, {A_MinusCheck}, 0, S_MINUS_DOWNWARD2, S_MINUS_UPWARD3}, // S_MINUS_UPWARD2 - {SPR_MNUS, 2, 1, {A_MinusCheck}, 0, S_MINUS_DOWNWARD3, S_MINUS_UPWARD4}, // S_MINUS_UPWARD3 - {SPR_MNUS, 3, 1, {A_MinusCheck}, 0, S_MINUS_DOWNWARD4, S_MINUS_UPWARD1}, // S_MINUS_UPWARD4 + {SPR_MNUS, 0, 1, {A_MinusCheck}, 0, 0, S_MINUS_UPWARD2}, // S_MINUS_UPWARD1 + {SPR_MNUS, 1, 1, {A_MinusCheck}, 0, 0, S_MINUS_UPWARD3}, // S_MINUS_UPWARD2 + {SPR_MNUS, 2, 1, {A_MinusCheck}, 0, 0, S_MINUS_UPWARD4}, // S_MINUS_UPWARD3 + {SPR_MNUS, 3, 1, {A_MinusCheck}, 0, 0, S_MINUS_UPWARD1}, // S_MINUS_UPWARD4 {SPR_MNUS, 4, 1, {A_MinusCheck}, 0, 0, S_MINUS_DOWNWARD2}, // S_MINUS_DOWNWARD1 {SPR_MNUS, 5, 1, {A_MinusCheck}, 0, 0, S_MINUS_DOWNWARD3}, // S_MINUS_DOWNWARD2 {SPR_MNUS, 6, 1, {A_MinusCheck}, 0, 0, S_MINUS_DOWNWARD4}, // S_MINUS_DOWNWARD3 From 1698e2d98653712d1c4119f2338ff4e344bf5fd6 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Mon, 18 Nov 2019 19:08:04 -0300 Subject: [PATCH 074/189] adjust duration --- src/f_wipe.c | 9 --------- src/st_stuff.c | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/f_wipe.c b/src/f_wipe.c index ad0e89c13..17ffbe0c4 100644 --- a/src/f_wipe.c +++ b/src/f_wipe.c @@ -450,15 +450,6 @@ void F_RunWipe(UINT8 wipetype, boolean drawMenu) #endif F_DoWipe(fmask); - // draw level title - if ((WipeStageTitle && st_overlay) - && !(mapheaderinfo[gamemap-1]->levelflags & LF_NOTITLECARD) - && *mapheaderinfo[gamemap-1]->lvlttl != '\0') - { - ST_runTitleCard(); - ST_drawWipeTitleCard(); - } - I_OsPolling(); I_UpdateNoBlit(); diff --git a/src/st_stuff.c b/src/st_stuff.c index 2b1b8e3ca..4e8afa16a 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -1202,7 +1202,7 @@ void ST_startTitleCard(void) // initialize HUD variables lt_ticker = lt_exitticker = lt_lasttic = 0; - lt_endtime = 2*TICRATE; + lt_endtime = 2*TICRATE + (10*NEWTICRATERATIO); lt_scroll = BASEVIDWIDTH * FRACUNIT; lt_zigzag = -((lt_patches[1])->width * FRACUNIT); lt_mom = 0; From 1e4060af8cc61f36dd34327f69f8556b74e6c366 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Mon, 18 Nov 2019 19:22:46 -0300 Subject: [PATCH 075/189] remove unused levelwipes --- src/d_main.c | 8 ----- src/doomdef.h | 3 -- src/f_finale.h | 2 -- src/f_wipe.c | 56 ++------------------------------ src/g_game.c | 1 - src/hardware/hw_drv.h | 2 -- src/hardware/hw_main.c | 20 ------------ src/hardware/hw_main.h | 1 - src/hardware/r_opengl/r_opengl.c | 5 --- src/m_menu.c | 2 -- src/sdl/hwsym_sdl.c | 1 - src/sdl/i_video.c | 1 - src/st_stuff.c | 4 --- src/win32/win_dll.c | 2 -- 14 files changed, 3 insertions(+), 105 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index e48b26ba8..728d227b3 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -420,12 +420,6 @@ static void D_Display(void) if (gamestate != GS_TIMEATTACK) CON_Drawer(); -#ifdef LEVELWIPES - // Running a level wipe - if (WipeInAction && WipeInLevel) - F_WipeTicker(); -#endif - M_Drawer(); // menu is drawn even on top of everything // focus lost moved to M_Drawer @@ -445,7 +439,6 @@ static void D_Display(void) { F_WipeEndScreen(); // Funny. -#ifndef LEVELWIPES if (WipeStageTitle && st_overlay) { lt_ticker--; @@ -454,7 +447,6 @@ static void D_Display(void) V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, levelfadecol); F_WipeStartScreen(); } -#endif F_RunWipe(wipetypepost, gamestate != GS_TIMEATTACK && gamestate != GS_TITLESCREEN); } diff --git a/src/doomdef.h b/src/doomdef.h index 8cf9e5d09..511dad858 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -628,9 +628,6 @@ extern const char *compdate, *comptime, *comprevision, *compbranch; #define ROTANGLES 24 // Needs to be a divisor of 360 (45, 60, 90, 120...) #define ROTANGDIFF (360 / ROTANGLES) -/// Level wipes -//#define LEVELWIPES - #ifndef HAVE_PNG #define NO_PNG_LUMPS #endif diff --git a/src/f_finale.h b/src/f_finale.h index 82a7e1408..b5334c29a 100644 --- a/src/f_finale.h +++ b/src/f_finale.h @@ -141,7 +141,6 @@ void F_MenuPresTicker(boolean run); #define FORCEWIPEOFF -2 extern boolean WipeInAction; -extern boolean WipeInLevel; extern boolean WipeStageTitle; typedef enum @@ -176,7 +175,6 @@ extern INT32 lastwipetic; void F_WipeStartScreen(void); void F_WipeEndScreen(void); void F_RunWipe(UINT8 wipetype, boolean drawMenu); -void F_WipeTicker(void); void F_WipeStageTitle(void); #define F_WipeColorFill(c) V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, (wipecolorfill = c)) tic_t F_GetWipeLength(UINT8 wipetype); diff --git a/src/f_wipe.c b/src/f_wipe.c index 17ffbe0c4..b2283c574 100644 --- a/src/f_wipe.c +++ b/src/f_wipe.c @@ -91,7 +91,6 @@ UINT8 wipedefs[NUMWIPEDEFS] = { //-------------------------------------------------------------------------- boolean WipeInAction = false; -boolean WipeInLevel = false; boolean WipeStageTitle = false; INT32 lastwipetic = 0; @@ -104,8 +103,6 @@ static UINT8 *wipe_scr_end; //screen 4 static UINT8 *wipe_scr; //screen 0 (main drawing) static fixed_t paldiv = 0; -static UINT8 curwipetype; -static UINT8 curwipeframe; UINT8 wipecolorfill = 31; /** Create fademask_t from lump @@ -349,8 +346,6 @@ static void F_DoWipe(fademask_t *fademask) free(scrxpos); free(scrypos); } - if (wipestyle == WIPESTYLE_LEVEL) - F_WipeStageTitle(); } #endif @@ -416,13 +411,6 @@ void F_RunWipe(UINT8 wipetype, boolean drawMenu) else wipestyle = WIPESTYLE_NORMAL; - curwipetype = wipetype; - curwipeframe = 0; -#ifdef LEVELWIPES - if (WipeInLevel) - return; -#endif - // lastwipetic should either be 0 or the tic we last wiped // on for fade-to-black for (;;) @@ -450,6 +438,9 @@ void F_RunWipe(UINT8 wipetype, boolean drawMenu) #endif F_DoWipe(fmask); + if (wipestyle == WIPESTYLE_LEVEL) + F_WipeStageTitle(); + I_OsPolling(); I_UpdateNoBlit(); @@ -463,47 +454,6 @@ void F_RunWipe(UINT8 wipetype, boolean drawMenu) } WipeInAction = false; - WipeInLevel = false; - WipeStageTitle = false; -#endif -} - -/** Run and display the fade with the level. - */ -void F_WipeTicker(void) -{ -#ifndef NOWIPE -#ifndef LEVELWIPES - WipeInAction = false; -#else - fademask_t *fmask; - - // Wait, what? - if (!WipeInAction) - return; - - if (rendermode == render_soft) - wipe_scr_start = wipe_scr_end = screens[0]; - - // get fademask first so we can tell if it exists or not - fmask = F_GetFadeMask(curwipetype, curwipeframe++); - if (!fmask) - { - // stop - WipeInAction = false; - WipeInLevel = false; - WipeStageTitle = false; - return; - } - -#ifdef HWRENDER - // send in the wipe type and wipe frame because we need to cache the graphic - if (rendermode == render_opengl) - HWR_DoLevelWipe(curwipetype, curwipeframe-1, wipecolorfill); // also send the wipe color - else -#endif - F_DoWipe(fmask); -#endif WipeStageTitle = false; #endif } diff --git a/src/g_game.c b/src/g_game.c index 5e1645901..3242db300 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1728,7 +1728,6 @@ void G_StartTitleCard(void) // start the title card WipeStageTitle = (!titlemapinaction); - WipeInLevel = true; wipestyleflags |= WSF_FADEIN; wipestyleflags &= ~WSF_FADEOUT; } diff --git a/src/hardware/hw_drv.h b/src/hardware/hw_drv.h index 1e40a403d..aed1611f1 100644 --- a/src/hardware/hw_drv.h +++ b/src/hardware/hw_drv.h @@ -71,7 +71,6 @@ EXPORT void HWRAPI(FlushScreenTextures) (void); EXPORT void HWRAPI(StartScreenWipe) (void); EXPORT void HWRAPI(EndScreenWipe) (void); EXPORT void HWRAPI(DoScreenWipe) (void); -EXPORT void HWRAPI(DoScreenWipeLevel) (void); EXPORT void HWRAPI(DrawIntermissionBG) (void); EXPORT void HWRAPI(MakeScreenTexture) (void); EXPORT void HWRAPI(MakeScreenFinalTexture) (void); @@ -113,7 +112,6 @@ struct hwdriver_s StartScreenWipe pfnStartScreenWipe; EndScreenWipe pfnEndScreenWipe; DoScreenWipe pfnDoScreenWipe; - DoScreenWipeLevel pfnDoScreenWipeLevel; DrawIntermissionBG pfnDrawIntermissionBG; MakeScreenTexture pfnMakeScreenTexture; MakeScreenFinalTexture pfnMakeScreenFinalTexture; diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 263344ebe..5f0c25a59 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -7085,26 +7085,6 @@ void HWR_DoTintedWipe(UINT8 wipenum, UINT8 scrnnum) HWR_DoWipe(wipenum, scrnnum); } -void HWR_DoLevelWipe(UINT8 wipenum, UINT8 scrnnum, UINT8 colfill) -{ -#ifndef LEVELWIPES - (void)wipenum; - (void)scrnnum; - (void)colfill; -#else - if (!HWR_WipeCheck(wipenum, scrnnum)) - return; - - HWR_EndScreenWipe(); - V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, colfill); - HWR_StartScreenWipe(); - HWR_GetFadeMask(wipelumpnum); - - HWD.pfnDoScreenWipeLevel(); - F_WipeStageTitle(); -#endif -} - void HWR_MakeScreenFinalTexture(void) { HWD.pfnMakeScreenFinalTexture(); diff --git a/src/hardware/hw_main.h b/src/hardware/hw_main.h index fb726f2f9..e19c557d0 100644 --- a/src/hardware/hw_main.h +++ b/src/hardware/hw_main.h @@ -67,7 +67,6 @@ void HWR_EndScreenWipe(void); void HWR_DrawIntermissionBG(void); void HWR_DoWipe(UINT8 wipenum, UINT8 scrnnum); void HWR_DoTintedWipe(UINT8 wipenum, UINT8 scrnnum); -void HWR_DoLevelWipe(UINT8 wipenum, UINT8 scrnnum, UINT8 wipecolorfill); void HWR_MakeScreenFinalTexture(void); void HWR_DrawScreenFinalTexture(int width, int height); diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index 323772cb0..8c0ca7155 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -2587,11 +2587,6 @@ EXPORT void HWRAPI(DoScreenWipe)(void) tex_downloaded = endScreenWipe; } -EXPORT void HWRAPI(DoScreenWipeLevel)(void) -{ - DoScreenWipe(); -} - // Create a texture from the screen. EXPORT void HWRAPI(MakeScreenTexture) (void) { diff --git a/src/m_menu.c b/src/m_menu.c index 7a5aa8ae6..9ffc1150c 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -3365,8 +3365,6 @@ boolean M_Responder(event_t *ev) void M_Drawer(void) { boolean wipe = WipeInAction; - if (WipeInLevel) - wipe = false; if (currentMenu == &MessageDef) menuactive = true; diff --git a/src/sdl/hwsym_sdl.c b/src/sdl/hwsym_sdl.c index 82a430ee6..5f040023a 100644 --- a/src/sdl/hwsym_sdl.c +++ b/src/sdl/hwsym_sdl.c @@ -97,7 +97,6 @@ void *hwSym(const char *funcName,void *handle) GETFUNC(StartScreenWipe); GETFUNC(EndScreenWipe); GETFUNC(DoScreenWipe); - GETFUNC(DoScreenWipeLevel); GETFUNC(DrawIntermissionBG); GETFUNC(MakeScreenTexture); GETFUNC(MakeScreenFinalTexture); diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 5f162b00d..f22c79eca 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -1666,7 +1666,6 @@ void I_StartupGraphics(void) HWD.pfnStartScreenWipe = hwSym("StartScreenWipe",NULL); HWD.pfnEndScreenWipe = hwSym("EndScreenWipe",NULL); HWD.pfnDoScreenWipe = hwSym("DoScreenWipe",NULL); - HWD.pfnDoScreenWipeLevel= hwSym("DoScreenWipeLevel",NULL); HWD.pfnDrawIntermissionBG=hwSym("DrawIntermissionBG",NULL); HWD.pfnMakeScreenTexture= hwSym("MakeScreenTexture",NULL); HWD.pfnMakeScreenFinalTexture=hwSym("MakeScreenFinalTexture",NULL); diff --git a/src/st_stuff.c b/src/st_stuff.c index 4e8afa16a..621f67820 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -1294,10 +1294,8 @@ void ST_drawTitleCard(void) return; #endif -#ifndef LEVELWIPES if ((lt_ticker-lt_lasttic) > 1) lt_ticker = lt_lasttic+1; -#endif ST_cacheLevelTitle(); actpat = lt_patches[0]; @@ -1351,9 +1349,7 @@ luahook: void ST_preLevelTitleCardDrawer(tic_t ticker, boolean update) { V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, levelfadecol); -#ifndef LEVELWIPES if (ticker < PRELEVELTIME-1) -#endif ST_drawWipeTitleCard(); I_OsPolling(); diff --git a/src/win32/win_dll.c b/src/win32/win_dll.c index 1311b6870..5378bb52f 100644 --- a/src/win32/win_dll.c +++ b/src/win32/win_dll.c @@ -121,7 +121,6 @@ static loadfunc_t hwdFuncTable[] = { {"StartScreenWipe@0", &hwdriver.pfnStartScreenWipe}, {"EndScreenWipe@0", &hwdriver.pfnEndScreenWipe}, {"DoScreenWipe@4", &hwdriver.pfnDoScreenWipe}, - {"DoScreenWipeLevel@0", &hwdriver.pfnDoScreenWipeLevel}, {"DrawIntermissionBG@0",&hwdriver.pfnDrawIntermissionBG}, {"MakeScreenTexture@0", &hwdriver.pfnMakeScreenTexture}, {"MakeScreenFinalTexture@0", &hwdriver.pfnMakeScreenFinalTexture}, @@ -153,7 +152,6 @@ static loadfunc_t hwdFuncTable[] = { {"StartScreenWipe", &hwdriver.pfnStartScreenWipe}, {"EndScreenWipe", &hwdriver.pfnEndScreenWipe}, {"DoScreenWipe", &hwdriver.pfnDoScreenWipe}, - {"DoScreenWipeLevel", &hwdriver.pfnDoScreenWipeLevel}, {"DrawIntermissionBG", &hwdriver.pfnDrawIntermissionBG}, {"MakeScreenTexture", &hwdriver.pfnMakeScreenTexture}, {"MakeScreenFinalTexture", &hwdriver.pfnMakeScreenFinalTexture}, From 8de06a93f9c2e62c57392d7bbc44fdba1855fcb4 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Mon, 18 Nov 2019 20:07:37 -0300 Subject: [PATCH 076/189] remove UINT8 wipecolorfill --- src/f_finale.h | 3 +-- src/f_wipe.c | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/f_finale.h b/src/f_finale.h index b5334c29a..024b183b2 100644 --- a/src/f_finale.h +++ b/src/f_finale.h @@ -165,7 +165,6 @@ extern wipestyleflags_t wipestyleflags; #define FADEGREENFACTOR 15 #define FADEBLUEFACTOR 10 -extern UINT8 wipecolorfill; extern INT32 lastwipetic; // Don't know where else to place this constant @@ -176,7 +175,7 @@ void F_WipeStartScreen(void); void F_WipeEndScreen(void); void F_RunWipe(UINT8 wipetype, boolean drawMenu); void F_WipeStageTitle(void); -#define F_WipeColorFill(c) V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, (wipecolorfill = c)) +#define F_WipeColorFill(c) V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, c) tic_t F_GetWipeLength(UINT8 wipetype); boolean F_WipeExists(UINT8 wipetype); diff --git a/src/f_wipe.c b/src/f_wipe.c index b2283c574..20651cb1d 100644 --- a/src/f_wipe.c +++ b/src/f_wipe.c @@ -103,8 +103,6 @@ static UINT8 *wipe_scr_end; //screen 4 static UINT8 *wipe_scr; //screen 0 (main drawing) static fixed_t paldiv = 0; -UINT8 wipecolorfill = 31; - /** Create fademask_t from lump * * \param lump Lump name to get data from From eefc285b5c3ffa9aaa2947018afe360d43f9d440 Mon Sep 17 00:00:00 2001 From: James R Date: Mon, 18 Nov 2019 15:48:29 -0800 Subject: [PATCH 077/189] locvars not needed --- src/p_enemy.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index a77c2a5ec..ea09533df 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -14606,8 +14606,6 @@ void A_RolloutRock(mobj_t *actor) // void A_DragonbomberSpawn(mobj_t *actor) { - INT32 locvar1 = var1; - INT32 locvar2 = var2; UINT8 i; mobj_t *mo = actor; @@ -14646,8 +14644,6 @@ void A_DragonbomberSpawn(mobj_t *actor) // void A_DragonWing(mobj_t *actor) { - INT32 locvar1 = var1; - INT32 locvar2 = var2; mobj_t *target = actor->target; fixed_t x, y; @@ -14676,8 +14672,6 @@ void A_DragonWing(mobj_t *actor) // void A_DragonSegment(mobj_t *actor) { - INT32 locvar1 = var1; - INT32 locvar2 = var2; mobj_t *target = actor->target; fixed_t dist = P_AproxDistance(P_AproxDistance(actor->x - target->x, actor->y - target->y), actor->z - target->z); fixed_t radius = actor->radius + target->radius; @@ -14695,4 +14689,4 @@ void A_DragonSegment(mobj_t *actor) actor->angle = hangle; P_TeleportMove(actor, target->x + xdist, target->y + ydist, target->z + zdist); -} \ No newline at end of file +} From 1febf8cb4b67108b85b8fad4e20ffe24e5d8d541 Mon Sep 17 00:00:00 2001 From: James R Date: Mon, 18 Nov 2019 15:52:14 -0800 Subject: [PATCH 078/189] Mixed code... --- src/b_bot.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/b_bot.c b/src/b_bot.c index badc36b27..0b3d08168 100644 --- a/src/b_bot.c +++ b/src/b_bot.c @@ -445,10 +445,12 @@ void B_KeysToTiccmd(mobj_t *mo, ticcmd_t *cmd, boolean forward, boolean backward // cap inputs so the bot can't accelerate faster diagonally angle = R_PointToAngle2(0, 0, cmd->sidemove << FRACBITS, cmd->forwardmove << FRACBITS); - INT32 maxforward = abs(P_ReturnThrustY(NULL, angle, MAXPLMOVE)); - INT32 maxside = abs(P_ReturnThrustX(NULL, angle, MAXPLMOVE)); - cmd->forwardmove = max(min(cmd->forwardmove, maxforward), -maxforward); - cmd->sidemove = max(min(cmd->sidemove, maxside), -maxside); + { + INT32 maxforward = abs(P_ReturnThrustY(NULL, angle, MAXPLMOVE)); + INT32 maxside = abs(P_ReturnThrustX(NULL, angle, MAXPLMOVE)); + cmd->forwardmove = max(min(cmd->forwardmove, maxforward), -maxforward); + cmd->sidemove = max(min(cmd->sidemove, maxside), -maxside); + } } if (jump) cmd->buttons |= BT_JUMP; From f3e66f7b5899dcd1b9d13bb3bdd16e1fa1ca278d Mon Sep 17 00:00:00 2001 From: James R Date: Mon, 18 Nov 2019 15:53:30 -0800 Subject: [PATCH 079/189] dist is unused --- src/p_mobj.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index b9770809e..cbd6c3c7f 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -9693,7 +9693,6 @@ void P_MobjThinker(mobj_t *mobj) fixed_t x = mobj->spawnpoint->x << FRACBITS; fixed_t y = mobj->spawnpoint->y << FRACBITS; fixed_t z = mobj->spawnpoint->z << FRACBITS; - fixed_t dist = P_AproxDistance(mobj->x - x, mobj->y - y); angle_t diff = R_PointToAngle2(mobj->x, mobj->y, x, y) - mobj->angle; if (diff > ANGLE_180) mobj->angle -= DRAGONTURNSPEED; From 1db9e312a6ce59546d15064ed49a3a63da07fb43 Mon Sep 17 00:00:00 2001 From: James R Date: Mon, 18 Nov 2019 15:55:21 -0800 Subject: [PATCH 080/189] P_MobjFlip does not return boolean --- src/b_bot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/b_bot.c b/src/b_bot.c index 0b3d08168..12cdc36a0 100644 --- a/src/b_bot.c +++ b/src/b_bot.c @@ -51,7 +51,7 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm player_t *player = sonic->player, *bot = tails->player; ticcmd_t *pcmd = &player->cmd; boolean water = tails->eflags & MFE_UNDERWATER; - boolean flip = P_MobjFlip(tails); + SINT8 flip = P_MobjFlip(tails); boolean _2d = (tails->flags2 & MF2_TWOD) || twodlevel; fixed_t scale = tails->scale; From 8de7ff0c861ecda31e4e738feefb477bc28a29bb Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Mon, 18 Nov 2019 21:44:02 -0300 Subject: [PATCH 081/189] fix subttl --- src/st_stuff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/st_stuff.c b/src/st_stuff.c index 621f67820..60aadccfe 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -1333,7 +1333,7 @@ void ST_drawTitleCard(void) V_DrawLevelTitle(lvlttlxpos - ttlscroll, 80, V_PERPLAYER, lvlttl); if (!(mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE)) V_DrawLevelTitle(zonexpos + ttlscroll, 104, V_PERPLAYER, M_GetText("Zone")); - V_DrawCenteredString(subttlxpos - ttlnumxpos, 128, V_PERPLAYER|V_ALLOWLOWERCASE, subttl); + V_DrawCenteredString(subttlxpos - ttlscroll, 128, V_PERPLAYER|V_ALLOWLOWERCASE, subttl); lt_lasttic = lt_ticker; From 99d4db956c58dbeff87cad16cbfece1c75251653 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Mon, 18 Nov 2019 21:45:30 -0300 Subject: [PATCH 082/189] change vertical alignment --- src/st_stuff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/st_stuff.c b/src/st_stuff.c index 60aadccfe..90e64798a 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -1333,7 +1333,7 @@ void ST_drawTitleCard(void) V_DrawLevelTitle(lvlttlxpos - ttlscroll, 80, V_PERPLAYER, lvlttl); if (!(mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE)) V_DrawLevelTitle(zonexpos + ttlscroll, 104, V_PERPLAYER, M_GetText("Zone")); - V_DrawCenteredString(subttlxpos - ttlscroll, 128, V_PERPLAYER|V_ALLOWLOWERCASE, subttl); + V_DrawCenteredString(subttlxpos - ttlscroll, 152, V_PERPLAYER|V_ALLOWLOWERCASE, subttl); lt_lasttic = lt_ticker; From 340e2e48f93ae5e466829dfdfbc3948774e5dab4 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 19 Nov 2019 11:53:45 +0000 Subject: [PATCH 083/189] Fix crash in new fireflower. (resolves #305) Also, correct indentation on bounce ring fuse since I was here. --- src/p_user.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 47812744e..080d51e53 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -4030,7 +4030,8 @@ static void P_DoFiring(player_t *player, ticcmd_t *cmd) { player->pflags |= PF_ATTACKDOWN; mo = P_SpawnPlayerMissile(player->mo, MT_FIREBALL, 0); - P_InstaThrust(mo, player->mo->angle, ((mo->info->speed>>FRACBITS)*player->mo->scale) + player->speed); + if (mo) + P_InstaThrust(mo, player->mo->angle, ((mo->info->speed>>FRACBITS)*player->mo->scale) + player->speed); S_StartSound(player->mo, sfx_mario7); P_SetWeaponDelay(player, TICRATE); // Short delay between fireballs so you can't spam them everywhere return; @@ -4051,8 +4052,8 @@ static void P_DoFiring(player_t *player, ticcmd_t *cmd) mo = P_SpawnPlayerMissile(player->mo, MT_THROWNBOUNCE, MF2_BOUNCERING); - if (mo) - mo->fuse = 3*TICRATE; // Bounce Ring time + if (mo) + mo->fuse = 3*TICRATE; // Bounce Ring time } // Rail ring else if (player->currentweapon == WEP_RAIL && player->powers[pw_railring]) From 2ac44240db77c0d6aa52855083f272be592aab22 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 19 Nov 2019 12:59:01 +0000 Subject: [PATCH 084/189] Fix the coords of the subtitle. --- src/st_stuff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/st_stuff.c b/src/st_stuff.c index 4e8afa16a..42a89aab6 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -1335,7 +1335,7 @@ void ST_drawTitleCard(void) V_DrawLevelTitle(lvlttlxpos - ttlscroll, 80, V_PERPLAYER, lvlttl); if (!(mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE)) V_DrawLevelTitle(zonexpos + ttlscroll, 104, V_PERPLAYER, M_GetText("Zone")); - V_DrawCenteredString(subttlxpos - ttlnumxpos, 128, V_PERPLAYER|V_ALLOWLOWERCASE, subttl); + V_DrawCenteredString(subttlxpos - ttlscroll, 135, V_PERPLAYER|V_ALLOWLOWERCASE, subttl); lt_lasttic = lt_ticker; From 3add9a9bd257d1d32b6739e393ca7faa5dbb6a0a Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 19 Nov 2019 13:00:10 +0000 Subject: [PATCH 085/189] Make the SPEEDING OFF TO ZONE text that appears while loading: * Use a mixed case "Zone" to match the mixed case level titles. * Have V_TRANSLUCENT to not stick out too much against pure black/white backgrounds. (Can revert this aspect if necessary, but I think you'll agree it's a good balance between readable and aesthetic.) --- src/p_setup.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/p_setup.c b/src/p_setup.c index bc0829670..e87a088d8 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2805,12 +2805,12 @@ boolean P_SetupLevel(boolean skipprecip) { // Don't include these in the fade! char tx[64]; - V_DrawSmallString(1, 191, V_ALLOWLOWERCASE, M_GetText("Speeding off to...")); + V_DrawSmallString(1, 191, V_ALLOWLOWERCASE|V_TRANSLUCENT, M_GetText("Speeding off to...")); snprintf(tx, 63, "%s%s%s", mapheaderinfo[gamemap-1]->lvlttl, - (mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE) ? "" : " ZONE", - (mapheaderinfo[gamemap-1]->actnum > 0) ? va(", Act %d",mapheaderinfo[gamemap-1]->actnum) : ""); - V_DrawSmallString(1, 195, V_ALLOWLOWERCASE, tx); + (mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE) ? "" : " Zone", + (mapheaderinfo[gamemap-1]->actnum > 0) ? va("%d",mapheaderinfo[gamemap-1]->actnum) : ""); + V_DrawSmallString(1, 195, V_ALLOWLOWERCASE|V_TRANSLUCENT, tx); I_UpdateNoVsync(); } From ef1aeb2ff6d17c64dcd221e2bbb4a09fd9ad5c5a Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 19 Nov 2019 13:36:33 +0000 Subject: [PATCH 086/189] MS Info packet tweaks. * Report a completely uppercase map title in SERVERINFO, as per the MS previously expected (resolves #300). * Ignore colour codes in map titles in SERVERINFO, since those now function like with console font. * Modulo the skin number provided in PLAYERINFO by 3 in DEVELOP builds, so it's safe to test with certain characters on the MS (AS LONG AS IT'S NOT A RELEASE BUILD). --- src/d_clisrv.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index aca37df1d..ece74ed4b 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1302,7 +1302,19 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime) M_Memcpy(netbuffer->u.serverinfo.mapmd5, mapmd5, 16); if (strcmp(mapheaderinfo[gamemap-1]->lvlttl, "")) - strncpy(netbuffer->u.serverinfo.maptitle, (char *)mapheaderinfo[gamemap-1]->lvlttl, 33); + { + char *read = mapheaderinfo[gamemap-1]->lvlttl, *writ = netbuffer->u.serverinfo.maptitle; + while (*read != '\0' && (read-mapheaderinfo[gamemap-1]->lvlttl) < 33) + { + if (!(*read & 0x80)) + { + *writ = toupper(*read); + writ++; + } + read++; + } + //strncpy(netbuffer->u.serverinfo.maptitle, (char *)mapheaderinfo[gamemap-1]->lvlttl, 33); + } else strncpy(netbuffer->u.serverinfo.maptitle, "UNKNOWN", 33); @@ -1358,7 +1370,11 @@ static void SV_SendPlayerInfo(INT32 node) netbuffer->u.playerinfo[i].score = LONG(players[i].score); netbuffer->u.playerinfo[i].timeinserver = SHORT((UINT16)(players[i].jointime / TICRATE)); - netbuffer->u.playerinfo[i].skin = (UINT8)players[i].skin; + netbuffer->u.playerinfo[i].skin = (UINT8)(players[i].skin +#ifdef DEVELOP // it's safe to do this only because PLAYERINFO isn't read by the game itself + % 3 +#endif + ); // Extra data netbuffer->u.playerinfo[i].data = 0; //players[i].skincolor; From f5885f84f039df2da679366c2f3ea9a2079b62dc Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 19 Nov 2019 13:40:07 +0000 Subject: [PATCH 087/189] lmao how did i forget a null terminator --- src/d_clisrv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index ece74ed4b..cde0382f5 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1304,7 +1304,7 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime) if (strcmp(mapheaderinfo[gamemap-1]->lvlttl, "")) { char *read = mapheaderinfo[gamemap-1]->lvlttl, *writ = netbuffer->u.serverinfo.maptitle; - while (*read != '\0' && (read-mapheaderinfo[gamemap-1]->lvlttl) < 33) + while (*read != '\0' && (read-mapheaderinfo[gamemap-1]->lvlttl) < 32) { if (!(*read & 0x80)) { @@ -1313,6 +1313,7 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime) } read++; } + *writ = '\0'; //strncpy(netbuffer->u.serverinfo.maptitle, (char *)mapheaderinfo[gamemap-1]->lvlttl, 33); } else From 86f343b84bb2eb51b97963b655bdd8e9592ade23 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 19 Nov 2019 14:09:24 +0000 Subject: [PATCH 088/189] Make the All Players linedef exectutor activator sector type more reliable for FOFs that span multiple sectors (resolves #301). --- src/p_spec.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/p_spec.c b/src/p_spec.c index f1a697399..bde941f29 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -4443,27 +4443,18 @@ void P_ProcessSpecialSector(player_t *player, sector_t *sector, sector_t *rovers { if (roversector) { - if (players[i].mo->subsector->sector == roversector) - ; - else if (sector->flags & SF_TRIGGERSPECIAL_TOUCH) + if (sector->flags & SF_TRIGGERSPECIAL_TOUCH) { - boolean insector = false; msecnode_t *node; for (node = players[i].mo->touching_sectorlist; node; node = node->m_sectorlist_next) { - if (node->m_sector == roversector) - { - insector = true; + if (P_ThingIsOnThe3DFloor(players[i].mo, sector, node->m_sector)) break; - } } - if (!insector) + if (!node) goto DoneSection2; } - else - goto DoneSection2; - - if (!P_ThingIsOnThe3DFloor(players[i].mo, sector, roversector)) + else if (players[i].mo->subsector && !P_ThingIsOnThe3DFloor(players[i].mo, sector, players[i].mo->subsector->sector)) // this function handles basically everything for us lmao goto DoneSection2; } else From 2bba25c1e1cc3fa08a3c6a9108078fd52f55d483 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 19 Nov 2019 15:59:24 +0000 Subject: [PATCH 089/189] As selected by Nev3r, implement option 2: Proximity Bastard for the Sea Egg to resolve #303. --- src/p_mobj.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index cbd6c3c7f..f2dd1a734 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -4538,23 +4538,29 @@ static void P_Boss3Thinker(mobj_t *mobj) } else if (mobj->movecount) // Firing mode { - // look for a new target - P_BossTargetPlayer(mobj, false); - - if (!mobj->target || !mobj->target->player) - return; - - // Always face your target. - A_FaceTarget(mobj); - // Check if the attack animation is running. If not, play it. if (mobj->state < &states[mobj->info->missilestate] || mobj->state > &states[mobj->info->raisestate]) { + // look for a new target + P_BossTargetPlayer(mobj, true); + + if (!mobj->target || !mobj->target->player) + return; + if (mobj->health <= mobj->info->damage) // pinch phase mobj->movecount--; // limited number of shots before diving again if (mobj->movecount) P_SetMobjState(mobj, mobj->info->missilestate+1); } + else if (mobj->target && mobj->target->player) + { + angle_t diff = R_PointToAngle2(mobj->x, mobj->y, mobj->target->x, mobj->target->y) - mobj->angle; + if (diff > ANGLE_180) + diff = InvAngle(InvAngle(diff)/4); + else + diff /= 4; + mobj->angle += diff; + } } else if (mobj->threshold >= 0) // Traveling mode { @@ -4669,13 +4675,10 @@ static void P_Boss3Thinker(mobj_t *mobj) S_StartSound(mobj, shock->info->seesound); // look for a new target - P_BossTargetPlayer(mobj, false); + P_BossTargetPlayer(mobj, true); if (mobj->target && mobj->target->player) - { - A_FaceTarget(mobj); P_SetMobjState(mobj, mobj->info->missilestate); - } } else if (mobj->flags2 & (MF2_STRONGBOX|MF2_CLASSICPUSH)) // just hit the bottom of your tube { From d1d1098f7caee6274be52185e984886ba8509e89 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 19 Nov 2019 12:31:20 -0500 Subject: [PATCH 090/189] fix object type restrictions for popping monitors (MT_BOUNCERING to MT_GRENADERING are actually the ammo pickups, MT_THROWNBOUNCE to MT_THROWNGRENADE are what actually want here) --- src/p_inter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_inter.c b/src/p_inter.c index f68cb90f0..a51a4e8e6 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -3532,7 +3532,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da // Make sure that boxes cannot be popped by enemies, red rings, etc. if (target->flags & MF_MONITOR && ((!source || !source->player || source->player->bot) - || (inflictor && inflictor->type >= MT_REDRING && inflictor->type <= MT_GRENADERING))) + || (inflictor && (inflictor->type == MT_REDRING || (inflictor->type >= MT_THROWNBOUNCE && inflictor->type <= MT_THROWNGRENADE))))) return false; } From c5d73e37bbc0c9fa8fd1dd874ac782b655068576 Mon Sep 17 00:00:00 2001 From: James R Date: Tue, 19 Nov 2019 11:16:17 -0800 Subject: [PATCH 091/189] Fix strcasestr SIGSEGV in the case of only upper case strchr returning NULL --- src/strcasestr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/strcasestr.c b/src/strcasestr.c index 2077dc3ff..86c7ec5b0 100644 --- a/src/strcasestr.c +++ b/src/strcasestr.c @@ -75,7 +75,7 @@ strcasestr (const char *s, const char *q) if (!( (intptr_t)up|(intptr_t)lp )) return 0; - if (!lp || up < lp) + if (!lp || ( up && up < lp )) { ppa = &up; ppb = &lp; From 7645d0417a397e34a080632403caf733c25a422f Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 19 Nov 2019 20:24:44 +0000 Subject: [PATCH 092/189] Further cleanup. --- src/d_clisrv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index cde0382f5..40703b557 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1301,10 +1301,10 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime) M_Memcpy(netbuffer->u.serverinfo.mapmd5, mapmd5, 16); - if (strcmp(mapheaderinfo[gamemap-1]->lvlttl, "")) + if (*mapheaderinfo[gamemap-1]->lvlttl) { char *read = mapheaderinfo[gamemap-1]->lvlttl, *writ = netbuffer->u.serverinfo.maptitle; - while (*read != '\0' && (read-mapheaderinfo[gamemap-1]->lvlttl) < 32) + while (writ < (netbuffer->u.serverinfo.maptitle+32) && *read != '\0') { if (!(*read & 0x80)) { @@ -1317,7 +1317,7 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime) //strncpy(netbuffer->u.serverinfo.maptitle, (char *)mapheaderinfo[gamemap-1]->lvlttl, 33); } else - strncpy(netbuffer->u.serverinfo.maptitle, "UNKNOWN", 33); + strncpy(netbuffer->u.serverinfo.maptitle, "UNKNOWN", 32); netbuffer->u.serverinfo.maptitle[32] = '\0'; From 9b96964cbbfc20565a8cfdb741f4927f36df7899 Mon Sep 17 00:00:00 2001 From: James R Date: Tue, 19 Nov 2019 12:25:50 -0800 Subject: [PATCH 093/189] Check for out of range gametype on map change --- src/d_netcmd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 4de166e41..8917156d7 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -2054,7 +2054,9 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum) lastgametype = gametype; gametype = READUINT8(*cp); - if (gametype != lastgametype) + if (gametype < 0 || gametype >= NUMGAMETYPES) + gametype = lastgametype; + else if (gametype != lastgametype) D_GameTypeChanged(lastgametype); // emulate consvar_t behavior for gametype skipprecutscene = ((flags & (1<<2)) != 0); From 6ffb18c4b157f9efecec6a104ef930dd71f8b986 Mon Sep 17 00:00:00 2001 From: James R Date: Tue, 19 Nov 2019 12:32:02 -0800 Subject: [PATCH 094/189] Warn if gametype number is out of range to map command --- src/d_netcmd.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 8917156d7..7a8cf539f 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -1939,6 +1939,17 @@ static void Command_Map_f(void) d = atoi(gametypename); if (d >= 0 && d < NUMGAMETYPES) newgametype = d; + else + { + CONS_Alert(CONS_ERROR, + "Gametype number %d is out of range. Use a number between" + " 0 and %d inclusive. ...Or just use the name. :v\n", + d, + NUMGAMETYPES-1); + Z_Free(realmapname); + Z_Free(mapname); + return; + } } else { From 032f53ce07d8c3b41451e0aa08eee262f081b5e2 Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Tue, 19 Nov 2019 22:44:33 +0100 Subject: [PATCH 095/189] Prevent drowning after completing the level --- src/p_mobj.c | 2 +- src/p_user.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index cbd6c3c7f..d73f11f81 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3408,7 +3408,7 @@ void P_MobjCheckWater(mobj_t *mobj) // Drown timer setting if ((p->powers[pw_shield] & SH_PROTECTWATER) // Has water protection - || (p->exiting) // Or exiting + || (p->exiting) || (p->pflags & PF_FINISHED) // Or finished/exiting || (maptol & TOL_NIGHTS) // Or in NiGHTS mode || (mariomode)) // Or in Mario mode... { diff --git a/src/p_user.c b/src/p_user.c index 47812744e..672cf8aae 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2153,6 +2153,10 @@ void P_DoPlayerFinish(player_t *player) if (netgame) CONS_Printf(M_GetText("%s has completed the level.\n"), player_names[player-players]); + + player->powers[pw_underwater] = 0; + player->powers[pw_spacetime] = 0; + P_RestoreMusic(player); } // @@ -2860,7 +2864,7 @@ static void P_CheckUnderwaterAndSpaceTimer(player_t *player) { tic_t timeleft = (player->powers[pw_spacetime]) ? player->powers[pw_spacetime] : player->powers[pw_underwater]; - if (player->exiting) + if (player->exiting || (player->pflags & PF_FINISHED)) player->powers[pw_underwater] = player->powers[pw_spacetime] = 0; timeleft--; // The original code was all n*TICRATE + 1, so let's remove 1 tic for simplicity From abf0c5e6321d4c45f8584abfb358701584bac76d Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 20 Nov 2019 14:34:19 +0000 Subject: [PATCH 096/189] resolve #315 --- src/p_spec.c | 75 ++++++++++++++++++++++++++++------------------------ 1 file changed, 40 insertions(+), 35 deletions(-) diff --git a/src/p_spec.c b/src/p_spec.c index bde941f29..f814e89c6 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -4439,50 +4439,55 @@ void P_ProcessSpecialSector(player_t *player, sector_t *sector, sector_t *rovers case 3: // Linedef executor requires all players present /// \todo check continues for proper splitscreen support? for (i = 0; i < MAXPLAYERS; i++) - if (playeringame[i] && !players[i].bot && players[i].mo && (gametype != GT_COOP || players[i].lives > 0)) + { + if (!playeringame[i]) + continue; + if (!players[i].mo) + continue; + if (players[i].spectator) + continue; + if (players[i].bot) + continue; + if (gametype == GT_COOP && players[i].lives <= 0) + continue; + if (roversector) { - if (roversector) + if (sector->flags & SF_TRIGGERSPECIAL_TOUCH) { - if (sector->flags & SF_TRIGGERSPECIAL_TOUCH) + msecnode_t *node; + for (node = players[i].mo->touching_sectorlist; node; node = node->m_sectorlist_next) { - msecnode_t *node; - for (node = players[i].mo->touching_sectorlist; node; node = node->m_sectorlist_next) - { - if (P_ThingIsOnThe3DFloor(players[i].mo, sector, node->m_sector)) - break; - } - if (!node) - goto DoneSection2; + if (P_ThingIsOnThe3DFloor(players[i].mo, sector, node->m_sector)) + break; } - else if (players[i].mo->subsector && !P_ThingIsOnThe3DFloor(players[i].mo, sector, players[i].mo->subsector->sector)) // this function handles basically everything for us lmao + if (!node) + goto DoneSection2; + } + else if (players[i].mo->subsector && !P_ThingIsOnThe3DFloor(players[i].mo, sector, players[i].mo->subsector->sector)) // this function handles basically everything for us lmao + goto DoneSection2; + } + else + { + if (players[i].mo->subsector->sector == sector) + ; + else if (sector->flags & SF_TRIGGERSPECIAL_TOUCH) + { + msecnode_t *node; + for (node = players[i].mo->touching_sectorlist; node; node = node->m_sectorlist_next) + { + if (node->m_sector == sector) + break; + } + if (!node) goto DoneSection2; } else - { - if (players[i].mo->subsector->sector == sector) - ; - else if (sector->flags & SF_TRIGGERSPECIAL_TOUCH) - { - boolean insector = false; - msecnode_t *node; - for (node = players[i].mo->touching_sectorlist; node; node = node->m_sectorlist_next) - { - if (node->m_sector == sector) - { - insector = true; - break; - } - } - if (!insector) - goto DoneSection2; - } - else - goto DoneSection2; + goto DoneSection2; - if (special == 3 && !P_MobjReadyToTrigger(players[i].mo, sector)) - goto DoneSection2; - } + if (special == 3 && !P_MobjReadyToTrigger(players[i].mo, sector)) + goto DoneSection2; } + } /* FALLTHRU */ case 4: // Linedef executor that doesn't require touching floor case 5: // Linedef executor From cdc7a88b04566eae275e43b4ea5b06430c4f15de Mon Sep 17 00:00:00 2001 From: lachwright Date: Wed, 20 Nov 2019 23:45:34 +0800 Subject: [PATCH 097/189] Add bump sounds to rollout rock & add Newton's third law to jumping off them --- src/info.c | 2 +- src/p_enemy.c | 3 +++ src/p_map.c | 4 +++- src/p_user.c | 2 ++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/info.c b/src/info.c index 50da228e5..404958058 100644 --- a/src/info.c +++ b/src/info.c @@ -13448,7 +13448,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // attacksound S_NULL, // painstate 12*TICRATE, // painchance (sets how long an unridden rock should last before disappearing - set to 0 to disable) - sfx_None, // painsound + sfx_s3k49, // painsound S_NULL, // meleestate S_NULL, // missilestate S_NULL, // deathstate diff --git a/src/p_enemy.c b/src/p_enemy.c index ea09533df..26d079cb4 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -14534,6 +14534,9 @@ void A_RolloutRock(mobj_t *actor) actor->friction = FRACUNIT; // turns out riding on solids sucks, so let's just make it easier on ourselves + if (actor->eflags & MFE_JUSTHITFLOOR) + S_StartSound(actor, actor->info->painsound); + if (actor->threshold) actor->threshold--; diff --git a/src/p_map.c b/src/p_map.c index 28c5ac955..97bff8156 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1032,7 +1032,8 @@ static boolean PIT_CheckThing(mobj_t *thing) P_SetPlayerMobjState(tmthing, S_PLAY_WALK); tmthing->player->powers[pw_carry] = CR_ROLLOUT; P_SetTarget(&tmthing->tracer, thing); - P_SetObjectMomZ(thing, tmthing->momz, true); + if (!P_IsObjectOnGround(thing)) + thing->momz += tmthing->momz; return true; } } @@ -1063,6 +1064,7 @@ static boolean PIT_CheckThing(mobj_t *thing) thing->momy = tmthing->momy; tmthing->momx = tempmomx; tmthing->momy = tempmomy; + S_StartSound(thing, thing->info->painsound); } } diff --git a/src/p_user.c b/src/p_user.c index 47812744e..f79e51080 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -4428,6 +4428,8 @@ void P_DoJump(player_t *player, boolean soundandstate) player->mo->momz = 9*FRACUNIT; if (P_MobjFlip(player->mo->tracer)*player->mo->tracer->momz > 0) player->mo->momz += player->mo->tracer->momz; + if (!P_IsObjectOnGround(player->mo->tracer)) + P_SetObjectMomZ(player->mo->tracer, -9*FRACUNIT, true); player->powers[pw_carry] = CR_NONE; player->mo->tracer->flags |= MF_PUSHABLE; P_SetTarget(&player->mo->tracer->tracer, NULL); From ac3924c9c82d809c5f3810717d230cdd566f0856 Mon Sep 17 00:00:00 2001 From: lachwright Date: Thu, 21 Nov 2019 01:05:22 +0800 Subject: [PATCH 098/189] Add GFZ debris; reorganize wood debris index --- src/dehacked.c | 7 ++-- src/info.c | 101 +++++++++++++++++++++++++++++++------------------ src/info.h | 11 +++--- 3 files changed, 74 insertions(+), 45 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 45148d712..4b5640c02 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -7669,8 +7669,6 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_DUST3", "S_DUST4", - "S_WOODDEBRIS", - "S_ROCKSPAWN", "S_ROCKCRUMBLEA", @@ -7689,7 +7687,9 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_ROCKCRUMBLEN", "S_ROCKCRUMBLEO", "S_ROCKCRUMBLEP", + "S_GFZDEBRIS", "S_BRICKDEBRIS", + "S_WOODDEBRIS", #ifdef SEENAMES "S_NAMECHECK", @@ -8445,7 +8445,6 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_EXPLODE", // Robot Explosion "MT_UWEXPLODE", // Underwater Explosion "MT_DUST", - "MT_WOODDEBRIS", "MT_ROCKSPAWNER", "MT_FALLINGROCK", "MT_ROCKCRUMBLE1", @@ -8464,7 +8463,9 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_ROCKCRUMBLE14", "MT_ROCKCRUMBLE15", "MT_ROCKCRUMBLE16", + "MT_GFZDEBRIS", "MT_BRICKDEBRIS", + "MT_WOODDEBRIS", #ifdef SEENAMES "MT_NAMECHECK", diff --git a/src/info.c b/src/info.c index 50da228e5..fb74aba87 100644 --- a/src/info.c +++ b/src/info.c @@ -3883,8 +3883,6 @@ state_t states[NUMSTATES] = {SPR_DUST, 2|FF_TRANS60, 3, {NULL}, 0, 0, S_DUST4}, // S_DUST3 {SPR_DUST, 3|FF_TRANS70, 2, {NULL}, 0, 0, S_NULL}, // S_DUST4 - {SPR_WDDB, FF_ANIMATE, -1, {A_DebrisRandom}, 7, 2, S_NULL}, // S_WOODDEBRIS - {SPR_NULL, 0, 1, {A_RockSpawn}, 0, 0, S_ROCKSPAWN}, // S_ROCKSPAWN {SPR_ROIA, FF_ANIMATE|FF_RANDOMANIM, -1, {NULL}, 4, 2, S_NULL}, // S_ROCKCRUMBLEA @@ -3904,7 +3902,9 @@ state_t states[NUMSTATES] = {SPR_ROIO, FF_ANIMATE|FF_RANDOMANIM, -1, {NULL}, 7, 2, S_NULL}, // S_ROCKCRUMBLEO {SPR_ROIP, FF_ANIMATE|FF_RANDOMANIM, -1, {NULL}, 7, 2, S_NULL}, // S_ROCKCRUMBLEP + {SPR_GFZD, FF_ANIMATE|FF_RANDOMANIM, -1, {NULL}, 31, 1, S_NULL}, // S_GFZDEBRIS {SPR_BRIC, FF_ANIMATE, -1, {A_DebrisRandom}, 7, 2, S_NULL}, // S_BRICKDEBRIS + {SPR_WDDB, FF_ANIMATE, -1, {A_DebrisRandom}, 7, 2, S_NULL}, // S_WOODDEBRIS #ifdef SEENAMES {SPR_NULL, 0, 1, {NULL}, 0, 0, S_NULL}, // S_NAMECHECK @@ -20960,33 +20960,6 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_WOODDEBRIS - -1, // doomednum - S_WOODDEBRIS, // spawnstate - 1, // 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 - 16*FRACUNIT, // radius - 16*FRACUNIT, // height - 0, // display offset - 100, // mass - 0, // damage - sfx_wbreak, // activesound - MF_NOBLOCKMAP|MF_NOCLIPTHING|MF_RUNSPAWNFUNC|MF_NOCLIPHEIGHT|MF_SCENERY, // flags - S_NULL // raisestate - }, - { // MT_ROCKSPAWNER 1202, // doomednum S_ROCKSPAWN, // spawnstate @@ -21473,16 +21446,16 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_BRICKDEBRIS + { // MT_GFZDEBRIS -1, // doomednum - S_BRICKDEBRIS, // spawnstate - 1, // spawnhealth + S_GFZDEBRIS, // spawnstate + 1, // spawnhealth S_NULL, // seestate - sfx_None, // seesound + sfx_None, // seesound 0, // reactiontime sfx_None, // attacksound S_NULL, // painstate - 0, // painchance + 0, // painchance sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate @@ -21490,16 +21463,70 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL, // xdeathstate sfx_None, // deathsound 0, // speed - 16*FRACUNIT, // radius + 32*FRACUNIT, // radius + 64*FRACUNIT, // height + 0, // display offset + 100, // mass + 0, // damage + sfx_wbreak, // activesound + MF_NOBLOCKMAP|MF_NOCLIPTHING|MF_RUNSPAWNFUNC|MF_NOCLIPHEIGHT|MF_SCENERY, // flags + S_NULL // raisestate + }, + + { // MT_BRICKDEBRIS + -1, // doomednum + S_BRICKDEBRIS, // spawnstate + 1, // 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 + 16*FRACUNIT, // radius 16*FRACUNIT, // height 0, // display offset - 100, // mass + 100, // mass 0, // damage - sfx_None, // activesound + sfx_None, // activesound MF_NOBLOCKMAP|MF_NOCLIPTHING|MF_RUNSPAWNFUNC|MF_NOCLIPHEIGHT|MF_SCENERY, // flags S_NULL // raisestate }, + { // MT_WOODDEBRIS + -1, // doomednum + S_WOODDEBRIS, // spawnstate + 1, // 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 + 16*FRACUNIT, // radius + 16*FRACUNIT, // height + 0, // display offset + 100, // mass + 0, // damage + sfx_wbreak, // activesound + MF_NOBLOCKMAP|MF_NOCLIPTHING|MF_RUNSPAWNFUNC|MF_NOCLIPHEIGHT|MF_SCENERY, // flags + S_NULL // raisestate + }, + #ifdef SEENAMES { // MT_NAMECHECK -1, // doomednum diff --git a/src/info.h b/src/info.h index e28a24ade..025ab55d2 100644 --- a/src/info.h +++ b/src/info.h @@ -3970,8 +3970,6 @@ typedef enum state S_DUST3, S_DUST4, - S_WOODDEBRIS, - S_ROCKSPAWN, S_ROCKCRUMBLEA, @@ -3991,8 +3989,10 @@ typedef enum state S_ROCKCRUMBLEO, S_ROCKCRUMBLEP, - // Bricks + // Level debris + S_GFZDEBRIS, S_BRICKDEBRIS, + S_WOODDEBRIS, #ifdef SEENAMES S_NAMECHECK, @@ -4768,7 +4768,6 @@ typedef enum mobj_type MT_EXPLODE, // Robot Explosion MT_UWEXPLODE, // Underwater Explosion MT_DUST, - MT_WOODDEBRIS, MT_ROCKSPAWNER, MT_FALLINGROCK, MT_ROCKCRUMBLE1, @@ -4788,8 +4787,10 @@ typedef enum mobj_type MT_ROCKCRUMBLE15, MT_ROCKCRUMBLE16, - // Bricks + // Level debris + MT_GFZDEBRIS, MT_BRICKDEBRIS, + MT_WOODDEBRIS, #ifdef SEENAMES MT_NAMECHECK, From c5d085d333ba64cf0f13ee8d6a835239c98028bd Mon Sep 17 00:00:00 2001 From: lachwright Date: Thu, 21 Nov 2019 01:14:24 +0800 Subject: [PATCH 099/189] Add missing GFZD spriteset --- src/hardware/hw_light.c | 5 +++-- src/info.c | 7 ++++--- src/info.h | 7 ++++--- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/hardware/hw_light.c b/src/hardware/hw_light.c index 584c58463..4df71d145 100644 --- a/src/hardware/hw_light.c +++ b/src/hardware/hw_light.c @@ -586,7 +586,6 @@ light_t *t_lspr[NUMSPRITES] = &lspr[SUPERSPARK_L], // SPR_BOM3 &lspr[NOLIGHT], // SPR_BOM4 &lspr[REDBALL_L], // SPR_BMNB - &lspr[NOLIGHT], // SPR_WDDB // Crumbly rocks &lspr[NOLIGHT], // SPR_ROIA @@ -606,8 +605,10 @@ light_t *t_lspr[NUMSPRITES] = &lspr[NOLIGHT], // SPR_ROIO &lspr[NOLIGHT], // SPR_ROIP - // Bricks + // Level debris + &lspr[NOLIGHT], // SPR_GFZD &lspr[NOLIGHT], // SPR_BRIC + &lspr[NOLIGHT], // SPR_WDDB // Gravity Well Objects &lspr[NOLIGHT], // SPR_GWLG diff --git a/src/info.c b/src/info.c index fb74aba87..0a1911e5d 100644 --- a/src/info.c +++ b/src/info.c @@ -483,7 +483,6 @@ char sprnames[NUMSPRITES + 1][5] = "BOM3", // Boss Explosion 2 "BOM4", // Underwater Explosion "BMNB", // Mine Explosion - "WDDB", // Wood Debris // Crumbly rocks "ROIA", @@ -503,8 +502,10 @@ char sprnames[NUMSPRITES + 1][5] = "ROIO", "ROIP", - // Bricks - "BRIC", + // Level debris + "GFZD", // GFZ debris + "BRIC", // Bricks + "WDDB", // Wood Debris // Gravity Well Objects "GWLG", diff --git a/src/info.h b/src/info.h index 025ab55d2..102610336 100644 --- a/src/info.h +++ b/src/info.h @@ -748,7 +748,6 @@ typedef enum sprite SPR_BOM3, // Boss Explosion 2 SPR_BOM4, // Underwater Explosion SPR_BMNB, // Mine Explosion - SPR_WDDB, // Wood Debris // Crumbly rocks SPR_ROIA, @@ -768,8 +767,10 @@ typedef enum sprite SPR_ROIO, SPR_ROIP, - // Bricks - SPR_BRIC, + // Level debris + SPR_GFZD, // GFZ debris + SPR_BRIC, // Bricks + SPR_WDDB, // Wood Debris // Gravity Well Objects SPR_GWLG, From 35f2572e29acb065b0ea3f227045b479cb243bc0 Mon Sep 17 00:00:00 2001 From: lachwright Date: Thu, 21 Nov 2019 01:26:53 +0800 Subject: [PATCH 100/189] Correct sound for GFZ debris (copy-paste oversight) --- src/info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/info.c b/src/info.c index 0a1911e5d..691fb5616 100644 --- a/src/info.c +++ b/src/info.c @@ -21469,7 +21469,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // display offset 100, // mass 0, // damage - sfx_wbreak, // activesound + sfx_crumbl, // activesound MF_NOBLOCKMAP|MF_NOCLIPTHING|MF_RUNSPAWNFUNC|MF_NOCLIPHEIGHT|MF_SCENERY, // flags S_NULL // raisestate }, From 2d509eff4771df5a845e498e8fbcfb3aa4e17c24 Mon Sep 17 00:00:00 2001 From: sphere Date: Thu, 21 Nov 2019 00:34:58 +0100 Subject: [PATCH 101/189] Move the main menu options around. --- src/m_menu.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 7a5aa8ae6..ef28b9ba9 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -474,16 +474,16 @@ static consvar_t cv_dummymares = {"dummymares", "Overall", CV_HIDEN|CV_CALL, dum // --------- static menuitem_t MainMenu[] = { - {IT_STRING|IT_CALL, NULL, "Secrets", M_SecretsMenu, 76}, - {IT_STRING|IT_CALL, NULL, "1 player", M_SinglePlayerMenu, 84}, + {IT_STRING|IT_CALL, NULL, "1 Player", M_SinglePlayerMenu, 76}, #ifndef NONET - {IT_STRING|IT_SUBMENU, NULL, "multiplayer", &MP_MainDef, 92}, + {IT_STRING|IT_SUBMENU, NULL, "Multiplayer", &MP_MainDef, 84}, #else - {IT_STRING|IT_CALL, NULL, "multiplayer", M_StartSplitServerMenu, 92}, + {IT_STRING|IT_CALL, NULL, "Multiplayer", M_StartSplitServerMenu, 84}, #endif - {IT_STRING|IT_CALL, NULL, "options", M_Options, 100}, - {IT_CALL |IT_STRING, NULL, "addons", M_Addons, 108}, - {IT_STRING|IT_CALL, NULL, "quit game", M_QuitSRB2, 116}, + {IT_STRING|IT_CALL, NULL, "Secrets", M_SecretsMenu, 92}, + {IT_CALL |IT_STRING, NULL, "Addons", M_Addons, 100}, + {IT_STRING|IT_CALL, NULL, "Options", M_Options, 108}, + {IT_STRING|IT_CALL, NULL, "Quit Game", M_QuitSRB2, 116}, }; typedef enum From f587069d0e4813eadfcea4df8d68fa32d6da75be Mon Sep 17 00:00:00 2001 From: sphere Date: Thu, 21 Nov 2019 01:14:09 +0100 Subject: [PATCH 102/189] Reorganize sound options. --- src/m_menu.c | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index ef28b9ba9..540482c82 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1348,37 +1348,33 @@ static menuitem_t OP_OpenGLColorMenu[] = static menuitem_t OP_SoundOptionsMenu[] = { {IT_HEADER, NULL, "Game Audio", NULL, 0}, - {IT_STRING | IT_CVAR, NULL, "Sound Effects", &cv_gamesounds, 6}, - {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Sound Volume", &cv_soundvolume, 11}, + {IT_STRING | IT_CVAR, NULL, "Sound Effects", &cv_gamesounds, 12}, + {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Sound Volume", &cv_soundvolume, 22}, - {IT_STRING | IT_CVAR, NULL, "Digital Music", &cv_gamedigimusic, 21}, - {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Digital Music Volume", &cv_digmusicvolume, 26}, + {IT_STRING | IT_CVAR, NULL, "Digital Music", &cv_gamedigimusic, 42}, + {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Digital Music Volume", &cv_digmusicvolume, 52}, - {IT_STRING | IT_CVAR, NULL, "MIDI Music", &cv_gamemidimusic, 36}, - {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "MIDI Music Volume", &cv_midimusicvolume, 41}, + {IT_STRING | IT_CVAR, NULL, "MIDI Music", &cv_gamemidimusic, 72}, + {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "MIDI Music Volume", &cv_midimusicvolume, 82}, - {IT_HEADER, NULL, "Accessibility", NULL, 50}, - {IT_STRING | IT_CVAR, NULL, "Closed Captioning", &cv_closedcaptioning, 56}, - {IT_STRING | IT_CVAR, NULL, "Reset Music Upon Dying", &cv_resetmusic, 61}, - - {IT_STRING | IT_CVAR, NULL, "Play Sound Effects if Unfocused", &cv_playsoundsifunfocused, 71}, - {IT_STRING | IT_CVAR, NULL, "Play Music if Unfocused", &cv_playmusicifunfocused, 76}, + {IT_HEADER, NULL, "Accessibility", NULL, 102}, + {IT_STRING | IT_CVAR, NULL, "Closed Captioning", &cv_closedcaptioning, 114}, #ifdef HAVE_MIXERX - {IT_STRING | IT_SUBMENU, NULL, "Advanced Settings...", &OP_SoundAdvancedDef, 94}, + {IT_STRING | IT_SUBMENU, NULL, "Advanced Settings...", &OP_SoundAdvancedDef, 144}, #endif }; #ifdef HAVE_MIXERX #ifdef HAVE_OPENMPT -#define OPENMPT_MENUOFFSET 32 +#define OPENMPT_MENUOFFSET 16 #else #define OPENMPT_MENUOFFSET 0 #endif #ifdef HAVE_MIXERX -#define MIXERX_MENUOFFSET 81 +#define MIXERX_MENUOFFSET 40 #else #define MIXERX_MENUOFFSET 0 #endif @@ -1387,18 +1383,22 @@ static menuitem_t OP_SoundAdvancedMenu[] = { #ifdef HAVE_OPENMPT {IT_HEADER, NULL, "OpenMPT Settings", NULL, 10}, - {IT_STRING | IT_CVAR, NULL, "Instrument Filter", &cv_modfilter, 22}, + {IT_STRING | IT_CVAR, NULL, "Instrument Filter", &cv_modfilter, 16}, #endif #ifdef HAVE_MIXERX {IT_HEADER, NULL, "MIDI Settings", NULL, OPENMPT_MENUOFFSET+10}, - {IT_STRING | IT_CVAR, NULL, "MIDI Player", &cv_midiplayer, OPENMPT_MENUOFFSET+22}, - {IT_STRING | IT_CVAR | IT_CV_STRING, NULL, "FluidSynth Sound Font File", &cv_midisoundfontpath, OPENMPT_MENUOFFSET+34}, - {IT_STRING | IT_CVAR | IT_CV_STRING, NULL, "TiMidity++ Config Folder", &cv_miditimiditypath, OPENMPT_MENUOFFSET+61}, + {IT_STRING | IT_CVAR, NULL, "MIDI Player", &cv_midiplayer, OPENMPT_MENUOFFSET+16}, + {IT_STRING | IT_CVAR | IT_CV_STRING, NULL, "FluidSynth Sound Font File", &cv_midisoundfontpath, OPENMPT_MENUOFFSET+21}, + {IT_STRING | IT_CVAR | IT_CV_STRING, NULL, "TiMidity++ Config Folder", &cv_miditimiditypath, OPENMPT_MENUOFFSET+35}, #endif {IT_HEADER, NULL, "Miscellaneous", NULL, OPENMPT_MENUOFFSET+MIXERX_MENUOFFSET+10}, - {IT_STRING | IT_CVAR, NULL, "Let Levels Force Reset Music", &cv_resetmusicbyheader, OPENMPT_MENUOFFSET+MIXERX_MENUOFFSET+22}, + {IT_STRING | IT_CVAR, NULL, "Play Sound Effects if Unfocused", &cv_playsoundsifunfocused, OPENMPT_MENUOFFSET+MIXERX_MENUOFFSET+16}, + {IT_STRING | IT_CVAR, NULL, "Play Music if Unfocused", &cv_playmusicifunfocused, OPENMPT_MENUOFFSET+MIXERX_MENUOFFSET+21}, + + {IT_STRING | IT_CVAR, NULL, "Reset Music Upon Dying", &cv_resetmusic, OPENMPT_MENUOFFSET+MIXERX_MENUOFFSET+31}, + {IT_STRING | IT_CVAR, NULL, "Let Levels Force Reset Music", &cv_resetmusicbyheader, OPENMPT_MENUOFFSET+MIXERX_MENUOFFSET+36}, }; #undef OPENMPT_MENUOFFSET @@ -1992,11 +1992,11 @@ menu_t OP_ColorOptionsDef = 0, NULL }; -menu_t OP_SoundOptionsDef = DEFAULTSCROLLMENUSTYLE( +menu_t OP_SoundOptionsDef = DEFAULTMENUSTYLE( MN_OP_MAIN + (MN_OP_SOUND << 6), "M_SOUND", OP_SoundOptionsMenu, &OP_MainDef, 30, 30); #ifdef HAVE_MIXERX -menu_t OP_SoundAdvancedDef = DEFAULTMENUSTYLE(MN_OP_MAIN + (MN_OP_SOUND << 6), "M_SOUND", OP_SoundAdvancedMenu, &OP_SoundOptionsDef, 30, 30); +menu_t OP_SoundAdvancedDef = DEFAULTSCROLLMENUSTYLE(MN_OP_MAIN + (MN_OP_SOUND << 6), "M_SOUND", OP_SoundAdvancedMenu, &OP_SoundOptionsDef, 30, 30); #endif menu_t OP_ServerOptionsDef = DEFAULTSCROLLMENUSTYLE( From 9608021824d21539ee2a72288ce203ce0517c880 Mon Sep 17 00:00:00 2001 From: sphere Date: Thu, 21 Nov 2019 01:34:32 +0100 Subject: [PATCH 103/189] Rename "secrets" to "extras". --- src/d_netcmd.c | 4 ++-- src/dehacked.c | 2 +- src/f_finale.c | 2 +- src/m_menu.c | 8 ++++---- src/m_menu.h | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 4de166e41..f46468feb 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -4336,9 +4336,9 @@ static void Command_Isgamemodified_f(void) if (savemoddata) CONS_Printf(M_GetText("modifiedgame is true, but you can save emblem and time data in this mod.\n")); else if (modifiedgame) - CONS_Printf(M_GetText("modifiedgame is true, secrets will not be unlocked\n")); + CONS_Printf(M_GetText("modifiedgame is true, extras will not be unlocked\n")); else - CONS_Printf(M_GetText("modifiedgame is false, you can unlock secrets\n")); + CONS_Printf(M_GetText("modifiedgame is false, you can unlock extravalues\n")); } static void Command_Cheats_f(void) diff --git a/src/dehacked.c b/src/dehacked.c index 45148d712..7f0fa8557 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -8904,7 +8904,7 @@ static const char *const MENUTYPES_LIST[] = { "OP_SCREENSHOTS", "OP_ERASEDATA", - // Secrets + // Extras "SR_MAIN", "SR_PANDORA", "SR_LEVELSELECT", diff --git a/src/f_finale.c b/src/f_finale.c index e3809ea25..10d3d02b4 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -1386,7 +1386,7 @@ boolean F_CreditResponder(event_t *event) void F_StartGameEvaluation(void) { - // Credits option in secrets menu + // Credits option in extras menu if (cursaveslot == -1) { S_FadeOutStopMusic(2*MUSICRATE); diff --git a/src/m_menu.c b/src/m_menu.c index 540482c82..4ecc41d0b 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -480,7 +480,7 @@ static menuitem_t MainMenu[] = #else {IT_STRING|IT_CALL, NULL, "Multiplayer", M_StartSplitServerMenu, 84}, #endif - {IT_STRING|IT_CALL, NULL, "Secrets", M_SecretsMenu, 92}, + {IT_STRING|IT_CALL, NULL, "Extras", M_SecretsMenu, 92}, {IT_CALL |IT_STRING, NULL, "Addons", M_Addons, 100}, {IT_STRING|IT_CALL, NULL, "Options", M_Options, 108}, {IT_STRING|IT_CALL, NULL, "Quit Game", M_QuitSRB2, 116}, @@ -661,7 +661,7 @@ static menuitem_t SR_PandorasBox[] = // Sky Room Custom Unlocks static menuitem_t SR_MainMenu[] = { - {IT_STRING|IT_SUBMENU,NULL, "Secrets Checklist", &SR_UnlockChecklistDef, 0}, + {IT_STRING|IT_SUBMENU,NULL, "Extras Checklist", &SR_UnlockChecklistDef, 0}, {IT_DISABLED, NULL, "", NULL, 0}, // Custom1 {IT_DISABLED, NULL, "", NULL, 0}, // Custom2 {IT_DISABLED, NULL, "", NULL, 0}, // Custom3 @@ -1455,7 +1455,7 @@ enum static menuitem_t OP_EraseDataMenu[] = { {IT_STRING | IT_CALL, NULL, "Erase Record Data", M_EraseData, 10}, - {IT_STRING | IT_CALL, NULL, "Erase Secrets Data", M_EraseData, 20}, + {IT_STRING | IT_CALL, NULL, "Erase Extras Data", M_EraseData, 20}, {IT_STRING | IT_CALL, NULL, "\x85" "Erase ALL Data", M_EraseData, 40}, }; @@ -10910,7 +10910,7 @@ static void M_EraseData(INT32 choice) if (choice == 0) eschoice = M_GetText("Record Attack data"); else if (choice == 1) - eschoice = M_GetText("Secrets data"); + eschoice = M_GetText("Extras data"); else eschoice = M_GetText("ALL game data"); diff --git a/src/m_menu.h b/src/m_menu.h index ec7915cc2..ce7198d75 100644 --- a/src/m_menu.h +++ b/src/m_menu.h @@ -99,7 +99,7 @@ typedef enum MN_OP_SCREENSHOTS, MN_OP_ERASEDATA, - // Secrets + // Extras MN_SR_MAIN, MN_SR_PANDORA, MN_SR_LEVELSELECT, From 48c454553f891b1b9897bcc4bd03e84782620870 Mon Sep 17 00:00:00 2001 From: sphere Date: Thu, 21 Nov 2019 02:19:31 +0100 Subject: [PATCH 104/189] Move SP and MP down if extras aren't unlocked yet. --- src/m_menu.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 4ecc41d0b..6cef107ff 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -488,11 +488,11 @@ static menuitem_t MainMenu[] = typedef enum { - secrets = 0, singleplr, multiplr, - options, + secrets = 2, addons, + options, quitdoom } main_e; @@ -3436,6 +3436,8 @@ void M_StartControlPanel(void) if (!Playing()) { // Secret menu! + MainMenu[singleplr].alphaKey = (M_AnySecretUnlocked()) ? 76 : 84; + MainMenu[multiplr].alphaKey = (M_AnySecretUnlocked()) ? 84 : 92; MainMenu[secrets].status = (M_AnySecretUnlocked()) ? (IT_STRING | IT_CALL) : (IT_DISABLED); currentMenu = &MainDef; From 74987beb1ff15d71961a91df9635756a6d9e8bdb Mon Sep 17 00:00:00 2001 From: sphere Date: Thu, 21 Nov 2019 02:24:12 +0100 Subject: [PATCH 105/189] Reword some evaluation sentences. --- src/f_finale.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/f_finale.c b/src/f_finale.c index 10d3d02b4..2d20eb7f4 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -1541,9 +1541,9 @@ void F_GameEvaluationDrawer(void) } } else if (netgame) - V_DrawString(8, 96, V_YELLOWMAP, "Prizes only\nawarded in\nsingle player!"); + V_DrawString(8, 96, V_YELLOWMAP, "Multiplayer games\ncan't unlock\nextras!"); else - V_DrawString(8, 96, V_YELLOWMAP, "Prizes not\nawarded in\nmodified games!"); + V_DrawString(8, 96, V_YELLOWMAP, "Modified games\ncan't unlock\nextras!"); } #endif } @@ -1590,7 +1590,7 @@ void F_GameEvaluationTicker(void) { HU_SetCEchoFlags(V_YELLOWMAP|V_RETURN8); HU_SetCEchoDuration(6); - HU_DoCEcho("\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\Prizes only awarded in singleplayer!"); + HU_DoCEcho("\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\Multiplayer games can't unlock extras!"); S_StartSound(NULL, sfx_s3k68); } else if (!modifiedgame || savemoddata) @@ -1612,7 +1612,7 @@ void F_GameEvaluationTicker(void) { HU_SetCEchoFlags(V_YELLOWMAP|V_RETURN8); HU_SetCEchoDuration(6); - HU_DoCEcho("\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\Prizes not awarded in modified games!"); + HU_DoCEcho("\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\Modified games can't unlock extras!"); S_StartSound(NULL, sfx_s3k68); } } From f021d35e7ebafe71ec5c4738a58dc9e8f4b3373a Mon Sep 17 00:00:00 2001 From: sphere Date: Thu, 21 Nov 2019 02:43:07 +0100 Subject: [PATCH 106/189] Move tutorial to the bottom of the 1 Player menu. --- src/m_menu.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 6cef107ff..0db4afead 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -726,20 +726,20 @@ static menuitem_t SR_EmblemHintMenu[] = // Single Player Main static menuitem_t SP_MainMenu[] = { - {IT_CALL | IT_STRING, NULL, "Tutorial", M_StartTutorial, 84}, - {IT_CALL | IT_STRING, NULL, "Start Game", M_LoadGame, 92}, - {IT_SECRET, NULL, "Record Attack", M_TimeAttack, 100}, - {IT_SECRET, NULL, "NiGHTS Mode", M_NightsAttack, 108}, - {IT_CALL | IT_STRING | IT_CALL_NOTMODIFIED, NULL, "Statistics", M_Statistics, 116}, + {IT_CALL | IT_STRING, NULL, "Start Game", M_LoadGame, 84}, + {IT_SECRET, NULL, "Record Attack", M_TimeAttack, 92}, + {IT_SECRET, NULL, "NiGHTS Mode", M_NightsAttack, 100}, + {IT_CALL | IT_STRING | IT_CALL_NOTMODIFIED, NULL, "Statistics", M_Statistics, 108}, + {IT_CALL | IT_STRING, NULL, "Tutorial", M_StartTutorial, 116}, }; enum { - sptutorial, sploadgame, sprecordattack, spnightsmode, - spstatistics + spstatistics, + sptutorial }; // Single Player Load Game @@ -1666,7 +1666,7 @@ menu_t SP_MainDef = //CENTERMENUSTYLE(NULL, SP_MainMenu, &MainDef, 72); SP_MainMenu, M_DrawCenteredMenu, BASEVIDWIDTH/2, 72, - 1, // start at "Start Game" on first entry + 0, NULL }; From 248306ccb04aa3d7f8cef32e4e08dbc391e45b80 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Thu, 21 Nov 2019 02:16:09 -0300 Subject: [PATCH 107/189] Remove D_ProcessEvents call in G_PreLevelTitleCard --- src/d_clisrv.c | 2 +- src/d_main.c | 3 --- src/g_game.c | 3 --- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index aca37df1d..cf9c34867 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -4602,7 +4602,7 @@ static void Local_Maketic(INT32 realtics) { I_OsPolling(); // I_Getevent D_ProcessEvents(); // menu responder, cons responder, - // game responder calls HU_Responder, AM_Responder, F_Responder, + // game responder calls HU_Responder, AM_Responder, // and G_MapEventsToControls if (!dedicated) rendergametic = gametic; // translate inputs (keyboard/mouse/joystick) into game controls diff --git a/src/d_main.c b/src/d_main.c index e48b26ba8..63413a207 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -180,9 +180,6 @@ void D_ProcessEvents(void) if (M_ScreenshotResponder(ev)) continue; // ate the event - if (WipeStageTitle) - continue; - if (gameaction == ga_nothing && gamestate == GS_TITLESCREEN) { if (cht_Responder(ev)) diff --git a/src/g_game.c b/src/g_game.c index 5e1645901..738210236 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1749,9 +1749,6 @@ void G_PreLevelTitleCard(tic_t ticker, boolean update) I_Sleep(); lasttime = nowtime; - // Run some bullshit whatever - D_ProcessEvents(); - ST_runTitleCard(); ST_preLevelTitleCardDrawer(ticker, update); From 7c7eec4b9a90f49e2968cfab9ff893c0e6858227 Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 21 Nov 2019 13:12:54 +0000 Subject: [PATCH 108/189] Fix conditionset-based unlocks on the Sound Test. --- src/s_sound.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/s_sound.c b/src/s_sound.c index ef673c9af..8e4e7715d 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -1685,7 +1685,7 @@ boolean S_PrepareSoundTest(void) soundtestdefs[pos++] = def; if (def->soundtestcond > 0 && !(mapvisited[def->soundtestcond-1] & MV_BEATEN)) continue; - if (def->soundtestcond < 0 && !M_Achieved(1-def->soundtestcond)) + if (def->soundtestcond < 0 && !M_Achieved(-1-def->soundtestcond)) continue; def->allowed = true; } From b37c3a414a1b574cbe2a1c1561378fe0533996c8 Mon Sep 17 00:00:00 2001 From: sphere Date: Thu, 21 Nov 2019 16:35:27 +0100 Subject: [PATCH 109/189] Remove unneeded HAVE_MIXERX checks. --- src/m_menu.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 0db4afead..5c224f044 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -312,9 +312,7 @@ menu_t OP_VideoOptionsDef, OP_VideoModeDef, OP_ColorOptionsDef; menu_t OP_OpenGLOptionsDef, OP_OpenGLFogDef, OP_OpenGLColorDef; #endif menu_t OP_SoundOptionsDef; -#ifdef HAVE_MIXERX menu_t OP_SoundAdvancedDef; -#endif //Misc menu_t OP_DataOptionsDef, OP_ScreenshotOptionsDef, OP_EraseDataDef; @@ -1360,13 +1358,9 @@ static menuitem_t OP_SoundOptionsMenu[] = {IT_HEADER, NULL, "Accessibility", NULL, 102}, {IT_STRING | IT_CVAR, NULL, "Closed Captioning", &cv_closedcaptioning, 114}, -#ifdef HAVE_MIXERX {IT_STRING | IT_SUBMENU, NULL, "Advanced Settings...", &OP_SoundAdvancedDef, 144}, -#endif }; -#ifdef HAVE_MIXERX - #ifdef HAVE_OPENMPT #define OPENMPT_MENUOFFSET 16 #else @@ -1403,7 +1397,6 @@ static menuitem_t OP_SoundAdvancedMenu[] = #undef OPENMPT_MENUOFFSET #undef MIXERX_MENUOFFSET -#endif static menuitem_t OP_DataOptionsMenu[] = { @@ -1995,9 +1988,7 @@ menu_t OP_ColorOptionsDef = menu_t OP_SoundOptionsDef = DEFAULTMENUSTYLE( MN_OP_MAIN + (MN_OP_SOUND << 6), "M_SOUND", OP_SoundOptionsMenu, &OP_MainDef, 30, 30); -#ifdef HAVE_MIXERX menu_t OP_SoundAdvancedDef = DEFAULTSCROLLMENUSTYLE(MN_OP_MAIN + (MN_OP_SOUND << 6), "M_SOUND", OP_SoundAdvancedMenu, &OP_SoundOptionsDef, 30, 30); -#endif menu_t OP_ServerOptionsDef = DEFAULTSCROLLMENUSTYLE( MN_OP_MAIN + (MN_OP_SERVER << 6), From 5a7ebb3ba6257c714cd8343fdf092f01bab3f454 Mon Sep 17 00:00:00 2001 From: sphere Date: Thu, 21 Nov 2019 16:53:37 +0100 Subject: [PATCH 110/189] Re-reorganize sound options. --- src/m_menu.c | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 5c224f044..648fa17f6 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1355,20 +1355,21 @@ static menuitem_t OP_SoundOptionsMenu[] = {IT_STRING | IT_CVAR, NULL, "MIDI Music", &cv_gamemidimusic, 72}, {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "MIDI Music Volume", &cv_midimusicvolume, 82}, - {IT_HEADER, NULL, "Accessibility", NULL, 102}, + {IT_HEADER, NULL, "Miscellaneous", NULL, 102}, {IT_STRING | IT_CVAR, NULL, "Closed Captioning", &cv_closedcaptioning, 114}, + {IT_STRING | IT_CVAR, NULL, "Reset Music Upon Dying", &cv_resetmusic, 124}, {IT_STRING | IT_SUBMENU, NULL, "Advanced Settings...", &OP_SoundAdvancedDef, 144}, }; #ifdef HAVE_OPENMPT -#define OPENMPT_MENUOFFSET 16 +#define OPENMPT_MENUOFFSET 32 #else #define OPENMPT_MENUOFFSET 0 #endif #ifdef HAVE_MIXERX -#define MIXERX_MENUOFFSET 40 +#define MIXERX_MENUOFFSET 81 #else #define MIXERX_MENUOFFSET 0 #endif @@ -1376,23 +1377,21 @@ static menuitem_t OP_SoundOptionsMenu[] = static menuitem_t OP_SoundAdvancedMenu[] = { #ifdef HAVE_OPENMPT - {IT_HEADER, NULL, "OpenMPT Settings", NULL, 10}, - {IT_STRING | IT_CVAR, NULL, "Instrument Filter", &cv_modfilter, 16}, + {IT_HEADER, NULL, "OpenMPT Settings", NULL, 0}, + {IT_STRING | IT_CVAR, NULL, "Instrument Filter", &cv_modfilter, 12}, #endif #ifdef HAVE_MIXERX - {IT_HEADER, NULL, "MIDI Settings", NULL, OPENMPT_MENUOFFSET+10}, - {IT_STRING | IT_CVAR, NULL, "MIDI Player", &cv_midiplayer, OPENMPT_MENUOFFSET+16}, - {IT_STRING | IT_CVAR | IT_CV_STRING, NULL, "FluidSynth Sound Font File", &cv_midisoundfontpath, OPENMPT_MENUOFFSET+21}, - {IT_STRING | IT_CVAR | IT_CV_STRING, NULL, "TiMidity++ Config Folder", &cv_miditimiditypath, OPENMPT_MENUOFFSET+35}, + {IT_HEADER, NULL, "MIDI Settings", NULL, OPENMPT_MENUOFFSET}, + {IT_STRING | IT_CVAR, NULL, "MIDI Player", &cv_midiplayer, OPENMPT_MENUOFFSET+12}, + {IT_STRING | IT_CVAR | IT_CV_STRING, NULL, "FluidSynth Sound Font File", &cv_midisoundfontpath, OPENMPT_MENUOFFSET+24}, + {IT_STRING | IT_CVAR | IT_CV_STRING, NULL, "TiMidity++ Config Folder", &cv_miditimiditypath, OPENMPT_MENUOFFSET+51}, #endif - {IT_HEADER, NULL, "Miscellaneous", NULL, OPENMPT_MENUOFFSET+MIXERX_MENUOFFSET+10}, - {IT_STRING | IT_CVAR, NULL, "Play Sound Effects if Unfocused", &cv_playsoundsifunfocused, OPENMPT_MENUOFFSET+MIXERX_MENUOFFSET+16}, - {IT_STRING | IT_CVAR, NULL, "Play Music if Unfocused", &cv_playmusicifunfocused, OPENMPT_MENUOFFSET+MIXERX_MENUOFFSET+21}, - - {IT_STRING | IT_CVAR, NULL, "Reset Music Upon Dying", &cv_resetmusic, OPENMPT_MENUOFFSET+MIXERX_MENUOFFSET+31}, - {IT_STRING | IT_CVAR, NULL, "Let Levels Force Reset Music", &cv_resetmusicbyheader, OPENMPT_MENUOFFSET+MIXERX_MENUOFFSET+36}, + {IT_HEADER, NULL, "Miscellaneous", NULL, OPENMPT_MENUOFFSET+MIXERX_MENUOFFSET}, + {IT_STRING | IT_CVAR, NULL, "Play Sound Effects if Unfocused", &cv_playsoundsifunfocused, OPENMPT_MENUOFFSET+MIXERX_MENUOFFSET+12}, + {IT_STRING | IT_CVAR, NULL, "Play Music if Unfocused", &cv_playmusicifunfocused, OPENMPT_MENUOFFSET+MIXERX_MENUOFFSET+22}, + {IT_STRING | IT_CVAR, NULL, "Let Levels Force Reset Music", &cv_resetmusicbyheader, OPENMPT_MENUOFFSET+MIXERX_MENUOFFSET+32}, }; #undef OPENMPT_MENUOFFSET @@ -1988,7 +1987,7 @@ menu_t OP_ColorOptionsDef = menu_t OP_SoundOptionsDef = DEFAULTMENUSTYLE( MN_OP_MAIN + (MN_OP_SOUND << 6), "M_SOUND", OP_SoundOptionsMenu, &OP_MainDef, 30, 30); -menu_t OP_SoundAdvancedDef = DEFAULTSCROLLMENUSTYLE(MN_OP_MAIN + (MN_OP_SOUND << 6), "M_SOUND", OP_SoundAdvancedMenu, &OP_SoundOptionsDef, 30, 30); +menu_t OP_SoundAdvancedDef = DEFAULTMENUSTYLE(MN_OP_MAIN + (MN_OP_SOUND << 6), "M_SOUND", OP_SoundAdvancedMenu, &OP_SoundOptionsDef, 30, 30); menu_t OP_ServerOptionsDef = DEFAULTSCROLLMENUSTYLE( MN_OP_MAIN + (MN_OP_SERVER << 6), From 7ff616b26e2675fa97d38fb8777fc44e19a2c457 Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 21 Nov 2019 16:10:28 +0000 Subject: [PATCH 111/189] Do a whole bunch of cleanup for mapvisited and intermission related things. * Move the visitation flags, Record Attack/NiGHTS Attack data, and emblem checking to outside of Y_StartIntermission. * Y_CleanupScreenBuffer never got called for maps which skip the intermission, leading to a small memory leak; this is now fixed by moving it to G_AfterIntermission. * Y_FollowIntermission was just G_AfterIntermission with modeattacking specific behaviour, but this is desired for all places where G_AfterIntermission is called, so just merge this into G_AfterIntermission. Notably, these changes are necessary because there are now three maps in the main SP campaign which do not end with traditional intermissions. As a result, this fixes an issue where Black Core's tracks are not available in the Sound Test (due to MV_BEATEN never being applied). Also, since I was here: Remove "gotperfect" from recorddata_t. This is a duplicate of `mapvisited[gamemap-1] & MV_PERFECT` which uses more memory. I have kept the new spacing in the gamedata for compatibility with RC1 savedatas, but moved it across to the original method everywhere else. --- src/doomstat.h | 1 - src/g_game.c | 148 ++++++++++++++++++++++++++++++++--- src/m_menu.c | 5 +- src/y_inter.c | 206 +++---------------------------------------------- src/y_inter.h | 5 +- 5 files changed, 150 insertions(+), 215 deletions(-) diff --git a/src/doomstat.h b/src/doomstat.h index 84939a8db..877f5b50b 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -435,7 +435,6 @@ typedef struct tic_t time; ///< Time in which the level was finished. UINT32 score; ///< Score when the level was finished. UINT16 rings; ///< Rings when the level was finished. - boolean gotperfect; ///< Got perfect bonus? } recorddata_t; /** Setup for one NiGHTS map. diff --git a/src/g_game.c b/src/g_game.c index 5e1645901..cc82f5d5c 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -540,11 +540,99 @@ void G_AddTempNightsRecords(UINT32 pscore, tic_t ptime, UINT8 mare) ntemprecords.nummares = mare; } +// +// G_UpdateRecordReplays +// +// Update replay files/data, etc. for Record Attack +// See G_SetNightsRecords for NiGHTS Attack. +// +static void G_UpdateRecordReplays(void) +{ + const size_t glen = strlen(srb2home)+1+strlen("replay")+1+strlen(timeattackfolder)+1+strlen("MAPXX")+1; + char *gpath; + char lastdemo[256], bestdemo[256]; + UINT8 earnedEmblems; + + // Record new best time + if (!mainrecords[gamemap-1]) + G_AllocMainRecordData(gamemap-1); + + if (players[consoleplayer].score > mainrecords[gamemap-1]->score) + mainrecords[gamemap-1]->score = players[consoleplayer].score; + + if ((mainrecords[gamemap-1]->time == 0) || (players[consoleplayer].realtime < mainrecords[gamemap-1]->time)) + mainrecords[gamemap-1]->time = players[consoleplayer].realtime; + + if ((UINT16)(players[consoleplayer].rings) > mainrecords[gamemap-1]->rings) + mainrecords[gamemap-1]->rings = (UINT16)(players[consoleplayer].rings); + + // Save demo! + bestdemo[255] = '\0'; + lastdemo[255] = '\0'; + G_SetDemoTime(players[consoleplayer].realtime, players[consoleplayer].score, (UINT16)(players[consoleplayer].rings)); + G_CheckDemoStatus(); + + I_mkdir(va("%s"PATHSEP"replay", srb2home), 0755); + I_mkdir(va("%s"PATHSEP"replay"PATHSEP"%s", srb2home, timeattackfolder), 0755); + + if ((gpath = malloc(glen)) == NULL) + I_Error("Out of memory for replay filepath\n"); + + sprintf(gpath,"%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s", srb2home, timeattackfolder, G_BuildMapName(gamemap)); + snprintf(lastdemo, 255, "%s-%s-last.lmp", gpath, skins[cv_chooseskin.value-1].name); + + if (FIL_FileExists(lastdemo)) + { + UINT8 *buf; + size_t len = FIL_ReadFile(lastdemo, &buf); + + snprintf(bestdemo, 255, "%s-%s-time-best.lmp", gpath, skins[cv_chooseskin.value-1].name); + if (!FIL_FileExists(bestdemo) || G_CmpDemoTime(bestdemo, lastdemo) & 1) + { // Better time, save this demo. + if (FIL_FileExists(bestdemo)) + remove(bestdemo); + FIL_WriteFile(bestdemo, buf, len); + CONS_Printf("\x83%s\x80 %s '%s'\n", M_GetText("NEW RECORD TIME!"), M_GetText("Saved replay as"), bestdemo); + } + + snprintf(bestdemo, 255, "%s-%s-score-best.lmp", gpath, skins[cv_chooseskin.value-1].name); + if (!FIL_FileExists(bestdemo) || (G_CmpDemoTime(bestdemo, lastdemo) & (1<<1))) + { // Better score, save this demo. + if (FIL_FileExists(bestdemo)) + remove(bestdemo); + FIL_WriteFile(bestdemo, buf, len); + CONS_Printf("\x83%s\x80 %s '%s'\n", M_GetText("NEW HIGH SCORE!"), M_GetText("Saved replay as"), bestdemo); + } + + snprintf(bestdemo, 255, "%s-%s-rings-best.lmp", gpath, skins[cv_chooseskin.value-1].name); + if (!FIL_FileExists(bestdemo) || (G_CmpDemoTime(bestdemo, lastdemo) & (1<<2))) + { // Better rings, save this demo. + if (FIL_FileExists(bestdemo)) + remove(bestdemo); + FIL_WriteFile(bestdemo, buf, len); + CONS_Printf("\x83%s\x80 %s '%s'\n", M_GetText("NEW MOST RINGS!"), M_GetText("Saved replay as"), bestdemo); + } + + //CONS_Printf("%s '%s'\n", M_GetText("Saved replay as"), lastdemo); + + Z_Free(buf); + } + free(gpath); + + // Check emblems when level data is updated + if ((earnedEmblems = M_CheckLevelEmblems())) + CONS_Printf(M_GetText("\x82" "Earned %hu emblem%s for Record Attack records.\n"), (UINT16)earnedEmblems, earnedEmblems > 1 ? "s" : ""); + + // Update timeattack menu's replay availability. + Nextmap_OnChange(); +} + void G_SetNightsRecords(void) { INT32 i; UINT32 totalscore = 0; tic_t totaltime = 0; + UINT8 earnedEmblems; const size_t glen = strlen(srb2home)+1+strlen("replay")+1+strlen(timeattackfolder)+1+strlen("MAPXX")+1; char *gpath; @@ -644,6 +732,9 @@ void G_SetNightsRecords(void) } free(gpath); + if ((earnedEmblems = M_CheckLevelEmblems())) + CONS_Printf(M_GetText("\x82" "Earned %hu emblem%s for NiGHTS records.\n"), (UINT16)earnedEmblems, earnedEmblems > 1 ? "s" : ""); + // If the mare count changed, this will update the score display Nextmap_OnChange(); } @@ -3128,6 +3219,7 @@ static INT16 RandMap(INT16 tolflags, INT16 pprevmap) static void G_DoCompleted(void) { INT32 i; + boolean spec = G_IsSpecialStage(gamemap); tokenlist = 0; // Reset the list @@ -3160,14 +3252,14 @@ static void G_DoCompleted(void) nextmap = (INT16)(mapheaderinfo[gamemap-1]->nextlevel-1); // Remember last map for when you come out of the special stage. - if (!G_IsSpecialStage(gamemap)) + if (!spec) lastmap = nextmap; // If nextmap is actually going to get used, make sure it points to // a map of the proper gametype -- skip levels that don't support // the current gametype. (Helps avoid playing boss levels in Race, // for instance). - if (!token && !G_IsSpecialStage(gamemap) + if (!token && !spec && (nextmap >= 0 && nextmap < NUMMAPS)) { register INT16 cm = nextmap; @@ -3231,7 +3323,7 @@ static void G_DoCompleted(void) gottoken = false; } - if (G_IsSpecialStage(gamemap) && !gottoken) + if (spec && !gottoken) nextmap = lastmap; // Exiting from a special stage? Go back to the game. Tails 08-11-2001 automapactive = false; @@ -3250,7 +3342,38 @@ static void G_DoCompleted(void) if (nextmap < NUMMAPS && !mapheaderinfo[nextmap]) P_AllocMapHeader(nextmap); - if (skipstats && !modeattacking) // Don't skip stats if we're in record attack + // Update visitation flags? + if ((!modifiedgame || savemoddata) // Not modified + && !multiplayer && !demoplayback && (gametype == GT_COOP) // SP/RA/NiGHTS mode + && !(spec && stagefailed)) // Not failed the special stage + { + UINT8 earnedEmblems; + + // Update visitation flags + mapvisited[gamemap-1] |= MV_BEATEN; + // eh, what the hell + if (ultimatemode) + mapvisited[gamemap-1] |= MV_ULTIMATE; + // may seem incorrect but IS possible in what the main game uses as special stages, and nummaprings will be -1 in NiGHTS + if (nummaprings > 0 && players[consoleplayer].rings >= nummaprings) + mapvisited[gamemap-1] |= MV_PERFECT; + if (!spec) + { + // not available to special stages because they can only really be done in one order in an unmodified game, so impossible for first six and trivial for seventh + if (ALL7EMERALDS(emeralds)) + mapvisited[gamemap-1] |= MV_ALLEMERALDS; + } + + if (modeattacking == ATTACKING_RECORD) + G_UpdateRecordReplays(); + else if (modeattacking == ATTACKING_NIGHTS) + G_SetNightsRecords(); + + if ((earnedEmblems = M_CompletionEmblems())) + CONS_Printf(M_GetText("\x82" "Earned %hu emblem%s for level completion.\n"), (UINT16)earnedEmblems, earnedEmblems > 1 ? "s" : ""); + } + + if ((skipstats && !modeattacking) || (spec && modeattacking && stagefailed)) G_AfterIntermission(); else { @@ -3261,6 +3384,14 @@ static void G_DoCompleted(void) void G_AfterIntermission(void) { + Y_CleanupScreenBuffer(); + + if (modeattacking) + { + M_EndModeAttackRun(); + return; + } + HU_ClearCEcho(); if (mapheaderinfo[gamemap-1]->cutscenenum && !modeattacking && skipstats <= 1) // Start a custom cutscene. @@ -3427,7 +3558,6 @@ void G_LoadGameData(void) UINT32 recscore; tic_t rectime; UINT16 recrings; - boolean gotperf; UINT8 recmares; INT32 curmare; @@ -3525,7 +3655,7 @@ void G_LoadGameData(void) recscore = READUINT32(save_p); rectime = (tic_t)READUINT32(save_p); recrings = READUINT16(save_p); - gotperf = (boolean)READUINT8(save_p); + save_p++; // compat if (recrings > 10000 || recscore > MAXSCORE) goto datacorrupt; @@ -3537,9 +3667,6 @@ void G_LoadGameData(void) mainrecords[i]->time = rectime; mainrecords[i]->rings = recrings; } - - if (gotperf) - mainrecords[i]->gotperfect = gotperf; } // Nights records @@ -3671,15 +3798,14 @@ void G_SaveGameData(void) WRITEUINT32(save_p, mainrecords[i]->score); WRITEUINT32(save_p, mainrecords[i]->time); WRITEUINT16(save_p, mainrecords[i]->rings); - WRITEUINT8(save_p, mainrecords[i]->gotperfect); } else { WRITEUINT32(save_p, 0); WRITEUINT32(save_p, 0); WRITEUINT16(save_p, 0); - WRITEUINT8(save_p, 0); } + WRITEUINT8(save_p, 0); // compat } // NiGHTS records diff --git a/src/m_menu.c b/src/m_menu.c index 7a5aa8ae6..5969dae27 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -9245,10 +9245,7 @@ void M_DrawTimeAttackMenu(void) V_DrawString(104-72, 73+lsheadingheight/2, V_YELLOWMAP, "RINGS:"); - if (!mainrecords[cv_nextmap.value-1] || !mainrecords[cv_nextmap.value-1]->gotperfect) - V_DrawRightAlignedString(104+64, 73+lsheadingheight/2, V_ALLOWLOWERCASE, beststr); - else - V_DrawRightAlignedString(104+64, 73+lsheadingheight/2, V_ALLOWLOWERCASE|V_YELLOWMAP, beststr); + V_DrawRightAlignedString(104+64, 73+lsheadingheight/2, V_ALLOWLOWERCASE|((mapvisited[cv_nextmap.value-1] & MV_PERFECT) ? V_YELLOWMAP : 0), beststr); V_DrawRightAlignedString(104+72, 83+lsheadingheight/2, V_ALLOWLOWERCASE, reqrings); } diff --git a/src/y_inter.c b/src/y_inter.c index 48d08a02e..32548d263 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -166,13 +166,11 @@ static INT32 endtic = -1; intertype_t intertype = int_none; static void Y_RescaleScreenBuffer(void); -static void Y_CleanupScreenBuffer(void); static void Y_AwardCoopBonuses(void); static void Y_AwardSpecialStageBonus(void); static void Y_CalculateCompetitionWinners(void); static void Y_CalculateTimeRaceWinners(void); static void Y_CalculateMatchWinners(void); -static void Y_FollowIntermission(void); static void Y_UnloadData(void); // Stuff copy+pasted from st_stuff.c @@ -293,7 +291,7 @@ static void Y_RescaleScreenBuffer(void) // // Free all related memory. // -static void Y_CleanupScreenBuffer(void) +void Y_CleanupScreenBuffer(void) { // Who knows? if (y_buffer == NULL) @@ -819,7 +817,7 @@ void Y_IntermissionDrawer(void) } } } - else if (intertype == int_classicrace) + else if (intertype == int_comp) { INT32 x = 4; INT32 y = 48; @@ -953,7 +951,7 @@ void Y_Ticker(void) if (!--timer) { Y_EndIntermission(); - Y_FollowIntermission(); + G_AfterIntermission(); return; } } @@ -961,7 +959,7 @@ void Y_Ticker(void) else if (intertic == endtic) { Y_EndIntermission(); - Y_FollowIntermission(); + G_AfterIntermission(); return; } @@ -1145,7 +1143,7 @@ void Y_Ticker(void) if (data.match.numplayers != D_NumPlayers()) Y_CalculateMatchWinners(); } - else if (intertype == int_race || intertype == int_classicrace) // race + else if (intertype == int_race || intertype == int_comp) // race { if (!intertic) // first time only S_ChangeMusicInternal("_inter", true); // loop it @@ -1154,96 +1152,6 @@ void Y_Ticker(void) } } -// -// Y_UpdateRecordReplays -// -// Update replay files/data, etc. for Record Attack -// See G_SetNightsRecords for NiGHTS Attack. -// -static void Y_UpdateRecordReplays(void) -{ - const size_t glen = strlen(srb2home)+1+strlen("replay")+1+strlen(timeattackfolder)+1+strlen("MAPXX")+1; - char *gpath; - char lastdemo[256], bestdemo[256]; - UINT8 earnedEmblems; - - // Record new best time - if (!mainrecords[gamemap-1]) - G_AllocMainRecordData(gamemap-1); - - if (players[consoleplayer].score > mainrecords[gamemap-1]->score) - mainrecords[gamemap-1]->score = players[consoleplayer].score; - - if ((mainrecords[gamemap-1]->time == 0) || (players[consoleplayer].realtime < mainrecords[gamemap-1]->time)) - mainrecords[gamemap-1]->time = players[consoleplayer].realtime; - - if ((UINT16)(players[consoleplayer].rings) > mainrecords[gamemap-1]->rings) - mainrecords[gamemap-1]->rings = (UINT16)(players[consoleplayer].rings); - - if (data.coop.gotperfbonus) - mainrecords[gamemap-1]->gotperfect = true; - - // Save demo! - bestdemo[255] = '\0'; - lastdemo[255] = '\0'; - G_SetDemoTime(players[consoleplayer].realtime, players[consoleplayer].score, (UINT16)(players[consoleplayer].rings)); - G_CheckDemoStatus(); - - I_mkdir(va("%s"PATHSEP"replay", srb2home), 0755); - I_mkdir(va("%s"PATHSEP"replay"PATHSEP"%s", srb2home, timeattackfolder), 0755); - - if ((gpath = malloc(glen)) == NULL) - I_Error("Out of memory for replay filepath\n"); - - sprintf(gpath,"%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s", srb2home, timeattackfolder, G_BuildMapName(gamemap)); - snprintf(lastdemo, 255, "%s-%s-last.lmp", gpath, skins[cv_chooseskin.value-1].name); - - if (FIL_FileExists(lastdemo)) - { - UINT8 *buf; - size_t len = FIL_ReadFile(lastdemo, &buf); - - snprintf(bestdemo, 255, "%s-%s-time-best.lmp", gpath, skins[cv_chooseskin.value-1].name); - if (!FIL_FileExists(bestdemo) || G_CmpDemoTime(bestdemo, lastdemo) & 1) - { // Better time, save this demo. - if (FIL_FileExists(bestdemo)) - remove(bestdemo); - FIL_WriteFile(bestdemo, buf, len); - CONS_Printf("\x83%s\x80 %s '%s'\n", M_GetText("NEW RECORD TIME!"), M_GetText("Saved replay as"), bestdemo); - } - - snprintf(bestdemo, 255, "%s-%s-score-best.lmp", gpath, skins[cv_chooseskin.value-1].name); - if (!FIL_FileExists(bestdemo) || (G_CmpDemoTime(bestdemo, lastdemo) & (1<<1))) - { // Better score, save this demo. - if (FIL_FileExists(bestdemo)) - remove(bestdemo); - FIL_WriteFile(bestdemo, buf, len); - CONS_Printf("\x83%s\x80 %s '%s'\n", M_GetText("NEW HIGH SCORE!"), M_GetText("Saved replay as"), bestdemo); - } - - snprintf(bestdemo, 255, "%s-%s-rings-best.lmp", gpath, skins[cv_chooseskin.value-1].name); - if (!FIL_FileExists(bestdemo) || (G_CmpDemoTime(bestdemo, lastdemo) & (1<<2))) - { // Better rings, save this demo. - if (FIL_FileExists(bestdemo)) - remove(bestdemo); - FIL_WriteFile(bestdemo, buf, len); - CONS_Printf("\x83%s\x80 %s '%s'\n", M_GetText("NEW MOST RINGS!"), M_GetText("Saved replay as"), bestdemo); - } - - //CONS_Printf("%s '%s'\n", M_GetText("Saved replay as"), lastdemo); - - Z_Free(buf); - } - free(gpath); - - // Check emblems when level data is updated - if ((earnedEmblems = M_CheckLevelEmblems())) - CONS_Printf(M_GetText("\x82" "Earned %hu emblem%s for Record Attack records.\n"), (UINT16)earnedEmblems, earnedEmblems > 1 ? "s" : ""); - - // Update timeattack menu's replay availability. - Nextmap_OnChange(); -} - // // Y_StartIntermission // @@ -1252,7 +1160,6 @@ static void Y_UpdateRecordReplays(void) void Y_StartIntermission(void) { INT32 i; - UINT8 completionEmblems = M_CompletionEmblems(); intertic = -1; @@ -1265,10 +1172,7 @@ void Y_StartIntermission(void) { timer = 0; - if (G_IsSpecialStage(gamemap)) - intertype = (maptol & TOL_NIGHTS) ? int_nightsspec : int_spec; - else - intertype = (maptol & TOL_NIGHTS) ? int_nights : int_coop; + intertype = (G_IsSpecialStage(gamemap)) ? int_spec : int_coop; } else { @@ -1283,14 +1187,7 @@ void Y_StartIntermission(void) } if (gametype == GT_COOP) - { - // Nights intermission is single player only - // Don't add it here - if (G_IsSpecialStage(gamemap)) - intertype = int_spec; - else - intertype = int_coop; - } + intertype = (G_IsSpecialStage(gamemap)) ? int_spec : int_coop; else if (gametype == GT_TEAMMATCH) intertype = int_teammatch; else if (gametype == GT_MATCH @@ -1300,7 +1197,7 @@ void Y_StartIntermission(void) else if (gametype == GT_RACE) intertype = int_race; else if (gametype == GT_COMPETITION) - intertype = int_classicrace; + intertype = int_comp; else if (gametype == GT_CTF) intertype = int_ctf; } @@ -1315,20 +1212,6 @@ void Y_StartIntermission(void) switch (intertype) { - case int_nights: - // Can't fail - G_SetNightsRecords(); - - // Check records - { - UINT8 earnedEmblems = M_CheckLevelEmblems(); - if (earnedEmblems) - CONS_Printf(M_GetText("\x82" "Earned %hu emblem%s for NiGHTS records.\n"), (UINT16)earnedEmblems, earnedEmblems > 1 ? "s" : ""); - } - - // fall back into the coop intermission for now - intertype = int_coop; - /* FALLTHRU */ case int_coop: // coop or single player, normal level { // award time and ring bonuses @@ -1337,24 +1220,6 @@ void Y_StartIntermission(void) // setup time data data.coop.tics = players[consoleplayer].realtime; - if ((!modifiedgame || savemoddata) && !multiplayer && !demoplayback) - { - // Update visitation flags - mapvisited[gamemap-1] |= MV_BEATEN; - if (ALL7EMERALDS(emeralds)) - mapvisited[gamemap-1] |= MV_ALLEMERALDS; - if (ultimatemode) - mapvisited[gamemap-1] |= MV_ULTIMATE; - if (data.coop.gotperfbonus) - mapvisited[gamemap-1] |= MV_PERFECT; - - if (modeattacking == ATTACKING_RECORD) - Y_UpdateRecordReplays(); - - if (completionEmblems) - CONS_Printf(M_GetText("\x82" "Earned %hu emblem%s for level completion.\n"), (UINT16)completionEmblems, completionEmblems > 1 ? "s" : ""); - } - for (i = 0; i < 4; ++i) data.coop.bonuspatches[i] = W_CachePatchName(data.coop.bonuses[i].patch, PU_STATIC); data.coop.ptotal = W_CachePatchName("YB_TOTAL", PU_STATIC); @@ -1421,40 +1286,8 @@ void Y_StartIntermission(void) break; } - case int_nightsspec: - if (modeattacking && stagefailed) - { - // Nuh-uh. Get out of here. - Y_EndIntermission(); - Y_FollowIntermission(); - break; - } - if (!stagefailed) - G_SetNightsRecords(); - - // Check records - { - UINT8 earnedEmblems = M_CheckLevelEmblems(); - if (earnedEmblems) - CONS_Printf(M_GetText("\x82" "Earned %hu emblem%s for NiGHTS records.\n"), (UINT16)earnedEmblems, earnedEmblems > 1 ? "s" : ""); - } - - // fall back into the special stage intermission for now - intertype = int_spec; - /* FALLTHRU */ case int_spec: // coop or single player, special stage { - // Update visitation flags? - if ((!modifiedgame || savemoddata) && !multiplayer && !demoplayback) - { - if (!stagefailed) - mapvisited[gamemap-1] |= MV_BEATEN; - - // all emeralds/ultimate/perfect emblems won't be possible in ss, oh well? - if (completionEmblems) - CONS_Printf(M_GetText("\x82" "Earned %hu emblem%s for level completion.\n"), (UINT16)completionEmblems, completionEmblems > 1 ? "s" : ""); - } - // give out ring bonuses Y_AwardSpecialStageBonus(); @@ -1640,7 +1473,7 @@ void Y_StartIntermission(void) break; } - case int_classicrace: // classic (full race) + case int_comp: // classic (full race) { // find out who won Y_CalculateCompetitionWinners(); @@ -2195,23 +2028,6 @@ void Y_EndIntermission(void) usebuffer = false; } -// -// Y_FollowIntermission -// -static void Y_FollowIntermission(void) -{ - if (modeattacking) - { - M_EndModeAttackRun(); - return; - } - - // This handles whether to play a post-level cutscene, end the game, - // or simply go to the next level. - // No need to duplicate the code here! - G_AfterIntermission(); -} - #define UNLOAD(x) Z_ChangeTag(x, PU_CACHE); x = NULL // @@ -2224,8 +2040,6 @@ static void Y_UnloadData(void) if (rendermode != render_soft) return; - Y_CleanupScreenBuffer(); - // unload the background patches UNLOAD(bgpatch); UNLOAD(widebgpatch); @@ -2261,7 +2075,7 @@ static void Y_UnloadData(void) break; default: //without this default, - //int_none, int_tag, int_chaos, and int_classicrace + //int_none, int_tag, int_chaos, and int_comp //are not handled break; } diff --git a/src/y_inter.h b/src/y_inter.h index ccb48dbd4..b47f3b157 100644 --- a/src/y_inter.h +++ b/src/y_inter.h @@ -16,6 +16,7 @@ void Y_Ticker(void); void Y_StartIntermission(void); void Y_EndIntermission(void); void Y_ConsiderScreenBuffer(void); +void Y_CleanupScreenBuffer(void); typedef enum { @@ -26,9 +27,7 @@ typedef enum // int_tag, // Tag int_ctf, // CTF int_spec, // Special Stage - int_nights, // NiGHTS into Dreams - int_nightsspec,// NiGHTS special stage int_race, // Race - int_classicrace, // Competition + int_comp, // Competition } intertype_t; extern intertype_t intertype; From 990d9ed40cf15b766c8029f6a573ee61c34f9ff1 Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 21 Nov 2019 22:50:04 +0000 Subject: [PATCH 112/189] Correct location of followmobj scale write to match read (resolves #322). Requires deleting all of RC1's Record Attack replays with followmobj characters, but I think you'll agree that's a reasonable price to pay. --- src/g_game.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 5e1645901..edae9ec64 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -4726,6 +4726,12 @@ void G_WriteGhostTic(mobj_t *ghost) oldghost.flags2 |= MF2_AMBUSH; } + if (ghost->player->followmobj->scale != ghost->scale) + { + followtic |= FZT_SCALE; + WRITEFIXED(demo_p,ghost->player->followmobj->scale); + } + temp = (INT16)((ghost->player->followmobj->x-ghost->x)>>8); WRITEINT16(demo_p,temp); temp = (INT16)((ghost->player->followmobj->y-ghost->y)>>8); @@ -4737,11 +4743,6 @@ void G_WriteGhostTic(mobj_t *ghost) WRITEUINT16(demo_p,ghost->player->followmobj->sprite); WRITEUINT8(demo_p,(ghost->player->followmobj->frame & FF_FRAMEMASK)); WRITEUINT8(demo_p,ghost->player->followmobj->color); - if (ghost->player->followmobj->scale != ghost->scale) - { - followtic |= FZT_SCALE; - WRITEFIXED(demo_p,ghost->player->followmobj->scale); - } *followtic_p = followtic; } From 143d4aa05348000e2d0841f1d45aa27b1ffb7354 Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 21 Nov 2019 23:38:33 +0000 Subject: [PATCH 113/189] Move all the visitation/emblems/record attack update stuff into a single function, and call that function in two different places depending on whether the tally screen is visited or not. --- src/g_game.c | 73 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 42 insertions(+), 31 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index cc82f5d5c..a18967052 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -3213,6 +3213,44 @@ static INT16 RandMap(INT16 tolflags, INT16 pprevmap) return ix; } +// +// G_UpdateVisited +// +static void G_UpdateVisited(void) +{ + boolean spec = G_IsSpecialStage(gamemap); + // Update visitation flags? + if ((!modifiedgame || savemoddata) // Not modified + && !multiplayer && !demoplayback && (gametype == GT_COOP) // SP/RA/NiGHTS mode + && !(spec && stagefailed)) // Not failed the special stage + { + UINT8 earnedEmblems; + + // Update visitation flags + mapvisited[gamemap-1] |= MV_BEATEN; + // eh, what the hell + if (ultimatemode) + mapvisited[gamemap-1] |= MV_ULTIMATE; + // may seem incorrect but IS possible in what the main game uses as special stages, and nummaprings will be -1 in NiGHTS + if (nummaprings > 0 && players[consoleplayer].rings >= nummaprings) + mapvisited[gamemap-1] |= MV_PERFECT; + if (!spec) + { + // not available to special stages because they can only really be done in one order in an unmodified game, so impossible for first six and trivial for seventh + if (ALL7EMERALDS(emeralds)) + mapvisited[gamemap-1] |= MV_ALLEMERALDS; + } + + if (modeattacking == ATTACKING_RECORD) + G_UpdateRecordReplays(); + else if (modeattacking == ATTACKING_NIGHTS) + G_SetNightsRecords(); + + if ((earnedEmblems = M_CompletionEmblems())) + CONS_Printf(M_GetText("\x82" "Earned %hu emblem%s for level completion.\n"), (UINT16)earnedEmblems, earnedEmblems > 1 ? "s" : ""); + } +} + // // G_DoCompleted // @@ -3342,43 +3380,16 @@ static void G_DoCompleted(void) if (nextmap < NUMMAPS && !mapheaderinfo[nextmap]) P_AllocMapHeader(nextmap); - // Update visitation flags? - if ((!modifiedgame || savemoddata) // Not modified - && !multiplayer && !demoplayback && (gametype == GT_COOP) // SP/RA/NiGHTS mode - && !(spec && stagefailed)) // Not failed the special stage - { - UINT8 earnedEmblems; - - // Update visitation flags - mapvisited[gamemap-1] |= MV_BEATEN; - // eh, what the hell - if (ultimatemode) - mapvisited[gamemap-1] |= MV_ULTIMATE; - // may seem incorrect but IS possible in what the main game uses as special stages, and nummaprings will be -1 in NiGHTS - if (nummaprings > 0 && players[consoleplayer].rings >= nummaprings) - mapvisited[gamemap-1] |= MV_PERFECT; - if (!spec) - { - // not available to special stages because they can only really be done in one order in an unmodified game, so impossible for first six and trivial for seventh - if (ALL7EMERALDS(emeralds)) - mapvisited[gamemap-1] |= MV_ALLEMERALDS; - } - - if (modeattacking == ATTACKING_RECORD) - G_UpdateRecordReplays(); - else if (modeattacking == ATTACKING_NIGHTS) - G_SetNightsRecords(); - - if ((earnedEmblems = M_CompletionEmblems())) - CONS_Printf(M_GetText("\x82" "Earned %hu emblem%s for level completion.\n"), (UINT16)earnedEmblems, earnedEmblems > 1 ? "s" : ""); - } - if ((skipstats && !modeattacking) || (spec && modeattacking && stagefailed)) + { + G_UpdateVisited(); G_AfterIntermission(); + } else { G_SetGamestate(GS_INTERMISSION); Y_StartIntermission(); + G_UpdateVisited(); } } From 514394a4f3aa37ba60616be5130fd9ac505f2e7a Mon Sep 17 00:00:00 2001 From: sphere Date: Fri, 22 Nov 2019 04:12:38 +0100 Subject: [PATCH 114/189] fuck autocomplete --- src/d_netcmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index f46468feb..cff9ced20 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -4338,7 +4338,7 @@ static void Command_Isgamemodified_f(void) else if (modifiedgame) CONS_Printf(M_GetText("modifiedgame is true, extras will not be unlocked\n")); else - CONS_Printf(M_GetText("modifiedgame is false, you can unlock extravalues\n")); + CONS_Printf(M_GetText("modifiedgame is false, you can unlock extras\n")); } static void Command_Cheats_f(void) From e3aca4b647242d3f3784df42d0d0d7bdf131bf5c Mon Sep 17 00:00:00 2001 From: sphere Date: Fri, 22 Nov 2019 20:24:57 +0100 Subject: [PATCH 115/189] restore secrets = 0, not sure why i changed that --- src/m_menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/m_menu.c b/src/m_menu.c index 648fa17f6..025637820 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -488,7 +488,7 @@ typedef enum { singleplr, multiplr, - secrets = 2, + secrets = 0, addons, options, quitdoom From 07221c50ce4440ed33ae67794a67dd671a0f294f Mon Sep 17 00:00:00 2001 From: sphere Date: Fri, 22 Nov 2019 20:37:35 +0100 Subject: [PATCH 116/189] i'm a dumbass --- src/m_menu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 025637820..ccfaa9a49 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -486,9 +486,9 @@ static menuitem_t MainMenu[] = typedef enum { - singleplr, + singleplr = 0, multiplr, - secrets = 0, + secrets, addons, options, quitdoom From c8c5237540b2f5324a1694b4643bb0a76120707f Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 22 Nov 2019 19:51:27 +0000 Subject: [PATCH 117/189] Resolve #310. --- src/p_user.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 0140bee4d..d61a179f5 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -7743,9 +7743,12 @@ void P_ElementalFire(player_t *player, boolean cropcircle) I_Assert(!P_MobjWasRemoved(player->mo)); if (player->mo->eflags & MFE_VERTICALFLIP) - ground = player->mo->ceilingz - FixedMul(mobjinfo[MT_SPINFIRE].height - 1, player->mo->scale); + ground = player->mo->ceilingz - FixedMul(mobjinfo[MT_SPINFIRE].height, player->mo->scale); else - ground = player->mo->floorz + 1; + ground = player->mo->floorz; + + if (cropcircle) + ground += P_MobjFlip(player->mo); if (cropcircle) { From de2a26bf5d262fd5e3973a5a4d2524aab0c76c2a Mon Sep 17 00:00:00 2001 From: sphere Date: Fri, 22 Nov 2019 21:00:03 +0100 Subject: [PATCH 118/189] Swap statistics and tutorial options in the 1 Player menu. --- src/m_menu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index ccfaa9a49..cc655b226 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -727,8 +727,8 @@ static menuitem_t SP_MainMenu[] = {IT_CALL | IT_STRING, NULL, "Start Game", M_LoadGame, 84}, {IT_SECRET, NULL, "Record Attack", M_TimeAttack, 92}, {IT_SECRET, NULL, "NiGHTS Mode", M_NightsAttack, 100}, - {IT_CALL | IT_STRING | IT_CALL_NOTMODIFIED, NULL, "Statistics", M_Statistics, 108}, - {IT_CALL | IT_STRING, NULL, "Tutorial", M_StartTutorial, 116}, + {IT_CALL | IT_STRING, NULL, "Tutorial", M_StartTutorial, 108}, + {IT_CALL | IT_STRING | IT_CALL_NOTMODIFIED, NULL, "Statistics", M_Statistics, 116} }; enum @@ -736,8 +736,8 @@ enum sploadgame, sprecordattack, spnightsmode, - spstatistics, - sptutorial + sptutorial, + spstatistics }; // Single Player Load Game From 227f69f06362d11352be270ababd59162e56f65d Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Fri, 22 Nov 2019 17:30:53 -0300 Subject: [PATCH 119/189] fix missing mmx check --- src/r_plane.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/r_plane.c b/src/r_plane.c index a3075c9d8..f21f49101 100644 --- a/src/r_plane.c +++ b/src/r_plane.c @@ -1007,6 +1007,8 @@ void R_DrawSinglePlane(visplane_t *pl) R_CheckFlatLength(W_LumpLength(levelflat->u.flat.lumpnum)); // Raw flats always have dimensions that are powers-of-two numbers. ds_powersoftwo = true; + if (spanfunc == basespanfunc) + spanfunc = mmxspanfunc; break; default: switch (type) From faa305a2f25db04f6cb54bf3af1b4f1498e308ac Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Fri, 22 Nov 2019 17:44:42 -0300 Subject: [PATCH 120/189] Fix crossfades Fixes NoReload using the wrong wipestyle. Also fixes non-titlemap title screen wipes using the wrong wipestyle. --- src/f_finale.h | 7 ++++--- src/f_wipe.c | 6 ++++-- src/g_game.c | 6 ++++-- src/p_setup.c | 2 +- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/f_finale.h b/src/f_finale.h index 024b183b2..0002cb3cf 100644 --- a/src/f_finale.h +++ b/src/f_finale.h @@ -152,9 +152,10 @@ extern wipestyle_t wipestyle; typedef enum { - WSF_FADEOUT = 1, - WSF_FADEIN = 1<<1, - WSF_TOWHITE = 1<<2, + WSF_FADEOUT = 1, + WSF_FADEIN = 1<<1, + WSF_TOWHITE = 1<<2, + WSF_CROSSFADE = 1<<3, } wipestyleflags_t; extern wipestyleflags_t wipestyleflags; diff --git a/src/f_wipe.c b/src/f_wipe.c index 20651cb1d..0c4c591c8 100644 --- a/src/f_wipe.c +++ b/src/f_wipe.c @@ -95,7 +95,7 @@ boolean WipeStageTitle = false; INT32 lastwipetic = 0; wipestyle_t wipestyle = WIPESTYLE_NORMAL; -wipestyleflags_t wipestyleflags = 0; +wipestyleflags_t wipestyleflags = WSF_CROSSFADE; #ifndef NOWIPE static UINT8 *wipe_scr_start; //screen 3 @@ -404,7 +404,9 @@ void F_RunWipe(UINT8 wipetype, boolean drawMenu) // don't know where else to put this. // this any good? - if (gamestate == GS_LEVEL || gamestate == GS_TITLESCREEN) + if ((gamestate == GS_LEVEL || gamestate == GS_TITLESCREEN) + && (wipestyleflags & (WSF_FADEIN|WSF_FADEOUT)) // only if wipestyleflags are actually set + && !(wipestyleflags & WSF_CROSSFADE)) // and if not crossfading wipestyle = WIPESTYLE_LEVEL; else wipestyle = WIPESTYLE_NORMAL; diff --git a/src/g_game.c b/src/g_game.c index 2fa70353e..963fc00f0 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1803,6 +1803,9 @@ void G_DoLoadLevel(boolean resetplayer) // void G_StartTitleCard(void) { + wipestyleflags |= WSF_FADEIN; + wipestyleflags &= ~WSF_FADEOUT; + // The title card has been disabled for this map. // Oh well. if (mapheaderinfo[gamemap-1]->levelflags & LF_NOTITLECARD) @@ -1819,8 +1822,6 @@ void G_StartTitleCard(void) // start the title card WipeStageTitle = (!titlemapinaction); - wipestyleflags |= WSF_FADEIN; - wipestyleflags &= ~WSF_FADEOUT; } // @@ -2855,6 +2856,7 @@ void G_DoReborn(INT32 playernum) // Do a wipe wipegamestate = -1; + wipestyleflags = WSF_CROSSFADE; if (camera.chase) P_ResetCamera(&players[displayplayer], &camera); diff --git a/src/p_setup.c b/src/p_setup.c index e87a088d8..b729177aa 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2725,7 +2725,7 @@ boolean P_SetupLevel(boolean skipprecip) S_FadeOutStopMusic(MUSICRATE/4); //FixedMul(FixedDiv(F_GetWipeLength(wipedefs[wipe_speclevel_towhite])*NEWTICRATERATIO, NEWTICRATE), MUSICRATE) F_WipeStartScreen(); - wipestyleflags |= WSF_FADEOUT|WSF_TOWHITE; + wipestyleflags |= (WSF_FADEOUT|WSF_TOWHITE); #ifdef HWRENDER // uh.......... From b24c709206328d8580cc448ee0bdd0fd58531b33 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Fri, 22 Nov 2019 17:50:05 -0300 Subject: [PATCH 121/189] clarify comment --- src/f_wipe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/f_wipe.c b/src/f_wipe.c index 0c4c591c8..b88b39ef0 100644 --- a/src/f_wipe.c +++ b/src/f_wipe.c @@ -405,7 +405,7 @@ void F_RunWipe(UINT8 wipetype, boolean drawMenu) // don't know where else to put this. // this any good? if ((gamestate == GS_LEVEL || gamestate == GS_TITLESCREEN) - && (wipestyleflags & (WSF_FADEIN|WSF_FADEOUT)) // only if wipestyleflags are actually set + && (wipestyleflags & (WSF_FADEIN|WSF_FADEOUT)) // only if one of those wipestyleflags are actually set && !(wipestyleflags & WSF_CROSSFADE)) // and if not crossfading wipestyle = WIPESTYLE_LEVEL; else From 5611f8eff4aba15114b0e2eda8039289699bd956 Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 22 Nov 2019 21:06:25 +0000 Subject: [PATCH 122/189] I was reading the Sonic 3 Unlocked blog by NeoHazard when I came across a very interesting post. https://s3unlocked.blogspot.com/2017/12/over-threshold.html It turns out that in Sonic 3 & Knuckles, the threshold for crossing into the super animation is increased compared to normal gameplay. This makes a lot of sense - however, both Sonic Mania and the Taxman/Stealth mobile remakes missed this. I quickly tested and confirmed that SRB2 had the same issue, so here's the fix. --- src/p_user.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 0140bee4d..0ba8efe95 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2359,11 +2359,23 @@ boolean P_PlayerHitFloor(player_t *player, boolean dorollstuff) ; else if (player->panim != PA_IDLE && player->panim != PA_WALK && player->panim != PA_RUN && player->panim != PA_DASH) { + fixed_t runspd = FixedMul(player->runspeed, player->mo->scale); + + // See comments in P_MovePlayer for explanation of changes. + + if (player->powers[pw_super]) + runspd = FixedMul(runspd, 5*FRACUNIT/3); + + runspd = FixedMul(runspd, player->mo->movefactor); + + if (maptol & TOL_2D) + runspd = FixedMul(runspd, 2*FRACUNIT/3); + if (player->cmomx || player->cmomy) { if (player->charflags & SF_DASHMODE && player->dashmode >= DASHMODE_THRESHOLD && player->panim != PA_DASH) P_SetPlayerMobjState(player->mo, S_PLAY_DASH); - else if (player->speed >= FixedMul(player->runspeed, player->mo->scale) + else if (player->speed >= runspd && (player->panim != PA_RUN || player->mo->state-states == S_PLAY_FLOAT_RUN)) P_SetPlayerMobjState(player->mo, S_PLAY_RUN); else if ((player->rmomx || player->rmomy) @@ -2376,7 +2388,7 @@ boolean P_PlayerHitFloor(player_t *player, boolean dorollstuff) { if (player->charflags & SF_DASHMODE && player->dashmode >= DASHMODE_THRESHOLD && player->panim != PA_DASH) P_SetPlayerMobjState(player->mo, S_PLAY_DASH); - else if (player->speed >= FixedMul(player->runspeed, player->mo->scale) + else if (player->speed >= runspd && (player->panim != PA_RUN || player->mo->state-states == S_PLAY_FLOAT_RUN)) P_SetPlayerMobjState(player->mo, S_PLAY_RUN); else if ((player->mo->momx || player->mo->momy) @@ -7924,6 +7936,11 @@ static void P_MovePlayer(player_t *player) cmd = &player->cmd; runspd = FixedMul(player->runspeed, player->mo->scale); + // This was done in Sonic 3 & Knuckles, but has been missed in Sonic Mania and the Taxman/Stealth mobile remakes. Thanks to NeoHazard for his 2017 blogpost on the matter, because this oversight otherwise almost made it all the way to 2.2's release. + //https://s3unlocked.blogspot.com/2017/12/over-threshold.html + if (player->powers[pw_super]) + runspd = FixedMul(runspd, 5*FRACUNIT/3); + // Let's have some movement speed fun on low-friction surfaces, JUST for players... (high friction surfaces shouldn't have any adjustment, since the acceleration in this game is super high and that ends up cheesing high-friction surfaces.) runspd = FixedMul(runspd, player->mo->movefactor); From 95ed442d55a13ee6d74b23e01fa7d3cc8da94070 Mon Sep 17 00:00:00 2001 From: toaster Date: Sat, 23 Nov 2019 14:20:41 +0000 Subject: [PATCH 123/189] Prevent Knuckles latching onto horizon special linedefs. Also, update all references to the horizon special to use a #defined constant instead of a magic number. --- src/hardware/hw_main.c | 2 +- src/p_map.c | 2 +- src/r_defs.h | 2 ++ src/r_segs.c | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 5f0c25a59..51c976973 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -1973,7 +1973,7 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) { // Single sided line... Deal only with the middletexture (if one exists) gr_midtexture = R_GetTextureNum(gr_sidedef->midtexture); - if (gr_midtexture && gr_linedef->special != 41) // Ignore horizon line for OGL + if (gr_midtexture && gr_linedef->special != HORIZONSPECIAL) // Ignore horizon line for OGL { { fixed_t texturevpeg; diff --git a/src/p_map.c b/src/p_map.c index 97bff8156..753ce9eb5 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -3471,7 +3471,7 @@ isblocking: } // see about climbing on the wall - if (!(checkline->flags & ML_NOCLIMB)) + if (!(checkline->flags & ML_NOCLIMB) && checkline->special != HORIZONSPECIAL) { boolean canclimb; angle_t climbangle, climbline; diff --git a/src/r_defs.h b/src/r_defs.h index 4d41f4f70..6d0b10b70 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -410,6 +410,8 @@ typedef enum ST_NEGATIVE } slopetype_t; +#define HORIZONSPECIAL 41 + typedef struct line_s { // Vertices, from v1 to v2. diff --git a/src/r_segs.c b/src/r_segs.c index 6eb81ce7a..ee62bfc73 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -2694,7 +2694,7 @@ void R_StoreWallRange(INT32 start, INT32 stop) worldbottomslope >>= 4; #endif - if (linedef->special == 41) { // HORIZON LINES + if (linedef->special == HORIZONSPECIAL) { // HORIZON LINES topstep = bottomstep = 0; topfrac = bottomfrac = (centeryfrac>>4); topfrac++; // Prevent 1px HOM @@ -2825,7 +2825,7 @@ void R_StoreWallRange(INT32 start, INT32 stop) #ifdef ESLOPE ffloor[i].f_pos_slope >>= 4; #endif - if (linedef->special == 41) // Horizon lines extend FOFs in contact with them too. + if (linedef->special == HORIZONSPECIAL) // Horizon lines extend FOFs in contact with them too. { ffloor[i].f_step = 0; ffloor[i].f_frac = (centeryfrac>>4); From 5a63e22f563e3729516b25c16356bd252187e76a Mon Sep 17 00:00:00 2001 From: toaster Date: Sat, 23 Nov 2019 14:43:36 +0000 Subject: [PATCH 124/189] It's not safe to store a file-scope pointer to a mobj_t* without having any mechanism to clear it between map reloadings, so move the Tailsbot "press jump now to fly!" indicator into `tails->target`. Resolves #331, and likely also #330 and #309. --- src/b_bot.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/b_bot.c b/src/b_bot.c index 12cdc36a0..709a280b5 100644 --- a/src/b_bot.c +++ b/src/b_bot.c @@ -31,7 +31,6 @@ static boolean panic = false; static UINT8 flymode = 0; static boolean spinmode = false; static boolean thinkfly = false; -static mobj_t *overlay; static inline void B_ResetAI(void) { @@ -336,17 +335,20 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm // Thinkfly overlay if (thinkfly) { - if (overlay == NULL) + if (!tails->target) { - overlay = P_SpawnMobjFromMobj(tails, 0, 0, 0, MT_OVERLAY); - P_SetTarget(&overlay->target, tails); - P_SetMobjState(overlay, S_FLIGHTINDICATOR); + P_SetTarget(&tails->target, P_SpawnMobjFromMobj(tails, 0, 0, 0, MT_OVERLAY)); + if (tails->target) + { + P_SetTarget(&tails->target->target, tails); + P_SetMobjState(tails->target, S_FLIGHTINDICATOR); + } } } - else if (overlay != NULL) + else if (tails->target && tails->target->type == MT_OVERLAY && tails->target->state == states+S_FLIGHTINDICATOR) { - P_RemoveMobj(overlay); - overlay = NULL; + P_RemoveMobj(tails->target); + P_SetTarget(&tails->target, NULL); } // Turn the virtual keypresses into ticcmd_t. From 7956584797a0b46f4a450aecf5392c2eb4d38d51 Mon Sep 17 00:00:00 2001 From: toaster Date: Sat, 23 Nov 2019 15:11:11 +0000 Subject: [PATCH 125/189] Have the vertical aiming focus on the signpost's z rather than continue to focus on the player even while the camera is forced to be near the signpost. (resolves #327) --- src/p_user.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 0140bee4d..9b3b8b9bd 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -10218,9 +10218,9 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall dist = FixedHypot(f1, f2); if (mo->eflags & MFE_VERTICALFLIP) - angle = R_PointToAngle2(0, thiscam->z + thiscam->height, dist, mo->z + mo->height - P_GetPlayerHeight(player)); + angle = R_PointToAngle2(0, thiscam->z + thiscam->height, dist, (sign ? sign->ceilingz : mo->z + mo->height) - P_GetPlayerHeight(player)); else - angle = R_PointToAngle2(0, thiscam->z, dist, mo->z + P_GetPlayerHeight(player)); + angle = R_PointToAngle2(0, thiscam->z, dist, (sign ? sign->floorz : mo->z) + P_GetPlayerHeight(player)); if (player->playerstate != PST_DEAD) angle += (focusaiming < ANGLE_180 ? focusaiming/2 : InvAngle(InvAngle(focusaiming)/2)); // overcomplicated version of '((signed)focusaiming)/2;' From ebead10dca70c07fb63093abf4276f5ffaae0181 Mon Sep 17 00:00:00 2001 From: toaster Date: Sat, 23 Nov 2019 15:23:42 +0000 Subject: [PATCH 126/189] Remove duplicate viewpointx/viewpointy set. --- src/p_user.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 9b3b8b9bd..dc3bcc113 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -10164,17 +10164,6 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall if (!camstill && !resetcalled && !paused) thiscam->angle = R_PointToAngle2(thiscam->x, thiscam->y, viewpointx, viewpointy); - if (sign) - { - viewpointx = sign->x + FixedMul(FINECOSINE((angle>>ANGLETOFINESHIFT) & FINEMASK), dist); - viewpointy = sign->y + FixedMul(FINESINE((angle>>ANGLETOFINESHIFT) & FINEMASK), dist); - } - else - { - viewpointx = mo->x + FixedMul(FINECOSINE((angle>>ANGLETOFINESHIFT) & FINEMASK), dist); - viewpointy = mo->y + FixedMul(FINESINE((angle>>ANGLETOFINESHIFT) & FINEMASK), dist); - } - /* if (twodlevel || (mo->flags2 & MF2_TWOD)) thiscam->angle = angle; From 90c13effc02ee6be94f04dd8026d99ba7e26872f Mon Sep 17 00:00:00 2001 From: toaster Date: Sat, 23 Nov 2019 15:40:32 +0000 Subject: [PATCH 127/189] Since I was tired of seeing NiGHTS players bump their head into the ceiling, and since similar camera enhancements have been made for the papersprite sign exit, implement a camera lock when exiting while NiGHTS. https://cdn.discordapp.com/attachments/359091121789468672/647821662003396609/srb20088.gif --- src/p_user.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 0140bee4d..68b99ae3e 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -9632,8 +9632,15 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall mo = player->mo; - if (player->exiting && mo->target && mo->target->type == MT_SIGN) - sign = mo->target; + if (player->exiting) + { + if (mo->target && mo->target->type == MT_SIGN && mo->target->spawnpoint) + sign = mo->target; + else if ((player->powers[pw_carry] == CR_NIGHTSMODE) + && !(player->mo->state >= &states[S_PLAY_NIGHTS_TRANS1] + && player->mo->state <= &states[S_PLAY_NIGHTS_TRANS6])) + return true; + } cameranoclip = (player->powers[pw_carry] == CR_NIGHTSMODE || player->pflags & PF_NOCLIP) || (mo->flags & (MF_NOCLIP|MF_NOCLIPHEIGHT)); // Noclipping player camera noclips too!! From aabddd69f145c59e5c3fd5b711147e3d29b55125 Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Sat, 23 Nov 2019 18:51:32 +0100 Subject: [PATCH 128/189] Fixed a missing space in the "Speeding off to..." text --- src/p_setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_setup.c b/src/p_setup.c index b729177aa..83f1d475b 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2809,7 +2809,7 @@ boolean P_SetupLevel(boolean skipprecip) snprintf(tx, 63, "%s%s%s", mapheaderinfo[gamemap-1]->lvlttl, (mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE) ? "" : " Zone", - (mapheaderinfo[gamemap-1]->actnum > 0) ? va("%d",mapheaderinfo[gamemap-1]->actnum) : ""); + (mapheaderinfo[gamemap-1]->actnum > 0) ? va(" %d",mapheaderinfo[gamemap-1]->actnum) : ""); V_DrawSmallString(1, 195, V_ALLOWLOWERCASE|V_TRANSLUCENT, tx); I_UpdateNoVsync(); } From bfae969ca6c048f3a907aa1f4cbb013a3a537abc Mon Sep 17 00:00:00 2001 From: FuriousFox Date: Sat, 23 Nov 2019 14:21:48 -0500 Subject: [PATCH 129/189] Updated sprite for Minus --- extras/conf/SRB2-22.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/conf/SRB2-22.cfg b/extras/conf/SRB2-22.cfg index f316cd032..ac93ed37d 100644 --- a/extras/conf/SRB2-22.cfg +++ b/extras/conf/SRB2-22.cfg @@ -3422,7 +3422,7 @@ thingtypes 121 { title = "Minus"; - sprite = "MNUSA1"; + sprite = "MNUSA0"; width = 24; height = 32; } From 869764be7deda7136fc94a77da5419153eaa6169 Mon Sep 17 00:00:00 2001 From: FuriousFox Date: Sat, 23 Nov 2019 15:04:59 -0500 Subject: [PATCH 130/189] Added Blue Gargoyle and Green Flame --- extras/conf/SRB2-22.cfg | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/extras/conf/SRB2-22.cfg b/extras/conf/SRB2-22.cfg index ac93ed37d..0a60eb2b9 100644 --- a/extras/conf/SRB2-22.cfg +++ b/extras/conf/SRB2-22.cfg @@ -5726,6 +5726,24 @@ thingtypes width = 24; height = 32; } + 1505 + { + title = "Green Flame"; + sprite = "CFLMA0E0"; + width = 8; + height = 32; + } + 1506 + { + arrow = 1; + blocking = 2; + title = "Blue Gargoyle"; + sprite = "BGARD1"; + width = 16; + height = 40; + flags4text = "[4] Slides when pushed"; + flags8text = "[8] Not pushable"; + } } dreamhill From 97a87574b209df9837500b7036756ef0af5348cd Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Sat, 23 Nov 2019 16:09:02 -0500 Subject: [PATCH 131/189] No longer allow showhud to toggle FPS counter or ping bar --- src/sdl/i_video.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index f22c79eca..95ddab3cc 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -1176,14 +1176,11 @@ void I_FinishUpdate(void) if (cv_closedcaptioning.value) SCR_ClosedCaptions(); - if (st_overlay) - { - if (cv_ticrate.value) - SCR_DisplayTicRate(); + if (cv_ticrate.value) + SCR_DisplayTicRate(); - if (cv_showping.value && netgame && consoleplayer != serverplayer) - SCR_DisplayLocalPing(); - } + if (cv_showping.value && netgame && consoleplayer != serverplayer) + SCR_DisplayLocalPing(); if (rendermode == render_soft && screens[0]) { From e850d42bc2d474aab27a7dd0a7913a5d4e9ac5f5 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Sat, 23 Nov 2019 18:15:09 -0300 Subject: [PATCH 132/189] fix RA fade --- src/g_game.c | 19 ++++++++++++++++++- src/g_game.h | 4 ++++ src/m_menu.c | 1 + src/p_setup.c | 7 +++++++ src/v_video.c | 5 ++++- 5 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 963fc00f0..faaed13c7 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -172,6 +172,7 @@ mapheader_t* mapheaderinfo[NUMMAPS] = {NULL}; static boolean exitgame = false; static boolean retrying = false; +static boolean retryingmodeattack = false; UINT8 stagefailed; // Used for GEMS BONUS? Also to see if you beat the stage. @@ -2015,7 +2016,7 @@ boolean G_Responder(event_t *ev) pausedelay = 1+(NEWTICRATE/2); else if (++pausedelay > 1+(NEWTICRATE/2)+(NEWTICRATE/3)) { - G_SetRetryFlag(); + G_SetModeAttackRetryFlag(); return true; } pausedelay++; // counteract subsequent subtraction this frame @@ -6925,6 +6926,22 @@ boolean G_GetRetryFlag(void) return retrying; } +void G_SetModeAttackRetryFlag(void) +{ + retryingmodeattack = true; + G_SetRetryFlag(); +} + +void G_ClearModeAttackRetryFlag(void) +{ + retryingmodeattack = false; +} + +boolean G_GetModeAttackRetryFlag(void) +{ + return retryingmodeattack; +} + // Time utility functions INT32 G_TicsToHours(tic_t tics) { diff --git a/src/g_game.h b/src/g_game.h index 87232c823..0a575c099 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -225,10 +225,14 @@ void G_AddPlayer(INT32 playernum); void G_SetExitGameFlag(void); void G_ClearExitGameFlag(void); boolean G_GetExitGameFlag(void); + void G_SetRetryFlag(void); void G_ClearRetryFlag(void); boolean G_GetRetryFlag(void); +void G_SetModeAttackRetryFlag(void); +void G_ClearModeAttackRetryFlag(void); +boolean G_GetModeAttackRetryFlag(void); void G_LoadGameData(void); void G_LoadGameSettings(void); diff --git a/src/m_menu.c b/src/m_menu.c index 52ee6b410..36be65db1 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -3535,6 +3535,7 @@ void M_StartControlPanel(void) void M_EndModeAttackRun(void) { + G_ClearModeAttackRetryFlag(); M_ModeAttackEndGame(0); } diff --git a/src/p_setup.c b/src/p_setup.c index 83f1d475b..5c792c73c 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2757,6 +2757,13 @@ boolean P_SetupLevel(boolean skipprecip) ranspecialwipe = 1; } + if (G_GetModeAttackRetryFlag()) + { + if (modeattacking) + wipestyleflags |= (WSF_FADEOUT|WSF_TOWHITE); + G_ClearModeAttackRetryFlag(); + } + // Make sure all sounds are stopped before Z_FreeTags. S_StopSounds(); S_ClearSfx(); diff --git a/src/v_video.c b/src/v_video.c index 58244531e..e92375630 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -20,6 +20,7 @@ #include "v_video.h" #include "st_stuff.h" #include "hu_stuff.h" +#include "f_finale.h" #include "r_draw.h" #include "console.h" @@ -1861,7 +1862,9 @@ void V_DrawFadeScreen(UINT16 color, UINT8 strength) { const UINT8 *fadetable = ((color & 0xFF00) // Color is not palette index? - ? ((UINT8 *)colormaps + strength*256) // Do COLORMAP fade. + ? ((UINT8 *)(((color & 0x0F00) == 0x0A00) ? fadecolormap // Do fadecolormap fade. + : (((color & 0x0F00) == 0x0B00) ? fadecolormap + (256 * FADECOLORMAPROWS) // Do white fadecolormap fade. + : colormaps)) + strength*256) // Do COLORMAP fade. : ((UINT8 *)transtables + ((9-strength)< Date: Sat, 23 Nov 2019 16:37:33 -0500 Subject: [PATCH 133/189] Added Dragonbomber --- extras/conf/SRB2-22.cfg | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/extras/conf/SRB2-22.cfg b/extras/conf/SRB2-22.cfg index 0a60eb2b9..c75ee31b3 100644 --- a/extras/conf/SRB2-22.cfg +++ b/extras/conf/SRB2-22.cfg @@ -3457,6 +3457,13 @@ thingtypes height = 34; flags8text = "[8] Start on fire"; } + 137 + { + title = "Dragonbomber"; + sprite = "DRABA1"; + width = 28; + height = 48; + } 105 { title = "Jetty-Syn Bomber"; From 2a9db29c58a04bd7eb3ab7c2aa647308b700b68d Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Sat, 23 Nov 2019 18:41:28 -0300 Subject: [PATCH 134/189] fix showfps with st_translucency --- src/screen.c | 4 ++-- src/st_stuff.c | 2 +- src/v_video.h | 4 ++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/screen.c b/src/screen.c index a1f6b7f55..5005118b6 100644 --- a/src/screen.c +++ b/src/screen.c @@ -421,9 +421,9 @@ void SCR_DisplayTicRate(void) else if (totaltics == TICRATE) ticcntcolor = V_GREENMAP; V_DrawString(vid.width-(72*vid.dupx), h, - V_YELLOWMAP|V_NOSCALESTART|V_HUDTRANS, "FPS:"); + V_YELLOWMAP|V_NOSCALESTART|V_USERHUDTRANS, "FPS:"); V_DrawString(vid.width-(40*vid.dupx), h, - ticcntcolor|V_NOSCALESTART|V_HUDTRANS, va("%02d/%02u", totaltics, TICRATE)); + ticcntcolor|V_NOSCALESTART|V_USERHUDTRANS, va("%02d/%02u", totaltics, TICRATE)); lasttic = ontic; } diff --git a/src/st_stuff.c b/src/st_stuff.c index 5ccf9bb52..6f75a25e7 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -198,7 +198,7 @@ void ST_Ticker(boolean run) // 0 is default, any others are special palettes. INT32 st_palette = 0; -INT32 st_translucency = 0; +INT32 st_translucency = 10; void ST_doPaletteStuff(void) { diff --git a/src/v_video.h b/src/v_video.h index cd32ac5f8..e3dbb75dc 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -106,6 +106,10 @@ extern RGBA_t *pMasterPalette; #define V_HUDTRANSHALF 0x000D0000 #define V_HUDTRANS 0x000E0000 // draw the hud translucent #define V_HUDTRANSDOUBLE 0x000F0000 +// Macros follow +#define V_USERHUDTRANSHALF ((10-(cv_translucenthud.value/2))< Date: Sun, 24 Nov 2019 10:22:00 +0100 Subject: [PATCH 135/189] Fixed crash when BASH's target disappears during chasing --- src/p_enemy.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index 26d079cb4..967c4b96e 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -2476,12 +2476,8 @@ void A_VultureBlast(mobj_t *actor) void A_VultureFly(mobj_t *actor) { fixed_t speedmax = 18*FRACUNIT; - angle_t angledif = R_PointToAngle2(actor->x, actor->y, actor->target->x, actor->target->y) - actor->angle; - fixed_t dx = actor->target->x - actor->x; - fixed_t dy = actor->target->y - actor->y; - fixed_t dz = actor->target->z - actor->z; - fixed_t dxy = FixedHypot(dx, dy); - fixed_t dm; + angle_t angledif; + fixed_t dx, dy, dz, dxy, dm; mobj_t *dust; fixed_t momm; @@ -2490,6 +2486,18 @@ void A_VultureFly(mobj_t *actor) return; #endif + if (!actor->target || P_MobjWasRemoved(actor->target)) + { + P_SetMobjState(actor, actor->info->spawnstate); + return; + } + + angledif = R_PointToAngle2(actor->x, actor->y, actor->target->x, actor->target->y) - actor->angle; + dx = actor->target->x - actor->x; + dy = actor->target->y - actor->y; + dz = actor->target->z - actor->z; + dxy = FixedHypot(dx, dy); + if (leveltime % 4 == 0) S_StartSound(actor, actor->info->activesound); From 3fa04cb091bf54b59f4183ea6d7ad609b4b4ea51 Mon Sep 17 00:00:00 2001 From: lachwright Date: Sun, 24 Nov 2019 18:46:59 +0800 Subject: [PATCH 136/189] Make Metal's vertical float speed technically negative --- src/p_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index 0838ff80e..0721c22b8 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -5550,7 +5550,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd) else potentialmomz = ((player->speed < 10*player->mo->scale) ? (player->speed - 10*player->mo->scale)/5 - : 0); + : -1); if (P_MobjFlip(player->mo)*player->mo->momz < potentialmomz) player->mo->momz = P_MobjFlip(player->mo)*potentialmomz; player->pflags &= ~PF_SPINNING; From ccc41c7a8fddd12fffd242f8e88ca8c04e6efc32 Mon Sep 17 00:00:00 2001 From: lachwright Date: Sun, 24 Nov 2019 19:30:20 +0800 Subject: [PATCH 137/189] Fix elemental stomp activating glide landing after emerging from goop; fix climbing boost-up not scaling properly with player scale --- src/p_user.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 0838ff80e..e08b30170 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2296,7 +2296,7 @@ boolean P_PlayerHitFloor(player_t *player, boolean dorollstuff) else if (!player->skidtime) player->pflags &= ~PF_GLIDING; } - else if (player->charability == CA_GLIDEANDCLIMB && player->pflags & PF_THOKKED && !(player->pflags & PF_SHIELDABILITY) && player->mo->state-states == S_PLAY_FALL) + else if (player->charability == CA_GLIDEANDCLIMB && player->pflags & PF_THOKKED && !(player->pflags & (PF_JUMPED|PF_SHIELDABILITY)) && player->mo->state-states == S_PLAY_FALL) { if (player->mo->state-states != S_PLAY_GLIDE_LANDING) { @@ -3523,7 +3523,7 @@ static void P_DoClimbing(player_t *player) { P_SetObjectMomZ(player->mo, 2*FRACUNIT, true); if (cmd->forwardmove) - P_SetObjectMomZ(player->mo, 2*player->mo->momz/3, false); + player->mo->momz = 2*player->mo->momz/3; } if (thrust) P_Thrust(player->mo, player->mo->angle, FixedMul(4*FRACUNIT, player->mo->scale)); // Lil' boost up. From 6cc2ca754258ca63a798e9717301e61de977719b Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 24 Nov 2019 13:24:37 +0000 Subject: [PATCH 138/189] * Resolve #345. * Prevent skincolours from being reset to the skin's prefcolour, but only for not-always-usable characters. --- src/d_main.c | 2 ++ src/d_netcmd.c | 19 +++++++++++-------- src/m_cond.c | 2 ++ 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index 98e16a277..3b627482d 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -729,6 +729,8 @@ void D_StartTitle(void) for (i = 0; i < MAXPLAYERS; i++) CL_ClearPlayer(i); + players[consoleplayer].availabilities = players[1].availabilities = R_GetSkinAvailabilities(); // players[1] is supposed to be for 2p + splitscreen = false; SplitScreen_OnChange(); botingame = false; diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 2b6055873..75852ff2d 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -1228,16 +1228,16 @@ static void SendNameAndColor(void) } else if ((foundskin = R_SkinAvailable(cv_skin.string)) != -1 && R_SkinUsable(consoleplayer, foundskin)) { - boolean notsame; + //boolean notsame; cv_skin.value = foundskin; - notsame = (cv_skin.value != players[consoleplayer].skin); + //notsame = (cv_skin.value != players[consoleplayer].skin); SetPlayerSkin(consoleplayer, cv_skin.string); CV_StealthSet(&cv_skin, skins[cv_skin.value].name); - if (notsame) + /*if (notsame) { CV_StealthSetValue(&cv_playercolor, skins[cv_skin.value].prefcolor); @@ -1245,7 +1245,7 @@ static void SendNameAndColor(void) if (players[consoleplayer].mo) players[consoleplayer].mo->color = (UINT8)players[consoleplayer].skincolor; - } + }*/ } else { @@ -1356,15 +1356,16 @@ static void SendNameAndColor2(void) } else if ((foundskin = R_SkinAvailable(cv_skin2.string)) != -1 && R_SkinUsable(secondplaya, foundskin)) { - boolean notsame; + //boolean notsame; cv_skin2.value = foundskin; - notsame = (cv_skin2.value != players[secondplaya].skin); + //notsame = (cv_skin2.value != players[secondplaya].skin); SetPlayerSkin(secondplaya, cv_skin2.string); + CV_StealthSet(&cv_skin, skins[cv_skin2.value].name); - if (notsame) + /*if (notsame) { CV_StealthSetValue(&cv_playercolor2, skins[players[secondplaya].skin].prefcolor); @@ -1372,7 +1373,7 @@ static void SendNameAndColor2(void) if (players[secondplaya].mo) players[secondplaya].mo->color = players[secondplaya].skincolor; - } + }*/ } else { @@ -4289,6 +4290,8 @@ void Command_ExitGame_f(void) for (i = 0; i < MAXPLAYERS; i++) CL_ClearPlayer(i); + players[consoleplayer].availabilities = players[1].availabilities = R_GetSkinAvailabilities(); // players[1] is supposed to be for 2p + splitscreen = false; SplitScreen_OnChange(); botingame = false; diff --git a/src/m_cond.c b/src/m_cond.c index b7520aba7..8c4e3c0b7 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -284,6 +284,8 @@ void M_SilentUpdateUnlockablesAndEmblems(void) continue; unlockables[i].unlocked = M_Achieved(unlockables[i].conditionset - 1); } + + players[consoleplayer].availabilities = players[1].availabilities = R_GetSkinAvailabilities(); // players[1] is supposed to be for 2p } // Emblem unlocking shit From fcfbd403f08f983696ac9e07d7c5ba8501d05c9f Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 24 Nov 2019 13:30:49 +0000 Subject: [PATCH 139/189] Make mouselook follow the first-person option when a spectator, even when other variables assume you're in third person (resolves #340). --- src/g_game.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index faaed13c7..b43bcddf9 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1019,11 +1019,11 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics) movebkey = PLAYER1INPUTDOWN(gc_backward); mouseaiming = (PLAYER1INPUTDOWN(gc_mouseaiming)) ^ - (cv_chasecam.value ? cv_chasefreelook.value : cv_alwaysfreelook.value); + ((cv_chasecam.value && !player->spectator) ? cv_chasefreelook.value : cv_alwaysfreelook.value); analogjoystickmove = cv_usejoystick.value && !Joystick.bGamepadStyle; gamepadjoystickmove = cv_usejoystick.value && Joystick.bGamepadStyle; - thisjoyaiming = (cv_chasecam.value) ? cv_chasefreelook.value : cv_alwaysfreelook.value; + thisjoyaiming = (cv_chasecam.value && !player->spectator) ? cv_chasefreelook.value : cv_alwaysfreelook.value; // Reset the vertical look if we're no longer joyaiming if (!thisjoyaiming && joyaiming) @@ -1348,11 +1348,11 @@ void G_BuildTiccmd2(ticcmd_t *cmd, INT32 realtics) movebkey = PLAYER2INPUTDOWN(gc_backward); mouseaiming = (PLAYER2INPUTDOWN(gc_mouseaiming)) ^ - (cv_chasecam2.value ? cv_chasefreelook2.value : cv_alwaysfreelook2.value); + ((cv_chasecam2.value && !player->spectator) ? cv_chasefreelook2.value : cv_alwaysfreelook2.value); analogjoystickmove = cv_usejoystick2.value && !Joystick2.bGamepadStyle; gamepadjoystickmove = cv_usejoystick2.value && Joystick2.bGamepadStyle; - thisjoyaiming = (cv_chasecam2.value) ? cv_chasefreelook2.value : cv_alwaysfreelook2.value; + thisjoyaiming = (cv_chasecam2.value && !player->spectator) ? cv_chasefreelook2.value : cv_alwaysfreelook2.value; // Reset the vertical look if we're no longer joyaiming if (!thisjoyaiming && joyaiming) From 4dfae1a65b9c945dbd84f5105576a47e52dd61ca Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 24 Nov 2019 13:35:26 +0000 Subject: [PATCH 140/189] Make cv_exitmove only have effect if gametype is GT_COOP, otherwise immediately exit (resolves #342). --- src/p_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index 0838ff80e..ed2a1a446 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -11470,7 +11470,7 @@ void P_PlayerThink(player_t *player) if (player->pflags & PF_FINISHED) { - if (cv_exitmove.value && !G_EnoughPlayersFinished()) + if ((gametype == GT_COOP && cv_exitmove.value) && !G_EnoughPlayersFinished()) player->exiting = 0; else P_DoPlayerExit(player); From 508feaad9d32389c6fb79c8144274d2e1d352385 Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 24 Nov 2019 13:51:53 +0000 Subject: [PATCH 141/189] Enable lowercase text for Statistics and Unlockable Checklist menus (resolves #339). --- src/dehacked.c | 134 ++++++++++++++++++++++++++----------------------- src/m_menu.c | 8 +-- 2 files changed, 74 insertions(+), 68 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 29992fcd5..49ad5dc67 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -3184,7 +3184,6 @@ static void readextraemblemdata(MYFILE *f, INT32 num) // Now get the part after word2 = tmp += 2; - strupr(word2); value = atoi(word2); // used for numerical settings @@ -3196,22 +3195,26 @@ static void readextraemblemdata(MYFILE *f, INT32 num) sizeof (extraemblems[num-1].description), va("Extra emblem %d: objective", num)); else if (fastcmp(word, "CONDITIONSET")) extraemblems[num-1].conditionset = (UINT8)value; - else if (fastcmp(word, "SPRITE")) - { - if (word2[0] >= 'A' && word2[0] <= 'Z') - value = word2[0]; - else - value += 'A'-1; - - if (value < 'A' || value > 'Z') - deh_warning("Emblem %d: sprite must be from A - Z (1 - 26)", num); - else - extraemblems[num-1].sprite = (UINT8)value; - } - else if (fastcmp(word, "COLOR")) - extraemblems[num-1].color = get_number(word2); else - deh_warning("Extra emblem %d: unknown word '%s'", num, word); + { + strupr(word2); + if (fastcmp(word, "SPRITE")) + { + if (word2[0] >= 'A' && word2[0] <= 'Z') + value = word2[0]; + else + value += 'A'-1; + + if (value < 'A' || value > 'Z') + deh_warning("Emblem %d: sprite must be from A - Z (1 - 26)", num); + else + extraemblems[num-1].sprite = (UINT8)value; + } + else if (fastcmp(word, "COLOR")) + extraemblems[num-1].color = get_number(word2); + else + deh_warning("Extra emblem %d: unknown word '%s'", num, word); + } } } while (!myfeof(f)); @@ -3262,7 +3265,6 @@ static void readunlockable(MYFILE *f, INT32 num) // Now get the part after word2 = tmp += 2; - strupr(word2); i = atoi(word2); // used for numerical settings @@ -3272,54 +3274,58 @@ static void readunlockable(MYFILE *f, INT32 num) else if (fastcmp(word, "OBJECTIVE")) deh_strlcpy(unlockables[num].objective, word2, sizeof (unlockables[num].objective), va("Unlockable %d: objective", num)); - else if (fastcmp(word, "HEIGHT")) - unlockables[num].height = (UINT16)i; - else if (fastcmp(word, "CONDITIONSET")) - unlockables[num].conditionset = (UINT8)i; - else if (fastcmp(word, "NOCECHO")) - unlockables[num].nocecho = (UINT8)(i || word2[0] == 'T' || word2[0] == 'Y'); - else if (fastcmp(word, "NOCHECKLIST")) - unlockables[num].nochecklist = (UINT8)(i || word2[0] == 'T' || word2[0] == 'Y'); - else if (fastcmp(word, "TYPE")) - { - if (fastcmp(word2, "NONE")) - unlockables[num].type = SECRET_NONE; - else if (fastcmp(word2, "ITEMFINDER")) - unlockables[num].type = SECRET_ITEMFINDER; - else if (fastcmp(word2, "EMBLEMHINTS")) - unlockables[num].type = SECRET_EMBLEMHINTS; - else if (fastcmp(word2, "PANDORA")) - unlockables[num].type = SECRET_PANDORA; - else if (fastcmp(word2, "CREDITS")) - unlockables[num].type = SECRET_CREDITS; - else if (fastcmp(word2, "RECORDATTACK")) - unlockables[num].type = SECRET_RECORDATTACK; - else if (fastcmp(word2, "NIGHTSMODE")) - unlockables[num].type = SECRET_NIGHTSMODE; - else if (fastcmp(word2, "HEADER")) - unlockables[num].type = SECRET_HEADER; - else if (fastcmp(word2, "LEVELSELECT")) - unlockables[num].type = SECRET_LEVELSELECT; - else if (fastcmp(word2, "WARP")) - unlockables[num].type = SECRET_WARP; - else if (fastcmp(word2, "SOUNDTEST")) - unlockables[num].type = SECRET_SOUNDTEST; - else - unlockables[num].type = (INT16)i; - } - else if (fastcmp(word, "VAR")) - { - // Support using the actual map name, - // i.e., Level AB, Level FZ, etc. - - // Convert to map number - if (word2[0] >= 'A' && word2[0] <= 'Z') - i = M_MapNumber(word2[0], word2[1]); - - unlockables[num].variable = (INT16)i; - } else - deh_warning("Unlockable %d: unknown word '%s'", num+1, word); + { + strupr(word2); + if (fastcmp(word, "HEIGHT")) + unlockables[num].height = (UINT16)i; + else if (fastcmp(word, "CONDITIONSET")) + unlockables[num].conditionset = (UINT8)i; + else if (fastcmp(word, "NOCECHO")) + unlockables[num].nocecho = (UINT8)(i || word2[0] == 'T' || word2[0] == 'Y'); + else if (fastcmp(word, "NOCHECKLIST")) + unlockables[num].nochecklist = (UINT8)(i || word2[0] == 'T' || word2[0] == 'Y'); + else if (fastcmp(word, "TYPE")) + { + if (fastcmp(word2, "NONE")) + unlockables[num].type = SECRET_NONE; + else if (fastcmp(word2, "ITEMFINDER")) + unlockables[num].type = SECRET_ITEMFINDER; + else if (fastcmp(word2, "EMBLEMHINTS")) + unlockables[num].type = SECRET_EMBLEMHINTS; + else if (fastcmp(word2, "PANDORA")) + unlockables[num].type = SECRET_PANDORA; + else if (fastcmp(word2, "CREDITS")) + unlockables[num].type = SECRET_CREDITS; + else if (fastcmp(word2, "RECORDATTACK")) + unlockables[num].type = SECRET_RECORDATTACK; + else if (fastcmp(word2, "NIGHTSMODE")) + unlockables[num].type = SECRET_NIGHTSMODE; + else if (fastcmp(word2, "HEADER")) + unlockables[num].type = SECRET_HEADER; + else if (fastcmp(word2, "LEVELSELECT")) + unlockables[num].type = SECRET_LEVELSELECT; + else if (fastcmp(word2, "WARP")) + unlockables[num].type = SECRET_WARP; + else if (fastcmp(word2, "SOUNDTEST")) + unlockables[num].type = SECRET_SOUNDTEST; + else + unlockables[num].type = (INT16)i; + } + else if (fastcmp(word, "VAR")) + { + // Support using the actual map name, + // i.e., Level AB, Level FZ, etc. + + // Convert to map number + if (word2[0] >= 'A' && word2[0] <= 'Z') + i = M_MapNumber(word2[0], word2[1]); + + unlockables[num].variable = (INT16)i; + } + else + deh_warning("Unlockable %d: unknown word '%s'", num+1, word); + } } } while (!myfeof(f)); // finish when the line is empty diff --git a/src/m_menu.c b/src/m_menu.c index 7d62514e6..32efa3fed 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -6688,7 +6688,7 @@ static void M_DrawChecklist(void) || !unlockables[i].conditionset || unlockables[i].conditionset > MAXCONDITIONSETS) continue; - V_DrawString(currentMenu->x, y, ((unlockables[i].unlocked) ? V_GREENMAP : V_TRANSLUCENT), ((unlockables[i].unlocked || !unlockables[i].nochecklist) ? unlockables[i].name : M_CreateSecretMenuOption(unlockables[i].name))); + V_DrawString(currentMenu->x, y, ((unlockables[i].unlocked) ? V_GREENMAP : V_TRANSLUCENT)|V_ALLOWLOWERCASE, ((unlockables[i].unlocked || !unlockables[i].nochecklist) ? unlockables[i].name : M_CreateSecretMenuOption(unlockables[i].name))); for (j = i+1; j < MAXUNLOCKABLES; j++) { @@ -8855,9 +8855,9 @@ static void M_DrawStatsMaps(int location) M_DrawMapEmblems(mnum+1, 292, y); if (mapheaderinfo[mnum]->actnum != 0) - V_DrawString(20, y, V_YELLOWMAP, va("%s %d", mapheaderinfo[mnum]->lvlttl, mapheaderinfo[mnum]->actnum)); + V_DrawString(20, y, V_YELLOWMAP|V_ALLOWLOWERCASE, va("%s %d", mapheaderinfo[mnum]->lvlttl, mapheaderinfo[mnum]->actnum)); else - V_DrawString(20, y, V_YELLOWMAP, mapheaderinfo[mnum]->lvlttl); + V_DrawString(20, y, V_YELLOWMAP|V_ALLOWLOWERCASE, mapheaderinfo[mnum]->lvlttl); y += 8; @@ -8901,7 +8901,7 @@ static void M_DrawStatsMaps(int location) else V_DrawSmallScaledPatch(292, y, 0, W_CachePatchName("NEEDIT", PU_CACHE)); - V_DrawString(20, y, V_YELLOWMAP, va("%s", exemblem->description)); + V_DrawString(20, y, V_YELLOWMAP|V_ALLOWLOWERCASE, va("%s", exemblem->description)); } y += 8; From 9a7979d841fc06efd19bfd48014f770e0adb82d4 Mon Sep 17 00:00:00 2001 From: lachwright Date: Sun, 24 Nov 2019 22:29:26 +0800 Subject: [PATCH 142/189] Have Minus rotate in mid-air --- src/dehacked.c | 12 ++++-------- src/info.c | 14 +++++--------- src/info.h | 12 ++++-------- src/p_mobj.c | 10 ++++++++++ 4 files changed, 23 insertions(+), 25 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 29992fcd5..14bb6f405 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -4969,14 +4969,10 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_MINUS_BURST4", "S_MINUS_BURST5", "S_MINUS_POPUP", - "S_MINUS_UPWARD1", - "S_MINUS_UPWARD2", - "S_MINUS_UPWARD3", - "S_MINUS_UPWARD4", - "S_MINUS_DOWNWARD1", - "S_MINUS_DOWNWARD2", - "S_MINUS_DOWNWARD3", - "S_MINUS_DOWNWARD4", + "S_MINUS_AERIAL1", + "S_MINUS_AERIAL2", + "S_MINUS_AERIAL3", + "S_MINUS_AERIAL4", // Minus dirt "S_MINUSDIRT1", diff --git a/src/info.c b/src/info.c index e14abd575..2be4a8184 100644 --- a/src/info.c +++ b/src/info.c @@ -1074,15 +1074,11 @@ state_t states[NUMSTATES] = {SPR_MNUD, 2|FF_ANIMATE, 5, {NULL}, 1, 2, S_MINUS_BURST4}, // S_MINUS_BURST3 {SPR_MNUD, 3|FF_ANIMATE, 5, {NULL}, 1, 2, S_MINUS_BURST5}, // S_MINUS_BURST4 {SPR_MNUD, 4|FF_ANIMATE, 5, {NULL}, 1, 2, S_MINUSDIRT2}, // S_MINUS_BURST5 - {SPR_MNUS, 3, 1, {A_MinusPopup}, 0, 0, S_MINUS_UPWARD1}, // S_MINUS_POPUP - {SPR_MNUS, 0, 1, {A_MinusCheck}, 0, 0, S_MINUS_UPWARD2}, // S_MINUS_UPWARD1 - {SPR_MNUS, 1, 1, {A_MinusCheck}, 0, 0, S_MINUS_UPWARD3}, // S_MINUS_UPWARD2 - {SPR_MNUS, 2, 1, {A_MinusCheck}, 0, 0, S_MINUS_UPWARD4}, // S_MINUS_UPWARD3 - {SPR_MNUS, 3, 1, {A_MinusCheck}, 0, 0, S_MINUS_UPWARD1}, // S_MINUS_UPWARD4 - {SPR_MNUS, 4, 1, {A_MinusCheck}, 0, 0, S_MINUS_DOWNWARD2}, // S_MINUS_DOWNWARD1 - {SPR_MNUS, 5, 1, {A_MinusCheck}, 0, 0, S_MINUS_DOWNWARD3}, // S_MINUS_DOWNWARD2 - {SPR_MNUS, 6, 1, {A_MinusCheck}, 0, 0, S_MINUS_DOWNWARD4}, // S_MINUS_DOWNWARD3 - {SPR_MNUS, 7, 1, {A_MinusCheck}, 0, 0, S_MINUS_DOWNWARD1}, // S_MINUS_DOWNWARD4 + {SPR_MNUS, 3, 1, {A_MinusPopup}, 0, 0, S_MINUS_AERIAL1}, // S_MINUS_POPUP + {SPR_MNUS, 0, 1, {A_MinusCheck}, 0, 0, S_MINUS_AERIAL2}, // S_MINUS_AERIAL1 + {SPR_MNUS, 1, 1, {A_MinusCheck}, 0, 0, S_MINUS_AERIAL3}, // S_MINUS_AERIAL2 + {SPR_MNUS, 2, 1, {A_MinusCheck}, 0, 0, S_MINUS_AERIAL4}, // S_MINUS_AERIAL3 + {SPR_MNUS, 3, 1, {A_MinusCheck}, 0, 0, S_MINUS_AERIAL1}, // S_MINUS_AERIAL4 {SPR_MNUD, FF_ANIMATE, 6, {NULL}, 1, 5, S_MINUSDIRT2}, // S_MINUSDIRT1 {SPR_MNUD, 5, 8, {NULL}, 3, 5, S_MINUSDIRT3}, // S_MINUSDIRT2 diff --git a/src/info.h b/src/info.h index ff346412e..f3f50fab7 100644 --- a/src/info.h +++ b/src/info.h @@ -1270,14 +1270,10 @@ typedef enum state S_MINUS_BURST4, S_MINUS_BURST5, S_MINUS_POPUP, - S_MINUS_UPWARD1, - S_MINUS_UPWARD2, - S_MINUS_UPWARD3, - S_MINUS_UPWARD4, - S_MINUS_DOWNWARD1, - S_MINUS_DOWNWARD2, - S_MINUS_DOWNWARD3, - S_MINUS_DOWNWARD4, + S_MINUS_AERIAL1, + S_MINUS_AERIAL2, + S_MINUS_AERIAL3, + S_MINUS_AERIAL4, // Minus dirt S_MINUSDIRT1, diff --git a/src/p_mobj.c b/src/p_mobj.c index f2dd1a734..e1c731696 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -9709,6 +9709,16 @@ void P_MobjThinker(mobj_t *mobj) #undef DRAGONTURNSPEED } break; + case MT_MINUS: +#ifdef ROTSPRITE + { + if (P_IsObjectOnGround(mobj)) + mobj->rollangle = 0; + else + mobj->rollangle = R_PointToAngle2(0, 0, mobj->momz, (mobj->scale << 1) - min(abs(mobj->momz), mobj->scale << 1)); + } +#endif + break; case MT_SPINFIRE: if (mobj->flags & MF_NOGRAVITY) { From 6773b39a40a86674b10ed8c4618e208b96a8252a Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 24 Nov 2019 15:19:15 +0000 Subject: [PATCH 143/189] Woops --- src/d_netcmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 75852ff2d..f9ec6c351 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -1363,7 +1363,7 @@ static void SendNameAndColor2(void) //notsame = (cv_skin2.value != players[secondplaya].skin); SetPlayerSkin(secondplaya, cv_skin2.string); - CV_StealthSet(&cv_skin, skins[cv_skin2.value].name); + CV_StealthSet(&cv_skin2, skins[cv_skin2.value].name); /*if (notsame) { From 4e9e5a072f8c5304fd5a7e003bb59eb91cfd20c8 Mon Sep 17 00:00:00 2001 From: lachwright Date: Sun, 24 Nov 2019 23:42:27 +0800 Subject: [PATCH 144/189] Have Minus spawn debris upon landing, as suggested --- src/info.c | 8 ++++---- src/p_enemy.c | 21 +++++++++++++++++---- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/info.c b/src/info.c index 2be4a8184..a09eb5bcc 100644 --- a/src/info.c +++ b/src/info.c @@ -1075,10 +1075,10 @@ state_t states[NUMSTATES] = {SPR_MNUD, 3|FF_ANIMATE, 5, {NULL}, 1, 2, S_MINUS_BURST5}, // S_MINUS_BURST4 {SPR_MNUD, 4|FF_ANIMATE, 5, {NULL}, 1, 2, S_MINUSDIRT2}, // S_MINUS_BURST5 {SPR_MNUS, 3, 1, {A_MinusPopup}, 0, 0, S_MINUS_AERIAL1}, // S_MINUS_POPUP - {SPR_MNUS, 0, 1, {A_MinusCheck}, 0, 0, S_MINUS_AERIAL2}, // S_MINUS_AERIAL1 - {SPR_MNUS, 1, 1, {A_MinusCheck}, 0, 0, S_MINUS_AERIAL3}, // S_MINUS_AERIAL2 - {SPR_MNUS, 2, 1, {A_MinusCheck}, 0, 0, S_MINUS_AERIAL4}, // S_MINUS_AERIAL3 - {SPR_MNUS, 3, 1, {A_MinusCheck}, 0, 0, S_MINUS_AERIAL1}, // S_MINUS_AERIAL4 + {SPR_MNUS, 0, 1, {A_MinusCheck}, 0, 1, S_MINUS_AERIAL2}, // S_MINUS_AERIAL1 + {SPR_MNUS, 1, 1, {A_MinusCheck}, 0, 1, S_MINUS_AERIAL3}, // S_MINUS_AERIAL2 + {SPR_MNUS, 2, 1, {A_MinusCheck}, 0, 1, S_MINUS_AERIAL4}, // S_MINUS_AERIAL3 + {SPR_MNUS, 3, 1, {A_MinusCheck}, 0, 1, S_MINUS_AERIAL1}, // S_MINUS_AERIAL4 {SPR_MNUD, FF_ANIMATE, 6, {NULL}, 1, 5, S_MINUSDIRT2}, // S_MINUSDIRT1 {SPR_MNUD, 5, 8, {NULL}, 3, 5, S_MINUSDIRT3}, // S_MINUSDIRT2 diff --git a/src/p_enemy.c b/src/p_enemy.c index 26d079cb4..75d5e67e7 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -5664,10 +5664,10 @@ void A_MinusPopup(mobj_t *actor) S_StartSound(actor, sfx_s3k82); for (i = 1; i <= num; i++) { - mobj_t *rock = P_SpawnMobj(actor->x, actor->y, actor->z + actor->height/4, MT_ROCKCRUMBLE1); + mobj_t *rock = P_SpawnMobjFromMobj(actor, 0, 0, actor->height/4, MT_ROCKCRUMBLE1); P_Thrust(rock, ani*i, FRACUNIT); - rock->momz = 3*FRACUNIT; - P_SetScale(rock, FRACUNIT/3); + P_SetObjectMomZ(rock, 3*FRACUNIT, false); + P_SetScale(rock, rock->scale/3); } P_RadiusAttack(actor, actor, 2*actor->radius, 0); if (actor->tracer) @@ -5681,11 +5681,12 @@ void A_MinusPopup(mobj_t *actor) // Description: If the minus hits the floor, dig back into the ground. // // var1 = State to switch to (if 0, use seestate). -// var2 = unused +// var2 = If not 0, spawn debris when hitting the floor. // void A_MinusCheck(mobj_t *actor) { INT32 locvar1 = var1; + INT32 locvar2 = var2; #ifdef HAVE_BLUA if (LUA_CallAction("A_MinusCheck", actor)) @@ -5696,6 +5697,18 @@ void A_MinusCheck(mobj_t *actor) { P_SetMobjState(actor, locvar1 ? (statenum_t)locvar1 : actor->info->seestate); actor->flags = actor->info->flags; + if (locvar2) + { + INT32 i, num = 6; + angle_t ani = FixedAngle(FRACUNIT*360/num); + for (i = 1; i <= num; i++) + { + mobj_t *rock = P_SpawnMobjFromMobj(actor, 0, 0, actor->height/4, MT_ROCKCRUMBLE1); + P_Thrust(rock, ani*i, FRACUNIT); + P_SetObjectMomZ(rock, 3*FRACUNIT, false); + P_SetScale(rock, rock->scale/3); + } + } } } From 6733a8c38f9e8e98489a38e991744ad02c7cfd30 Mon Sep 17 00:00:00 2001 From: lachwright Date: Sun, 24 Nov 2019 23:46:37 +0800 Subject: [PATCH 145/189] Shhhhh, Fang --- src/sounds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sounds.c b/src/sounds.c index ba2402eb9..c9aff6edc 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -92,7 +92,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"pstop", false, 100, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Crusher stomp"}, {"steam1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Steam jet"}, // Tails 06-19-2001 {"steam2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Steam jet"}, // Tails 06-19-2001 - {"wbreak", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Wood breaking"}, + {"wbreak", true, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Wood breaking"}, {"ambmac", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Machinery"}, {"spsmsh", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Heavy impact"}, From 359462389187c9e5ec36f38f9bb21447639c9e7f Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 24 Nov 2019 16:42:13 +0000 Subject: [PATCH 146/189] Courteousy of fickle, an adjustment to papersprite rendering that prevents the object's x1 and x2 being slightly off where they should be. Not perfect, but absolutely better than it was! Also, tweak the Minecart segment spawning position, since this was originally placed based on the awkward rendering. --- src/p_mobj.c | 2 +- src/r_things.c | 62 +++++++++++++++++++++++++++++++------------------- 2 files changed, 39 insertions(+), 25 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index f2dd1a734..f1984783b 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -7082,7 +7082,7 @@ static void P_SpawnMinecartSegments(mobj_t *mobj, boolean mode) seg = P_SpawnMobj(x, y, z, MT_MINECARTSEG); P_SetMobjState(seg, (statenum_t)(S_MINECARTSEG_FRONT + i)); if (i >= 2) - seg->extravalue1 = (i == 2) ? -18 : 18; + seg->extravalue1 = (i == 2) ? -20 : 20; else { seg->extravalue2 = (i == 0) ? 24 : -24; diff --git a/src/r_things.c b/src/r_things.c index c89d87bf4..9763648cd 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1137,8 +1137,6 @@ static void R_ProjectSprite(mobj_t *thing) UINT32 rollangle = AngleFixed(arollangle)>>FRACBITS; #endif - fixed_t ang_scale = FRACUNIT; - // transform the origin point tr_x = thing->x - viewx; tr_y = thing->y - viewy; @@ -1223,8 +1221,6 @@ static void R_ProjectSprite(mobj_t *thing) if (sprframe->rotate != SRF_SINGLE || papersprite) { ang = R_PointToAngle (thing->x, thing->y) - (thing->player ? thing->player->drawangle : thing->angle); - if (papersprite) - ang_scale = abs(FINESINE(ang>>ANGLETOFINESHIFT)); } if (sprframe->rotate == SRF_SINGLE) @@ -1286,24 +1282,11 @@ static void R_ProjectSprite(mobj_t *thing) else offset = -spr_offset; offset = FixedMul(offset, this_scale); - tx += FixedMul(offset, ang_scale); - x1 = (centerxfrac + FixedMul (tx,xscale)) >>FRACBITS; - - // off the right side? - if (x1 > viewwidth) - return; - offset2 = FixedMul(spr_width, this_scale); - tx += FixedMul(offset2, ang_scale); - x2 = ((centerxfrac + FixedMul (tx,xscale)) >> FRACBITS) - (papersprite ? 2 : 1); - - // off the left side - if (x2 < 0) - return; if (papersprite) { - fixed_t yscale2, cosmul, sinmul, tz2; + fixed_t xscale2, yscale2, cosmul, sinmul, tz2; INT32 range; if (ang >= ANGLE_180) @@ -1323,6 +1306,16 @@ static void R_ProjectSprite(mobj_t *thing) yscale = FixedDiv(projectiony, tz); if (yscale < 64) return; // Fix some funky visuals + gxt = -FixedMul(tr_x, viewsin); + gyt = FixedMul(tr_y, viewcos); + tx = -(gyt + gxt); + xscale = FixedDiv(projection, tz); + x1 = (centerxfrac + FixedMul(tx,xscale))>>FRACBITS; + + // off the right side? + if (x1 > viewwidth) + return; + tr_x += FixedMul(offset2, cosmul); tr_y += FixedMul(offset2, sinmul); gxt = FixedMul(tr_x, viewcos); @@ -1331,15 +1324,25 @@ static void R_ProjectSprite(mobj_t *thing) yscale2 = FixedDiv(projectiony, tz2); if (yscale2 < 64) return; // ditto + gxt = -FixedMul(tr_x, viewsin); + gyt = FixedMul(tr_y, viewcos); + tx = -(gyt + gxt); + xscale2 = FixedDiv(projection, tz2); + x2 = (centerxfrac + FixedMul(tx,xscale2))>>FRACBITS; x2--; + + // off the left side + if (x2 < 0) + return; + if (max(tz, tz2) < FixedMul(MINZ, this_scale)) // non-papersprite clipping is handled earlier return; - if (x2 > x1) - range = (x2 - x1); - else + if ((range = x2 - x1) <= 0) range = 1; - scalestep = (yscale2 - yscale)/range ?: 1; + scalestep = (yscale2 - yscale)/range; + scalestep = scalestep ? scalestep : 1; + xscale = FixedDiv(range<>FRACBITS; - xscale = FixedMul(xscale, ang_scale); + // off the right side? + if (x1 > viewwidth) + return; + + tx += offset2; + x2 = ((centerxfrac + FixedMul(tx,xscale))>>FRACBITS); x2--; + + // off the left side + if (x2 < 0) + return; + } if ((thing->flags2 & MF2_LINKDRAW) && thing->tracer) // toast 16/09/16 (SYMMETRY) { From c9ff8ec26b4ac47190a5a78f820366ec9afcaba4 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Sun, 24 Nov 2019 17:37:11 -0300 Subject: [PATCH 147/189] Fix FreeMipmapColormap crash --- src/hardware/hw_cache.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/hardware/hw_cache.c b/src/hardware/hw_cache.c index 6eaafca6d..2d4704b8b 100644 --- a/src/hardware/hw_cache.c +++ b/src/hardware/hw_cache.c @@ -771,18 +771,25 @@ void HWR_InitTextureCache(void) gr_textures2 = NULL; } - // Callback function for HWR_FreeTextureCache. static void FreeMipmapColormap(INT32 patchnum, void *patch) { - GLPatch_t* const grpatch = patch; + GLPatch_t* const pat = patch; (void)patchnum; //unused - while (grpatch->mipmap->nextcolormap) + while (pat->mipmap && pat->mipmap->nextcolormap) // The mipmap must be valid, obviously { - GLMipmap_t *grmip = grpatch->mipmap->nextcolormap; - grpatch->mipmap->nextcolormap = grmip->nextcolormap; - if (grmip->grInfo.data) Z_Free(grmip->grInfo.data); - free(grmip); + // Confusing at first, but pat->mipmap->nextcolormap + // at the beginning of the loop is the first colormap + // from the linked list of colormaps + GLMipmap_t *next = pat->mipmap->nextcolormap; + // Set the first colormap + // to the one that comes after it + pat->mipmap->nextcolormap = next->nextcolormap; + // Free image data from memory + if (next->grInfo.data) + Z_Free(next->grInfo.data); + // Free the old colormap from memory + free(next); } } @@ -799,7 +806,7 @@ void HWR_FreeTextureCache(void) // Alam: free the Z_Blocks before freeing it's users - // free all skin after each level: must be done after pfnClearMipMapCache! + // free all patch colormaps after each level: must be done after ClearMipMapCache! for (i = 0; i < numwadfiles; i++) M_AATreeIterate(wadfiles[i]->hwrcache, FreeMipmapColormap); From ba69a39802e4f7ed59c36a7cb72c70dff844affd Mon Sep 17 00:00:00 2001 From: FuriousFox Date: Sun, 24 Nov 2019 15:43:49 -0500 Subject: [PATCH 148/189] Updated the list of which skies are associated with which maps, rearranged the list of character to match the character select in-game, and added myself to the file's credits. (Re-did all of this because I think I messed up the branches and stuff last time. --- extras/conf/SRB2-22.cfg | 50 +++++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/extras/conf/SRB2-22.cfg b/extras/conf/SRB2-22.cfg index c75ee31b3..74117f91c 100644 --- a/extras/conf/SRB2-22.cfg +++ b/extras/conf/SRB2-22.cfg @@ -3,6 +3,7 @@ For Sonic Robo Blast 2 Version 2.2 Contributors (alphabetical): * Foxboy + * FuriousFox * JJames19119 * Kalaron * Kristos @@ -44,27 +45,32 @@ formatinterface = "SRB2MapSetIO"; //Sky textures for vanilla maps defaultskytextures { - SKY1 = "MAP01,MAP02,MAP03,MAP50,MAPA1,MAPA2,MAPA5,MAPA6,MAPA9,MAPAA,MAPAB,MAPAC,MAPAD,MAPAE,MAPAG,MAPAJ,MAPAK,MAPF0,MAPF1,MAPFA,MAPM0,MAPM8,MAPMA,MAPMB,MAPMC"; - SKY4 = "MAP04,MAP06,MAP51,MAPF8,MAPM1"; - SKY6 = "MAP05"; - SKY7 = "MAP07,MAP08,MAP09,MAP52,MAPM2,MAPM5"; - SKY10 = "MAP12,MAP53,MAPM3"; - SKY11 = "MAP10,MAP11,MAP16,MAP55,MAPF2,MAPF5,MAPF6,MAPF9,MAPM7"; - SKY13 = "MAP13,MAP54,MAPAS"; - SKY21 = "MAPAF,MAPF7,MAPM4"; - SKY22 = "MAP22,MAP23,MAP24,MAP25,MAP56,MAPAN,MAPAO,MAPF4,MAPM6"; - SKY29 = "MAP58,MAPAV"; + SKY1 = "MAP01,MAP02,MAP03,MAP33,MAP50,MAP60,MAPF0,MAPM0"; + SKY2 = "MAPM7,MAPMB" + SKY4 = "MAP04,MAP06,MAP61,MAPF6,MAPM1"; + SKY6 = "MAP05,MAP51,MAPMA"; + SKY7 = "MAPM2,MAPM5"; + SKY8 = "MAP07,MAP08,MAP09,MAP52,MAP62,MAPF1"; + SKY10 = "MAP10,MAP12,MAP53,MAP63,MAPM3"; + SKY11 = "MAP11,MAPF7"; + SKY13 = "MAP13,MAP64"; + SKY14 = "MAP14"; + SKY15 = "MAP15,MAP54"; + SKY17 = "MAP70"; + SKY20 = "MAP32,MAP55,MAP65,MAPF2,MAPF5"; + SKY21 = "MAPM4"; + SKY22 = "MAP22,MAP23,MAP25,MAP26,MAP27,MAP56,MAP66,MAPF4,MAPM6"; SKY30 = "MAP30"; - SKY35 = "MAP41"; - SKY40 = "MAP40"; - SKY55 = "MAPF3,MAPM9"; - SKY66 = "MAPAT"; - SKY99 = "MAP57"; - SKY103 = "MAPA3,MAPA4,MAPAU"; - SKY107 = "MAPA7,MAPA8"; - SKY117 = "MAPAH,MAPAI"; - SKY127 = "MAPAR"; - SKY132 = "MAPAW"; + SKY31 = "MAP31"; + SKY35 = "MAP42"; + SKY40 = "MAP41,MAP71,MAPM9"; + SKY55 = "MAPF3,MAPM8"; + SKY68 = "MAPF8"; + SKY99 = "MAP57,MAPZ0"; + SKY159 = "MAP16"; + SKY172 = "MAP40"; + SKY300 = "MAP72"; + SKY301 = "MAP73"; } // Default lump name for new map @@ -90,9 +96,9 @@ skins Sonic; Tails; Knuckles; - Metalsonic; - Fang; Amy; + Fang; + Metalsonic; } // Gametypes From b231719eedc74167da4dcde7f49f202e34099ef7 Mon Sep 17 00:00:00 2001 From: FuriousFox Date: Sun, 24 Nov 2019 16:09:18 -0500 Subject: [PATCH 149/189] Missed a semicolon --- extras/conf/SRB2-22.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/conf/SRB2-22.cfg b/extras/conf/SRB2-22.cfg index 74117f91c..7a8f31d5a 100644 --- a/extras/conf/SRB2-22.cfg +++ b/extras/conf/SRB2-22.cfg @@ -46,7 +46,7 @@ formatinterface = "SRB2MapSetIO"; defaultskytextures { SKY1 = "MAP01,MAP02,MAP03,MAP33,MAP50,MAP60,MAPF0,MAPM0"; - SKY2 = "MAPM7,MAPMB" + SKY2 = "MAPM7,MAPMB"; SKY4 = "MAP04,MAP06,MAP61,MAPF6,MAPM1"; SKY6 = "MAP05,MAP51,MAPMA"; SKY7 = "MAPM2,MAPM5"; From d4a8fd8e64cc0877186f75f2d138404d55663569 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Sun, 24 Nov 2019 16:37:13 -0500 Subject: [PATCH 150/189] Fix time emblem overlapping best time on NiGHTS Mode menu (Resolves #353) --- src/m_menu.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 7d62514e6..bc457f588 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -9388,6 +9388,7 @@ void M_DrawNightsAttackMenu(void) { emblem_t *em; INT32 yHeight; + INT32 xpos; patch_t *PictureOfLevel; lumpnum_t lumpnum; char beststr[40]; @@ -9447,17 +9448,23 @@ void M_DrawNightsAttackMenu(void) { switch (em->type) { - case ET_NGRADE: yHeight = 48; break; - case ET_NTIME: yHeight = 68; break; + case ET_NGRADE: + xpos = 104+38; + yHeight = 48; + break; + case ET_NTIME: + xpos = 104+76; + yHeight = 68; + break; default: goto skipThisOne; } if (em->collected) - V_DrawSmallMappedPatch(104+38, yHeight+lsheadingheight/2, 0, W_CachePatchName(M_GetEmblemPatch(em, false), PU_CACHE), + V_DrawSmallMappedPatch(xpos, yHeight+lsheadingheight/2, 0, W_CachePatchName(M_GetEmblemPatch(em, false), PU_CACHE), R_GetTranslationColormap(TC_DEFAULT, M_GetEmblemColor(em), GTC_CACHE)); else - V_DrawSmallScaledPatch(104+38, yHeight+lsheadingheight/2, 0, W_CachePatchName("NEEDIT", PU_CACHE)); + V_DrawSmallScaledPatch(xpos, yHeight+lsheadingheight/2, 0, W_CachePatchName("NEEDIT", PU_CACHE)); skipThisOne: em = M_GetLevelEmblems(-1); From 7b80d509cca9cd2350dc84b4b347c11fbfed3909 Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Sun, 24 Nov 2019 23:01:17 +0100 Subject: [PATCH 151/189] Give RVZ lavafalls fire damage --- src/info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/info.c b/src/info.c index e14abd575..2937d2ba2 100644 --- a/src/info.c +++ b/src/info.c @@ -13373,7 +13373,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 0, // damage sfx_None, // activesound - MF_SPECIAL|MF_PAIN|MF_NOGRAVITY, // flags + MF_SPECIAL|MF_PAIN|MF_NOGRAVITY|MF_FIRE, // flags S_NULL // raisestate }, From c0bc46ca9cd42752f533adae4225c5975945d8c5 Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 24 Nov 2019 22:38:26 +0000 Subject: [PATCH 152/189] A bunch of spike tweaks. * Make it possible to break them in reverse gravity (resolves #348) by making the spikes break in a circle around the spike touched, rather than in a circle around the player. * Fix the spike chunks spawned not being flipped in reverse gravity by using P_SpawnMobjFromMobj. * Make their breaking sound singular (prevents eardrum destruction). --- src/p_inter.c | 21 ++++----------------- src/p_map.c | 16 ++++++++-------- src/sounds.c | 2 +- 3 files changed, 13 insertions(+), 26 deletions(-) diff --git a/src/p_inter.c b/src/p_inter.c index a51a4e8e6..d1ea02c80 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2814,13 +2814,10 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget if (flip) momz *= -1; #define makechunk(angtweak, xmov, ymov) \ - chunk = P_SpawnMobj(target->x, target->y, target->z, MT_SPIKE);\ - chunk->eflags |= flip;\ + chunk = P_SpawnMobjFromMobj(target, 0, 0, 0, MT_SPIKE);\ P_SetMobjState(chunk, target->info->xdeathstate);\ chunk->health = 0;\ chunk->angle = angtweak;\ - chunk->destscale = scale;\ - P_SetScale(chunk, scale);\ P_UnsetThingPosition(chunk);\ chunk->flags = MF_NOCLIP;\ chunk->x += xmov;\ @@ -2839,14 +2836,10 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget if (flip) momz *= -1; - chunk = P_SpawnMobj(target->x, target->y, target->z, MT_SPIKE); - chunk->eflags |= flip; - + chunk = P_SpawnMobjFromMobj(target, 0, 0, 0, MT_SPIKE); P_SetMobjState(chunk, target->info->deathstate); chunk->health = 0; chunk->angle = ang + ANGLE_180; - chunk->destscale = scale; - P_SetScale(chunk, scale); P_UnsetThingPosition(chunk); chunk->flags = MF_NOCLIP; chunk->x -= xoffs; @@ -2889,13 +2882,10 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget sprflip = P_RandomChance(FRACUNIT/2); #define makechunk(angtweak, xmov, ymov) \ - chunk = P_SpawnMobj(target->x, target->y, target->z, MT_WALLSPIKE);\ - chunk->eflags |= flip;\ + chunk = P_SpawnMobjFromMobj(target, 0, 0, 0, MT_WALLSPIKE);\ P_SetMobjState(chunk, target->info->xdeathstate);\ chunk->health = 0;\ chunk->angle = target->angle;\ - chunk->destscale = scale;\ - P_SetScale(chunk, scale);\ P_UnsetThingPosition(chunk);\ chunk->flags = MF_NOCLIP;\ chunk->x += xmov - forwardxoffs;\ @@ -2917,14 +2907,11 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget sprflip = P_RandomChance(FRACUNIT/2); - chunk = P_SpawnMobj(target->x, target->y, target->z, MT_WALLSPIKE); - chunk->eflags |= flip; + chunk = P_SpawnMobjFromMobj(target, 0, 0, 0, MT_WALLSPIKE); P_SetMobjState(chunk, target->info->deathstate); chunk->health = 0; chunk->angle = target->angle; - chunk->destscale = scale; - P_SetScale(chunk, scale); P_UnsetThingPosition(chunk); chunk->flags = MF_NOCLIP; chunk->x += forwardxoffs - xoffs; diff --git a/src/p_map.c b/src/p_map.c index 753ce9eb5..c7120535c 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -784,12 +784,12 @@ static boolean PIT_CheckThing(mobj_t *thing) if (thing->type == MT_SPIKE || thing->type == MT_WALLSPIKE) { - mobjtype_t type = thing->type; + mobj_t *iter; if (thing->flags & MF_SOLID) S_StartSound(tmthing, thing->info->deathsound); - for (thing = thing->subsector->sector->thinglist; thing; thing = thing->snext) - if (thing->type == type && thing->health > 0 && thing->flags & MF_SOLID && P_AproxDistance(P_AproxDistance(thing->x - tmthing->x, thing->y - tmthing->y), thing->z - tmthing->z) < 56*thing->scale)//FixedMul(56*FRACUNIT, thing->scale)) - P_KillMobj(thing, tmthing, tmthing, 0); + for (iter = thing->subsector->sector->thinglist; iter; iter = iter->snext) + if (iter->type == thing->type && iter->health > 0 && iter->flags & MF_SOLID && (iter == thing || P_AproxDistance(P_AproxDistance(thing->x - iter->x, thing->y - iter->y), thing->z - iter->z) < 56*thing->scale))//FixedMul(56*FRACUNIT, thing->scale)) + P_KillMobj(iter, tmthing, tmthing, 0); } else { @@ -823,12 +823,12 @@ static boolean PIT_CheckThing(mobj_t *thing) if (thing->type == MT_SPIKE || thing->type == MT_WALLSPIKE) { - mobjtype_t type = thing->type; + mobj_t *iter; if (thing->flags & MF_SOLID) S_StartSound(tmthing, thing->info->deathsound); - for (thing = thing->subsector->sector->thinglist; thing; thing = thing->snext) - if (thing->type == type && thing->health > 0 && thing->flags & MF_SOLID && P_AproxDistance(P_AproxDistance(thing->x - tmthing->x, thing->y - tmthing->y), thing->z - tmthing->z) < 56*thing->scale)//FixedMul(56*FRACUNIT, thing->scale)) - P_KillMobj(thing, tmthing, tmthing, 0); + for (iter = thing->subsector->sector->thinglist; iter; iter = iter->snext) + if (iter->type == thing->type && iter->health > 0 && iter->flags & MF_SOLID && (iter == thing || P_AproxDistance(P_AproxDistance(thing->x - iter->x, thing->y - iter->y), thing->z - iter->z) < 56*thing->scale))//FixedMul(56*FRACUNIT, thing->scale)) + P_KillMobj(iter, tmthing, tmthing, 0); } else { diff --git a/src/sounds.c b/src/sounds.c index ba2402eb9..a249ccf4f 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -208,7 +208,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"shrpsp", true, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Spincushion"}, {"shrpgo", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Launch"}, {"mswarp", false, 60, 16, -1, NULL, 0, -1, -1, LUMPERROR, "Spinning out"}, - {"mspogo", false, 60, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Breaking through"}, + {"mspogo", true, 60, 8, -1, NULL, 0, -1, -1, LUMPERROR, "Breaking through"}, {"boingf", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Bouncing"}, {"corkp", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Cork fired"}, {"corkh", false, 32, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Cork hit"}, From 74ae5819c40f7d347589a31e0078438d4cf4aff3 Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Sun, 24 Nov 2019 23:40:40 +0100 Subject: [PATCH 153/189] Account for exiting but non-finished players in G_EnoughPlayersFinished --- src/g_game.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/g_game.c b/src/g_game.c index faaed13c7..d0ea9728b 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2997,7 +2997,7 @@ boolean G_EnoughPlayersFinished(void) continue; total++; - if (players[i].pflags & PF_FINISHED) + if ((players[i].pflags & PF_FINISHED) || players[i].exiting) exiting++; } From df5c8e792f96f076d13cc1a5c925907079d63bea Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 24 Nov 2019 22:55:37 +0000 Subject: [PATCH 154/189] Go from spindash into ordinary roll if player's speed is suddenly above the speed you're allowed to roll at. --- src/p_user.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 0838ff80e..656f2f935 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -4613,6 +4613,13 @@ static void P_DoSpinAbility(player_t *player, ticcmd_t *cmd) // Revving else if ((cmd->buttons & BT_USE) && (player->pflags & PF_STARTDASH)) { + if (player->speed > 5*player->mo->scale) + { + player->pflags &= ~PF_STARTDASH; + P_SetPlayerMobjState(player->mo, S_PLAY_ROLL); + S_StartSound(player->mo, sfx_spin); + break; + } if (player->dashspeed < player->maxdash) { #define chargecalculation (6*(player->dashspeed - player->mindash))/(player->maxdash - player->mindash) @@ -4628,7 +4635,6 @@ static void P_DoSpinAbility(player_t *player, ticcmd_t *cmd) G_GhostAddRev(); } } - // If not moving up or down, and travelling faster than a speed of five while not holding // down the spin button and not spinning. // AKA Just go into a spin on the ground, you idiot. ;) @@ -4780,10 +4786,10 @@ static void P_DoSpinAbility(player_t *player, ticcmd_t *cmd) // Rolling normally if (onground && player->pflags & PF_SPINNING && !(player->pflags & PF_STARTDASH) - && player->speed < FixedMul(5*FRACUNIT,player->mo->scale) && canstand) + && player->speed < 5*player->mo->scale && canstand) { if (GETSECSPECIAL(player->mo->subsector->sector->special, 4) == 7 || (player->mo->ceilingz - player->mo->floorz < P_GetPlayerHeight(player))) - P_InstaThrust(player->mo, player->mo->angle, FixedMul(10*FRACUNIT, player->mo->scale)); + P_InstaThrust(player->mo, player->mo->angle, 10*player->mo->scale); else { player->skidtime = 0; From 82843fc78eaa66eb88e054de7d666e09a7c1060e Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 25 Nov 2019 00:08:38 +0000 Subject: [PATCH 155/189] Fix Tutorial prompt being incorrect size in GL (resolves #349). --- src/v_video.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/v_video.c b/src/v_video.c index e92375630..0b2edde33 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -1902,14 +1902,15 @@ void V_DrawPromptBack(INT32 boxheight, INT32 color) { UINT8 *deststop, *buf; - boxheight = ((boxheight * 4) + (boxheight/2)*5); - if (color >= 256 && color < 512) { + boxheight = ((boxheight * 4) + (boxheight/2)*5); V_DrawFill((BASEVIDWIDTH-(vid.width/vid.dupx))/2, BASEVIDHEIGHT-boxheight, (vid.width/vid.dupx),boxheight, (color-256)|V_SNAPTOBOTTOM); return; } + boxheight *= vid.dupy; + if (color == INT32_MAX) color = cons_backcolor.value; @@ -1951,7 +1952,7 @@ void V_DrawPromptBack(INT32 boxheight, INT32 color) // heavily simplified -- we don't need to know x or y position, // just the start and stop positions deststop = screens[0] + vid.rowbytes * vid.height; - buf = deststop - vid.rowbytes * boxheight * vid.dupy; // 4 lines of space plus gaps between and some leeway + buf = deststop - vid.rowbytes * ((boxheight * 4) + (boxheight/2)*5); // 4 lines of space plus gaps between and some leeway for (; buf < deststop; ++buf) *buf = promptbgmap[*buf]; } From a187460865447614d83e43ff0fce699b6ce288dd Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Mon, 25 Nov 2019 01:09:00 +0100 Subject: [PATCH 156/189] Revert "Render title map on connecting to server screen too" This reverts commit b6e145f0c5ce990e54f4dd99a7f78d0df39303e0. --- src/d_main.c | 117 +++++++++++++++++++++++++------------------------ src/d_main.h | 3 -- src/f_finale.c | 12 +++-- 3 files changed, 65 insertions(+), 67 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index 98e16a277..a68f9c09c 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -291,8 +291,11 @@ static void D_Display(void) switch (gamestate) { case GS_TITLESCREEN: - F_TitleScreenDrawer(); - break; + if (!titlemapinaction || !curbghide) { + F_TitleScreenDrawer(); + break; + } + /* FALLTHRU */ case GS_LEVEL: if (!gametic) break; @@ -363,11 +366,56 @@ static void D_Display(void) // clean up border stuff // see if the border needs to be initially drawn - if (gamestate == GS_LEVEL) + if (gamestate == GS_LEVEL || (gamestate == GS_TITLESCREEN && titlemapinaction && curbghide && (!hidetitlemap))) { // draw the view directly - D_Render(); + if (!automapactive && !dedicated && cv_renderview.value) + { + if (players[displayplayer].mo || players[displayplayer].playerstate == PST_DEAD) + { + topleft = screens[0] + viewwindowy*vid.width + viewwindowx; + objectsdrawn = 0; + #ifdef HWRENDER + if (rendermode != render_soft) + HWR_RenderPlayerView(0, &players[displayplayer]); + else + #endif + if (rendermode != render_none) + R_RenderPlayerView(&players[displayplayer]); + } + + // render the second screen + if (splitscreen && players[secondarydisplayplayer].mo) + { + #ifdef HWRENDER + if (rendermode != render_soft) + HWR_RenderPlayerView(1, &players[secondarydisplayplayer]); + else + #endif + if (rendermode != render_none) + { + viewwindowy = vid.height / 2; + M_Memcpy(ylookup, ylookup2, viewheight*sizeof (ylookup[0])); + + topleft = screens[0] + viewwindowy*vid.width + viewwindowx; + + R_RenderPlayerView(&players[secondarydisplayplayer]); + + viewwindowy = 0; + M_Memcpy(ylookup, ylookup1, viewheight*sizeof (ylookup[0])); + } + } + + // Image postprocessing effect + if (rendermode == render_soft) + { + if (postimgtype) + V_DoPostProcessor(0, postimgtype, postimgparam); + if (postimgtype2) + V_DoPostProcessor(1, postimgtype2, postimgparam2); + } + } if (lastdraw) { @@ -380,9 +428,14 @@ static void D_Display(void) lastdraw = false; } - ST_Drawer(); - F_TextPromptDrawer(); - HU_Drawer(); + if (gamestate == GS_LEVEL) + { + ST_Drawer(); + F_TextPromptDrawer(); + HU_Drawer(); + } + else + F_TitleScreenDrawer(); } } @@ -494,56 +547,6 @@ static void D_Display(void) } } -void D_Render(void) -{ - if (!automapactive && !dedicated && cv_renderview.value) - { - if (players[displayplayer].mo || players[displayplayer].playerstate == PST_DEAD) - { - topleft = screens[0] + viewwindowy*vid.width + viewwindowx; - objectsdrawn = 0; -#ifdef HWRENDER - if (rendermode != render_soft) - HWR_RenderPlayerView(0, &players[displayplayer]); - else -#endif - if (rendermode != render_none) - R_RenderPlayerView(&players[displayplayer]); - } - - // render the second screen - if (splitscreen && players[secondarydisplayplayer].mo) - { -#ifdef HWRENDER - if (rendermode != render_soft) - HWR_RenderPlayerView(1, &players[secondarydisplayplayer]); - else -#endif - if (rendermode != render_none) - { - viewwindowy = vid.height / 2; - M_Memcpy(ylookup, ylookup2, viewheight*sizeof (ylookup[0])); - - topleft = screens[0] + viewwindowy*vid.width + viewwindowx; - - R_RenderPlayerView(&players[secondarydisplayplayer]); - - viewwindowy = 0; - M_Memcpy(ylookup, ylookup1, viewheight*sizeof (ylookup[0])); - } - } - - // Image postprocessing effect - if (rendermode == render_soft) - { - if (postimgtype) - V_DoPostProcessor(0, postimgtype, postimgparam); - if (postimgtype2) - V_DoPostProcessor(1, postimgtype2, postimgparam2); - } - } -} - // ========================================================================= // D_SRB2Loop // ========================================================================= diff --git a/src/d_main.h b/src/d_main.h index 65c51802a..d67a5bb49 100644 --- a/src/d_main.h +++ b/src/d_main.h @@ -54,7 +54,4 @@ const char *D_Home(void); void D_AdvanceDemo(void); void D_StartTitle(void); -/* Here for title maps */ -void D_Render(void); - #endif //__D_MAIN__ diff --git a/src/f_finale.c b/src/f_finale.c index 2d20eb7f4..4a0b0826f 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -2588,9 +2588,7 @@ void F_TitleScreenDrawer(void) // Draw that sky! if (curbgcolor >= 0) V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, curbgcolor); - else if (titlemapinaction && curbghide && ! hidetitlemap) - D_Render(); - else + else if (!curbghide || !titlemapinaction || gamestate == GS_WAITINGPLAYERS) F_SkyScroll(curbgxspeed, curbgyspeed, curbgname); // Don't draw outside of the title screen, or if the patch isn't there. @@ -3350,6 +3348,10 @@ void F_TitleScreenTicker(boolean run) if (run) finalecount++; + // don't trigger if doing anything besides idling on title + if (gameaction != ga_nothing || gamestate != GS_TITLESCREEN) + return; + // Execute the titlemap camera settings if (titlemapinaction) { @@ -3396,10 +3398,6 @@ void F_TitleScreenTicker(boolean run) } } - // don't trigger if doing anything besides idling on title - if (gameaction != ga_nothing || gamestate != GS_TITLESCREEN) - return; - // no demos to play? or, are they disabled? if (!cv_rollingdemos.value || !numDemos) return; From 71e74ca36340e5532a52d1fc7f50a5a07aa833b0 Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 25 Nov 2019 14:33:15 +0000 Subject: [PATCH 157/189] Fix a bunch of shit with MP special stages! * Prevent an infinite quantity of Emeralds being spawned when P_GiveEmerald is called while a MP Special Stage is in session (resolves #347). * Fix FuriousFox's ridiculous timer on special stage spawn (mentioned in the comments of the previous issue) by correctly marking spectator players in special stages as finished, and preventing the underflow. --- src/g_game.c | 2 +- src/p_mobj.c | 2 +- src/p_tick.c | 5 ++--- src/p_user.c | 4 +++- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index faaed13c7..11ad1862d 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2978,7 +2978,7 @@ void G_AddPlayer(INT32 playernum) if (G_GametypeUsesLives() || ((netgame || multiplayer) && gametype == GT_COOP)) p->lives = cv_startinglives.value; - if (countplayers && !notexiting) + if ((countplayers && !notexiting) || G_IsSpecialStage(gamemap)) P_DoPlayerExit(p); } diff --git a/src/p_mobj.c b/src/p_mobj.c index f2dd1a734..b5af077b5 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -11294,7 +11294,7 @@ void P_SpawnPlayer(INT32 playernum) mobj->radius = FixedMul(skins[p->skin].radius, mobj->scale); mobj->height = P_GetPlayerHeight(p); - if (!leveltime && ((maptol & TOL_NIGHTS) == TOL_NIGHTS) != (G_IsSpecialStage(gamemap))) // non-special NiGHTS stage or special non-NiGHTS stage + if (!leveltime && !p->spectator && ((maptol & TOL_NIGHTS) == TOL_NIGHTS) != (G_IsSpecialStage(gamemap))) // non-special NiGHTS stage or special non-NiGHTS stage { if (maptol & TOL_NIGHTS) { diff --git a/src/p_tick.c b/src/p_tick.c index e02b11f49..60a776cbc 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -476,7 +476,7 @@ static inline void P_DoSpecialStageStuff(void) // Count up the rings of all the players and see if // they've collected the required amount. for (i = 0; i < MAXPLAYERS; i++) - if (playeringame[i]) + if (playeringame[i] && players[i].nightstime) { tic_t oldnightstime = players[i].nightstime; countspheres += players[i].spheres; @@ -506,12 +506,11 @@ static inline void P_DoSpecialStageStuff(void) { // Halt all the players for (i = 0; i < MAXPLAYERS; i++) - if (playeringame[i]) + if (playeringame[i] && !players[i].exiting) { players[i].mo->momx = players[i].mo->momy = 0; players[i].exiting = (14*TICRATE)/5 + 1; } - sstimer = 0; P_GiveEmerald(true); P_RestoreMusic(&players[consoleplayer]); diff --git a/src/p_user.c b/src/p_user.c index ed2a1a446..115ecc667 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -343,13 +343,15 @@ void P_GiveEmerald(boolean spawnObj) continue; emmo = P_SpawnMobjFromMobj(players[i].mo, 0, 0, players[i].mo->height, MT_GOTEMERALD); + if (!emmo) + continue; P_SetTarget(&emmo->target, players[i].mo); P_SetMobjState(emmo, mobjinfo[MT_GOTEMERALD].meleestate + em); P_SetTarget(&players[i].mo->tracer, emmo); if (pnum == 255) { - i = pnum; + pnum = i; continue; } From 2110fa6bd1642c74ea755f5187ce5ecabd2049d4 Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 25 Nov 2019 14:59:06 +0000 Subject: [PATCH 158/189] Fix extra lives given to game-overed players not re-entering them into the action when cv_coopstarposts is 0. --- src/p_user.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index ed2a1a446..cdfc073c6 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1223,6 +1223,7 @@ void P_GivePlayerSpheres(player_t *player, INT32 num_spheres) // void P_GivePlayerLives(player_t *player, INT32 numlives) { + UINT8 prevlives = player->lives; if (!player) return; @@ -1239,10 +1240,9 @@ void P_GivePlayerLives(player_t *player, INT32 numlives) if ((netgame || multiplayer) && gametype == GT_COOP && cv_cooplives.value == 0) { - UINT8 prevlives = player->lives; P_GivePlayerRings(player, 100*numlives); if (player->lives - prevlives >= numlives) - return; + goto docooprespawn; numlives = (numlives + prevlives - player->lives); } @@ -1256,6 +1256,15 @@ void P_GivePlayerLives(player_t *player, INT32 numlives) player->lives = 99; else if (player->lives < 1) player->lives = 1; + +docooprespawn: + if (cv_coopstarposts.value) + return; + if (prevlives > 0) + return; + if (!player->spectator) + return; + P_SpectatorJoinGame(player); } void P_GiveCoopLives(player_t *player, INT32 numlives, boolean sound) From 63987799830b63e7c6dd4ea916dbe4fccd98e945 Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 25 Nov 2019 16:04:03 +0000 Subject: [PATCH 159/189] Correct two instances where "Zone" is forced uppercase. --- src/d_clisrv.c | 2 +- src/m_misc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 2a89116a1..635bd7ee9 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1633,7 +1633,7 @@ static void CL_LoadReceivedSavegame(void) { CONS_Printf(": %s", mapheaderinfo[gamemap-1]->lvlttl); if (!(mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE)) - CONS_Printf(M_GetText(" ZONE")); + CONS_Printf(M_GetText(" Zone")); if (actnum > 0) CONS_Printf(" %2d", actnum); } diff --git a/src/m_misc.c b/src/m_misc.c index 5cfb20f0f..ca9b3a8e1 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -789,7 +789,7 @@ static void M_PNGText(png_structp png_ptr, png_infop png_info_ptr, PNG_CONST png if (gamestate == GS_LEVEL && mapheaderinfo[gamemap-1]->lvlttl[0] != '\0') snprintf(lvlttltext, 48, "%s%s%s", mapheaderinfo[gamemap-1]->lvlttl, - (mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE) ? "" : " ZONE", + (mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE) ? "" : " Zone", (mapheaderinfo[gamemap-1]->actnum > 0) ? va(" %d",mapheaderinfo[gamemap-1]->actnum) : ""); else snprintf(lvlttltext, 48, "Unknown"); From 5719a93211b164f4ca725c6a0664c75fa40be89c Mon Sep 17 00:00:00 2001 From: lachwright Date: Tue, 26 Nov 2019 00:16:46 +0800 Subject: [PATCH 160/189] Fix 'Speeding off to...' placement in non-greeen resolutions --- src/p_setup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_setup.c b/src/p_setup.c index 5c792c73c..2216334e7 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2812,12 +2812,12 @@ boolean P_SetupLevel(boolean skipprecip) { // Don't include these in the fade! char tx[64]; - V_DrawSmallString(1, 191, V_ALLOWLOWERCASE|V_TRANSLUCENT, M_GetText("Speeding off to...")); + V_DrawSmallString(1, 191, V_ALLOWLOWERCASE|V_TRANSLUCENT|V_SNAPTOLEFT|V_SNAPTOBOTTOM, M_GetText("Speeding off to...")); snprintf(tx, 63, "%s%s%s", mapheaderinfo[gamemap-1]->lvlttl, (mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE) ? "" : " Zone", (mapheaderinfo[gamemap-1]->actnum > 0) ? va(" %d",mapheaderinfo[gamemap-1]->actnum) : ""); - V_DrawSmallString(1, 195, V_ALLOWLOWERCASE|V_TRANSLUCENT, tx); + V_DrawSmallString(1, 195, V_ALLOWLOWERCASE|V_TRANSLUCENT|V_SNAPTOLEFT|V_SNAPTOBOTTOM, tx); I_UpdateNoVsync(); } From 287e8133bb634e0ad5f85ef8d21fc58f3509de82 Mon Sep 17 00:00:00 2001 From: lachwright Date: Tue, 26 Nov 2019 00:20:43 +0800 Subject: [PATCH 161/189] Add comment --- src/p_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index 0721c22b8..7d7cc48c1 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -5550,7 +5550,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd) else potentialmomz = ((player->speed < 10*player->mo->scale) ? (player->speed - 10*player->mo->scale)/5 - : -1); + : -1); // Should be 0, but made negative to ensure P_PlayerHitFloor runs upon touching ground if (P_MobjFlip(player->mo)*player->mo->momz < potentialmomz) player->mo->momz = P_MobjFlip(player->mo)*potentialmomz; player->pflags &= ~PF_SPINNING; From 404d09e35a6823736203700391b4875909cf0b31 Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Mon, 25 Nov 2019 17:23:35 +0100 Subject: [PATCH 162/189] Do not focus the camera on the end sign if exitmove is active --- src/p_user.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index ed2a1a446..d649c5679 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -9654,7 +9654,8 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall if (player->exiting) { - if (mo->target && mo->target->type == MT_SIGN && mo->target->spawnpoint) + if (mo->target && mo->target->type == MT_SIGN && mo->target->spawnpoint + && !(gametype == GT_COOP && (netgame || multiplayer) && cv_exitmove.value)) sign = mo->target; else if ((player->powers[pw_carry] == CR_NIGHTSMODE) && !(player->mo->state >= &states[S_PLAY_NIGHTS_TRANS1] From 5cf803f7d041fff3ef6c565800e8697c1ea7d810 Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 25 Nov 2019 16:45:54 +0000 Subject: [PATCH 163/189] Allow character select for NiGHTS stages on the Secret Level Select now that every character has NiGHTS sprites. (think of this as the collorary to 358, not a direct change) --- src/m_menu.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 7d62514e6..44a06ca04 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -8340,10 +8340,7 @@ static void M_SetupChoosePlayer(INT32 choice) char *and; (void)choice; - if (!(mapheaderinfo[startmap-1] - && (mapheaderinfo[startmap-1]->forcecharacter[0] != '\0' - || (mapheaderinfo[startmap-1]->typeoflevel & TOL_NIGHTS)) // remove this later when everyone gets their own nights sprites, maybe - )) + if (!mapheaderinfo[startmap-1] || mapheaderinfo[startmap-1]->forcecharacter[0] == '\0') { for (i = 0; i < 32; i++) // Handle charsels, availability, and unlocks. { @@ -8406,17 +8403,16 @@ static void M_SetupChoosePlayer(INT32 choice) } } - if (firstvalid != 255) - { // One last bit of order we can't do in the iteration above. - description[firstvalid].prev = lastvalid; - description[lastvalid].next = firstvalid; - } - else // We're being forced into a specific character, so might as well just skip it. + if (firstvalid == 255) // We're being forced into a specific character, so might as well just skip it. { M_ChoosePlayer(-1); return; } + // One last bit of order we can't do in the iteration above. + description[firstvalid].prev = lastvalid; + description[lastvalid].next = firstvalid; + M_ChangeMenuMusic("_chsel", true); /* the menus suck -James */ From fc407cf6ce3c589906e76c00d275ded9d81f127e Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 25 Nov 2019 16:55:06 +0000 Subject: [PATCH 164/189] Skip tagteam characters (ie, Sonic&Tails) for NiGHTS secret map character selection. --- src/m_menu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/m_menu.c b/src/m_menu.c index 44a06ca04..38b072870 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -8350,6 +8350,8 @@ static void M_SetupChoosePlayer(INT32 choice) if (and) { char firstskin[SKINNAMESIZE+1]; + if (mapheaderinfo[startmap-1]->typeoflevel & TOL_NIGHTS) // skip tagteam characters for NiGHTS levels + continue; strncpy(firstskin, description[i].skinname, (and - description[i].skinname)); firstskin[(and - description[i].skinname)] = '\0'; description[i].skinnum[0] = R_SkinAvailable(firstskin); From f86b46640d6d1106588c294f093f2274022ee9da Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 25 Nov 2019 17:05:58 +0000 Subject: [PATCH 165/189] Skip character select entirely if only one character is available on the list. --- src/m_menu.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 38b072870..355e38ea1 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -8334,8 +8334,7 @@ static void M_SetupChoosePlayer(INT32 choice) { INT32 skinnum; UINT8 i; - UINT8 firstvalid = 255; - UINT8 lastvalid = 0; + UINT8 firstvalid = 255, lastvalid = 255; boolean allowed = false; char *and; (void)choice; @@ -8405,9 +8404,9 @@ static void M_SetupChoosePlayer(INT32 choice) } } - if (firstvalid == 255) // We're being forced into a specific character, so might as well just skip it. + if (firstvalid == lastvalid) // We're being forced into a specific character, so might as well just skip it. { - M_ChoosePlayer(-1); + M_ChoosePlayer(firstvalid); return; } @@ -8741,7 +8740,7 @@ static void M_ChoosePlayer(INT32 choice) UINT8 skinnum; // skip this if forcecharacter or no characters available - if (choice == -1) + if (choice == 255) { skinnum = botskin = 0; botingame = false; From ef556ca6d5adcf9e6d97c5509dc983c51c700bdd Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 25 Nov 2019 18:52:38 +0000 Subject: [PATCH 166/189] Fix Continue sprites not working for custom characters (incorrect SPR2_XTRA bounds check). Also, change all the references to XTRA_ constants to consistently check for > its value, instead of >= its value plus one (or that there's any frames at all) - for extra clarity/consistency, and capacity for re-ordering later. --- src/f_finale.c | 2 +- src/m_menu.c | 4 ++-- src/st_stuff.c | 4 ++-- src/v_video.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/f_finale.c b/src/f_finale.c index 4a0b0826f..9da09e2f2 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -1683,7 +1683,7 @@ void F_StartEnding(void) UINT8 skinnum = players[consoleplayer].skin; spritedef_t *sprdef; spriteframe_t *sprframe; - if (skins[skinnum].sprites[SPR2_XTRA].numframes >= (XTRA_ENDING+2)+1) + if (skins[skinnum].sprites[SPR2_XTRA].numframes > (XTRA_ENDING+2)) { sprdef = &skins[skinnum].sprites[SPR2_XTRA]; // character head, skin specific diff --git a/src/m_menu.c b/src/m_menu.c index ee6c896d2..3ce34ffde 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -8381,7 +8381,7 @@ static void M_SetupChoosePlayer(INT32 choice) if (!(description[i].picname[0])) { - if (skins[skinnum].sprites[SPR2_XTRA].numframes >= XTRA_CHARSEL+1) + if (skins[skinnum].sprites[SPR2_XTRA].numframes > XTRA_CHARSEL) { spritedef_t *sprdef = &skins[skinnum].sprites[SPR2_XTRA]; spriteframe_t *sprframe = &sprdef->spriteframes[XTRA_CHARSEL]; @@ -9112,7 +9112,7 @@ void M_DrawTimeAttackMenu(void) // Character face! { - if (skins[cv_chooseskin.value-1].sprites[SPR2_XTRA].numframes >= XTRA_CHARSEL+1) + if (skins[cv_chooseskin.value-1].sprites[SPR2_XTRA].numframes > XTRA_CHARSEL) { spritedef_t *sprdef = &skins[cv_chooseskin.value-1].sprites[SPR2_XTRA]; spriteframe_t *sprframe = &sprdef->spriteframes[XTRA_CHARSEL]; diff --git a/src/st_stuff.c b/src/st_stuff.c index 6f75a25e7..8b3ceac9d 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -353,12 +353,12 @@ void ST_LoadGraphics(void) // made separate so that skins code can reload custom face graphics void ST_LoadFaceGraphics(INT32 skinnum) { - if (skins[skinnum].sprites[SPR2_XTRA].numframes) + if (skins[skinnum].sprites[SPR2_XTRA].numframes > XTRA_LIFEPIC) { spritedef_t *sprdef = &skins[skinnum].sprites[SPR2_XTRA]; spriteframe_t *sprframe = &sprdef->spriteframes[XTRA_LIFEPIC]; faceprefix[skinnum] = W_CachePatchNum(sprframe->lumppat[0], PU_HUDGFX); - if (skins[skinnum].sprites[(SPR2_XTRA|FF_SPR2SUPER)].numframes) + if (skins[skinnum].sprites[(SPR2_XTRA|FF_SPR2SUPER)].numframes > XTRA_LIFEPIC) { sprdef = &skins[skinnum].sprites[SPR2_XTRA|FF_SPR2SUPER]; sprframe = &sprdef->spriteframes[0]; diff --git a/src/v_video.c b/src/v_video.c index 0b2edde33..5813a451b 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -1076,7 +1076,7 @@ void V_DrawCroppedPatch(fixed_t x, fixed_t y, fixed_t pscale, INT32 scrn, patch_ // void V_DrawContinueIcon(INT32 x, INT32 y, INT32 flags, INT32 skinnum, UINT8 skincolor) { - if (skinnum >= 0 && skinnum < numskins && skins[skinnum].sprites[SPR2_XTRA].numframes >= 4) + if (skinnum >= 0 && skinnum < numskins && skins[skinnum].sprites[SPR2_XTRA].numframes > XTRA_CONTINUE) { spritedef_t *sprdef = &skins[skinnum].sprites[SPR2_XTRA]; spriteframe_t *sprframe = &sprdef->spriteframes[XTRA_CONTINUE]; From 1b360d2cd8359e3d4b8723adc3f11986ccd1d3d1 Mon Sep 17 00:00:00 2001 From: Nev3r Date: Mon, 25 Nov 2019 20:30:06 +0100 Subject: [PATCH 167/189] Fix the "play from nowhere as long as you're in the tagged areas" behavior in the Play Sound line executor. --- src/p_spec.c | 43 +++++++++++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/src/p_spec.c b/src/p_spec.c index f814e89c6..ed5034a87 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -2721,6 +2721,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) if (line->tag != 0) // Do special stuff only if a non-zero linedef tag is set { + // Play sounds from tagged sectors' origins. if (line->flags & ML_EFFECT5) // Repeat Midtexture { // Additionally play the sound from tagged sectors' soundorgs @@ -2732,31 +2733,45 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) S_StartSound(&sec->soundorg, sfxnum); } } - else if (mo) // A mobj must have triggered the executor + + // Play the sound without origin for anyone, as long as they're inside tagged areas. + else { - // Only trigger if mobj is touching the tag + UINT i = 0; + mobj_t* camobj = players[displayplayer].mo; ffloor_t *rover; boolean foundit = false; - for(rover = mo->subsector->sector->ffloors; rover; rover = rover->next) + for (i = 0; i < 2; camobj = players[secondarydisplayplayer].mo, i++) { - if (rover->master->frontsector->tag != line->tag) + if (!camobj) continue; - if (mo->z > P_GetSpecialTopZ(mo, sectors + rover->secnum, mo->subsector->sector)) - continue; + if (foundit || (camobj->subsector->sector->tag == line->tag)) + { + foundit = true; + break; + } - if (mo->z + mo->height < P_GetSpecialBottomZ(mo, sectors + rover->secnum, mo->subsector->sector)) - continue; + // Only trigger if mobj is touching the tag + for(rover = camobj->subsector->sector->ffloors; rover; rover = rover->next) + { + if (rover->master->frontsector->tag != line->tag) + continue; - foundit = true; + if (camobj->z > P_GetSpecialTopZ(camobj, sectors + rover->secnum, camobj->subsector->sector)) + continue; + + if (camobj->z + camobj->height < P_GetSpecialBottomZ(camobj, sectors + rover->secnum, camobj->subsector->sector)) + continue; + + foundit = true; + break; + } } - if (mo->subsector->sector->tag == line->tag) - foundit = true; - - if (!foundit) - return; + if (foundit) + S_StartSound(NULL, sfxnum); } } else From 64cda33d6d7f433bed8451eaea2630e875d47bdf Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 25 Nov 2019 20:12:42 +0000 Subject: [PATCH 168/189] SMOOTH PAPERCOLLISION TIME!!!!!!!! resolves #273, damn i feel good --- src/p_map.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/p_map.c b/src/p_map.c index c7120535c..3f140e1d5 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -3758,6 +3758,33 @@ void P_SlideMove(mobj_t *mo) v2.x = tmhitthing->x + cosradius; v2.y = tmhitthing->y + sinradius; + // Can we box collision our way into smooth movement..? + if (mo->y + mo->radius <= min(v1.y, v2.y)) + { + mo->momy = 0; + P_TryMove(mo, mo->x + mo->momx, min(v1.y, v2.y) - mo->radius, true); + return; + } + else if (mo->y - mo->radius >= max(v1.y, v2.y)) + { + mo->momy = 0; + P_TryMove(mo, mo->x + mo->momx, max(v1.y, v2.y) + mo->radius, true); + return; + } + else if (mo->x + mo->radius <= min(v1.x, v2.x)) + { + mo->momx = 0; + P_TryMove(mo, min(v1.x, v2.x) - mo->radius, mo->y + mo->momy, true); + return; + } + else if (mo->x - mo->radius >= max(v1.x, v2.x)) + { + mo->momx = 0; + P_TryMove(mo, max(v1.x, v2.x) + mo->radius, mo->y + mo->momy, true); + return; + } + + // nope, gotta fuck around with a fake linedef! junk.v1 = &v1; junk.v2 = &v2; junk.dx = 2*cosradius; // v2.x - v1.x; From f54eeb82b7d39ab3e2ff9d435e86774aa6251347 Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Mon, 25 Nov 2019 22:35:40 +0100 Subject: [PATCH 169/189] -Fix player being able to push up spikes -Minor tweaks to make paper collision slightly more reliable --- src/p_map.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index 3f140e1d5..d4c753dfc 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1719,8 +1719,8 @@ static boolean PIT_CheckThing(mobj_t *thing) } } - if ((tmthing->flags & MF_SPRING || tmthing->type == MT_STEAM) && (thing->player)) - ; // springs and gas jets should never be able to step up onto a player + if ((tmthing->flags & MF_SPRING || tmthing->type == MT_STEAM || tmthing->type == MT_SPIKE || tmthing->type == MT_WALLSPIKE) && (thing->player)) + ; // springs, gas jets and springs should never be able to step up onto a player // z checking at last // Treat noclip things as non-solid! else if ((thing->flags & (MF_SOLID|MF_NOCLIP)) == MF_SOLID @@ -3759,25 +3759,25 @@ void P_SlideMove(mobj_t *mo) v2.y = tmhitthing->y + sinradius; // Can we box collision our way into smooth movement..? - if (mo->y + mo->radius <= min(v1.y, v2.y)) + if (sinradius && mo->y + mo->radius <= min(v1.y, v2.y)) { mo->momy = 0; P_TryMove(mo, mo->x + mo->momx, min(v1.y, v2.y) - mo->radius, true); return; } - else if (mo->y - mo->radius >= max(v1.y, v2.y)) + else if (sinradius && mo->y - mo->radius >= max(v1.y, v2.y)) { mo->momy = 0; P_TryMove(mo, mo->x + mo->momx, max(v1.y, v2.y) + mo->radius, true); return; } - else if (mo->x + mo->radius <= min(v1.x, v2.x)) + else if (cosradius && mo->x + mo->radius <= min(v1.x, v2.x)) { mo->momx = 0; P_TryMove(mo, min(v1.x, v2.x) - mo->radius, mo->y + mo->momy, true); return; } - else if (mo->x - mo->radius >= max(v1.x, v2.x)) + else if (cosradius && mo->x - mo->radius >= max(v1.x, v2.x)) { mo->momx = 0; P_TryMove(mo, max(v1.x, v2.x) + mo->radius, mo->y + mo->momy, true); From 67d0499903185f6e1e8414295dc9403c1a0fc412 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Mon, 25 Nov 2019 20:16:17 -0300 Subject: [PATCH 170/189] Fix stuck closed captioning --- src/d_main.c | 1 + src/s_sound.c | 41 +++++++++++++++++++++-------------------- src/s_sound.h | 1 + 3 files changed, 23 insertions(+), 20 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index ed28c2228..5853fccf0 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -667,6 +667,7 @@ void D_SRB2Loop(void) // consoleplayer -> displayplayer (hear sounds from viewpoint) S_UpdateSounds(); // move positional sounds + S_UpdateClosedCaptions(); // check for media change, loop music.. I_UpdateCD(); diff --git a/src/s_sound.c b/src/s_sound.c index 8e4e7715d..2f88349f1 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -860,7 +860,6 @@ static INT32 actualmidimusicvolume; void S_UpdateSounds(void) { INT32 audible, cnum, volume, sep, pitch; - UINT8 i; channel_t *c; listener_t listener; @@ -1017,28 +1016,30 @@ void S_UpdateSounds(void) notinlevel: I_UpdateSound(); +} +void S_UpdateClosedCaptions(void) +{ + UINT8 i; + boolean gamestopped = (paused || P_AutoPause()); + for (i = 0; i < NUMCAPTIONS; i++) // update captions { - boolean gamestopped = (paused || P_AutoPause()); - for (i = 0; i < NUMCAPTIONS; i++) // update captions + if (!closedcaptions[i].s) + continue; + + if (i == 0 && (closedcaptions[0].s-S_sfx == sfx_None) && gamestopped) + continue; + + if (!(--closedcaptions[i].t)) { - if (!closedcaptions[i].s) - continue; - - if (i == 0 && (closedcaptions[0].s-S_sfx == sfx_None) && gamestopped) - continue; - - if (!(--closedcaptions[i].t)) - { - closedcaptions[i].c = NULL; - closedcaptions[i].s = NULL; - } - else if (closedcaptions[i].c && !I_SoundIsPlaying(closedcaptions[i].c->handle)) - { - closedcaptions[i].c = NULL; - if (closedcaptions[i].t > CAPTIONFADETICS) - closedcaptions[i].t = CAPTIONFADETICS; - } + closedcaptions[i].c = NULL; + closedcaptions[i].s = NULL; + } + else if (closedcaptions[i].c && !I_SoundIsPlaying(closedcaptions[i].c->handle)) + { + closedcaptions[i].c = NULL; + if (closedcaptions[i].t > CAPTIONFADETICS) + closedcaptions[i].t = CAPTIONFADETICS; } } } diff --git a/src/s_sound.h b/src/s_sound.h index d1551df0b..f9bbf6767 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -303,6 +303,7 @@ boolean S_FadeOutStopMusic(UINT32 ms); // Updates music & sounds // void S_UpdateSounds(void); +void S_UpdateClosedCaptions(void); FUNCMATH fixed_t S_CalculateSoundDistance(fixed_t px1, fixed_t py1, fixed_t pz1, fixed_t px2, fixed_t py2, fixed_t pz2); From 1dee1da7e33aa4f5dbe39a051f9d908ea14d0d5d Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 26 Nov 2019 10:11:52 +0000 Subject: [PATCH 171/189] Fix issue where you can get stuck in pain frames after stepping up, or after sliding (resolves #369). --- src/p_user.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/p_user.c b/src/p_user.c index 7a80031b8..a3264b675 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -5962,6 +5962,8 @@ static void P_3dMovement(player_t *player) // When sliding, don't allow forward/back if (player->pflags & PF_SLIDING) cmd->forwardmove = 0; + else if (onground && player->mo->state == states+S_PLAY_PAIN) + P_SetPlayerMobjState(player->mo, S_PLAY_WALK); player->aiming = cmd->aiming< Date: Tue, 26 Nov 2019 11:53:49 +0000 Subject: [PATCH 172/189] Prevent Tailsbot from considering flight when Sonic is exiting. --- src/b_bot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/b_bot.c b/src/b_bot.c index 709a280b5..895c8d18d 100644 --- a/src/b_bot.c +++ b/src/b_bot.c @@ -135,7 +135,7 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm // ******** // FLY MODE // spinmode check - if (spinmode) + if (spinmode || player->exiting) thinkfly = false; else { From 6ac44415fb34c90b2c2375fb7f83892b65e3b20f Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 26 Nov 2019 11:55:31 +0000 Subject: [PATCH 173/189] Make P_CanPickupItem check whether Sonic is in a state to recieve it when Tailsbot tries to get it. Specfically, this fixes the case where Sonic runs into something hazardous and spills his rings, but Tailsbot is immediately behind and ends up picking them all up the tic before they also get hurt. --- src/p_inter.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/p_inter.c b/src/p_inter.c index d1ea02c80..a81be3c3a 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -148,15 +148,21 @@ void P_ResetStarposts(void) // boolean P_CanPickupItem(player_t *player, boolean weapon) { - if (player->bot && weapon) +soniccheck: + if (!player->mo || player->mo->health <= 0) return false; + if (player->bot) + { + if (weapon || players[consoleplayer].bot) + return false; + player = &players[consoleplayer]; + goto soniccheck; + } + if (player->powers[pw_flashing] > (flashingtics/4)*3 && player->powers[pw_flashing] < UINT16_MAX) return false; - if (player->mo && player->mo->health <= 0) - return false; - return true; } From f1387a07a1813ac65e26b6414061d0d4c8215458 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 26 Nov 2019 12:30:32 +0000 Subject: [PATCH 174/189] Instead of making conditions which check for death individually check for special stages to prevent lives loss, just set G_GametypeUsesLives to false in a special stage. --- src/g_game.c | 2 +- src/p_inter.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 6988a011a..2fa52e7c0 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -3099,7 +3099,7 @@ boolean G_GametypeUsesLives(void) // Coop, Competitive if ((gametype == GT_COOP || gametype == GT_COMPETITION) && !(modeattacking || metalrecording) // No lives in Time Attack - //&& !G_IsSpecialStage(gamemap) + && !G_IsSpecialStage(gamemap) && !(maptol & TOL_NIGHTS)) // No lives in NiGHTS return true; return false; diff --git a/src/p_inter.c b/src/p_inter.c index d1ea02c80..325070b35 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2521,7 +2521,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget if ((target->player->lives <= 1) && (netgame || multiplayer) && (gametype == GT_COOP) && (cv_cooplives.value == 0)) ; - else if (!target->player->bot && !target->player->spectator && !G_IsSpecialStage(gamemap) && (target->player->lives != INFLIVES) + else if (!target->player->bot && !target->player->spectator && (target->player->lives != INFLIVES) && G_GametypeUsesLives()) { target->player->lives -= 1; // Lose a life Tails 03-11-2000 From b71cf97cac424eff568426f1dccfe1caeb6e27fe Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 26 Nov 2019 12:33:56 +0000 Subject: [PATCH 175/189] * Prevent that GOD AWFUL random camera turn that happens sometimes during the fade after you die (when you input camera turn stuff after death) by locking the camera during PST_REBORN. * Remove whitespace in P_DeathThink. --- src/p_user.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 7a80031b8..2be24fbfd 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -9499,7 +9499,6 @@ static void P_DeathThink(player_t *player) } else if ((netgame || multiplayer) && player->deadtimer >= 8*TICRATE) { - INT32 i, deadtimercheck = INT32_MAX; // In a net/multiplayer game, and out of lives @@ -9664,7 +9663,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall fixed_t f1, f2; // We probably shouldn't move the camera if there is no player or player mobj somehow - if (!player || !player->mo) + if (!player || !player->mo || player->playerstate == PST_REBORN) return true; mo = player->mo; From f50feb16393e68f7e619374dcc0a66b3fae5ab6e Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 26 Nov 2019 12:37:57 +0000 Subject: [PATCH 176/189] Change the default value of cv_coopstarposts (as per #321), and make it NOT a cheat to change since the other options are in effect more restrictive. (Leaving cv_cooplives at its current value for now, though.) --- src/d_netcmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index f9ec6c351..8fa4b2e0b 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -355,7 +355,7 @@ static CV_PossibleValue_t inttime_cons_t[] = {{0, "MIN"}, {3600, "MAX"}, {0, NUL consvar_t cv_inttime = {"inttime", "10", CV_NETVAR, inttime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t coopstarposts_cons_t[] = {{0, "Per-player"}, {1, "Shared"}, {2, "Teamwork"}, {0, NULL}}; -consvar_t cv_coopstarposts = {"coopstarposts", "Teamwork", CV_NETVAR|CV_CALL|CV_CHEAT, coopstarposts_cons_t, CoopStarposts_OnChange, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_coopstarposts = {"coopstarposts", "Per-player", CV_NETVAR|CV_CALL, coopstarposts_cons_t, CoopStarposts_OnChange, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t cooplives_cons_t[] = {{0, "Infinite"}, {1, "Per-player"}, {2, "Avoid Game Over"}, {3, "Single pool"}, {0, NULL}}; consvar_t cv_cooplives = {"cooplives", "Avoid Game Over", CV_NETVAR|CV_CALL|CV_CHEAT, cooplives_cons_t, CoopLives_OnChange, 0, NULL, NULL, 0, 0, NULL}; From 613ae0c9f88047fc4667aacfe84df2a868296394 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 26 Nov 2019 17:06:30 +0000 Subject: [PATCH 177/189] Resolve #374. --- src/p_enemy.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/p_enemy.c b/src/p_enemy.c index d87945547..785d19fb4 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -14611,6 +14611,9 @@ void A_RolloutRock(mobj_t *actor) actor->frame = actor->reactiontime % maxframes; // set frame + if (!actor->tracer || P_MobjWasRemoved(actor->tracer) || !actor->tracer->health) + actor->flags |= MF_PUSHABLE; + if (!(actor->flags & MF_PUSHABLE)) // if being ridden, don't disappear actor->fuse = 0; else if (!actor->fuse && actor->movecount == 1) // otherwise if rock has moved, set its fuse From fa01a32a7f86d47134a0b31ef97673b10e7d7fc4 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 26 Nov 2019 17:56:42 +0000 Subject: [PATCH 178/189] Move the fireball despawn to later so its target/tracer isn't nulled until AFTER the enemy it touches is killed, allowing for correct point delivery (resolves #373). --- src/p_map.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index d4c753dfc..8220f3818 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1303,11 +1303,6 @@ static boolean PIT_CheckThing(mobj_t *thing) return false; } - // Fireball touched an enemy - // Don't bounce though, just despawn right there - if ((tmthing->type == MT_FIREBALL) && (thing->flags & MF_ENEMY)) - P_KillMobj(tmthing, NULL, NULL, 0); - // damage / explode if (tmthing->flags & MF_ENEMY) // An actual ENEMY! (Like the deton, for example) P_DamageMobj(thing, tmthing, tmthing, 1, 0); @@ -1356,6 +1351,11 @@ static boolean PIT_CheckThing(mobj_t *thing) P_DamageMobj(thing, tmthing, tmthing->target, 1, damagetype); } + // Fireball touched an enemy + // Don't bounce though, just despawn right there + if ((tmthing->type == MT_FIREBALL) && (thing->flags & MF_ENEMY)) + P_KillMobj(tmthing, NULL, NULL, 0); + // don't traverse any more if (tmthing->type == MT_SHELL) From d56a117a939ae26d9bf9f0dd71b1f2173c0ca37b Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 26 Nov 2019 18:25:36 +0000 Subject: [PATCH 179/189] Now we have mixed case level title font, and since we had a question mark graphic in that for a while, make the continue screen a tad nicer. --- src/f_finale.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/f_finale.c b/src/f_finale.c index 9da09e2f2..8c63def18 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -3550,7 +3550,7 @@ void F_ContinueDrawer(void) if (timetonext >= (11*TICRATE)+10) return; - V_DrawLevelTitle(x - (V_LevelNameWidth("CONTINUE")>>1), 16, 0, "CONTINUE"); + V_DrawLevelTitle(x - (V_LevelNameWidth("Continue?")>>1), 16, 0, "Continue?"); // Two stars... patch = W_CachePatchName("CONTSTAR", PU_CACHE); From c55a6cb3f8f15eb4b45f6cb312838e5f8d8cda8f Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 26 Nov 2019 17:10:59 -0500 Subject: [PATCH 180/189] MascaraSnake is a bully and will make a pariah out of me in front of his doctoral student colleagues if I don't change this --- src/p_inter.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/p_inter.c b/src/p_inter.c index a81be3c3a..0ff75b3eb 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -148,16 +148,14 @@ void P_ResetStarposts(void) // boolean P_CanPickupItem(player_t *player, boolean weapon) { -soniccheck: if (!player->mo || player->mo->health <= 0) return false; if (player->bot) { - if (weapon || players[consoleplayer].bot) + if (weapon) return false; - player = &players[consoleplayer]; - goto soniccheck; + return P_CanPickupItem(&players[consoleplayer], true); // weapon is true to prevent infinite recursion if p1 is bot - doesn't occur in vanilla, but may be relevant for mods } if (player->powers[pw_flashing] > (flashingtics/4)*3 && player->powers[pw_flashing] < UINT16_MAX) From a3050063cd37cb2a78c3ce43b139b83c3a0ed1e3 Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 27 Nov 2019 09:03:21 +0000 Subject: [PATCH 181/189] Resolve #378, because I knew as soon as I saw that issue name that it was my fault. --- src/p_tick.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/p_tick.c b/src/p_tick.c index 60a776cbc..237d6b593 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -476,11 +476,14 @@ static inline void P_DoSpecialStageStuff(void) // Count up the rings of all the players and see if // they've collected the required amount. for (i = 0; i < MAXPLAYERS; i++) - if (playeringame[i] && players[i].nightstime) + if (playeringame[i]) { tic_t oldnightstime = players[i].nightstime; countspheres += players[i].spheres; + if (!oldnightstime) + continue; + // If in water, deplete timer 6x as fast. if (players[i].mo->eflags & (MFE_TOUCHWATER|MFE_UNDERWATER) && !(players[i].powers[pw_shield] & SH_PROTECTWATER)) players[i].nightstime -= 5; From 7ff4a9b1e7713a7ed6ebaa34bbb891cba471cbd7 Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 27 Nov 2019 12:29:31 +0000 Subject: [PATCH 182/189] Make camerascale have no effect in 2D mode (resolves #359 and resolves #363). --- src/p_user.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index bddf24d42..ef33584ed 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -9768,7 +9768,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall camorbit = cv_cam_orbit.value; camrotate = cv_cam_rotate.value; camdist = FixedMul(cv_cam_dist.value, mo->scale); - camheight = FixedMul(cv_cam_height.value, FixedMul(player->camerascale, mo->scale)); + camheight = FixedMul(cv_cam_height.value, mo->scale); } else // Camera 2 { @@ -9777,9 +9777,12 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall camorbit = cv_cam2_orbit.value; camrotate = cv_cam2_rotate.value; camdist = FixedMul(cv_cam2_dist.value, mo->scale); - camheight = FixedMul(cv_cam2_height.value, FixedMul(player->camerascale, mo->scale)); + camheight = FixedMul(cv_cam2_height.value, mo->scale); } + if (!(twodlevel || (mo->flags2 & MF2_TWOD)) && !(player->powers[pw_carry] == CR_NIGHTSMODE)) + camheight = FixedMul(camheight, player->camerascale); + #ifdef REDSANALOG if (P_AnalogMove(player) && (player->cmd.buttons & (BT_CAMLEFT|BT_CAMRIGHT)) == (BT_CAMLEFT|BT_CAMRIGHT)) { camstill = true; @@ -9890,9 +9893,10 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall dist <<= 1; } + if (!(twodlevel || (mo->flags2 & MF2_TWOD)) && !(player->powers[pw_carry] == CR_NIGHTSMODE)) + dist = FixedMul(dist, player->camerascale); - - checkdist = (dist = FixedMul(dist, player->camerascale)); + checkdist = dist; if (checkdist < 128*FRACUNIT) checkdist = 128*FRACUNIT; From bcbf5e7c38ee2a161842debb5d6d1961faaff028 Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 27 Nov 2019 12:54:00 +0000 Subject: [PATCH 183/189] Correct tutorialmode case doubling up on camerascale. --- src/p_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index ef33584ed..b999f1f72 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -9759,7 +9759,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall camorbit = (!stricmp(cv_cam_orbit.defaultvalue, "off")) ? false : true; camrotate = atoi(cv_cam_rotate.defaultvalue); camdist = FixedMul((INT32)(atof(cv_cam_dist.defaultvalue) * FRACUNIT), mo->scale); - camheight = FixedMul((INT32)(atof(cv_cam_height.defaultvalue) * FRACUNIT), FixedMul(player->camerascale, mo->scale)); + camheight = FixedMul((INT32)(atof(cv_cam_height.defaultvalue) * FRACUNIT), mo->scale); } else if (thiscam == &camera) { From ae84246721d221bd0b5e2ac6065f616d0a786af5 Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 27 Nov 2019 13:37:03 +0000 Subject: [PATCH 184/189] Fix camera not being flipped when camera is stopped due to game design hack reasons (resolves #383). --- src/p_local.h | 1 + src/p_mobj.c | 39 +++++++++++++++++++++++---------------- src/p_user.c | 12 +++++++++++- 3 files changed, 35 insertions(+), 17 deletions(-) diff --git a/src/p_local.h b/src/p_local.h index b718c43f1..646fa70f2 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -323,6 +323,7 @@ SINT8 P_MobjFlip(mobj_t *mobj); fixed_t P_GetMobjGravity(mobj_t *mo); FUNCMATH boolean P_WeaponOrPanel(mobjtype_t type); +void P_CalcChasePostImg(player_t *player, camera_t *thiscam); boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled); void P_Attract(mobj_t *source, mobj_t *enemy, boolean nightsgrab); diff --git a/src/p_mobj.c b/src/p_mobj.c index c31b88940..74df95cb2 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3724,17 +3724,10 @@ void P_DestroyRobots(void) } } -// P_CameraThinker -// -// Process the mobj-ish required functions of the camera -boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled) +// the below is chasecam only, if you're curious. check out P_CalcPostImg in p_user.c for first person +void P_CalcChasePostImg(player_t *player, camera_t *thiscam) { - boolean itsatwodlevel = false; postimg_t postimg = postimg_none; - if (twodlevel - || (thiscam == &camera && players[displayplayer].mo && (players[displayplayer].mo->flags2 & MF2_TWOD)) - || (thiscam == &camera2 && players[secondarydisplayplayer].mo && (players[secondarydisplayplayer].mo->flags2 & MF2_TWOD))) - itsatwodlevel = true; if (player->pflags & PF_FLIPCAM && !(player->powers[pw_carry] == CR_NIGHTSMODE) && player->mo->eflags & MFE_VERTICALFLIP) postimg = postimg_flip; @@ -3762,13 +3755,27 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled postimg = postimg_heat; } - if (postimg != postimg_none) - { - if (splitscreen && player == &players[secondarydisplayplayer]) - postimgtype2 = postimg; - else - postimgtype = postimg; - } + if (postimg == postimg_none) + return; + + if (splitscreen && player == &players[secondarydisplayplayer]) + postimgtype2 = postimg; + else + postimgtype = postimg; +} + +// P_CameraThinker +// +// Process the mobj-ish required functions of the camera +boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled) +{ + boolean itsatwodlevel = false; + if (twodlevel + || (thiscam == &camera && players[displayplayer].mo && (players[displayplayer].mo->flags2 & MF2_TWOD)) + || (thiscam == &camera2 && players[secondarydisplayplayer].mo && (players[secondarydisplayplayer].mo->flags2 & MF2_TWOD))) + itsatwodlevel = true; + + P_CalcChasePostImg(player, thiscam); if (thiscam->momx || thiscam->momy) { diff --git a/src/p_user.c b/src/p_user.c index b999f1f72..6f3981630 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -9665,11 +9665,17 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall fixed_t f1, f2; // We probably shouldn't move the camera if there is no player or player mobj somehow - if (!player || !player->mo || player->playerstate == PST_REBORN) + if (!player || !player->mo) return true; mo = player->mo; + if (player->playerstate == PST_REBORN) + { + P_CalcChasePostImg(player, thiscam); + return true; + } + if (player->exiting) { if (mo->target && mo->target->type == MT_SIGN && mo->target->spawnpoint @@ -9678,7 +9684,10 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall else if ((player->powers[pw_carry] == CR_NIGHTSMODE) && !(player->mo->state >= &states[S_PLAY_NIGHTS_TRANS1] && player->mo->state <= &states[S_PLAY_NIGHTS_TRANS6])) + { + P_CalcChasePostImg(player, thiscam); return true; + } } cameranoclip = (player->powers[pw_carry] == CR_NIGHTSMODE || player->pflags & PF_NOCLIP) || (mo->flags & (MF_NOCLIP|MF_NOCLIPHEIGHT)); // Noclipping player camera noclips too!! @@ -10419,6 +10428,7 @@ boolean P_SpectatorJoinGame(player_t *player) return false; } +// the below is first person only, if you're curious. check out P_CalcChasePostImg in p_mobj.c for chasecam static void P_CalcPostImg(player_t *player) { sector_t *sector = player->mo->subsector->sector; From 7ff218efaf1ed5ecb14e6053660b2ce69dbdc9e4 Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 27 Nov 2019 13:47:38 +0000 Subject: [PATCH 185/189] Change SPR_NFLT default to superised SPR2_FALL (resolves code side of #382). --- src/info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/info.c b/src/info.c index 7755404a0..45a4c88d9 100644 --- a/src/info.c +++ b/src/info.c @@ -635,7 +635,7 @@ playersprite_t spr2defaults[NUMPLAYERSPRITES] = { 0, // SPR2_TRNS, FF_SPR2SUPER|SPR2_STND, // SPR2_NSTD, - FF_SPR2SUPER|SPR2_FLT , // SPR2_NFLT, + FF_SPR2SUPER|SPR2_FALL, // SPR2_NFLT, 0, // SPR2_NFLY, (will never be referenced unless skin 0 lacks this) SPR2_NFLY, // SPR2_NDRL, FF_SPR2SUPER|SPR2_STUN, // SPR2_NSTN, From 803b22a3e70f469a9a42a038b98d018206ae4127 Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 27 Nov 2019 13:54:13 +0000 Subject: [PATCH 186/189] Change required for Tails' tails to behave like falling sprite. --- src/p_mobj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index c31b88940..19ad48b90 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -255,7 +255,6 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state) case S_PLAY_WALK: case S_PLAY_SKID: case S_PLAY_FLOAT: - case S_PLAY_NIGHTS_FLOAT: player->panim = PA_WALK; break; case S_PLAY_RUN: @@ -281,6 +280,7 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state) player->panim = PA_SPRING; break; case S_PLAY_FALL: + case S_PLAY_NIGHTS_FLOAT: player->panim = PA_FALL; break; case S_PLAY_FLY: From ec69195fc9f306e6090ae18d76b91890e2f8c301 Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Wed, 27 Nov 2019 17:32:02 +0100 Subject: [PATCH 187/189] Keep counting players as finished even after dying --- src/g_game.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/g_game.c b/src/g_game.c index 2fa52e7c0..340babb10 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2323,6 +2323,9 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps) outofcoop = players[player].outofcoop; pflags = (players[player].pflags & (PF_FLIPCAM|PF_ANALOGMODE|PF_DIRECTIONCHAR|PF_AUTOBRAKE|PF_TAGIT|PF_GAMETYPEOVER)); + if (!betweenmaps) + pflags |= (players[player].pflags & PF_FINISHED); + // As long as we're not in multiplayer, carry over cheatcodes from map to map if (!(netgame || multiplayer)) pflags |= (players[player].pflags & (PF_GODMODE|PF_NOCLIP|PF_INVIS)); From f5dd0c5c3b666b0e6d07fb5e897df5fc524ee8ca Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 28 Nov 2019 19:10:59 +0000 Subject: [PATCH 188/189] Update ending cutscene(s) to linger for an additional two seconds, so that the music can properly fade out (resolves #384). --- src/f_finale.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/f_finale.c b/src/f_finale.c index 8c63def18..b8c9dd5f2 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -1625,6 +1625,7 @@ void F_GameEvaluationTicker(void) // ========== #define INFLECTIONPOINT (6*TICRATE) +#define STOPPINGPOINT (14*TICRATE) #define SPARKLLOOPTIME 15 // must be odd void F_StartEnding(void) @@ -1716,7 +1717,7 @@ void F_StartEnding(void) void F_EndingTicker(void) { - if (++finalecount > INFLECTIONPOINT*2) + if (++finalecount > STOPPINGPOINT) { F_StartCredits(); wipetypepre = INT16_MAX; @@ -2112,26 +2113,26 @@ void F_EndingDrawer(void) if (finalecount < 10) trans = (10-finalecount)/2; - else if (finalecount > (2*INFLECTIONPOINT) - 20) + else if (finalecount > STOPPINGPOINT - 20) { - trans = 10 + (finalecount/2) - INFLECTIONPOINT; + trans = 10 + (finalecount - STOPPINGPOINT)/2; donttouch = true; } - if (trans != 10) + if (trans < 10) { //colset(linkmap, 164, 165, 169); -- the ideal purple colour to represent a clicked in-game link, but not worth it just for a soundtest-controlled secret V_DrawCenteredString(BASEVIDWIDTH/2, 8, V_ALLOWLOWERCASE|(trans<'|(trans<= (2*INFLECTIONPOINT)-TICRATE) ? V_PURPLEMAP : V_BLUEMAP)|(trans<"); + V_DrawString(40, ((finalecount == STOPPINGPOINT-(20+TICRATE)) ? 1 : 0)+BASEVIDHEIGHT-16, ((timesBeaten || finalecount >= STOPPINGPOINT-TICRATE) ? V_PURPLEMAP : V_BLUEMAP)|(trans<"); } - if (finalecount > (2*INFLECTIONPOINT)-(20+(2*TICRATE))) + if (finalecount > STOPPINGPOINT-(20+(2*TICRATE))) { INT32 trans2 = abs((5*FINECOSINE((FixedAngle((finalecount*5)<>ANGLETOFINESHIFT & FINEMASK)))>>FRACBITS)+2; if (!donttouch) { - trans = 10 + ((2*INFLECTIONPOINT)-(20+(2*TICRATE))) - finalecount; + trans = 10 + (STOPPINGPOINT-(20+(2*TICRATE))) - finalecount; if (trans > trans2) trans2 = trans; } From ccbb1221436662feccd51b941b0dfbd9b9bb952e Mon Sep 17 00:00:00 2001 From: James R Date: Thu, 28 Nov 2019 12:10:57 -0800 Subject: [PATCH 189/189] Holy shit --- src/p_spec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_spec.c b/src/p_spec.c index ed5034a87..605638bd3 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -2737,7 +2737,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) // Play the sound without origin for anyone, as long as they're inside tagged areas. else { - UINT i = 0; + UINT8 i = 0; mobj_t* camobj = players[displayplayer].mo; ffloor_t *rover; boolean foundit = false;