diff --git a/src/r_main.c b/src/r_main.c index 70c271f5d..b2eb1890c 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -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; diff --git a/src/r_plane.c b/src/r_plane.c index 2c2fe3432..2f6f97240 100644 --- a/src/r_plane.c +++ b/src/r_plane.c @@ -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 ;) diff --git a/src/r_plane.h b/src/r_plane.h index a269fed6a..238fde182 100644 --- a/src/r_plane.h +++ b/src/r_plane.h @@ -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); diff --git a/src/r_portal.c b/src/r_portal.c index ad5d32e70..a1dcfe335 100644 --- a/src/r_portal.c +++ b/src/r_portal.c @@ -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);