mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-01-17 23:31:29 +00:00
- fixed: The 3D floor light list should use the last light starting above the ceiling, not the first one.
- fixed: ExtraFloor_LightOnly type 2 was behaving like type 0. Instead anything interrupting it should reset to the sector's own light level.
This commit is contained in:
parent
058bfdea26
commit
674b81a6b1
2 changed files with 24 additions and 17 deletions
|
@ -290,6 +290,7 @@ static int P_Set3DFloor(line_t * line, int param, int param2, int alpha)
|
||||||
// if flooding is used the floor must be non-solid and is automatically made shootthrough and seethrough
|
// if flooding is used the floor must be non-solid and is automatically made shootthrough and seethrough
|
||||||
if ((param2&128) && !(flags & FF_SOLID)) flags |= FF_FLOOD|FF_SEETHROUGH|FF_SHOOTTHROUGH;
|
if ((param2&128) && !(flags & FF_SOLID)) flags |= FF_FLOOD|FF_SEETHROUGH|FF_SHOOTTHROUGH;
|
||||||
if (param2&512) flags |= FF_FADEWALLS;
|
if (param2&512) flags |= FF_FADEWALLS;
|
||||||
|
if (param2&1024) flags |= FF_RESET;
|
||||||
FTextureID tex = line->sidedef[0]->GetTexture(side_t::top);
|
FTextureID tex = line->sidedef[0]->GetTexture(side_t::top);
|
||||||
if (!tex.Exists() && alpha<255)
|
if (!tex.Exists() && alpha<255)
|
||||||
{
|
{
|
||||||
|
@ -434,6 +435,7 @@ void P_Recalculate3DFloors(sector_t * sector)
|
||||||
fixed_t maxheight, minheight;
|
fixed_t maxheight, minheight;
|
||||||
unsigned i, j;
|
unsigned i, j;
|
||||||
lightlist_t newlight;
|
lightlist_t newlight;
|
||||||
|
lightlist_t resetlight; // what it goes back to after FF_DOUBLESHADOW
|
||||||
|
|
||||||
TArray<F3DFloor*> & ffloors=sector->e->XFloor.ffloors;
|
TArray<F3DFloor*> & ffloors=sector->e->XFloor.ffloors;
|
||||||
TArray<lightlist_t> & lightlist = sector->e->XFloor.lightlist;
|
TArray<lightlist_t> & lightlist = sector->e->XFloor.lightlist;
|
||||||
|
@ -588,7 +590,9 @@ void P_Recalculate3DFloors(sector_t * sector)
|
||||||
lightlist[0].extra_colormap = sector->ColorMap;
|
lightlist[0].extra_colormap = sector->ColorMap;
|
||||||
lightlist[0].blend = 0;
|
lightlist[0].blend = 0;
|
||||||
lightlist[0].flags = 0;
|
lightlist[0].flags = 0;
|
||||||
|
|
||||||
|
resetlight = lightlist[0];
|
||||||
|
|
||||||
maxheight = sector->CenterCeiling();
|
maxheight = sector->CenterCeiling();
|
||||||
minheight = sector->CenterFloor();
|
minheight = sector->CenterFloor();
|
||||||
for(i = 0; i < ffloors.Size(); i++)
|
for(i = 0; i < ffloors.Size(); i++)
|
||||||
|
@ -611,7 +615,7 @@ void P_Recalculate3DFloors(sector_t * sector)
|
||||||
newlight.flags = rover->flags;
|
newlight.flags = rover->flags;
|
||||||
lightlist.Push(newlight);
|
lightlist.Push(newlight);
|
||||||
}
|
}
|
||||||
else if (i==0)
|
else //if (i==0)
|
||||||
{
|
{
|
||||||
fixed_t ff_bottom=rover->bottom.plane->ZatPoint(CenterSpot(sector));
|
fixed_t ff_bottom=rover->bottom.plane->ZatPoint(CenterSpot(sector));
|
||||||
if (ff_bottom<maxheight)
|
if (ff_bottom<maxheight)
|
||||||
|
@ -625,6 +629,18 @@ void P_Recalculate3DFloors(sector_t * sector)
|
||||||
lightlist[0].flags = rover->flags;
|
lightlist[0].flags = rover->flags;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!(rover->flags & (FF_DOUBLESHADOW | FF_RESET)))
|
||||||
|
{
|
||||||
|
resetlight = lightlist.Last();
|
||||||
|
}
|
||||||
|
else if (rover->flags & FF_RESET)
|
||||||
|
{
|
||||||
|
resetlight.p_lightlevel = §or->lightlevel;
|
||||||
|
resetlight.lightsource = NULL;
|
||||||
|
resetlight.extra_colormap = sector->ColorMap;
|
||||||
|
resetlight.blend = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (rover->flags&FF_DOUBLESHADOW)
|
if (rover->flags&FF_DOUBLESHADOW)
|
||||||
{
|
{
|
||||||
fixed_t ff_bottom=rover->bottom.plane->ZatPoint(CenterSpot(sector));
|
fixed_t ff_bottom=rover->bottom.plane->ZatPoint(CenterSpot(sector));
|
||||||
|
@ -632,20 +648,10 @@ void P_Recalculate3DFloors(sector_t * sector)
|
||||||
{
|
{
|
||||||
newlight.caster = rover;
|
newlight.caster = rover;
|
||||||
newlight.plane = *rover->bottom.plane;
|
newlight.plane = *rover->bottom.plane;
|
||||||
if (lightlist.Size()>1)
|
newlight.lightsource = resetlight.lightsource;
|
||||||
{
|
newlight.p_lightlevel = resetlight.p_lightlevel;
|
||||||
newlight.lightsource = lightlist[lightlist.Size()-2].lightsource;
|
newlight.extra_colormap = resetlight.extra_colormap;
|
||||||
newlight.p_lightlevel = lightlist[lightlist.Size()-2].p_lightlevel;
|
newlight.blend = resetlight.blend;
|
||||||
newlight.extra_colormap = lightlist[lightlist.Size()-2].extra_colormap;
|
|
||||||
newlight.blend = lightlist[lightlist.Size()-2].blend;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
newlight.lightsource = NULL;
|
|
||||||
newlight.p_lightlevel = §or->lightlevel;
|
|
||||||
newlight.extra_colormap = sector->ColorMap;
|
|
||||||
newlight.blend = 0;
|
|
||||||
}
|
|
||||||
newlight.flags = rover->flags;
|
newlight.flags = rover->flags;
|
||||||
lightlist.Push(newlight);
|
lightlist.Push(newlight);
|
||||||
}
|
}
|
||||||
|
@ -825,7 +831,7 @@ void P_LineOpening_XFloors (FLineOpening &open, AActor * thing, const line_t *li
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
void P_Spawn3DFloors (void)
|
void P_Spawn3DFloors (void)
|
||||||
{
|
{
|
||||||
static int flagvals[] = {128+512, 2+512, 512};
|
static int flagvals[] = {512, 2+512, 512+1024};
|
||||||
int i;
|
int i;
|
||||||
line_t * line;
|
line_t * line;
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,7 @@ typedef enum
|
||||||
FF_ADDITIVETRANS = 0x10000000, // Render this floor with additive translucency
|
FF_ADDITIVETRANS = 0x10000000, // Render this floor with additive translucency
|
||||||
FF_FLOOD = 0x20000000, // extends towards the next lowest flooding or solid 3D floor or the bottom of the sector
|
FF_FLOOD = 0x20000000, // extends towards the next lowest flooding or solid 3D floor or the bottom of the sector
|
||||||
FF_THISINSIDE = 0x40000000, // hack for software 3D with FF_BOTHPLANES
|
FF_THISINSIDE = 0x40000000, // hack for software 3D with FF_BOTHPLANES
|
||||||
|
FF_RESET = 0x80000000, // light effect is completely reset, once interrupted
|
||||||
} ffloortype_e;
|
} ffloortype_e;
|
||||||
|
|
||||||
// This is for the purpose of Sector_SetContents:
|
// This is for the purpose of Sector_SetContents:
|
||||||
|
|
Loading…
Reference in a new issue