mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 23:02:03 +00:00
SW: Add the macro SO_EMPTY and use it instead of
separate checks of the form sop->xmid == INT32_MAX
This commit is contained in:
parent
d510b9b95a
commit
37c3f1cc46
5 changed files with 15 additions and 13 deletions
|
@ -2152,6 +2152,8 @@ struct SECTOR_OBJECTstruct
|
|||
#define SO_TANK 98
|
||||
#define SO_SPEED_BOAT 99
|
||||
|
||||
#define SO_EMPTY(sop) ((sop)->xmid == INT32_MAX)
|
||||
|
||||
extern SECTOR_OBJECT SectorObject[MAX_SECTOR_OBJECTS];
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -202,7 +202,7 @@ void so_updateinterpolations(void) // Stick at beginning of domovethings
|
|||
for (sop = SectorObject, interp = so_interpdata;
|
||||
sop < &SectorObject[MAX_SECTOR_OBJECTS]; sop++, interp++)
|
||||
{
|
||||
if (sop->xmid == INT32_MAX /*|| sop->xmid == MAXSO*/)
|
||||
if (SO_EMPTY(sop))
|
||||
continue;
|
||||
if (interp->tic < interp->lasttic)
|
||||
interp->tic += synctics;
|
||||
|
@ -240,7 +240,7 @@ void so_dointerpolations(int32_t smoothratio) // Stick at b
|
|||
for (sop = SectorObject, interp = so_interpdata;
|
||||
sop < &SectorObject[MAX_SECTOR_OBJECTS]; sop++, interp++)
|
||||
{
|
||||
if (sop->xmid == INT32_MAX /*|| sop->xmid == MAXSO*/)
|
||||
if (SO_EMPTY(sop))
|
||||
continue;
|
||||
|
||||
for (i = 0; i < interp->numinterpolations; i++)
|
||||
|
@ -266,7 +266,7 @@ void so_dointerpolations(int32_t smoothratio) // Stick at b
|
|||
for (sop = SectorObject, interp = so_interpdata;
|
||||
sop < &SectorObject[MAX_SECTOR_OBJECTS]; sop++, interp++)
|
||||
{
|
||||
if (sop->xmid == INT32_MAX /*|| sop->xmid == MAXSO*/)
|
||||
if (SO_EMPTY(sop))
|
||||
continue;
|
||||
|
||||
// Unfortunately, interpolating over less samples doesn't work well
|
||||
|
@ -305,7 +305,7 @@ void so_restoreinterpolations(void) // Stick at end of drawscree
|
|||
for (sop = SectorObject, interp = so_interpdata;
|
||||
sop < &SectorObject[MAX_SECTOR_OBJECTS]; sop++, interp++)
|
||||
{
|
||||
if (sop->xmid == INT32_MAX /*|| sop->xmid == MAXSO*/)
|
||||
if (SO_EMPTY(sop))
|
||||
continue;
|
||||
|
||||
for (i = 0, data = interp->data; i < interp->numinterpolations; i++, data++)
|
||||
|
|
|
@ -47,7 +47,7 @@ DoSectorObjectSetScale(short match)
|
|||
|
||||
for (sop = SectorObject; sop < &SectorObject[MAX_SECTOR_OBJECTS]; sop++)
|
||||
{
|
||||
if (sop->xmid == INT32_MAX)
|
||||
if (SO_EMPTY(sop))
|
||||
continue;
|
||||
|
||||
if (sop->match_event == match)
|
||||
|
@ -122,7 +122,7 @@ DoSOevent(short match, short state)
|
|||
|
||||
for (sop = SectorObject; sop < &SectorObject[MAX_SECTOR_OBJECTS]; sop++)
|
||||
{
|
||||
if (sop->xmid == INT32_MAX)
|
||||
if (SO_EMPTY(sop))
|
||||
continue;
|
||||
|
||||
if (sop->match_event == match)
|
||||
|
|
|
@ -1346,7 +1346,7 @@ DoSectorObjectKillMatch(short match)
|
|||
|
||||
for (sop = SectorObject; sop < &SectorObject[MAX_SECTOR_OBJECTS]; sop++)
|
||||
{
|
||||
if (sop->xmid == INT32_MAX)
|
||||
if (SO_EMPTY(sop))
|
||||
continue;
|
||||
|
||||
if (sop->match_event == match)
|
||||
|
@ -3314,7 +3314,7 @@ DoSector(void)
|
|||
for (sop = SectorObject; sop < &SectorObject[MAX_SECTOR_OBJECTS]; sop++)
|
||||
{
|
||||
|
||||
if (sop->xmid == INT32_MAX /*|| sop->xmid == MAXSO*/)
|
||||
if (SO_EMPTY(sop))
|
||||
continue;
|
||||
|
||||
|
||||
|
|
|
@ -1428,7 +1428,7 @@ PostSetupSectorObject(void)
|
|||
|
||||
for (sop = SectorObject; sop < &SectorObject[MAX_SECTOR_OBJECTS]; sop++)
|
||||
{
|
||||
if (sop->xmid == INT32_MAX)
|
||||
if (SO_EMPTY(sop))
|
||||
continue;
|
||||
FindMainSector(sop);
|
||||
}
|
||||
|
@ -1442,7 +1442,7 @@ PlayerOnObject(short sectnum_match)
|
|||
SECTOR_OBJECTp sop;
|
||||
|
||||
// place each sector object on the track
|
||||
//for (i = 0; (SectorObject[i].xmid != INT32_MAX) && (i < MAX_SECTOR_OBJECTS); i++)
|
||||
//for (i = 0; !SO_EMPTY(&SectorObject[i]) && (i < MAX_SECTOR_OBJECTS); i++)
|
||||
for (i = 0; (i < MAX_SECTOR_OBJECTS); i++)
|
||||
{
|
||||
sop = &SectorObject[i];
|
||||
|
@ -1476,7 +1476,7 @@ PlaceSectorObjectsOnTracks(void)
|
|||
SECTOR_OBJECTp sop = &SectorObject[i];
|
||||
TRACK_POINTp tpoint = NULL;
|
||||
|
||||
if (sop->xmid == INT32_MAX)
|
||||
if (SO_EMPTY(sop))
|
||||
continue;
|
||||
|
||||
|
||||
|
@ -2095,7 +2095,7 @@ DetectSectorObject(SECTORp sectph)
|
|||
// move all points to nx,ny
|
||||
for (sop = SectorObject; sop < &SectorObject[MAX_SECTOR_OBJECTS]; sop++)
|
||||
{
|
||||
if (sop->xmid == INT32_MAX /*|| sop->xmid == MAXSO*/)
|
||||
if (SO_EMPTY(sop))
|
||||
continue;
|
||||
|
||||
for (sectp = sop->sectp, j = 0; *sectp; sectp++, j++)
|
||||
|
@ -2123,7 +2123,7 @@ DetectSectorObjectByWall(WALLp wph)
|
|||
// move all points to nx,ny
|
||||
for (sop = SectorObject; sop < &SectorObject[MAX_SECTOR_OBJECTS]; sop++)
|
||||
{
|
||||
if (sop->xmid == INT32_MAX /*|| sop->xmid == MAXSO*/)
|
||||
if (SO_EMPTY(sop))
|
||||
continue;
|
||||
|
||||
for (sectp = sop->sectp, j = 0; *sectp; sectp++, j++)
|
||||
|
|
Loading…
Reference in a new issue