mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-12-01 16:41:22 +00:00
- reduced number of references to r_viewpoint in hw_fakeflat.cpp
This commit is contained in:
parent
18f43dea1e
commit
3eb4b137f3
1 changed files with 6 additions and 5 deletions
|
@ -392,15 +392,16 @@ sector_t * hw_FakeFlat(sector_t * sec, sector_t * dest, area_t in_area, bool bac
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void HWDrawInfo::SetViewArea()
|
void HWDrawInfo::SetViewArea()
|
||||||
{
|
{
|
||||||
|
auto &vp = r_viewpoint;
|
||||||
// The render_sector is better suited to represent the current position in GL
|
// The render_sector is better suited to represent the current position in GL
|
||||||
r_viewpoint.sector = R_PointInSubsector(r_viewpoint.Pos)->render_sector;
|
vp.sector = R_PointInSubsector(vp.Pos)->render_sector;
|
||||||
|
|
||||||
// Get the heightsec state from the render sector, not the current one!
|
// Get the heightsec state from the render sector, not the current one!
|
||||||
if (r_viewpoint.sector->GetHeightSec())
|
if (vp.sector->GetHeightSec())
|
||||||
{
|
{
|
||||||
in_area = r_viewpoint.Pos.Z <= r_viewpoint.sector->heightsec->floorplane.ZatPoint(r_viewpoint.Pos) ? area_below :
|
in_area = vp.Pos.Z <= vp.sector->heightsec->floorplane.ZatPoint(vp.Pos) ? area_below :
|
||||||
(r_viewpoint.Pos.Z > r_viewpoint.sector->heightsec->ceilingplane.ZatPoint(r_viewpoint.Pos) &&
|
(vp.Pos.Z > vp.sector->heightsec->ceilingplane.ZatPoint(vp.Pos) &&
|
||||||
!(r_viewpoint.sector->heightsec->MoreFlags&SECMF_FAKEFLOORONLY)) ? area_above : area_normal;
|
!(vp.sector->heightsec->MoreFlags&SECMF_FAKEFLOORONLY)) ? area_above : area_normal;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue