diff options
author | Simon Howard | 2008-09-17 01:05:14 +0000 |
---|---|---|
committer | Simon Howard | 2008-09-17 01:05:14 +0000 |
commit | 55bb7e8935369cb392c705969ed626fe9c0c391c (patch) | |
tree | 8a7428c5504b089e19625d3657e75f9a8c0f2839 /src/hexen | |
parent | 61e77600041ba534d824943320e7ddddb8e4f6ce (diff) | |
download | chocolate-doom-55bb7e8935369cb392c705969ed626fe9c0c391c.tar.gz chocolate-doom-55bb7e8935369cb392c705969ed626fe9c0c391c.tar.bz2 chocolate-doom-55bb7e8935369cb392c705969ed626fe9c0c391c.zip |
Convert MAXINT/MININT -> INT_MAX/INT_MIN in Heretic/Hexen code.
Subversion-branch: /branches/raven-branch
Subversion-revision: 1234
Diffstat (limited to 'src/hexen')
-rw-r--r-- | src/hexen/am_map.c | 18 | ||||
-rw-r--r-- | src/hexen/d_net.c | 4 | ||||
-rw-r--r-- | src/hexen/h2_main.c | 2 | ||||
-rw-r--r-- | src/hexen/h2def.h | 12 | ||||
-rw-r--r-- | src/hexen/info.c | 20 | ||||
-rw-r--r-- | src/hexen/m_misc.c | 4 | ||||
-rw-r--r-- | src/hexen/p_local.h | 8 | ||||
-rw-r--r-- | src/hexen/p_map.c | 2 | ||||
-rw-r--r-- | src/hexen/p_maputl.c | 4 | ||||
-rw-r--r-- | src/hexen/p_sight.c | 4 | ||||
-rw-r--r-- | src/hexen/p_spec.c | 2 | ||||
-rw-r--r-- | src/hexen/r_main.c | 2 | ||||
-rw-r--r-- | src/hexen/r_segs.c | 20 | ||||
-rw-r--r-- | src/hexen/r_things.c | 2 |
14 files changed, 48 insertions, 56 deletions
diff --git a/src/hexen/am_map.c b/src/hexen/am_map.c index be16a8ac..6678f325 100644 --- a/src/hexen/am_map.c +++ b/src/hexen/am_map.c @@ -126,9 +126,9 @@ void AM_getIslope(mline_t *ml, islope_t *is) dy = ml->a.y - ml->b.y; dx = ml->b.x - ml->a.x; - if (!dy) is->islp = (dx<0?-MAXINT:MAXINT); + if (!dy) is->islp = (dx<0?-INT_MAX:INT_MAX); else is->islp = FixedDiv(dx, dy); - if (!dx) is->slp = (dy<0?-MAXINT:MAXINT); + if (!dx) is->slp = (dy<0?-INT_MAX:INT_MAX); else is->slp = FixedDiv(dy, dx); } */ @@ -192,8 +192,8 @@ void AM_findMinMaxBoundaries(void) int i; fixed_t a, b; - min_x = min_y = MAXINT; - max_x = max_y = -MAXINT; + min_x = min_y = INT_MAX; + max_x = max_y = -INT_MAX; for (i = 0; i < numvertexes; i++) { if (vertexes[i].x < min_x) @@ -223,7 +223,7 @@ void AM_changeWindowLoc(void) if (m_paninc.x || m_paninc.y) { followplayer = 0; - f_oldloc.x = MAXINT; + f_oldloc.x = INT_MAX; } m_x += m_paninc.x; @@ -276,7 +276,7 @@ void AM_initVariables(void) automapactive = true; fb = screen; - f_oldloc.x = MAXINT; + f_oldloc.x = INT_MAX; amclock = 0; lightlev = 0; @@ -487,7 +487,7 @@ boolean AM_Responder(event_t * ev) break; case AM_FOLLOWKEY: followplayer = !followplayer; - f_oldloc.x = MAXINT; + f_oldloc.x = INT_MAX; P_SetMessage(plr, followplayer ? AMSTR_FOLLOWON : AMSTR_FOLLOWOFF, true); @@ -576,7 +576,7 @@ void AM_doFollowPlayer(void) dmapx = (MTOF(plr->mo->x)-MTOF(f_oldloc.x)); //fixed point dmapy = (MTOF(f_oldloc.y)-MTOF(plr->mo->y)); - if(f_oldloc.x == MAXINT) //to eliminate an error when the user first + if(f_oldloc.x == INT_MAX) //to eliminate an error when the user first dmapx=0; //goes into the automap. mapxstart += dmapx; mapystart += dmapy; @@ -650,7 +650,7 @@ void AM_clearFB(int color) oldplr.x = plr->mo->x; oldplr.y = plr->mo->y; -// if(f_oldloc.x == MAXINT) //to eliminate an error when the user first +// if(f_oldloc.x == INT_MAX) //to eliminate an error when the user first // dmapx=0; //goes into the automap. mapxstart += dmapx >> 1; mapystart += dmapy >> 1; diff --git a/src/hexen/d_net.c b/src/hexen/d_net.c index f7381d4e..7527d7f6 100644 --- a/src/hexen/d_net.c +++ b/src/hexen/d_net.c @@ -823,7 +823,7 @@ void TryRunTics(void) // NetUpdate(); - lowtic = MAXINT; + lowtic = INT_MAX; numplaying = 0; for (i = 0; i < doomcom->numnodes; i++) if (nodeingame[i]) @@ -891,7 +891,7 @@ void TryRunTics(void) { NetUpdate(); - lowtic = MAXINT; + lowtic = INT_MAX; for (i = 0; i < doomcom->numnodes; i++) if (nodeingame[i] && nettics[i] < lowtic) diff --git a/src/hexen/h2_main.c b/src/hexen/h2_main.c index 60ae9f64..3518ea37 100644 --- a/src/hexen/h2_main.c +++ b/src/hexen/h2_main.c @@ -844,7 +844,7 @@ fixed_t FixedDiv(fixed_t a, fixed_t b) { if ((abs(a) >> 14) >= abs(b)) { - return ((a ^ b) < 0 ? MININT : MAXINT); + return ((a ^ b) < 0 ? INT_MIN : INT_MAX); } return (FixedDiv2(a, b)); } diff --git a/src/hexen/h2def.h b/src/hexen/h2def.h index 6a4a3a89..61e0fc70 100644 --- a/src/hexen/h2def.h +++ b/src/hexen/h2def.h @@ -27,6 +27,8 @@ #include <stdio.h> #include <string.h> #include <stdlib.h> +#include <values.h> + #include "st_start.h" #ifdef __WATCOMC__ #include <malloc.h> @@ -118,16 +120,6 @@ extern byte *destview, *destscreen; // PC direct to screen pointers #define KEY_BACKSLASH 0x5C -#define MAXCHAR ((char)0x7f) -#define MAXSHORT ((short)0x7fff) -#define MAXINT ((int)0x7fffffff) /* max pos 32-bit int */ -#define MAXLONG ((long)0x7fffffff) - -#define MINCHAR ((char)0x80) -#define MINSHORT ((short)0x8000) -#define MININT ((int)0x80000000) /* max negative 32-bit integer */ -#define MINLONG ((long)0x80000000) - #define FINEANGLES 8192 #define FINEMASK (FINEANGLES-1) #define ANGLETOFINESHIFT 19 // 0x100000000 to 0x2000 diff --git a/src/hexen/info.c b/src/hexen/info.c index ac050dcf..aa4621d4 100644 --- a/src/hexen/info.c +++ b/src/hexen/info.c @@ -5288,7 +5288,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = { 0, // speed 1, // radius 1, // height - MAXINT, // mass + INT_MAX, // mass 0, // damage SFX_NONE, // activesound MF_NOGRAVITY | MF_NOBLOCKMAP | MF_SHADOW | MF_NOCLIP | MF_DROPOFF, // flags @@ -5882,7 +5882,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = { 0, // speed 15 * FRACUNIT, // radius 180 * FRACUNIT, // height - MAXINT, // mass + INT_MAX, // mass 0, // damage SFX_NONE, // activesound MF_SOLID | MF_SHOOTABLE | MF_NOBLOOD, // flags @@ -8312,7 +8312,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = { 0, // speed 8 * FRACUNIT, // radius 24 * FRACUNIT, // height - MAXINT, // mass + INT_MAX, // mass 0, // damage SFX_NONE, // activesound MF_SOLID | MF_SHOOTABLE | MF_NOBLOOD, // flags @@ -8339,7 +8339,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = { 0, // speed 16 * FRACUNIT, // radius 40 * FRACUNIT, // height - MAXINT, // mass + INT_MAX, // mass 0, // damage SFX_NONE, // activesound MF_SOLID | MF_SHOOTABLE | MF_NOBLOOD, // flags @@ -8393,7 +8393,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = { 0, // speed 6 * FRACUNIT, // radius 20 * FRACUNIT, // height - MAXINT, // mass + INT_MAX, // mass 0, // damage SFX_NONE, // activesound MF_SHOOTABLE | MF_SOLID | MF_NOBLOOD, // flags @@ -8528,7 +8528,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = { 0, // speed 16 * FRACUNIT, // radius 72 * FRACUNIT, // height - MAXINT, // mass + INT_MAX, // mass 0, // damage SFX_NONE, // activesound MF_SOLID | MF_SHOOTABLE | MF_NOBLOOD, // flags @@ -8582,7 +8582,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = { 0, // speed 56 * FRACUNIT, // radius 120 * FRACUNIT, // height - MAXINT, // mass + INT_MAX, // mass 0, // damage SFX_NONE, // activesound MF_SOLID | MF_SHOOTABLE | MF_NOBLOOD | MF_NOGRAVITY | MF_SPAWNCEILING, // flags @@ -8663,7 +8663,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = { 0, // speed 11 * FRACUNIT, // radius 130 * FRACUNIT, // height - MAXINT, // mass + INT_MAX, // mass 0, // damage SFX_NONE, // activesound MF_SOLID | MF_SHOOTABLE | MF_NOBLOOD, // flags @@ -11660,7 +11660,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = { 12, // speed 32 * FRACUNIT, // radius 70 * FRACUNIT, // height - MAXINT, // mass + INT_MAX, // mass 0, // damage SFX_NONE, // activesound MF_SOLID | MF_COUNTKILL | MF_NOBLOOD, // flags @@ -11984,7 +11984,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = { 10 * FRACUNIT, // speed 20 * FRACUNIT, // radius 65 * FRACUNIT, // height - MAXINT, // mass + INT_MAX, // mass 0, // damage SFX_DRAGON_ACTIVE, // activesound MF_SOLID | MF_SHOOTABLE | MF_COUNTKILL | MF_FLOAT | MF_NOGRAVITY | MF_NOBLOOD, // flags diff --git a/src/hexen/m_misc.c b/src/hexen/m_misc.c index c493b23f..6955cfb8 100644 --- a/src/hexen/m_misc.c +++ b/src/hexen/m_misc.c @@ -188,8 +188,8 @@ void M_ClearRandom(void) void M_ClearBox(fixed_t * box) { - box[BOXTOP] = box[BOXRIGHT] = MININT; - box[BOXBOTTOM] = box[BOXLEFT] = MAXINT; + box[BOXTOP] = box[BOXRIGHT] = INT_MIN; + box[BOXBOTTOM] = box[BOXLEFT] = INT_MAX; } void M_AddToBox(fixed_t * box, fixed_t x, fixed_t y) diff --git a/src/hexen/p_local.h b/src/hexen/p_local.h index 55f5e72a..b9e6c5dc 100644 --- a/src/hexen/p_local.h +++ b/src/hexen/p_local.h @@ -135,10 +135,10 @@ enum FLOOR_SLUDGE }; -#define ONFLOORZ MININT -#define ONCEILINGZ MAXINT -#define FLOATRANDZ (MAXINT-1) -#define FROMCEILINGZ128 (MAXINT-2) +#define ONFLOORZ INT_MIN +#define ONCEILINGZ INT_MAX +#define FLOATRANDZ (INT_MAX-1) +#define FROMCEILINGZ128 (INT_MAX-2) extern mobjtype_t PuffType; extern mobj_t *MissileMobj; diff --git a/src/hexen/p_map.c b/src/hexen/p_map.c index 5078b340..27c8386f 100644 --- a/src/hexen/p_map.c +++ b/src/hexen/p_map.c @@ -505,7 +505,7 @@ boolean PIT_CheckThing(mobj_t * thing) { if (thing->flags & MF_SHOOTABLE && thing != tmthing->target) { - if (thing->info->mass != MAXINT) + if (thing->info->mass != INT_MAX) { thing->momx += tmthing->momx >> 4; thing->momy += tmthing->momy >> 4; diff --git a/src/hexen/p_maputl.c b/src/hexen/p_maputl.c index 762b9dbf..3c92717c 100644 --- a/src/hexen/p_maputl.c +++ b/src/hexen/p_maputl.c @@ -653,7 +653,7 @@ boolean P_TraverseIntercepts(traverser_t func, fixed_t maxfrac) while (count--) { - dist = MAXINT; + dist = INT_MAX; for (scan = intercepts; scan < intercept_p; scan++) if (scan->frac < dist) { @@ -676,7 +676,7 @@ boolean P_TraverseIntercepts(traverser_t func, fixed_t maxfrac) if (!func(in)) return false; // don't bother going farther - in->frac = MAXINT; + in->frac = INT_MAX; } return true; // everything was traversed diff --git a/src/hexen/p_sight.c b/src/hexen/p_sight.c index a2377bde..423c26de 100644 --- a/src/hexen/p_sight.c +++ b/src/hexen/p_sight.c @@ -215,7 +215,7 @@ boolean P_SightTraverseIntercepts(void) while (count--) { - dist = MAXINT; + dist = INT_MAX; for (scan = intercepts; scan < intercept_p; scan++) if (scan->frac < dist) { @@ -225,7 +225,7 @@ boolean P_SightTraverseIntercepts(void) if (!PTR_SightTraverse(in)) return false; // don't bother going farther - in->frac = MAXINT; + in->frac = INT_MAX; } return true; // everything was traversed diff --git a/src/hexen/p_spec.c b/src/hexen/p_spec.c index 44c9c713..f7a820ca 100644 --- a/src/hexen/p_spec.c +++ b/src/hexen/p_spec.c @@ -274,7 +274,7 @@ fixed_t P_FindLowestCeilingSurrounding(sector_t * sec) int i; line_t *check; sector_t *other; - fixed_t height = MAXINT; + fixed_t height = INT_MAX; for (i = 0; i < sec->linecount; i++) { diff --git a/src/hexen/r_main.c b/src/hexen/r_main.c index 066f5579..d61b5114 100644 --- a/src/hexen/r_main.c +++ b/src/hexen/r_main.c @@ -67,7 +67,7 @@ int viewangletox[FINEANGLES / 2]; angle_t xtoviewangle[SCREENWIDTH + 1]; // the finetangentgent[angle+FINEANGLES/4] table holds the fixed_t tangent -// values for view angles, ranging from MININT to 0 to MAXINT. +// values for view angles, ranging from INT_MIN to 0 to INT_MAX. // fixed_t finetangent[FINEANGLES/2]; // fixed_t finesine[5*FINEANGLES/4]; diff --git a/src/hexen/r_segs.c b/src/hexen/r_segs.c index ac7c1934..4eef6040 100644 --- a/src/hexen/r_segs.c +++ b/src/hexen/r_segs.c @@ -131,7 +131,7 @@ void R_RenderMaskedSegRange(drawseg_t * ds, int x1, int x2) for (dc_x = x1; dc_x <= x2; dc_x++) { // calculate lighting - if (maskedtexturecol[dc_x] != MAXSHORT) + if (maskedtexturecol[dc_x] != SHRT_MAX) { if (!fixedcolormap) { @@ -152,7 +152,7 @@ void R_RenderMaskedSegRange(drawseg_t * ds, int x1, int x2) maskedtexturecol[dc_x]) - 3); R_DrawMaskedColumn(col, -1); - maskedtexturecol[dc_x] = MAXSHORT; + maskedtexturecol[dc_x] = SHRT_MAX; } spryscale += rw_scalestep; } @@ -435,8 +435,8 @@ void R_StoreWallRange(int start, int stop) ds_p->silhouette = SIL_BOTH; ds_p->sprtopclip = screenheightarray; ds_p->sprbottomclip = negonearray; - ds_p->bsilheight = MAXINT; - ds_p->tsilheight = MININT; + ds_p->bsilheight = INT_MAX; + ds_p->tsilheight = INT_MIN; } else { @@ -453,7 +453,7 @@ void R_StoreWallRange(int start, int stop) else if (backsector->floorheight > viewz) { ds_p->silhouette = SIL_BOTTOM; - ds_p->bsilheight = MAXINT; + ds_p->bsilheight = INT_MAX; // ds_p->sprbottomclip = negonearray; } if (frontsector->ceilingheight < backsector->ceilingheight) @@ -464,20 +464,20 @@ void R_StoreWallRange(int start, int stop) else if (backsector->ceilingheight < viewz) { ds_p->silhouette |= SIL_TOP; - ds_p->tsilheight = MININT; + ds_p->tsilheight = INT_MIN; // ds_p->sprtopclip = screenheightarray; } if (backsector->ceilingheight <= frontsector->floorheight) { ds_p->sprbottomclip = negonearray; - ds_p->bsilheight = MAXINT; + ds_p->bsilheight = INT_MAX; ds_p->silhouette |= SIL_BOTTOM; } if (backsector->floorheight >= frontsector->ceilingheight) { ds_p->sprtopclip = screenheightarray; - ds_p->tsilheight = MININT; + ds_p->tsilheight = INT_MIN; ds_p->silhouette |= SIL_TOP; } worldhigh = backsector->ceilingheight - viewz; @@ -652,12 +652,12 @@ void R_StoreWallRange(int start, int stop) if (maskedtexture && !(ds_p->silhouette & SIL_TOP)) { ds_p->silhouette |= SIL_TOP; - ds_p->tsilheight = MININT; + ds_p->tsilheight = INT_MIN; } if (maskedtexture && !(ds_p->silhouette & SIL_BOTTOM)) { ds_p->silhouette |= SIL_BOTTOM; - ds_p->bsilheight = MAXINT; + ds_p->bsilheight = INT_MAX; } ds_p++; } diff --git a/src/hexen/r_things.c b/src/hexen/r_things.c index 2ba32dbf..b460d6a7 100644 --- a/src/hexen/r_things.c +++ b/src/hexen/r_things.c @@ -879,7 +879,7 @@ void R_SortVisSprites(void) vsprsortedhead.next = vsprsortedhead.prev = &vsprsortedhead; for (i = 0; i < count; i++) { - bestscale = MAXINT; + bestscale = INT_MAX; for (ds = unsorted.next; ds != &unsorted; ds = ds->next) { if (ds->scale < bestscale) |