mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-14 16:41:13 +00:00
- Fixed: sector_t::GetHeightSec() was too aggressive about not returning heightsec.
SVN r3600 (trunk)
This commit is contained in:
parent
fc6d55c508
commit
6369a88e0f
2 changed files with 26 additions and 8 deletions
|
@ -802,6 +802,31 @@ int sector_t::GetCeilingLight () const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sector_t *sector_t::GetHeightSec() const
|
||||||
|
{
|
||||||
|
if (heightsec == NULL)
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
if (heightsec->MoreFlags & SECF_IGNOREHEIGHTSEC)
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
if (e && e->XFloor.ffloors.Size())
|
||||||
|
{
|
||||||
|
// If any of these fake floors render their planes, ignore heightsec.
|
||||||
|
for (unsigned i = e->XFloor.ffloors.Size(); i-- > 0; )
|
||||||
|
{
|
||||||
|
if ((e->XFloor.ffloors[i]->flags & (FF_EXISTS | FF_RENDERPLANES)) == (FF_EXISTS | FF_RENDERPLANES))
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return heightsec;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool secplane_t::CopyPlaneIfValid (secplane_t *dest, const secplane_t *opp) const
|
bool secplane_t::CopyPlaneIfValid (secplane_t *dest, const secplane_t *opp) const
|
||||||
{
|
{
|
||||||
bool copy = false;
|
bool copy = false;
|
||||||
|
|
|
@ -439,6 +439,7 @@ struct sector_t
|
||||||
void ClosestPoint(fixed_t x, fixed_t y, fixed_t &ox, fixed_t &oy) const;
|
void ClosestPoint(fixed_t x, fixed_t y, fixed_t &ox, fixed_t &oy) const;
|
||||||
int GetFloorLight () const;
|
int GetFloorLight () const;
|
||||||
int GetCeilingLight () const;
|
int GetCeilingLight () const;
|
||||||
|
sector_t *GetHeightSec() const;
|
||||||
|
|
||||||
DInterpolation *SetInterpolation(int position, bool attach);
|
DInterpolation *SetInterpolation(int position, bool attach);
|
||||||
void StopInterpolation(int position);
|
void StopInterpolation(int position);
|
||||||
|
@ -600,14 +601,6 @@ struct sector_t
|
||||||
planes[pos].TexZ += val;
|
planes[pos].TexZ += val;
|
||||||
}
|
}
|
||||||
|
|
||||||
sector_t *GetHeightSec() const
|
|
||||||
{
|
|
||||||
return (heightsec &&
|
|
||||||
!(heightsec->MoreFlags & SECF_IGNOREHEIGHTSEC) &&
|
|
||||||
!(this->e && this->e->XFloor.ffloors.Size())
|
|
||||||
)? heightsec : NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline short ClampLight(int level)
|
static inline short ClampLight(int level)
|
||||||
{
|
{
|
||||||
return (short)clamp(level, SHRT_MIN, SHRT_MAX);
|
return (short)clamp(level, SHRT_MIN, SHRT_MAX);
|
||||||
|
|
Loading…
Reference in a new issue