mirror of
https://github.com/DrBeef/Raze.git
synced 2025-02-20 18:52:43 +00:00
- new access methods for spritetype and DDukeActor.
This commit is contained in:
parent
16bdea1b2e
commit
2979fb9e03
2 changed files with 39 additions and 29 deletions
|
@ -152,35 +152,6 @@ extern TArray<walltype> wall;
|
|||
extern spritetype sprite[MAXSPRITES];
|
||||
EXTERN int leveltimer;
|
||||
|
||||
inline sectortype* spritetype::sector() const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
return sectnum < 0? nullptr : &::sector[sectnum];
|
||||
#else
|
||||
return &::sector[sectnum];
|
||||
#endif
|
||||
}
|
||||
|
||||
inline sectortype* walltype::nextSector() const
|
||||
{
|
||||
return &::sector[nextsector];
|
||||
}
|
||||
|
||||
inline walltype* walltype::nextWall() const
|
||||
{
|
||||
return &::wall[nextwall];
|
||||
}
|
||||
|
||||
inline walltype* walltype::point2Wall() const
|
||||
{
|
||||
return &::wall[point2];
|
||||
}
|
||||
|
||||
inline walltype* sectortype::firstWall() const
|
||||
{
|
||||
return &wall[wallptr];
|
||||
}
|
||||
|
||||
|
||||
extern TArray<sectortype> sectorbackup;
|
||||
extern TArray<walltype> wallbackup;
|
||||
|
@ -223,6 +194,40 @@ inline bool validWallIndex(int wallnum)
|
|||
return wallnum >= 0 && wallnum < numwalls;
|
||||
}
|
||||
|
||||
inline sectortype* spritetype::sector() const
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
return !validSectorIndex(sectnum) ? nullptr : &::sector[sectnum];
|
||||
#else
|
||||
return &::sector[sectnum];
|
||||
#endif
|
||||
}
|
||||
|
||||
inline bool spritetype::insector() const
|
||||
{
|
||||
return validSectorIndex(sectnum);
|
||||
}
|
||||
|
||||
inline sectortype* walltype::nextSector() const
|
||||
{
|
||||
return &::sector[nextsector];
|
||||
}
|
||||
|
||||
inline walltype* walltype::nextWall() const
|
||||
{
|
||||
return &::wall[nextwall];
|
||||
}
|
||||
|
||||
inline walltype* walltype::point2Wall() const
|
||||
{
|
||||
return &::wall[point2];
|
||||
}
|
||||
|
||||
inline walltype* sectortype::firstWall() const
|
||||
{
|
||||
return &wall[wallptr];
|
||||
}
|
||||
|
||||
EXTERN int32_t randomseed;
|
||||
|
||||
EXTERN uint8_t paletteloaded;
|
||||
|
|
|
@ -101,6 +101,11 @@ struct DDukeActor
|
|||
return s->sector();
|
||||
}
|
||||
|
||||
bool insector() const
|
||||
{
|
||||
return s->insector();
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
extern DDukeActor hittype[MAXSPRITES + 1];
|
||||
|
|
Loading…
Reference in a new issue