minor code clean-up

This commit is contained in:
Fabian Greffrath 2020-03-12 10:17:25 +01:00
parent 33af43d5ba
commit a1ae302ca7
5 changed files with 8 additions and 29 deletions

View File

@ -2375,7 +2375,7 @@ byte *G_ReadOptions(byte *demo_p)
for (i=0; i < COMP_TOTAL; i++) for (i=0; i < COMP_TOTAL; i++)
comp[i] = compatibility; 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; comp[comp_3keydoor] = 1;
monster_infighting = 1; // killough 7/19/98 monster_infighting = 1; // killough 7/19/98

View File

@ -485,9 +485,9 @@ void R_DrawSpan (void)
dest = ylookup[ds_y] + columnofs[ds_x1]; dest = ylookup[ds_y] + columnofs[ds_x1];
count = ds_x2 - ds_x1 + 1; count = ds_x2 - ds_x1 + 1;
// [FG] fix flat distortion towards the right of the screen
while (count >= 4) while (count >= 4)
{ {
// [FG] fix flat distortion towards the right of the screen
ytemp = (ds_yfrac >> 10) & 0x0FC0; ytemp = (ds_yfrac >> 10) & 0x0FC0;
xtemp = (ds_xfrac >> 16) & 0x003F; xtemp = (ds_xfrac >> 16) & 0x003F;
spot = xtemp | ytemp; spot = xtemp | ytemp;

View File

@ -214,7 +214,7 @@ angle_t R_PointToAngleCrispy(fixed_t x, fixed_t y)
ANG270+tantoangle[SlopeDivCrispy(x,y)] : // octant 7 ANG270+tantoangle[SlopeDivCrispy(x,y)] : // octant 7
y >= 0 ? (x = -x) > y ? ANG180-1-tantoangle[SlopeDivCrispy(y,x)] : // octant 3 y >= 0 ? (x = -x) > y ? ANG180-1-tantoangle[SlopeDivCrispy(y,x)] : // octant 3
ANG90 + tantoangle[SlopeDivCrispy(x,y)] : // octant 2 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 ANG270-1-tantoangle[SlopeDivCrispy(x,y)] : // octant 5
0; 0;
} }

View File

@ -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 // R_StoreWallRange
// A wall segment will be drawn // A wall segment will be drawn

View File

@ -386,7 +386,6 @@ static patch_t** lnames;
// [FG] number of level name graphics // [FG] number of level name graphics
static int num_lnames; static int num_lnames;
// //
// CODE // CODE
// //
@ -428,7 +427,7 @@ static void WI_drawLF(void)
int y = WI_TITLEY; int y = WI_TITLEY;
// [FG] prevent crashes for levels without name graphics // [FG] prevent crashes for levels without name graphics
if (wbs->last < num_lnames && lnames[wbs->last]) if (wbs->last < num_lnames)
{ {
// draw <LevelName> // draw <LevelName>
V_DrawPatch((SCREENWIDTH - SHORT(lnames[wbs->last]->width))/2, V_DrawPatch((SCREENWIDTH - SHORT(lnames[wbs->last]->width))/2,
@ -458,7 +457,7 @@ static void WI_drawEL(void)
y, FB, entering); y, FB, entering);
// [FG] prevent crashes for levels without name graphics // [FG] prevent crashes for levels without name graphics
if (wbs->next < num_lnames && lnames[wbs->next]) if (wbs->next < num_lnames)
{ {
// draw level // draw level
y += (5*SHORT(lnames[wbs->next]->height))/4; y += (5*SHORT(lnames[wbs->next]->height))/4;
@ -1850,8 +1849,7 @@ static void WI_loadData(void)
for (i=0 ; i<NUMCMAPS ; i++) for (i=0 ; i<NUMCMAPS ; i++)
{ {
snprintf(name, sizeof(name), "CWILV%2.2d", i); snprintf(name, sizeof(name), "CWILV%2.2d", i);
// [FG] prevent crashes for levels without name graphics lnames[i] = W_CacheLumpName(name, PU_STATIC);
lnames[i] = W_CheckNumForName(name) > -1 ? W_CacheLumpName(name, PU_STATIC) : NULL;
} }
} }
else else
@ -1861,8 +1859,7 @@ static void WI_loadData(void)
for (i=0 ; i<NUMMAPS ; i++) for (i=0 ; i<NUMMAPS ; i++)
{ {
sprintf(name, "WILV%d%d", wbs->epsd, i); sprintf(name, "WILV%d%d", wbs->epsd, i);
// [FG] prevent crashes for levels without name graphics lnames[i] = W_CacheLumpName(name, PU_STATIC);
lnames[i] = W_CheckNumForName(name) > -1 ? W_CacheLumpName(name, PU_STATIC) : NULL;
} }
// you are here // you are here