- SetupSpriteForBreak, extra sprite flags as enum

This commit is contained in:
Christoph Oelckers 2021-10-31 15:54:02 +01:00
parent 5bf77ddb2b
commit 6a4049e33c
5 changed files with 32 additions and 25 deletions

View file

@ -493,8 +493,9 @@ BREAK_INFOp SetupWallForBreak(WALLp wallp)
return break_info; return break_info;
} }
BREAK_INFOp SetupSpriteForBreak(SPRITEp sp) BREAK_INFOp SetupSpriteForBreak(DSWActor* actor)
{ {
auto sp = &actor->s();
short picnum = sp->picnum; short picnum = sp->picnum;
BREAK_INFOp break_info; BREAK_INFOp break_info;

View file

@ -49,7 +49,7 @@ BREAK_INFOp FindWallBreakInfo(short picnum);
BREAK_INFOp FindSpriteBreakInfo(short picnum); BREAK_INFOp FindSpriteBreakInfo(short picnum);
void SortBreakInfo(void); void SortBreakInfo(void);
BREAK_INFOp SetupWallForBreak(WALLp wallp); BREAK_INFOp SetupWallForBreak(WALLp wallp);
BREAK_INFOp SetupSpriteForBreak(SPRITEp sp); BREAK_INFOp SetupSpriteForBreak(DSWActor* actor);
short FindBreakSpriteMatch(short match); short FindBreakSpriteMatch(short match);
bool HitBreakWall(WALLp wp, int, int, int, short ang, short type); bool HitBreakWall(WALLp wp, int, int, int, short ang, short type);
int HitBreakSprite(short BreakSprite, short type); int HitBreakSprite(short BreakSprite, short type);

View file

@ -1279,31 +1279,35 @@ struct USERSAVE
}; };
// sprite->extra flags enum
// BUILD AND GAME - DO NOT MOVE THESE {
#define SPRX_SKILL (BIT(0) | BIT(1) | BIT(2)) // sprite->extra flags
// BUILD AND GAME - DO NOT MOVE THESE
SPRX_SKILL = (BIT(0) | BIT(1) | BIT(2)),
// BIT(4) ST1 BUILD AND GAME // BIT(4) ST1 BUILD AND GAME
#define SPRX_STAY_PUT_VATOR (BIT(5)) // BUILD AND GAME - will not move with vators etc SPRX_STAY_PUT_VATOR = (BIT(5)), // BUILD AND GAME - will not move with vators etc
// DO NOT MOVE THIS // DO NOT MOVE THIS
#define SPRX_STAG (BIT(6)) // BUILD AND GAME - NON-ST1 sprite with ST1 type tagging SPRX_STAG = (BIT(6)), // BUILD AND GAME - NON-ST1 sprite with ST1 type tagging
// DO NOT MOVE // DO NOT MOVE
#define SPRX_QUEUE_SPRITE (BIT(7)) // Queue sprite -check queue when deleting SPRX_QUEUE_SPRITE = (BIT(7)), // Queue sprite -check queue when deleting
#define SPRX_MULTI_ITEM (BIT(9)) // BUILD AND GAME - multi player item SPRX_MULTI_ITEM = (BIT(9)), // BUILD AND GAME - multi player item
// have users - could be moved // have users - could be moved
#define SPRX_PLAYER_OR_ENEMY (BIT(11)) // for checking quickly if sprite is a SPRX_PLAYER_OR_ENEMY = (BIT(11)), // for checking quickly if sprite is a
// player or actor // player or actor
// do not need Users // do not need Users
#define SPRX_FOUND (BIT(12)) // BUILD ONLY INTERNAL - used for finding sprites SPRX_FOUND = (BIT(12)), // BUILD ONLY INTERNAL - used for finding sprites
#define SPRX_BLADE (BIT(12)) // blade sprite SPRX_BLADE = (BIT(12)), // blade sprite
#define SPRX_BREAKABLE (BIT(13)) // breakable items SPRX_BREAKABLE = (BIT(13)), // breakable items
#define SPRX_BURNABLE (BIT(14)) // used for burnable sprites in the game SPRX_BURNABLE = (BIT(14)), // used for burnable sprites in the game
// temp use
SPRX_BLOCK = (BIT(15)), // BUILD AND GAME
};
// temp use
#define SPRX_BLOCK (BIT(15)) // BUILD AND GAME
// BUILD - tell which actors should not spawn // BUILD - tell which actors should not spawn
// GAME - used for internal game code // GAME - used for internal game code
// ALT-M debug mode // ALT-M debug mode

View file

@ -1827,6 +1827,7 @@ PlayerInitCaltrops(PLAYERp pp)
w = SpawnSprite(STAT_DEAD_ACTOR, CALTROPS, s_Caltrops, pp->cursectnum, w = SpawnSprite(STAT_DEAD_ACTOR, CALTROPS, s_Caltrops, pp->cursectnum,
nx, ny, nz, pp->angle.ang.asbuild(), (CHEMBOMB_VELOCITY + RandomRange(CHEMBOMB_VELOCITY)) / 2); nx, ny, nz, pp->angle.ang.asbuild(), (CHEMBOMB_VELOCITY + RandomRange(CHEMBOMB_VELOCITY)) / 2);
auto spawnedActor = &swActors[w];
wp = &sprite[w]; wp = &sprite[w];
wu = User[w].Data(); wu = User[w].Data();
@ -1878,7 +1879,7 @@ PlayerInitCaltrops(PLAYERp pp)
// wu->WaitTics = CHEMTICS*5; // wu->WaitTics = CHEMTICS*5;
// } // }
SetupSpriteForBreak(wp); // Put Caltrops in the break queue SetupSpriteForBreak(spawnedActor); // Put Caltrops in the break queue
return 0; return 0;
} }
@ -1904,6 +1905,7 @@ InitCaltrops(int16_t SpriteNum)
w = SpawnSprite(STAT_DEAD_ACTOR, CALTROPS, s_Caltrops, sp->sectnum, w = SpawnSprite(STAT_DEAD_ACTOR, CALTROPS, s_Caltrops, sp->sectnum,
nx, ny, nz, sp->ang, CHEMBOMB_VELOCITY / 2); nx, ny, nz, sp->ang, CHEMBOMB_VELOCITY / 2);
auto spawnedActor = &swActors[w];
wp = &sprite[w]; wp = &sprite[w];
wu = User[w].Data(); wu = User[w].Data();
@ -1929,7 +1931,7 @@ InitCaltrops(int16_t SpriteNum)
wu->ychange = MOVEy(wp->xvel, wp->ang); wu->ychange = MOVEy(wp->xvel, wp->ang);
wu->zchange = wp->zvel >> 1; wu->zchange = wp->zvel >> 1;
SetupSpriteForBreak(wp); // Put Caltrops in the break queue SetupSpriteForBreak(spawnedActor); // Put Caltrops in the break queue
return 0; return 0;
} }

View file

@ -1934,7 +1934,7 @@ SpriteSetup(void)
else else
{ {
// BREAK SETUP TABLE AUTOMATED // BREAK SETUP TABLE AUTOMATED
SetupSpriteForBreak(sp); SetupSpriteForBreak(actor);
} }
if (sp->lotag == TAG_SPRITE_HIT_MATCH) if (sp->lotag == TAG_SPRITE_HIT_MATCH)