mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-10 23:01:59 +00:00
- give line_t a GetLevel function.
The portal getters need this, even though currently it only gets the global level.
This commit is contained in:
parent
3cef56249d
commit
f4081c33a6
2 changed files with 10 additions and 5 deletions
|
@ -473,31 +473,35 @@ inline bool sector_t::PortalIsLinked(int plane)
|
||||||
return (GetPortalType(plane) == PORTS_LINKEDPORTAL);
|
return (GetPortalType(plane) == PORTS_LINKEDPORTAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline FLevelLocals *line_t::GetLevel() const
|
||||||
|
{
|
||||||
|
return &level;
|
||||||
|
}
|
||||||
inline FLinePortal *line_t::getPortal() const
|
inline FLinePortal *line_t::getPortal() const
|
||||||
{
|
{
|
||||||
return portalindex >= level.linePortals.Size() ? (FLinePortal*)NULL : &level.linePortals[portalindex];
|
return portalindex >= GetLevel()->linePortals.Size() ? (FLinePortal*)nullptr : &GetLevel()->linePortals[portalindex];
|
||||||
}
|
}
|
||||||
|
|
||||||
// returns true if the portal is crossable by actors
|
// returns true if the portal is crossable by actors
|
||||||
inline bool line_t::isLinePortal() const
|
inline bool line_t::isLinePortal() const
|
||||||
{
|
{
|
||||||
return portalindex >= level.linePortals.Size() ? false : !!(level.linePortals[portalindex].mFlags & PORTF_PASSABLE);
|
return portalindex >= GetLevel()->linePortals.Size() ? false : !!(GetLevel()->linePortals[portalindex].mFlags & PORTF_PASSABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// returns true if the portal needs to be handled by the renderer
|
// returns true if the portal needs to be handled by the renderer
|
||||||
inline bool line_t::isVisualPortal() const
|
inline bool line_t::isVisualPortal() const
|
||||||
{
|
{
|
||||||
return portalindex >= level.linePortals.Size() ? false : !!(level.linePortals[portalindex].mFlags & PORTF_VISIBLE);
|
return portalindex >= GetLevel()->linePortals.Size() ? false : !!(GetLevel()->linePortals[portalindex].mFlags & PORTF_VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline line_t *line_t::getPortalDestination() const
|
inline line_t *line_t::getPortalDestination() const
|
||||||
{
|
{
|
||||||
return portalindex >= level.linePortals.Size() ? (line_t*)NULL : level.linePortals[portalindex].mDestination;
|
return portalindex >= GetLevel()->linePortals.Size() ? (line_t*)nullptr : GetLevel()->linePortals[portalindex].mDestination;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int line_t::getPortalAlignment() const
|
inline int line_t::getPortalAlignment() const
|
||||||
{
|
{
|
||||||
return portalindex >= level.linePortals.Size() ? 0 : level.linePortals[portalindex].mAlign;
|
return portalindex >= GetLevel()->linePortals.Size() ? 0 : GetLevel()->linePortals[portalindex].mAlign;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool line_t::hitSkyWall(AActor* mo) const
|
inline bool line_t::hitSkyWall(AActor* mo) const
|
||||||
|
|
|
@ -1408,6 +1408,7 @@ struct line_t
|
||||||
FSectorPortal *GetTransferredPortal();
|
FSectorPortal *GetTransferredPortal();
|
||||||
void AdjustLine();
|
void AdjustLine();
|
||||||
|
|
||||||
|
inline FLevelLocals *GetLevel() const;
|
||||||
inline FLinePortal *getPortal() const;
|
inline FLinePortal *getPortal() const;
|
||||||
inline bool isLinePortal() const;
|
inline bool isLinePortal() const;
|
||||||
inline bool isVisualPortal() const;
|
inline bool isVisualPortal() const;
|
||||||
|
|
Loading…
Reference in a new issue