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:
1 parent
4f2dbdf2ec
commit
f14b3ba989
3 files changed
+8
-8
No files matched your search
@@ -2978,7 +2978,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;
|
||||
|
||||
+6
-6
@@ -812,7 +812,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;
|
||||
@@ -1062,7 +1062,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;
|
||||
@@ -1088,13 +1088,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;
|
||||
|
||||
+1
-1
@@ -65,7 +65,7 @@ sector_t *R_FakeFlat(sector_t *sec, sector_t *tempsec, INT32 *floorlightlevel,
|
||||
boolean R_IsEmptyLine(seg_t *line, const sector_t *front, const sector_t *back);
|
||||
|
||||
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"
|
||||
|
||||
Reference in new issue
Block a user