pass frontsector ceiling z to R_Prep3DFloors
in both cases "R_Subsector" already got the frontsectors ceiling z, so no need to get it again within R_Prep3DFloors should save some P_GetSectorCeilingZAt per frame
This commit is contained in:
parent
9b99d2fd91
commit
ffc2e5e253
3 changed files with 8 additions and 8 deletions
|
|
@ -2649,7 +2649,7 @@ static void HWR_Subsector(size_t num)
|
|||
if (anyMoved == true)
|
||||
{
|
||||
gl_frontsector->numlights = sub->sector->numlights = 0;
|
||||
R_Prep3DFloors(gl_frontsector);
|
||||
R_Prep3DFloors(gl_frontsector, locCeilingHeight);
|
||||
sub->sector->lightlist = gl_frontsector->lightlist;
|
||||
sub->sector->numlights = gl_frontsector->numlights;
|
||||
sub->sector->moved = gl_frontsector->moved = false;
|
||||
|
|
|
|||
|
|
@ -1012,7 +1012,7 @@ static void R_Subsector(size_t num)
|
|||
if (anyMoved == true)
|
||||
{
|
||||
frontsector->numlights = sub->sector->numlights = 0;
|
||||
R_Prep3DFloors(frontsector);
|
||||
R_Prep3DFloors(frontsector, ceilingcenterz);
|
||||
sub->sector->lightlist = frontsector->lightlist;
|
||||
sub->sector->numlights = frontsector->numlights;
|
||||
sub->sector->moved = frontsector->moved = false;
|
||||
|
|
@ -1303,7 +1303,7 @@ static void R_Subsector(size_t num)
|
|||
//
|
||||
// This function creates the lightlists that the given sector uses to light
|
||||
// floors/ceilings/walls according to the 3D floors.
|
||||
void R_Prep3DFloors(sector_t *sector)
|
||||
void R_Prep3DFloors(sector_t *sector, fixed_t secceilz)
|
||||
{
|
||||
ffloor_t *rover;
|
||||
ffloor_t *best;
|
||||
|
|
@ -1329,13 +1329,13 @@ void R_Prep3DFloors(sector_t *sector)
|
|||
if (count != sector->numlights)
|
||||
{
|
||||
Z_Free(sector->lightlist);
|
||||
sector->lightlist = static_cast<lightlist_t*>(Z_Calloc(sizeof (*sector->lightlist) * count, PU_LEVEL, NULL));
|
||||
sector->lightlist = static_cast<lightlist_t*>(Z_Malloc(sizeof(*sector->lightlist) * count, PU_LEVEL, NULL));
|
||||
sector->numlights = count;
|
||||
}
|
||||
else
|
||||
memset(sector->lightlist, 0, sizeof (lightlist_t) * count);
|
||||
|
||||
heighttest = P_GetSectorCeilingZAt(sector, sector->soundorg.x, sector->soundorg.y);
|
||||
memset(sector->lightlist, 0, sizeof(lightlist_t) * count);
|
||||
|
||||
heighttest = secceilz; // sector ceiling z
|
||||
|
||||
sector->lightlist[0].height = heighttest + 1;
|
||||
sector->lightlist[0].slope = sector->c_slope;
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ boolean R_IsEmptyLine(seg_t *line, sector_t *front, sector_t *back);
|
|||
boolean R_IsDebugLine(seg_t *line);
|
||||
|
||||
INT32 R_GetPlaneLight(sector_t *sector, fixed_t planeheight, boolean underside);
|
||||
void R_Prep3DFloors(sector_t *sector);
|
||||
void R_Prep3DFloors(sector_t *sector, fixed_t secceilz);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
|
|
|
|||
Loading…
Reference in a new issue