Made Portal_Add static; move ffloors clip reset from R_RenderPlayerView to r_plane.

This commit is contained in:
Nev3r 2019-06-09 22:48:54 +02:00
parent f536ab3467
commit 581e80ed69
4 changed files with 20 additions and 12 deletions

View File

@ -1114,15 +1114,7 @@ void R_RenderPlayerView(player_t *player)
masks[nummasks - 1].viewsector = viewsector;
curdrawsegs = ds_p;
// opening / clipping determination
for (i = 0; i < viewwidth; i++)
{
for (p = 0; p < MAXFFLOORS; p++)
{
ffloor[p].f_clip[i] = (INT16)viewheight;
ffloor[p].c_clip[i] = -1;
}
}
R_ClearFFloorClips();
R_RenderBSPNode((INT32)numnodes - 1);
masks[nummasks - 1].drawsegs[1] = ds_p - drawsegs;

View File

@ -305,6 +305,23 @@ void R_MapPlane(INT32 y, INT32 x1, INT32 x2)
#endif
}
void R_ClearFFloorClips (void)
{
INT32 i, p;
// opening / clipping determination
for (i = 0; i < viewwidth; i++)
{
for (p = 0; p < MAXFFLOORS; p++)
{
ffloor[p].f_clip[i] = (INT16)viewheight;
ffloor[p].c_clip[i] = -1;
}
}
numffloors = 0;
}
//
// R_ClearPlanes
// At begining of frame.
@ -327,8 +344,6 @@ void R_ClearPlanes(void)
}
}
numffloors = 0;
for (i = 0; i < MAXVISPLANES; i++)
for (*freehead = visplanes[i], visplanes[i] = NULL;
freehead && *freehead ;)

View File

@ -76,6 +76,7 @@ extern lighttable_t **planezlight;
void R_InitPlanes(void);
void R_ClearPlanes(void);
void R_ClearFFloorClips (void);
void R_MapPlane(INT32 y, INT32 x1, INT32 x2);
void R_MakeSpans(INT32 x, INT32 t1, INT32 b1, INT32 t2, INT32 b2);

View File

@ -97,7 +97,7 @@ void Portal_ClipApply (const portal_t* portal)
}
}
portal_t* Portal_Add (const INT16 x1, const INT16 x2)
static portal_t* Portal_Add (const INT16 x1, const INT16 x2)
{
portal_t *portal = Z_Malloc(sizeof(portal_t), PU_LEVEL, NULL);
INT16 *ceilingclipsave = Z_Malloc(sizeof(INT16)*(x2-x1 + 1), PU_LEVEL, NULL);