Use named enum constants for the HUD flags instead of literal numbers.

git-svn-id: https://svn.eduke32.com/eduke32@4174 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2013-11-22 19:26:50 +00:00
parent 9209b946bb
commit 9aa8bc7c82
3 changed files with 15 additions and 7 deletions

View file

@ -214,6 +214,13 @@ int32_t mddraw(const spritetype *tspr);
typedef struct { float xadd, yadd, zadd; int16_t angadd, flags, fov; } hudtyp;
enum {
HUDFLAG_HIDE = 1,
HUDFLAG_NOBOB = 2,
HUDFLAG_FLIPPED = 4,
HUDFLAG_NODEPTH = 8,
};
EXTERN hudtyp hudmem[2][MAXTILES];
EXTERN int32_t mdpause;

View file

@ -1277,13 +1277,13 @@ static int32_t defsparser(scriptfile *script)
case T_FOV:
scriptfile_getsymbol(script,&fov); break;
case T_HIDE:
flags |= 1; break;
flags |= HUDFLAG_HIDE; break;
case T_NOBOB:
flags |= 2; break;
flags |= HUDFLAG_NOBOB; break;
case T_FLIPPED:
flags |= 4; break;
flags |= HUDFLAG_FLIPPED; break;
case T_NODEPTH:
flags |= 8; break;
flags |= HUDFLAG_NODEPTH; break;
}
}

View file

@ -4155,7 +4155,8 @@ void polymost_dorotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16
spritetype tspr;
memset(&tspr,0,sizeof(spritetype));
if (hudmem[(dastat&4)>>2][picnum].flags&1) return; //"HIDE" is specified in DEF
if (hudmem[(dastat&4)>>2][picnum].flags & HUDFLAG_HIDE)
return;
ogchang = gchang; gchang = 1.0;
ogshang = gshang; gshang = 0.0; d = (double)z/(65536.0*16384.0);
@ -4177,7 +4178,7 @@ void polymost_dorotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16
z1 = pr_hudzadd;
}
#endif
if (!(hudmem[(dastat&4)>>2][picnum].flags&2)) //"NOBOB" is specified in DEF
if (!(hudmem[(dastat&4)>>2][picnum].flags & HUDFLAG_NOBOB))
{
double fx = ((double)sx)*(1.0/65536.0);
double fy = ((double)sy)*(1.0/65536.0);
@ -4296,7 +4297,7 @@ void polymost_dorotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16
bglLoadIdentity();
}
if (hudmem[(dastat&4)>>2][picnum].flags&8) //NODEPTH flag
if (hudmem[(dastat&4)>>2][picnum].flags & HUDFLAG_NODEPTH)
bglDisable(GL_DEPTH_TEST);
else
{