From a1ae302ca772e987a845a32951760c64180cb5a9 Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Thu, 12 Mar 2020 10:17:25 +0100 Subject: [PATCH] minor code clean-up --- Source/g_game.c | 2 +- Source/r_draw.c | 4 ++-- Source/r_main.c | 2 +- Source/r_segs.c | 18 ------------------ Source/wi_stuff.c | 11 ++++------- 5 files changed, 8 insertions(+), 29 deletions(-) diff --git a/Source/g_game.c b/Source/g_game.c index 33e1ea57..2c61ba29 100644 --- a/Source/g_game.c +++ b/Source/g_game.c @@ -2375,7 +2375,7 @@ byte *G_ReadOptions(byte *demo_p) for (i=0; i < COMP_TOTAL; i++) comp[i] = compatibility; - // [FG] Boom did never have the 3-key door bug + // [FG] Boom never had the 3-key door bug comp[comp_3keydoor] = 1; monster_infighting = 1; // killough 7/19/98 diff --git a/Source/r_draw.c b/Source/r_draw.c index 5e1e4f76..561df27d 100644 --- a/Source/r_draw.c +++ b/Source/r_draw.c @@ -479,15 +479,15 @@ void R_DrawSpan (void) unsigned spot; unsigned xtemp; unsigned ytemp; - + source = ds_source; colormap = ds_colormap; dest = ylookup[ds_y] + columnofs[ds_x1]; count = ds_x2 - ds_x1 + 1; + // [FG] fix flat distortion towards the right of the screen while (count >= 4) { - // [FG] fix flat distortion towards the right of the screen ytemp = (ds_yfrac >> 10) & 0x0FC0; xtemp = (ds_xfrac >> 16) & 0x003F; spot = xtemp | ytemp; diff --git a/Source/r_main.c b/Source/r_main.c index 086d8d07..0c93472f 100644 --- a/Source/r_main.c +++ b/Source/r_main.c @@ -214,7 +214,7 @@ angle_t R_PointToAngleCrispy(fixed_t x, fixed_t y) ANG270+tantoangle[SlopeDivCrispy(x,y)] : // octant 7 y >= 0 ? (x = -x) > y ? ANG180-1-tantoangle[SlopeDivCrispy(y,x)] : // octant 3 ANG90 + tantoangle[SlopeDivCrispy(x,y)] : // octant 2 - (x = -x) > (y = -y) ? ANG180+tantoangle[ SlopeDivCrispy(y,x)] : // octant 4 + (x = -x) > (y = -y) ? ANG180+tantoangle[SlopeDivCrispy(y,x)] : // octant 4 ANG270-1-tantoangle[SlopeDivCrispy(x,y)] : // octant 5 0; } diff --git a/Source/r_segs.c b/Source/r_segs.c index f5f01f3a..9054e1fe 100644 --- a/Source/r_segs.c +++ b/Source/r_segs.c @@ -365,24 +365,6 @@ static void R_RenderSegLoop (void) } } -#if 0 -// killough 5/2/98: move from r_main.c, made static, simplified - -static fixed_t R_PointToDist(fixed_t x, fixed_t y) -{ - fixed_t dx = abs(x - viewx); - fixed_t dy = abs(y - viewy); - if (dy > dx) - { - fixed_t t = dx; - dx = dy; - dy = t; - } - return dx ? FixedDiv(dx, finesine[(tantoangle[FixedDiv(dy,dx) >> DBITS] - + ANG90) >> ANGLETOFINESHIFT]) : 0; -} -#endif - // // R_StoreWallRange // A wall segment will be drawn diff --git a/Source/wi_stuff.c b/Source/wi_stuff.c index 499f4ba3..7dcc1cc0 100644 --- a/Source/wi_stuff.c +++ b/Source/wi_stuff.c @@ -386,7 +386,6 @@ static patch_t** lnames; // [FG] number of level name graphics static int num_lnames; - // // CODE // @@ -428,7 +427,7 @@ static void WI_drawLF(void) int y = WI_TITLEY; // [FG] prevent crashes for levels without name graphics - if (wbs->last < num_lnames && lnames[wbs->last]) + if (wbs->last < num_lnames) { // draw V_DrawPatch((SCREENWIDTH - SHORT(lnames[wbs->last]->width))/2, @@ -458,7 +457,7 @@ static void WI_drawEL(void) y, FB, entering); // [FG] prevent crashes for levels without name graphics - if (wbs->next < num_lnames && lnames[wbs->next]) + if (wbs->next < num_lnames) { // draw level y += (5*SHORT(lnames[wbs->next]->height))/4; @@ -1850,8 +1849,7 @@ static void WI_loadData(void) for (i=0 ; i -1 ? W_CacheLumpName(name, PU_STATIC) : NULL; + lnames[i] = W_CacheLumpName(name, PU_STATIC); } } else @@ -1861,8 +1859,7 @@ static void WI_loadData(void) for (i=0 ; iepsd, i); - // [FG] prevent crashes for levels without name graphics - lnames[i] = W_CheckNumForName(name) > -1 ? W_CacheLumpName(name, PU_STATIC) : NULL; + lnames[i] = W_CacheLumpName(name, PU_STATIC); } // you are here