those can be const

This commit is contained in:
Alug committed 2025-06-29 11:42:58 +02:00
1 parent 2eb4c0709d
commit 10822d0618
2 files changed
+8 -7

No files matched your search

+2 -3
View File
@@ -491,7 +491,7 @@ boolean R_DoCulling(line_t *cullheight, line_t *viewcullheight, fixed_t vz, fixe
// Returns search dimensions within a blockmap, in the direction of viewangle and out to a certain distance.
void R_GetRenderBlockMapDimensions(fixed_t drawdist, INT32 *xl, INT32 *xh, INT32 *yl, INT32 *yh)
{
const angle_t left = viewangle - clipangle;
const angle_t left = viewangle - clipangle;
const angle_t right = viewangle + clipangle;
const fixed_t vxleft = viewx + FixedMul(drawdist, FCOS(left));
@@ -657,7 +657,6 @@ void R_CheckViewMorph(void)
rollangle >>= ANGLETOFINESHIFT;
rollangle = ((rollangle+2) & ~3) & FINEMASK; // Limit the distinct number of angles to reduce recalcs from angles changing a lot.
if (rollangle == viewmorph.rollangle &&
viewmorph.scrmapsize == vid.width*vid.height)
return; // No change
@@ -1363,7 +1362,7 @@ void R_RenderPlayerView(player_t *player)
// load previous saved value of skyVisible for the player
skyVisible = skyVisiblePerPlayer[viewssnum];
fixed_t fov = R_GetPlayerFov(player);
const fixed_t fov = R_GetPlayerFov(player);
if (viewfov[viewssnum] != fov)
{
+6 -4
View File
@@ -149,7 +149,7 @@ void R_AllocPlaneMemory(void)
//
static fixed_t R_CalculateRippleOffset(drawspandata_t* ds, INT32 y)
{
fixed_t distance = FixedMul(ds->planeheight, yslope[y]);
const fixed_t distance = FixedMul(ds->planeheight, yslope[y]);
const INT32 yay = (ds->planeripple.offset + (distance>>9)) & 8191;
return FixedDiv(FINESINE(yay), (1<<12) + (distance>>11));
}
@@ -559,6 +559,7 @@ visplane_t *R_CheckPlane(visplane_t *pl, INT32 start, INT32 stop)
else /* Cannot use existing plane; create a new one */
{
visplane_t *new_pl;
if (pl->ffloor)
{
new_pl = new_visplane(MAXVISPLANES - 1);
@@ -782,7 +783,6 @@ void R_DrawSkyPlanes(void)
static void R_DrawSkyPlane(visplane_t *pl, void(*colfunc2)(drawcolumndata_t*), boolean allow_parallel)
{
INT32 x;
drawcolumndata_t dc = {};
if (!(pl->minx <= pl->maxx))
return;
@@ -794,6 +794,8 @@ static void R_DrawSkyPlane(visplane_t *pl, void(*colfunc2)(drawcolumndata_t*), b
return;
}
drawcolumndata_t dc = {};
// Reset column drawer function (note: couldn't we just call walldrawerfunc directly?)
// (that is, unless we'll need to switch drawers in future for some reason)
R_SetColumnFunc(BASEDRAWFUNC);
@@ -1006,8 +1008,8 @@ static inline void R_AdjustSlopeCoordinates(drawspandata_t* ds, vector3_t *origi
{
const fixed_t modmask = ((1 << (32-ds->nflatshiftup)) - 1);
fixed_t ox = (origin->x & modmask);
fixed_t oy = -(origin->y & modmask);
const fixed_t ox = (origin->x & modmask);
const fixed_t oy = -(origin->y & modmask);
ds->xoffs &= modmask;
ds->yoffs &= modmask;