Reduced GETFLAG macro args to just one as requested, true/yes are also valid now like with level header flags params (everything else is considered 'off')

This commit is contained in:
Monster Iestyn 2016-08-08 22:34:47 +01:00
parent f46ec64958
commit 841ee6eca0

View file

@ -2666,25 +2666,28 @@ void R_AddSkins(UINT16 wadnum)
GETFLOAT(camerascale) GETFLOAT(camerascale)
#undef GETFLOAT #undef GETFLOAT
#define GETFLAG(field, flag) else if (!stricmp(stoken, #field)) { \ #define GETFLAG(field) else if (!stricmp(stoken, #field)) { \
if (atoi(value) == 1) \ strupr(value); \
skin->flags |= flag; \ if (atoi(value) || value[0] == 'T' || value[0] == 'Y') \
skin->flags |= (SF_##field); \
else \ else \
skin->flags &= ~flag; \ skin->flags &= ~(SF_##field); \
} }
// parameters for individual character flags // parameters for individual character flags
GETFLAG(super, SF_SUPER) // these are uppercase so they can be concatenated with SF_
GETFLAG(superanims, SF_SUPERANIMS) // 1, true, yes are all valid values
GETFLAG(superspin, SF_SUPERSPIN) GETFLAG(SUPER)
GETFLAG(hires, SF_HIRES) GETFLAG(SUPERANIMS)
GETFLAG(noskid, SF_NOSKID) GETFLAG(SUPERSPIN)
GETFLAG(nospeedadjust, SF_NOSPEEDADJUST) GETFLAG(HIRES)
GETFLAG(runonwater, SF_RUNONWATER) GETFLAG(NOSKID)
GETFLAG(nojumpspin, SF_NOJUMPSPIN) GETFLAG(NOSPEEDADJUST)
GETFLAG(nojumpdamage, SF_NOJUMPDAMAGE) GETFLAG(RUNONWATER)
GETFLAG(stompdamage, SF_STOMPDAMAGE) GETFLAG(NOJUMPSPIN)
GETFLAG(mariodamage, SF_MARIODAMAGE) GETFLAG(NOJUMPDAMAGE)
GETFLAG(machine, SF_MACHINE) GETFLAG(STOMPDAMAGE)
GETFLAG(MARIODAMAGE)
GETFLAG(MACHINE)
#undef GETFLAG #undef GETFLAG
else // let's check if it's a sound, otherwise error out else // let's check if it's a sound, otherwise error out