Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
bradharding committed Feb 28, 2025
1 parent b67dfcb commit 3755011
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
6 changes: 0 additions & 6 deletions src/m_fixed.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@
#define FRACBITS 16
#define FRACUNIT (1 << FRACBITS)
#define FIXED2DOUBLE(a) ((a) / (double)FRACUNIT)
#define FRACMASK (FRACUNIT - 1)
#define FRACFILL(a, b) ((a) | ((b) < 0 ? (FRACMASK << (32 - FRACBITS)) : 0))

#define IntToFixed(a) ((a) << FRACBITS)
#define FixedToInt(a) FRACFILL((a) >> FRACBITS, (a))

#define FIXED_MIN INT32_MIN
#define FIXED_MAX INT32_MAX

Expand Down
18 changes: 6 additions & 12 deletions src/r_plane.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,12 +439,10 @@ static void DrawSkyTex(visplane_t *pl, skytex_t *skytex, void func(void))
dc_iscale = FixedMul(skyiscale, skytex->scaley);

for (dc_x = pl->left; dc_x <= pl->right; dc_x++)
if ((dc_yl = pl->top[dc_x]) != USHRT_MAX
&& dc_yl <= (dc_yh = pl->bottom[dc_x]))
if ((dc_yl = pl->top[dc_x]) != USHRT_MAX && dc_yl <= (dc_yh = pl->bottom[dc_x]))
{
dc_source = R_GetTextureColumn(R_CacheTextureCompositePatchNum(texture),
FixedToInt(FixedMul(IntToFixed((angle + xtoskyangle[dc_x]) >> ANGLETOSKYSHIFT),
skytex->scalex)));
FixedMul((angle + xtoskyangle[dc_x]) >> ANGLETOSKYSHIFT, skytex->scalex));
func();
}
}
Expand Down Expand Up @@ -483,8 +481,7 @@ void R_DrawPlanes(void)
dc_texturemid = -28 * FRACUNIT;

for (dc_x = pl->left; dc_x <= pl->right; dc_x++)
if ((dc_yl = pl->top[dc_x]) != USHRT_MAX
&& dc_yl <= (dc_yh = pl->bottom[dc_x]))
if ((dc_yl = pl->top[dc_x]) != USHRT_MAX && dc_yl <= (dc_yh = pl->bottom[dc_x]))
{
dc_source = R_GetFireColumn((viewangle + xtoskyangle[dc_x]) >> ANGLETOSKYSHIFT);
skycolfunc();
Expand All @@ -505,8 +502,7 @@ void R_DrawPlanes(void)
dc_texturemid = skytexturemid;

for (dc_x = pl->left; dc_x <= pl->right; dc_x++)
if ((dc_yl = pl->top[dc_x]) != USHRT_MAX
&& dc_yl <= (dc_yh = pl->bottom[dc_x]))
if ((dc_yl = pl->top[dc_x]) != USHRT_MAX && dc_yl <= (dc_yh = pl->bottom[dc_x]))
{
dc_source = R_GetTextureColumn(R_CacheTextureCompositePatchNum(skytexture),
(((viewangle + xtoskyangle[dc_x])
Expand Down Expand Up @@ -538,8 +534,7 @@ void R_DrawPlanes(void)
if (side->missingtoptexture)
{
for (dc_x = pl->left; dc_x <= pl->right; dc_x++)
if ((dc_yl = pl->top[dc_x]) != USHRT_MAX
&& dc_yl <= (dc_yh = pl->bottom[dc_x]))
if ((dc_yl = pl->top[dc_x]) != USHRT_MAX && dc_yl <= (dc_yh = pl->bottom[dc_x]))
R_DrawColorColumn();

continue;
Expand Down Expand Up @@ -574,8 +569,7 @@ void R_DrawPlanes(void)
tex_patch = R_CacheTextureCompositePatchNum(texture);

for (dc_x = pl->left; dc_x <= pl->right; dc_x++)
if ((dc_yl = pl->top[dc_x]) != USHRT_MAX
&& dc_yl <= (dc_yh = pl->bottom[dc_x]))
if ((dc_yl = pl->top[dc_x]) != USHRT_MAX && dc_yl <= (dc_yh = pl->bottom[dc_x]))
{
dc_source = R_GetTextureColumn(tex_patch,
((((angle + xtoskyangle[dc_x]) ^ flip)
Expand Down

0 comments on commit 3755011

Please sign in to comment.