mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 12:31:54 +00:00
Fix bitflags enum sectoractionflags_t for C++
This commit is contained in:
parent
5e3c9e5c92
commit
ef1c653e85
2 changed files with 40 additions and 42 deletions
|
|
@ -1065,7 +1065,7 @@ static void P_LoadSectors(UINT8 *data)
|
|||
ss->action = 0;
|
||||
memset(ss->args, 0, NUM_SCRIPT_ARGS*sizeof(*ss->args));
|
||||
memset(ss->stringargs, 0x00, NUM_SCRIPT_STRINGARGS*sizeof(*ss->stringargs));
|
||||
ss->activation = static_cast<sectoractionflags_t>(0);
|
||||
ss->activation = 0;
|
||||
|
||||
P_InitializeSector(ss);
|
||||
}
|
||||
|
|
@ -1842,27 +1842,27 @@ static void ParseTextmapSectorParameter(UINT32 i, const char *param, const char
|
|||
sectors[i].args[argnum] = atol(val);
|
||||
}
|
||||
else if (fastcmp(param, "repeatspecial") && fastcmp("true", val))
|
||||
sectors[i].activation = static_cast<sectoractionflags_t>(sectors[i].activation | ((sectors[i].activation & ~SECSPAC_TRIGGERMASK) | SECSPAC_REPEATSPECIAL));
|
||||
sectors[i].activation |= ((sectors[i].activation & ~SECSPAC_TRIGGERMASK) | SECSPAC_REPEATSPECIAL);
|
||||
else if (fastcmp(param, "continuousspecial") && fastcmp("true", val))
|
||||
sectors[i].activation = static_cast<sectoractionflags_t>(sectors[i].activation | ((sectors[i].activation & ~SECSPAC_TRIGGERMASK) | SECSPAC_CONTINUOUSSPECIAL));
|
||||
sectors[i].activation |= ((sectors[i].activation & ~SECSPAC_TRIGGERMASK) | SECSPAC_CONTINUOUSSPECIAL);
|
||||
else if (fastcmp(param, "playerenter") && fastcmp("true", val))
|
||||
sectors[i].activation = static_cast<sectoractionflags_t>(sectors[i].activation | SECSPAC_ENTER);
|
||||
sectors[i].activation |= SECSPAC_ENTER;
|
||||
else if (fastcmp(param, "playerfloor") && fastcmp("true", val))
|
||||
sectors[i].activation = static_cast<sectoractionflags_t>(sectors[i].activation | SECSPAC_FLOOR);
|
||||
sectors[i].activation |= SECSPAC_FLOOR;
|
||||
else if (fastcmp(param, "playerceiling") && fastcmp("true", val))
|
||||
sectors[i].activation = static_cast<sectoractionflags_t>(sectors[i].activation | SECSPAC_CEILING);
|
||||
sectors[i].activation |= SECSPAC_CEILING;
|
||||
else if (fastcmp(param, "monsterenter") && fastcmp("true", val))
|
||||
sectors[i].activation = static_cast<sectoractionflags_t>(sectors[i].activation | SECSPAC_ENTERMONSTER);
|
||||
sectors[i].activation |= SECSPAC_ENTERMONSTER;
|
||||
else if (fastcmp(param, "monsterfloor") && fastcmp("true", val))
|
||||
sectors[i].activation = static_cast<sectoractionflags_t>(sectors[i].activation | SECSPAC_FLOORMONSTER);
|
||||
sectors[i].activation |= SECSPAC_FLOORMONSTER;
|
||||
else if (fastcmp(param, "monsterceiling") && fastcmp("true", val))
|
||||
sectors[i].activation = static_cast<sectoractionflags_t>(sectors[i].activation | SECSPAC_CEILINGMONSTER);
|
||||
sectors[i].activation |= SECSPAC_CEILINGMONSTER;
|
||||
else if (fastcmp(param, "missileenter") && fastcmp("true", val))
|
||||
sectors[i].activation = static_cast<sectoractionflags_t>(sectors[i].activation | SECSPAC_ENTERMISSILE);
|
||||
sectors[i].activation |= SECSPAC_ENTERMISSILE;
|
||||
else if (fastcmp(param, "missilefloor") && fastcmp("true", val))
|
||||
sectors[i].activation = static_cast<sectoractionflags_t>(sectors[i].activation | SECSPAC_FLOORMISSILE);
|
||||
sectors[i].activation |= SECSPAC_FLOORMISSILE;
|
||||
else if (fastcmp(param, "missileceiling") && fastcmp("true", val))
|
||||
sectors[i].activation = static_cast<sectoractionflags_t>(sectors[i].activation | SECSPAC_CEILINGMISSILE);
|
||||
sectors[i].activation |= SECSPAC_CEILINGMISSILE;
|
||||
else
|
||||
ParseUserProperty(§ors[i].user, param, val);
|
||||
}
|
||||
|
|
@ -3215,7 +3215,7 @@ static void P_LoadTextmap(void)
|
|||
sc->action = 0;
|
||||
memset(sc->args, 0, NUM_SCRIPT_ARGS*sizeof(*sc->args));
|
||||
memset(sc->stringargs, 0x00, NUM_SCRIPT_STRINGARGS*sizeof(*sc->stringargs));
|
||||
sc->activation = static_cast<sectoractionflags_t>(0);
|
||||
sc->activation = 0;
|
||||
|
||||
K_UserPropertiesClear(&sc->user);
|
||||
|
||||
|
|
|
|||
56
src/r_defs.h
56
src/r_defs.h
|
|
@ -383,47 +383,45 @@ typedef int sectorspecialflags_t;
|
|||
#define SSF_ZOOMTUBESTART (1<<15)
|
||||
#define SSF_ZOOMTUBEEND (1<<16)
|
||||
|
||||
typedef enum
|
||||
{
|
||||
// Mask to get trigger type.
|
||||
SECSPAC_TRIGGERMASK = 0x0000000F,
|
||||
typedef int sectoractionflags_t;
|
||||
// Mask to get trigger type.
|
||||
#define SECSPAC_TRIGGERMASK (0x0000000F)
|
||||
|
||||
// Special action is activated once.
|
||||
SECSPAC_ONCESPECIAL = 0x00000000,
|
||||
// Special action is activated once.
|
||||
#define SECSPAC_ONCESPECIAL (0x00000000)
|
||||
|
||||
// Special action is repeatable.
|
||||
SECSPAC_REPEATSPECIAL = 0x00000001,
|
||||
// Special action is repeatable.
|
||||
#define SECSPAC_REPEATSPECIAL (0x00000001)
|
||||
|
||||
// Special action is activated continously.
|
||||
SECSPAC_CONTINUOUSSPECIAL = 0x00000002,
|
||||
// Special action is activated continously.
|
||||
#define SECSPAC_CONTINUOUSSPECIAL (0x00000002)
|
||||
|
||||
// When a player enters this sector.
|
||||
SECSPAC_ENTER = 0x00000010,
|
||||
// When a player enters this sector.
|
||||
#define SECSPAC_ENTER (0x00000010)
|
||||
|
||||
// When a player touches the floor of this sector.
|
||||
SECSPAC_FLOOR = 0x00000020,
|
||||
// When a player touches the floor of this sector.
|
||||
#define SECSPAC_FLOOR (0x00000020)
|
||||
|
||||
// When a player touches the ceiling of this sector.
|
||||
SECSPAC_CEILING = 0x00000040,
|
||||
// When a player touches the ceiling of this sector.
|
||||
#define SECSPAC_CEILING (0x00000040)
|
||||
|
||||
// When an enemy enters this sector.
|
||||
SECSPAC_ENTERMONSTER = 0x00000080,
|
||||
// When an enemy enters this sector.
|
||||
#define SECSPAC_ENTERMONSTER (0x00000080)
|
||||
|
||||
// When an enemy touches the floor of this sector.
|
||||
SECSPAC_FLOORMONSTER = 0x00000100,
|
||||
// When an enemy touches the floor of this sector.
|
||||
#define SECSPAC_FLOORMONSTER (0x00000100)
|
||||
|
||||
// When an enemy touches the ceiling of this sector.
|
||||
SECSPAC_CEILINGMONSTER = 0x00000200,
|
||||
// When an enemy touches the ceiling of this sector.
|
||||
#define SECSPAC_CEILINGMONSTER (0x00000200)
|
||||
|
||||
// When a projectile enters this sector.
|
||||
SECSPAC_ENTERMISSILE = 0x00000400,
|
||||
// When a projectile enters this sector.
|
||||
#define SECSPAC_ENTERMISSILE (0x00000400)
|
||||
|
||||
// When a projectile touches the floor of this sector.
|
||||
SECSPAC_FLOORMISSILE = 0x00000800,
|
||||
// When a projectile touches the floor of this sector.
|
||||
#define SECSPAC_FLOORMISSILE (0x00000800)
|
||||
|
||||
// When a projectile touches the ceiling of this sector.
|
||||
SECSPAC_CEILINGMISSILE = 0x00001000,
|
||||
} sectoractionflags_t;
|
||||
// When a projectile touches the ceiling of this sector.
|
||||
#define SECSPAC_CEILINGMISSILE (0x00001000)
|
||||
|
||||
typedef enum
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue