SW: Replace MAXLONG with INT32_MAX

git-svn-id: https://svn.eduke32.com/eduke32@8281 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2019-11-08 04:22:58 +00:00 committed by Christoph Oelckers
parent f52a58d9ac
commit 125ec7ad2c
7 changed files with 21 additions and 21 deletions

View file

@ -597,7 +597,7 @@ int AutoBreakWall(WALLp wallp, int hit_x, int hit_y, int hit_z, short ang, short
// Check to see if it should break with current weapon type // Check to see if it should break with current weapon type
if (!CheckBreakToughness(break_info, type)) return FALSE; if (!CheckBreakToughness(break_info, type)) return FALSE;
if (hit_x != MAXLONG) if (hit_x != INT32_MAX)
{ {
vec3_t hit_pos = { hit_x, hit_y, hit_z }; vec3_t hit_pos = { hit_x, hit_y, hit_z };
// need correct location for spawning shrap // need correct location for spawning shrap
@ -811,7 +811,7 @@ int WallBreakPosition(short hit_wall, short *sectnum, int *x, int *y, int *z, sh
updatesectorz(*x,*y,*z,sectnum); updatesectorz(*x,*y,*z,sectnum);
if (*sectnum < 0) if (*sectnum < 0)
{ {
*x = MAXLONG; // don't spawn shrap, just change wall *x = INT32_MAX; // don't spawn shrap, just change wall
return FALSE; return FALSE;
} }
@ -830,7 +830,7 @@ SWBOOL HitBreakWall(WALLp wp, int hit_x, int hit_y, int hit_z, short ang, short
return TRUE; return TRUE;
} }
//if (hit_x == MAXLONG) //if (hit_x == INT32_MAX)
{ {
short sectnum; short sectnum;
WallBreakPosition(wp - wall, &sectnum, &hit_x, &hit_y, &hit_z, &ang); WallBreakPosition(wp - wall, &sectnum, &hit_x, &hit_y, &hit_z, &ang);

View file

@ -2269,7 +2269,7 @@ extern SWBOOL NightVision;
int _PlayerSound(const char *file, int line, int num, int *x, int *y, int *z, Voc3D_Flags flags, PLAYERp pp); int _PlayerSound(const char *file, int line, int num, int *x, int *y, int *z, Voc3D_Flags flags, PLAYERp pp);
#define PlayerSound(num, x, y, z, flags, pp) _PlayerSound(__FILE__, __LINE__, (num), (x), (y), (z), (flags), (pp)) #define PlayerSound(num, x, y, z, flags, pp) _PlayerSound(__FILE__, __LINE__, (num), (x), (y), (z), (flags), (pp))
#define MAXSO (MAXLONG) #define MAXSO (INT32_MAX)
/////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////
// //

View file

@ -47,7 +47,7 @@ DoSectorObjectSetScale(short match)
for (sop = SectorObject; sop < &SectorObject[MAX_SECTOR_OBJECTS]; sop++) for (sop = SectorObject; sop < &SectorObject[MAX_SECTOR_OBJECTS]; sop++)
{ {
if (sop->xmid == MAXLONG) if (sop->xmid == INT32_MAX)
continue; continue;
if (sop->match_event == match) if (sop->match_event == match)
@ -122,7 +122,7 @@ DoSOevent(short match, short state)
for (sop = SectorObject; sop < &SectorObject[MAX_SECTOR_OBJECTS]; sop++) for (sop = SectorObject; sop < &SectorObject[MAX_SECTOR_OBJECTS]; sop++)
{ {
if (sop->xmid == MAXLONG) if (sop->xmid == INT32_MAX)
continue; continue;
if (sop->match_event == match) if (sop->match_event == match)

View file

@ -496,7 +496,7 @@ SectorSetup(void)
SectorObject[ndx].Animator = NULL; SectorObject[ndx].Animator = NULL;
SectorObject[ndx].controller = NULL; SectorObject[ndx].controller = NULL;
SectorObject[ndx].sp_child = NULL; SectorObject[ndx].sp_child = NULL;
SectorObject[ndx].xmid = MAXLONG; SectorObject[ndx].xmid = INT32_MAX;
} }
memset(SineWaveFloor, -1, sizeof(SineWaveFloor)); memset(SineWaveFloor, -1, sizeof(SineWaveFloor));
@ -1451,7 +1451,7 @@ DoSectorObjectKillMatch(short match)
for (sop = SectorObject; sop < &SectorObject[MAX_SECTOR_OBJECTS]; sop++) for (sop = SectorObject; sop < &SectorObject[MAX_SECTOR_OBJECTS]; sop++)
{ {
if (sop->xmid == MAXLONG) if (sop->xmid == INT32_MAX)
continue; continue;
if (sop->match_event == match) if (sop->match_event == match)
@ -3419,7 +3419,7 @@ DoSector(void)
for (sop = SectorObject; sop < &SectorObject[MAX_SECTOR_OBJECTS]; sop++) for (sop = SectorObject; sop < &SectorObject[MAX_SECTOR_OBJECTS]; sop++)
{ {
if (sop->xmid == MAXLONG /*|| sop->xmid == MAXSO*/) if (sop->xmid == INT32_MAX /*|| sop->xmid == MAXSO*/)
continue; continue;

View file

@ -109,7 +109,7 @@ SOSync(void)
for (sop = SectorObject; sop < &SectorObject[MAX_SECTOR_OBJECTS]; sop++) for (sop = SectorObject; sop < &SectorObject[MAX_SECTOR_OBJECTS]; sop++)
{ {
// if (sop->xmid == MAXLONG) // if (sop->xmid == INT32_MAX)
// continue; // continue;
updatecrc(crc, (sop->xmid) & 255); updatecrc(crc, (sop->xmid) & 255);

View file

@ -1428,7 +1428,7 @@ PostSetupSectorObject(void)
for (sop = SectorObject; sop < &SectorObject[MAX_SECTOR_OBJECTS]; sop++) for (sop = SectorObject; sop < &SectorObject[MAX_SECTOR_OBJECTS]; sop++)
{ {
if (sop->xmid == MAXLONG) if (sop->xmid == INT32_MAX)
continue; continue;
FindMainSector(sop); FindMainSector(sop);
} }
@ -1442,7 +1442,7 @@ PlayerOnObject(short sectnum_match)
SECTOR_OBJECTp sop; SECTOR_OBJECTp sop;
// place each sector object on the track // place each sector object on the track
//for (i = 0; (SectorObject[i].xmid != MAXLONG) && (i < MAX_SECTOR_OBJECTS); i++) //for (i = 0; (SectorObject[i].xmid != INT32_MAX) && (i < MAX_SECTOR_OBJECTS); i++)
for (i = 0; (i < MAX_SECTOR_OBJECTS); i++) for (i = 0; (i < MAX_SECTOR_OBJECTS); i++)
{ {
sop = &SectorObject[i]; sop = &SectorObject[i];
@ -1477,7 +1477,7 @@ PlaceSectorObjectsOnTracks(void)
TRACK_POINTp tpoint = NULL; TRACK_POINTp tpoint = NULL;
short spnum, next_spnum; short spnum, next_spnum;
if (sop->xmid == MAXLONG) if (sop->xmid == INT32_MAX)
continue; continue;
@ -1693,14 +1693,14 @@ MovePoints(SECTOR_OBJECTp sop, short delta_ang, int nx, int ny)
short i, nexti, rot_ang; short i, nexti, rot_ang;
SWBOOL PlayerMove = TRUE; SWBOOL PlayerMove = TRUE;
if (sop->xmid >= (int)MAXSO) if (sop->xmid >= MAXSO)
PlayerMove = FALSE; PlayerMove = FALSE;
// move along little midpoint // move along little midpoint
sop->xmid += BOUND_4PIX(nx); sop->xmid += BOUND_4PIX(nx);
sop->ymid += BOUND_4PIX(ny); sop->ymid += BOUND_4PIX(ny);
if (sop->xmid >= (int)MAXSO) if (sop->xmid >= MAXSO)
PlayerMove = FALSE; PlayerMove = FALSE;
// move child sprite along also // move child sprite along also
@ -1882,7 +1882,7 @@ PlayerPart:
// Does not necessarily move with the sector so must accout for // Does not necessarily move with the sector so must accout for
// moving across sectors // moving across sectors
if (sop->xmid < (int)MAXSO) // special case for operating SO's if (sop->xmid < MAXSO) // special case for operating SO's
setspritez(sop->sp_num[i], (vec3_t *)sp); setspritez(sop->sp_num[i], (vec3_t *)sp);
} }
@ -1902,7 +1902,7 @@ PlayerPart:
// update here AFTER sectors/player has been manipulated // update here AFTER sectors/player has been manipulated
// prevents you from falling into map HOLEs created by moving // prevents you from falling into map HOLEs created by moving
// Sectors and sprites around. // Sectors and sprites around.
//if (sop->xmid < (int)MAXSO) //if (sop->xmid < MAXSO)
COVERupdatesector(pp->posx, pp->posy, &pp->cursectnum); COVERupdatesector(pp->posx, pp->posy, &pp->cursectnum);
// in case you are in a whirlpool // in case you are in a whirlpool
@ -2077,7 +2077,7 @@ DetectSectorObject(SECTORp sectph)
// move all points to nx,ny // move all points to nx,ny
for (sop = SectorObject; sop < &SectorObject[MAX_SECTOR_OBJECTS]; sop++) for (sop = SectorObject; sop < &SectorObject[MAX_SECTOR_OBJECTS]; sop++)
{ {
if (sop->xmid == MAXLONG /*|| sop->xmid == MAXSO*/) if (sop->xmid == INT32_MAX /*|| sop->xmid == MAXSO*/)
continue; continue;
for (sectp = sop->sectp, j = 0; *sectp; sectp++, j++) for (sectp = sop->sectp, j = 0; *sectp; sectp++, j++)
@ -2105,7 +2105,7 @@ DetectSectorObjectByWall(WALLp wph)
// move all points to nx,ny // move all points to nx,ny
for (sop = SectorObject; sop < &SectorObject[MAX_SECTOR_OBJECTS]; sop++) for (sop = SectorObject; sop < &SectorObject[MAX_SECTOR_OBJECTS]; sop++)
{ {
if (sop->xmid == MAXLONG /*|| sop->xmid == MAXSO*/) if (sop->xmid == INT32_MAX /*|| sop->xmid == MAXSO*/)
continue; continue;
for (sectp = sop->sectp, j = 0; *sectp; sectp++, j++) for (sectp = sop->sectp, j = 0; *sectp; sectp++, j++)

View file

@ -7762,10 +7762,10 @@ void TraverseBreakableWalls(short start_sect, int x, int y, int z, short ang, in
if (WallBreakPosition(j, &sectnum, &hit_x, &hit_y, &hit_z, &wall_ang)) if (WallBreakPosition(j, &sectnum, &hit_x, &hit_y, &hit_z, &wall_ang))
{ {
if (hit_x != MAXLONG && sectnum >= 0 && FAFcansee(x, y, z, start_sect, hit_x, hit_y, hit_z, sectnum)) if (hit_x != INT32_MAX && sectnum >= 0 && FAFcansee(x, y, z, start_sect, hit_x, hit_y, hit_z, sectnum))
{ {
//HitBreakWall(&wall[j], x, y, z, ang, 0); //HitBreakWall(&wall[j], x, y, z, ang, 0);
HitBreakWall(&wall[j], MAXLONG, MAXLONG, MAXLONG, ang, 0); HitBreakWall(&wall[j], INT32_MAX, INT32_MAX, INT32_MAX, ang, 0);
break_count++; break_count++;
if (break_count > 4) if (break_count > 4)