From a469cebef79d2823a557abf50ce799be783f5aff Mon Sep 17 00:00:00 2001 From: James R Date: Tue, 4 Apr 2023 22:01:42 -0700 Subject: [PATCH 1/5] M_DrawPause: fix iterating beyond bounds of menuitems --- src/k_menudraw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k_menudraw.c b/src/k_menudraw.c index 3ef4eeefd..326d143ca 100644 --- a/src/k_menudraw.c +++ b/src/k_menudraw.c @@ -4011,7 +4011,7 @@ void M_DrawPause(void) i++; // Regardless of whether we drew or not, go to the next item in the menu. - if (i > currentMenu->numitems) + if (i >= currentMenu->numitems) { i = 0; while (!(currentMenu->menuitems[i].status & IT_DISPLAY)) From 32ed5fe4ae89f8fdf188cb0219fdd3ac3dbea344 Mon Sep 17 00:00:00 2001 From: James R Date: Tue, 4 Apr 2023 22:04:09 -0700 Subject: [PATCH 2/5] Newsnapshotfile: increase array size to fit webm extension --- src/m_misc.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/m_misc.cpp b/src/m_misc.cpp index a8c6ccf0c..c6f23a056 100644 --- a/src/m_misc.cpp +++ b/src/m_misc.cpp @@ -782,12 +782,13 @@ static void M_CreateScreenShotPalette(void) #if NUMSCREENS > 2 static const char *Newsnapshotfile(const char *pathname, const char *ext) { - static char freename[19] = "ringracersXXXX.ext"; + static char freename[20] = "ringracersXXXX.exte"; int i = 5000; // start in the middle: num screenshots divided by 2 int add = i; // how much to add or subtract if wrong; gets divided by 2 each time int result; // -1 = guess too high, 0 = correct, 1 = guess too low // find a file name to save it to + I_Assert(strlen(ext) < (sizeof freename) - 15); strcpy(freename+15,ext); for (;;) From e5d51d5a31ab7afe7c4572c5ca3fa5e3e48aaba0 Mon Sep 17 00:00:00 2001 From: James R Date: Tue, 4 Apr 2023 22:06:32 -0700 Subject: [PATCH 3/5] R_RenderSegLoop: fix FINETANGENT sometimes going out of bounds --- src/r_segs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/r_segs.c b/src/r_segs.c index 3d657657e..44784b087 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -1451,7 +1451,8 @@ static void R_RenderSegLoop (void) //SoM: Calculate offsets for Thick fake floors. // calculate texture offset angle = (rw_centerangle + xtoviewangle[viewssnum][rw_x])>>ANGLETOFINESHIFT; - texturecolumn = rw_offset-FixedMul(FINETANGENT(angle),rw_distance); + // Mask 4095 to guarantee this index is within bounds + texturecolumn = rw_offset-FixedMul(FINETANGENT(angle & 4095),rw_distance); if (oldtexturecolumn != -1) { rw_bottomtexturemid += FixedMul(rw_bottomtextureslide, oldtexturecolumn-texturecolumn); From f087d6d8656d03850d304f4ec1406a94c857dc10 Mon Sep 17 00:00:00 2001 From: James R Date: Tue, 4 Apr 2023 22:08:43 -0700 Subject: [PATCH 4/5] ST_drawDebugInfo: fix displayplayers access out of bounds on startup On startup, the cvar is not registered yet so the value went negative subtracting from zero. --- src/st_stuff.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/st_stuff.c b/src/st_stuff.c index a48d844d5..6c66d069d 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -438,8 +438,10 @@ void ST_drawDebugInfo(void) { INT32 height = 192; + const UINT8 screen = cv_devmode_screen.value - 1; + // devmode_screen = 1..4 - stplyr = &players[displayplayers[min(r_splitscreen, cv_devmode_screen.value - 1)]]; + stplyr = &players[displayplayers[min(r_splitscreen, screen)]]; if (!stplyr->mo) return; From b92bf69ce5beb0f7af5eb52365890eddf2c867e7 Mon Sep 17 00:00:00 2001 From: James R Date: Tue, 4 Apr 2023 22:15:44 -0700 Subject: [PATCH 5/5] R_RasterizeFloorSplat: set ds_brightmap to NULL Previously did not set ds_brightmap, so it could sneak in from a previous span renderer. --- src/r_splats.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/r_splats.c b/src/r_splats.c index 011e1d9eb..bfd0197ca 100644 --- a/src/r_splats.c +++ b/src/r_splats.c @@ -425,6 +425,8 @@ static void R_RasterizeFloorSplat(floorsplat_t *pSplat, vector2_t *verts, visspr ds_colormap = vis->colormap; ds_fullbright = colormaps; + ds_brightmap = NULL; + ds_translation = R_GetSpriteTranslation(vis); if (ds_translation == NULL) ds_translation = colormaps;