Moved BUILD engine defined CSTAT enums into the BUILD engine side of the code base.

git-svn-id: https://svn.eduke32.com/eduke32@6657 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
pogokeen 2018-02-16 06:38:31 +00:00
parent 3ca5f33c73
commit a2cf961591
11 changed files with 99 additions and 97 deletions

View file

@ -101,6 +101,33 @@ typedef struct
// bit 13: 1 = does not cast shadow // bit 13: 1 = does not cast shadow
// bit 14: 1 = invisible but casts shadow // bit 14: 1 = invisible but casts shadow
// bit 15: 1 = Invisible sprite, 0 = not invisible // bit 15: 1 = Invisible sprite, 0 = not invisible
#ifndef buildtypes_h__enums
enum
{
CSTAT_SPRITE_BLOCK = 1u,
CSTAT_SPRITE_TRANSLUCENT = 1u<<1u,
CSTAT_SPRITE_XFLIP = 1u<<2u,
CSTAT_SPRITE_YFLIP = 1u<<3u,
CSTAT_SPRITE_ALIGNMENT = 1u<<4u | 1u<<5u, // (cstat & CSTAT_SPRITE_ALIGNMENT) == CSTAT_SPRITE_ALIGNMENT_xxxxxx can be used to check sprite alignment
CSTAT_SPRITE_ONE_SIDED = 1u<<6u,
CSTAT_SPRITE_YCENTER = 1u<<7u,
CSTAT_SPRITE_BLOCK_HITSCAN = 1u<<8u,
CSTAT_SPRITE_TRANSLUCENT_INVERT = 1u<<9u,
CSTAT_SPRITE_RESERVED1 = 1u<<10u, // game-side
CSTAT_SPRITE_RESERVED2 = 1u<<11u, // game-side
CSTAT_SPRITE_RESERVED3 = 1u<<12u,
CSTAT_SPRITE_NO_SHADOW = 1u<<13u, // re-defined in Shadow Warrior
CSTAT_SPRITE_INVISIBLE_WITH_SHADOW = 1u<<14u, // re-defined in Shadow Warrior
CSTAT_SPRITE_INVISIBLE = 1u<<15u,
};
enum
{
CSTAT_SPRITE_ALIGNMENT_FACING = 0,
CSTAT_SPRITE_ALIGNMENT_WALL = 1u<<4u,
CSTAT_SPRITE_ALIGNMENT_FLOOR = 1u<<5u,
CSTAT_SPRITE_ALIGNMENT_SLAB = 1u<<4u | 1u<<5u,
};
#endif
//44 bytes //44 bytes
typedef struct typedef struct
@ -166,4 +193,8 @@ typedef struct
#undef StructTracker #undef StructTracker
#undef StructName #undef StructName
#ifndef buildtypes_h__enums
#define buildtypes_h__enums
#endif
#endif // buildtypes_h__ #endif // buildtypes_h__

View file

@ -390,7 +390,7 @@ void P_SetGamePalette(DukePlayer_t *player, uint32_t palid, int32_t set);
// Cstat protection mask for (currently) spawned MASKWALL* sprites. // Cstat protection mask for (currently) spawned MASKWALL* sprites.
// TODO: look at more cases of cstat=(cstat&PROTECTED)|ADDED in A_Spawn()? // TODO: look at more cases of cstat=(cstat&PROTECTED)|ADDED in A_Spawn()?
// 2048+(32+16)+8+4 // 2048+(32+16)+8+4
#define SPAWN_PROTECT_CSTAT_MASK (CSTAT_SPRITE_NOSHADE|CSTAT_SPRITE_SLAB|CSTAT_SPRITE_XFLIP|CSTAT_SPRITE_YFLIP); #define SPAWN_PROTECT_CSTAT_MASK (CSTAT_SPRITE_NOSHADE|CSTAT_SPRITE_ALIGNMENT_SLAB|CSTAT_SPRITE_XFLIP|CSTAT_SPRITE_YFLIP);
void fadepal(int32_t r,int32_t g,int32_t b,int32_t start,int32_t end,int32_t step); void fadepal(int32_t r,int32_t g,int32_t b,int32_t start,int32_t end,int32_t step);
//void fadepaltile(int32_t r,int32_t g,int32_t b,int32_t start,int32_t end,int32_t step,int32_t tile); //void fadepaltile(int32_t r,int32_t g,int32_t b,int32_t start,int32_t end,int32_t step,int32_t tile);

View file

@ -164,22 +164,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// bit 13: reserved // bit 13: reserved
// bit 14: reserved // bit 14: reserved
// bit 15: 1 = Invisible sprite, 0 = not invisible // bit 15: 1 = Invisible sprite, 0 = not invisible
#define CSTAT_SPRITE_BLOCK BIT(0)
#define CSTAT_SPRITE_TRANSLUCENT BIT(1)
#define CSTAT_SPRITE_XFLIP BIT(2)
#define CSTAT_SPRITE_YFLIP BIT(3)
#define CSTAT_SPRITE_WALL BIT(4)
#define CSTAT_SPRITE_FLOOR BIT(5)
#define CSTAT_SPRITE_SLAB (BIT(4)|BIT(5))
#define CSTAT_SPRITE_ONE_SIDE BIT(6)
#define CSTAT_SPRITE_YCENTER BIT(7)
#define CSTAT_SPRITE_BLOCK_HITSCAN BIT(8)
#define CSTAT_SPRITE_TRANS_FLIP BIT(9)
#define CSTAT_SPRITE_NOSHADE BIT(11) #define CSTAT_SPRITE_NOSHADE BIT(11)
#define CSTAT_SPRITE_INVISIBLE BIT(15)
#define CSTAT_SPRITE_BREAKABLE (CSTAT_SPRITE_BLOCK_HITSCAN) #define CSTAT_SPRITE_BREAKABLE (CSTAT_SPRITE_BLOCK_HITSCAN)
#define SP(i) sprite[i].yvel #define SP(i) sprite[i].yvel

View file

@ -792,7 +792,7 @@ DoActorStopFall(short SpriteNum)
// don't stand on face or wall sprites - jump again // don't stand on face or wall sprites - jump again
if (u->lo_sp && !TEST(u->lo_sp->cstat, CSTAT_SPRITE_FLOOR)) if (u->lo_sp && !TEST(u->lo_sp->cstat, CSTAT_SPRITE_ALIGNMENT_FLOOR))
{ {
USERp tu = User[u->lo_sp - sprite]; USERp tu = User[u->lo_sp - sprite];

View file

@ -258,7 +258,7 @@ DoShadowFindGroundPoint(uspritetype * sp)
{ {
hsp = &sprite[NORM_SPRITE(florhit)]; hsp = &sprite[NORM_SPRITE(florhit)];
if (TEST(hsp->cstat, CSTAT_SPRITE_FLOOR)) if (TEST(hsp->cstat, CSTAT_SPRITE_ALIGNMENT_FLOOR))
{ {
// found a sprite floor // found a sprite floor
return loz; return loz;
@ -415,7 +415,7 @@ DoShadows(uspritetype * tsp, int viewz)
loz = tu->loz; loz = tu->loz;
if (tu->lo_sp) if (tu->lo_sp)
{ {
if (!TEST(tu->lo_sp->cstat, CSTAT_SPRITE_WALL | CSTAT_SPRITE_FLOOR)) if (!TEST(tu->lo_sp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL | CSTAT_SPRITE_ALIGNMENT_FLOOR))
{ {
loz = DoShadowFindGroundPoint(tsp); loz = DoShadowFindGroundPoint(tsp);
} }
@ -536,7 +536,7 @@ DoMotionBlur(uspritetype const * tsp)
{ {
New = &tsprite[spritesortcnt]; New = &tsprite[spritesortcnt];
memcpy(New, tsp, sizeof(SPRITE)); memcpy(New, tsp, sizeof(SPRITE));
SET(New->cstat, CSTAT_SPRITE_TRANSLUCENT|CSTAT_SPRITE_TRANS_FLIP); SET(New->cstat, CSTAT_SPRITE_TRANSLUCENT|CSTAT_SPRITE_TRANSLUCENT_INVERT);
New->x += dx; New->x += dx;
New->y += dy; New->y += dy;
@ -559,7 +559,7 @@ DoMotionBlur(uspritetype const * tsp)
void SetVoxelSprite(SPRITEp sp, short pic) void SetVoxelSprite(SPRITEp sp, short pic)
{ {
SET(sp->cstat, CSTAT_SPRITE_SLAB); SET(sp->cstat, CSTAT_SPRITE_ALIGNMENT_SLAB);
sp->picnum = pic; sp->picnum = pic;
} }
@ -780,7 +780,7 @@ analyzesprites(int viewx, int viewy, int viewz, SWBOOL mirror)
tsp->picnum = DART_PIC; tsp->picnum = DART_PIC;
tsp->ang = NORM_ANGLE(tsp->ang - 512 - 24); tsp->ang = NORM_ANGLE(tsp->ang - 512 - 24);
tsp->xrepeat = tsp->yrepeat = DART_REPEAT; tsp->xrepeat = tsp->yrepeat = DART_REPEAT;
SET(tsp->cstat, CSTAT_SPRITE_WALL); SET(tsp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL);
} }
else else
DoStarView(tsp, tu, viewz); DoStarView(tsp, tu, viewz);
@ -845,7 +845,7 @@ analyzesprites(int viewx, int viewy, int viewz, SWBOOL mirror)
tsp->picnum = DART_PIC; tsp->picnum = DART_PIC;
tsp->ang = NORM_ANGLE(tsp->ang - 512); tsp->ang = NORM_ANGLE(tsp->ang - 512);
tsp->xrepeat = tsp->yrepeat = DART_REPEAT; tsp->xrepeat = tsp->yrepeat = DART_REPEAT;
SET(tsp->cstat, CSTAT_SPRITE_WALL); SET(tsp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL);
} }
// Call my sprite handler // Call my sprite handler
@ -1116,7 +1116,7 @@ ViewOutsidePlayerRecurse(PLAYERp pp, int32_t* vx, int32_t* vy, int32_t* vz, int1
sp = &sprite[hit_sprite]; sp = &sprite[hit_sprite];
// if you hit a sprite that's not a wall sprite - try again // if you hit a sprite that's not a wall sprite - try again
if (!TEST(sp->cstat, CSTAT_SPRITE_WALL)) if (!TEST(sp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL))
{ {
FLIP(sp->cstat, CSTAT_SPRITE_BLOCK); FLIP(sp->cstat, CSTAT_SPRITE_BLOCK);
ViewOutsidePlayerRecurse(pp, vx, vy, vz, ang, vsectnum); ViewOutsidePlayerRecurse(pp, vx, vy, vz, ang, vsectnum);
@ -1215,7 +1215,7 @@ BackView(int *nx, int *ny, int *nz, short *vsect, short *nang, short horiz)
int flag_backup; int flag_backup;
// if you hit a sprite that's not a wall sprite - try again // if you hit a sprite that's not a wall sprite - try again
if (!TEST(hsp->cstat, CSTAT_SPRITE_WALL)) if (!TEST(hsp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL))
{ {
flag_backup = hsp->cstat; flag_backup = hsp->cstat;
RESET(hsp->cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN); RESET(hsp->cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
@ -1336,7 +1336,7 @@ CircleCamera(int *nx, int *ny, int *nz, short *vsect, short *nang, short horiz)
int flag_backup; int flag_backup;
// if you hit a sprite that's not a wall sprite - try again // if you hit a sprite that's not a wall sprite - try again
if (!TEST(hsp->cstat, CSTAT_SPRITE_WALL)) if (!TEST(hsp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL))
{ {
flag_backup = hsp->cstat; flag_backup = hsp->cstat;
RESET(hsp->cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN); RESET(hsp->cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
@ -2493,9 +2493,9 @@ drawscreen(PLAYERp pp)
// Don't show sprites tagged with 257 // Don't show sprites tagged with 257
if (sprite[j].lotag == 257) if (sprite[j].lotag == 257)
{ {
if (TEST(sprite[j].cstat, CSTAT_SPRITE_FLOOR)) if (TEST(sprite[j].cstat, CSTAT_SPRITE_ALIGNMENT_FLOOR))
{ {
RESET(sprite[j].cstat, CSTAT_SPRITE_FLOOR); RESET(sprite[j].cstat, CSTAT_SPRITE_ALIGNMENT_FLOOR);
sprite[j].owner = -2; sprite[j].owner = -2;
} }
} }
@ -2515,7 +2515,7 @@ drawscreen(PLAYERp pp)
{ {
// Don't show sprites tagged with 257 // Don't show sprites tagged with 257
if (sprite[j].lotag == 257 && sprite[j].owner == -2) if (sprite[j].lotag == 257 && sprite[j].owner == -2)
SET(sprite[j].cstat, CSTAT_SPRITE_FLOOR); SET(sprite[j].cstat, CSTAT_SPRITE_ALIGNMENT_FLOOR);
} }
// if doing a screen save don't need to process the rest // if doing a screen save don't need to process the rest

View file

@ -464,7 +464,7 @@ int StdRandomRange(int range);
#define SPRITEp_SIZE_TOS(sp) (DIV2(SPRITEp_SIZE_Z(sp)) + Z(SPRITEp_YOFF(sp))) #define SPRITEp_SIZE_TOS(sp) (DIV2(SPRITEp_SIZE_Z(sp)) + Z(SPRITEp_YOFF(sp)))
#define SPRITEp_SIZE_BOS(sp) (DIV2(SPRITEp_SIZE_Z(sp)) - Z(SPRITEp_YOFF(sp))) #define SPRITEp_SIZE_BOS(sp) (DIV2(SPRITEp_SIZE_Z(sp)) - Z(SPRITEp_YOFF(sp)))
// acual Z for TOS and BOS - handles both WYSIWYG and old style // actual Z for TOS and BOS - handles both WYSIWYG and old style
#define SPRITEp_TOS(sp) (TEST((sp)->cstat, CSTAT_SPRITE_YCENTER) ? \ #define SPRITEp_TOS(sp) (TEST((sp)->cstat, CSTAT_SPRITE_YCENTER) ? \
((sp)->z - SPRITEp_SIZE_TOS(sp)) : \ ((sp)->z - SPRITEp_SIZE_TOS(sp)) : \
((sp)->z - SPRITEp_SIZE_Z(sp))) ((sp)->z - SPRITEp_SIZE_Z(sp)))
@ -473,7 +473,7 @@ int StdRandomRange(int range);
((sp)->z + SPRITEp_SIZE_BOS(sp)) : \ ((sp)->z + SPRITEp_SIZE_BOS(sp)) : \
(sp)->z) (sp)->z)
// mid and upper/lower sprite caluculations // mid and upper/lower sprite calculations
#define SPRITEp_MID(sp) (DIV2(SPRITEp_TOS(sp) + SPRITEp_BOS(sp))) #define SPRITEp_MID(sp) (DIV2(SPRITEp_TOS(sp) + SPRITEp_BOS(sp)))
#define SPRITEp_UPPER(sp) (SPRITEp_TOS(sp) + DIV4(SPRITEp_SIZE_Z(sp))) #define SPRITEp_UPPER(sp) (SPRITEp_TOS(sp) + DIV4(SPRITEp_SIZE_Z(sp)))
#define SPRITEp_LOWER(sp) (SPRITEp_BOS(sp) - DIV4(SPRITEp_SIZE_Z(sp))) #define SPRITEp_LOWER(sp) (SPRITEp_BOS(sp) - DIV4(SPRITEp_SIZE_Z(sp)))
@ -626,24 +626,10 @@ int StdRandomRange(int range);
// bit 13: reserved // bit 13: reserved
// bit 14: reserved // bit 14: reserved
// bit 15: 1 = Invisible sprite, 0 = not invisible // bit 15: 1 = Invisible sprite, 0 = not invisible
#define CSTAT_SPRITE_BLOCK BIT(0)
#define CSTAT_SPRITE_TRANSLUCENT BIT(1)
#define CSTAT_SPRITE_XFLIP BIT(2)
#define CSTAT_SPRITE_YFLIP BIT(3)
#define CSTAT_SPRITE_WALL BIT(4)
#define CSTAT_SPRITE_FLOOR BIT(5)
#define CSTAT_SPRITE_SLAB (BIT(4)|BIT(5))
#define CSTAT_SPRITE_ONE_SIDE BIT(6)
#define CSTAT_SPRITE_YCENTER BIT(7)
#define CSTAT_SPRITE_BLOCK_HITSCAN BIT(8)
#define CSTAT_SPRITE_TRANS_FLIP BIT(9)
#define CSTAT_SPRITE_RESTORE BIT(12) // my def #define CSTAT_SPRITE_RESTORE BIT(12) // my def
#define CSTAT_SPRITE_CLOSE_FLOOR BIT(13) // my def - tells whether a sprite #define CSTAT_SPRITE_CLOSE_FLOOR BIT(13) // my def - tells whether a sprite
// started out close to a ceiling or floor // started out close to a ceiling or floor
#define CSTAT_SPRITE_BLOCK_MISSILE BIT(14) // my def #define CSTAT_SPRITE_BLOCK_MISSILE BIT(14) // my def
#define CSTAT_SPRITE_INVISIBLE BIT(15)
#define CSTAT_SPRITE_BREAKABLE (CSTAT_SPRITE_BLOCK_HITSCAN|CSTAT_SPRITE_BLOCK_MISSILE) #define CSTAT_SPRITE_BREAKABLE (CSTAT_SPRITE_BLOCK_HITSCAN|CSTAT_SPRITE_BLOCK_MISSILE)
@ -661,7 +647,7 @@ int StdRandomRange(int range);
// for actors to clip against walls // for actors to clip against walls
#define CLIPMASK_ACTOR \ #define CLIPMASK_ACTOR \
( \ ( \
CS(CSTAT_SPRITE_BLOCK) | \ CS(CSTAT_SPRITE_BLOCK) | \
CSTAT_WALL_BLOCK | \ CSTAT_WALL_BLOCK | \
CSTAT_WALL_BLOCK_ACTOR \ CSTAT_WALL_BLOCK_ACTOR \
) )

View file

@ -429,7 +429,7 @@ DoBloodSpray(int16_t Weapon)
SPRITEp hsp = &sprite[hit_sprite]; SPRITEp hsp = &sprite[hit_sprite];
USERp hu = User[hit_sprite]; USERp hu = User[hit_sprite];
if (TEST(hsp->cstat, CSTAT_SPRITE_WALL)) if (TEST(hsp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL))
{ {
wall_ang = NORM_ANGLE(hsp->ang); wall_ang = NORM_ANGLE(hsp->ang);
SpawnMidSplash(Weapon); SpawnMidSplash(Weapon);
@ -648,7 +648,7 @@ DoPhosphorus(int16_t Weapon)
hsp = &sprite[hit_sprite]; hsp = &sprite[hit_sprite];
hu = User[hit_sprite]; hu = User[hit_sprite];
if (TEST(hsp->cstat, CSTAT_SPRITE_WALL)) if (TEST(hsp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL))
{ {
wall_ang = NORM_ANGLE(hsp->ang); wall_ang = NORM_ANGLE(hsp->ang);
WallBounce(Weapon, wall_ang); WallBounce(Weapon, wall_ang);
@ -875,7 +875,7 @@ DoChemBomb(int16_t Weapon)
hit_sprite = NORM_SPRITE(u->ret); hit_sprite = NORM_SPRITE(u->ret);
hsp = &sprite[hit_sprite]; hsp = &sprite[hit_sprite];
if (TEST(hsp->cstat, CSTAT_SPRITE_WALL)) if (TEST(hsp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL))
{ {
wall_ang = NORM_ANGLE(hsp->ang); wall_ang = NORM_ANGLE(hsp->ang);
WallBounce(Weapon, wall_ang); WallBounce(Weapon, wall_ang);
@ -1133,7 +1133,7 @@ DoCaltrops(int16_t Weapon)
hit_sprite = NORM_SPRITE(u->ret); hit_sprite = NORM_SPRITE(u->ret);
hsp = &sprite[hit_sprite]; hsp = &sprite[hit_sprite];
if (TEST(hsp->cstat, CSTAT_SPRITE_WALL)) if (TEST(hsp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL))
{ {
wall_ang = NORM_ANGLE(hsp->ang); wall_ang = NORM_ANGLE(hsp->ang);
WallBounce(Weapon, wall_ang); WallBounce(Weapon, wall_ang);

View file

@ -1397,7 +1397,7 @@ DoSpawnTeleporterEffect(SPRITEp sp)
SET(ep->cstat, CSTAT_SPRITE_YCENTER); SET(ep->cstat, CSTAT_SPRITE_YCENTER);
RESET(ep->cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN); RESET(ep->cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
SET(ep->cstat, CSTAT_SPRITE_WALL); SET(ep->cstat, CSTAT_SPRITE_ALIGNMENT_WALL);
//ep->ang = NORM_ANGLE(ep->ang + 512); //ep->ang = NORM_ANGLE(ep->ang + 512);
} }
@ -1424,7 +1424,7 @@ DoSpawnTeleporterEffectPlace(SPRITEp sp)
SET(ep->cstat, CSTAT_SPRITE_YCENTER); SET(ep->cstat, CSTAT_SPRITE_YCENTER);
RESET(ep->cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN); RESET(ep->cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
SET(ep->cstat, CSTAT_SPRITE_WALL); SET(ep->cstat, CSTAT_SPRITE_ALIGNMENT_WALL);
} }
void void
@ -4587,7 +4587,7 @@ PlayerOnLadder(PLAYERp pp)
// if the sprite blocking you hit is not a wall sprite there is something between // if the sprite blocking you hit is not a wall sprite there is something between
// you and the ladder // you and the ladder
if (TEST(sprite[hitinfo.sprite].cstat, CSTAT_SPRITE_BLOCK) && if (TEST(sprite[hitinfo.sprite].cstat, CSTAT_SPRITE_BLOCK) &&
!TEST(sprite[hitinfo.sprite].cstat, CSTAT_SPRITE_WALL)) !TEST(sprite[hitinfo.sprite].cstat, CSTAT_SPRITE_ALIGNMENT_WALL))
{ {
return FALSE; return FALSE;
} }
@ -7069,7 +7069,7 @@ void DoPlayerDeathMoveHead(PLAYERp pp)
hit_sprite = NORM_SPRITE(u->ret); hit_sprite = NORM_SPRITE(u->ret);
hsp = &sprite[hit_sprite]; hsp = &sprite[hit_sprite];
if (!TEST(hsp->cstat, CSTAT_SPRITE_WALL)) if (!TEST(hsp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL))
break; break;

View file

@ -1133,7 +1133,7 @@ SectorExp(short SpriteNum, short sectnum, short orig_ang, int zh)
USERp eu; USERp eu;
int x,y,z; int x,y,z;
RESET(sp->cstat, CSTAT_SPRITE_WALL|CSTAT_SPRITE_FLOOR); RESET(sp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL|CSTAT_SPRITE_ALIGNMENT_FLOOR);
SectorMidPoint(sectnum, &x, &y, &z); SectorMidPoint(sectnum, &x, &y, &z);
sp->ang = orig_ang; sp->ang = orig_ang;
sp->x = x; sp->x = x;

View file

@ -1750,7 +1750,7 @@ SpriteSetupPost(void)
if (ds->picnum == ST1) if (ds->picnum == ST1)
continue; continue;
if (TEST(ds->cstat, CSTAT_SPRITE_WALL|CSTAT_SPRITE_FLOOR)) if (TEST(ds->cstat, CSTAT_SPRITE_ALIGNMENT_WALL|CSTAT_SPRITE_ALIGNMENT_FLOOR))
continue; continue;
if (User[i]) if (User[i])
@ -1818,8 +1818,8 @@ SpriteSetup(void)
} }
// CSTAT_SPIN is insupported - get rid of it // CSTAT_SPIN is insupported - get rid of it
if (TEST(sp->cstat, CSTAT_SPRITE_SLAB) == CSTAT_SPRITE_SLAB) if (TEST(sp->cstat, CSTAT_SPRITE_ALIGNMENT) == CSTAT_SPRITE_ALIGNMENT_SLAB)
RESET(sp->cstat, CSTAT_SPRITE_SLAB); RESET(sp->cstat, CSTAT_SPRITE_ALIGNMENT_SLAB);
// if BLOCK is set set BLOCK_HITSCAN // if BLOCK is set set BLOCK_HITSCAN
// Hope this doesn't screw up anything // Hope this doesn't screw up anything
@ -1904,7 +1904,7 @@ SpriteSetup(void)
short track_num; short track_num;
// skip this sprite, just for numbering walls/sectors // skip this sprite, just for numbering walls/sectors
if (TEST(sprite[SpriteNum].cstat, CSTAT_SPRITE_WALL)) if (TEST(sprite[SpriteNum].cstat, CSTAT_SPRITE_ALIGNMENT_WALL))
continue; continue;
track_num = sprite[SpriteNum].picnum - TRACK_SPRITE + 0; track_num = sprite[SpriteNum].picnum - TRACK_SPRITE + 0;
@ -3127,7 +3127,7 @@ KeyMain:
u->spal = sprite[SpriteNum].pal; // Set the palette from build u->spal = sprite[SpriteNum].pal; // Set the palette from build
//SET(sp->cstat, CSTAT_SPRITE_WALL); //SET(sp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL);
ChangeState(SpriteNum, s_Key[num]); ChangeState(SpriteNum, s_Key[num]);
@ -4595,7 +4595,7 @@ int SpawnItemsMatch(short match)
// need to set the palette here - suggest table lookup // need to set the palette here - suggest table lookup
u->spal = sprite[SpriteNum].pal = KeyPal[num]; u->spal = sprite[SpriteNum].pal = KeyPal[num];
//SET(sp->cstat, CSTAT_SPRITE_WALL); //SET(sp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL);
ChangeState(SpriteNum, s_Key[num]); ChangeState(SpriteNum, s_Key[num]);
@ -4973,7 +4973,7 @@ ActorDrop(short SpriteNum, int x, int y, int z, short new_sector, short min_heig
SPRITEp hsp = &sprite[florhit & 4095]; SPRITEp hsp = &sprite[florhit & 4095];
// if its a floor sprite and not too far down // if its a floor sprite and not too far down
if (TEST(hsp->cstat, CSTAT_SPRITE_FLOOR) && if (TEST(hsp->cstat, CSTAT_SPRITE_ALIGNMENT_FLOOR) &&
(labs(loz - z) <= min_height)) (labs(loz - z) <= min_height))
{ {
return FALSE; return FALSE;
@ -6452,7 +6452,7 @@ KeyMain:
// Attach flag to player // Attach flag to player
nu->Counter = 0; nu->Counter = 0;
RESET(np->cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN); RESET(np->cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
SET(np->cstat, CSTAT_SPRITE_WALL); SET(np->cstat, CSTAT_SPRITE_ALIGNMENT_WALL);
SetAttach(pp->PlayerSprite, New); SetAttach(pp->PlayerSprite, New);
nu->sz = SPRITEp_MID(&sprite[pp->PlayerSprite]); // Set mid way up who it hit nu->sz = SPRITEp_MID(&sprite[pp->PlayerSprite]); // Set mid way up who it hit
nu->spal = np->pal = sp->pal; // Set the palette of the flag nu->spal = np->pal = sp->pal; // Set the palette of the flag

View file

@ -4633,7 +4633,7 @@ WeaponMoveHit(short SpriteNum)
//return(TRUE); //return(TRUE);
} }
if (TEST(hsp->cstat, CSTAT_SPRITE_WALL)) if (TEST(hsp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL))
{ {
if (hsp->lotag || hsp->hitag) if (hsp->lotag || hsp->hitag)
{ {
@ -4694,7 +4694,7 @@ WeaponMoveHit(short SpriteNum)
return TRUE; return TRUE;
} }
if (TEST(hsp->cstat, CSTAT_SPRITE_WALL)) if (TEST(hsp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL))
{ {
if (hsp->lotag || hsp->hitag) if (hsp->lotag || hsp->hitag)
{ {
@ -8759,7 +8759,7 @@ DoPlasma(int16_t Weapon)
SPRITEp hsp = &sprite[hit_sprite]; SPRITEp hsp = &sprite[hit_sprite];
USERp hu = User[hit_sprite]; USERp hu = User[hit_sprite];
if (TEST(hsp->cstat, CSTAT_SPRITE_BLOCK) && !TEST(hsp->cstat, CSTAT_SPRITE_WALL)) if (TEST(hsp->cstat, CSTAT_SPRITE_BLOCK) && !TEST(hsp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL))
{ {
short hcstat = hsp->cstat; short hcstat = hsp->cstat;
@ -9033,7 +9033,7 @@ DoGrenade(int16_t Weapon)
DoMatchEverything(NULL, hsp->hitag, -1); DoMatchEverything(NULL, hsp->hitag, -1);
} }
if (TEST(hsp->cstat, CSTAT_SPRITE_WALL)) if (TEST(hsp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL))
{ {
wall_ang = NORM_ANGLE(hsp->ang); wall_ang = NORM_ANGLE(hsp->ang);
WallBounce(Weapon, wall_ang); WallBounce(Weapon, wall_ang);
@ -9266,7 +9266,7 @@ DoVulcanBoulder(int16_t Weapon)
hit_sprite = NORM_SPRITE(u->ret); hit_sprite = NORM_SPRITE(u->ret);
hsp = &sprite[hit_sprite]; hsp = &sprite[hit_sprite];
if (TEST(hsp->cstat, CSTAT_SPRITE_WALL)) if (TEST(hsp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL))
{ {
wall_ang = NORM_ANGLE(hsp->ang); wall_ang = NORM_ANGLE(hsp->ang);
WallBounce(Weapon, wall_ang); WallBounce(Weapon, wall_ang);
@ -9716,11 +9716,11 @@ DoMine(int16_t Weapon)
} }
else else
{ {
if (TEST(hsp->cstat, CSTAT_SPRITE_WALL)) if (TEST(hsp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL))
{ {
SET(u->Flags2, SPR2_ATTACH_WALL); SET(u->Flags2, SPR2_ATTACH_WALL);
} }
else if (TEST(hsp->cstat, CSTAT_SPRITE_FLOOR)) else if (TEST(hsp->cstat, CSTAT_SPRITE_ALIGNMENT_FLOOR))
{ {
// hit floor // hit floor
if (sp->z > DIV2(u->hiz + u->loz)) if (sp->z > DIV2(u->hiz + u->loz))
@ -12159,7 +12159,7 @@ DoFindGround(int16_t SpriteNum)
{ {
hsp = &sprite[NORM_SPRITE(florhit)]; hsp = &sprite[NORM_SPRITE(florhit)];
if (TEST(hsp->cstat, CSTAT_SPRITE_FLOOR)) if (TEST(hsp->cstat, CSTAT_SPRITE_ALIGNMENT_FLOOR))
{ {
// found a sprite floor // found a sprite floor
u->lo_sp = hsp; u->lo_sp = hsp;
@ -12219,7 +12219,7 @@ DoFindGroundPoint(int16_t SpriteNum)
{ {
hsp = &sprite[NORM_SPRITE(florhit)]; hsp = &sprite[NORM_SPRITE(florhit)];
if (TEST(hsp->cstat, CSTAT_SPRITE_FLOOR)) if (TEST(hsp->cstat, CSTAT_SPRITE_ALIGNMENT_FLOOR))
{ {
// found a sprite floor // found a sprite floor
u->lo_sp = hsp; u->lo_sp = hsp;
@ -12296,7 +12296,7 @@ DoNapalm(int16_t Weapon)
{ {
SPRITEp hsp = &sprite[NORM_SPRITE(u->ret)]; SPRITEp hsp = &sprite[NORM_SPRITE(u->ret)];
if (TEST(hsp->cstat, CSTAT_SPRITE_BLOCK) && !TEST(hsp->cstat, CSTAT_SPRITE_WALL)) if (TEST(hsp->cstat, CSTAT_SPRITE_BLOCK) && !TEST(hsp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL))
{ {
short hcstat = hsp->cstat; short hcstat = hsp->cstat;
@ -12728,7 +12728,7 @@ DoMirv(int16_t Weapon)
{ {
SPRITEp hsp = &sprite[NORM_SPRITE(u->ret)]; SPRITEp hsp = &sprite[NORM_SPRITE(u->ret)];
if (TEST(hsp->cstat, CSTAT_SPRITE_BLOCK) && !TEST(hsp->cstat, CSTAT_SPRITE_WALL)) if (TEST(hsp->cstat, CSTAT_SPRITE_BLOCK) && !TEST(hsp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL))
{ {
short hcstat = hsp->cstat; short hcstat = hsp->cstat;
@ -13953,7 +13953,7 @@ InitSwordAttack(PLAYERp pp)
} }
// hit a switch? // hit a switch?
if (TEST(hsp->cstat, CSTAT_SPRITE_WALL) && (hsp->lotag || hsp->hitag)) if (TEST(hsp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL) && (hsp->lotag || hsp->hitag))
{ {
ShootableSwitch(hitinfo.sprite,-1); ShootableSwitch(hitinfo.sprite,-1);
} }
@ -14145,7 +14145,7 @@ InitFistAttack(PLAYERp pp)
} }
// hit a switch? // hit a switch?
if (TEST(hsp->cstat, CSTAT_SPRITE_WALL) && (hsp->lotag || hsp->hitag)) if (TEST(hsp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL) && (hsp->lotag || hsp->hitag))
{ {
ShootableSwitch(hitinfo.sprite,-1); ShootableSwitch(hitinfo.sprite,-1);
} }
@ -14753,7 +14753,7 @@ InitStar(PLAYERp pp)
// PlaySound(DIGI_STARWIZ, &wp->x, &wp->y, &wp->z, v3df_follow); // PlaySound(DIGI_STARWIZ, &wp->x, &wp->y, &wp->z, v3df_follow);
// Set3DSoundOwner(w); // Set3DSoundOwner(w);
//SET(wp->cstat, CSTAT_SPRITE_WALL); //SET(wp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL);
SetOwner(pp->PlayerSprite, w); SetOwner(pp->PlayerSprite, w);
wp->yrepeat = wp->xrepeat = STAR_REPEAT; wp->yrepeat = wp->xrepeat = STAR_REPEAT;
wp->shade = -25; wp->shade = -25;
@ -15048,7 +15048,7 @@ int ContinueHitscan(PLAYERp pp, short sectnum, int x, int y, int z, short ang, i
return 0; return 0;
// hit a switch? // hit a switch?
if (TEST(hsp->cstat, CSTAT_SPRITE_WALL) && (hsp->lotag || hsp->hitag)) if (TEST(hsp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL) && (hsp->lotag || hsp->hitag))
{ {
ShootableSwitch(hitinfo.sprite,-1); ShootableSwitch(hitinfo.sprite,-1);
} }
@ -15224,7 +15224,7 @@ InitShotgun(PLAYERp pp)
continue; continue;
// hit a switch? // hit a switch?
if (TEST(hsp->cstat, CSTAT_SPRITE_WALL) && (hsp->lotag || hsp->hitag)) if (TEST(hsp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL) && (hsp->lotag || hsp->hitag))
{ {
ShootableSwitch(hitinfo.sprite,-1); ShootableSwitch(hitinfo.sprite,-1);
} }
@ -17816,9 +17816,9 @@ int SpawnWallHole(short hit_sect, short hit_wall, int hit_x, int hit_y, int hit_
sp->z = hit_z; sp->z = hit_z;
sp->picnum = 2151; sp->picnum = 2151;
//SET(sp->cstat, CSTAT_SPRITE_TRANSLUCENT|CSTAT_SPRITE_WALL); //SET(sp->cstat, CSTAT_SPRITE_TRANSLUCENT|CSTAT_SPRITE_ALIGNMENT_WALL);
SET(sp->cstat, CSTAT_SPRITE_WALL); SET(sp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL);
SET(sp->cstat, CSTAT_SPRITE_ONE_SIDE); SET(sp->cstat, CSTAT_SPRITE_ONE_SIDED);
w = hit_wall; w = hit_wall;
nw = wall[w].point2; nw = wall[w].point2;
@ -18046,7 +18046,7 @@ InitUzi(PLAYERp pp)
return 0; return 0;
// hit a switch? // hit a switch?
if (TEST(hsp->cstat, CSTAT_SPRITE_WALL) && (hsp->lotag || hsp->hitag)) if (TEST(hsp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL) && (hsp->lotag || hsp->hitag))
{ {
ShootableSwitch(hitinfo.sprite,-1); ShootableSwitch(hitinfo.sprite,-1);
} }
@ -18225,7 +18225,7 @@ InitEMP(PLAYERp pp)
//return(0); //return(0);
// hit a switch? // hit a switch?
if (TEST(hsp->cstat, CSTAT_SPRITE_WALL) && (hsp->lotag || hsp->hitag)) if (TEST(hsp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL) && (hsp->lotag || hsp->hitag))
{ {
ShootableSwitch(hitinfo.sprite,-1); ShootableSwitch(hitinfo.sprite,-1);
} }
@ -18240,11 +18240,11 @@ InitEMP(PLAYERp pp)
} }
else else
{ {
if (TEST(hsp->cstat, CSTAT_SPRITE_WALL)) if (TEST(hsp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL))
{ {
SET(wu->Flags2, SPR2_ATTACH_WALL); SET(wu->Flags2, SPR2_ATTACH_WALL);
} }
else if (TEST(hsp->cstat, CSTAT_SPRITE_FLOOR)) else if (TEST(hsp->cstat, CSTAT_SPRITE_ALIGNMENT_FLOOR))
{ {
// hit floor // hit floor
if (wp->z > DIV2(wu->hiz + wu->loz)) if (wp->z > DIV2(wu->hiz + wu->loz))
@ -18740,7 +18740,7 @@ InitSobjMachineGun(short SpriteNum, PLAYERp pp)
return 0; return 0;
// hit a switch? // hit a switch?
if (TEST(hsp->cstat, CSTAT_SPRITE_WALL) && (hsp->lotag || hsp->hitag)) if (TEST(hsp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL) && (hsp->lotag || hsp->hitag))
{ {
ShootableSwitch(hitinfo.sprite,-1); ShootableSwitch(hitinfo.sprite,-1);
} }
@ -19183,7 +19183,7 @@ InitTurretMgun(SECTOR_OBJECTp sop)
continue; continue;
// hit a switch? // hit a switch?
if (TEST(hsp->cstat, CSTAT_SPRITE_WALL) && (hsp->lotag || hsp->hitag)) if (TEST(hsp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL) && (hsp->lotag || hsp->hitag))
{ {
ShootableSwitch(hitinfo.sprite,-1); ShootableSwitch(hitinfo.sprite,-1);
} }
@ -20736,8 +20736,8 @@ int QueueHole(short ang, short hit_sect, short hit_wall, int hit_x, int hit_y, i
ASSERT(sp->statnum != MAXSTATUS); ASSERT(sp->statnum != MAXSTATUS);
SET(sp->cstat, CSTAT_SPRITE_WALL); SET(sp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL);
SET(sp->cstat, CSTAT_SPRITE_ONE_SIDE); SET(sp->cstat, CSTAT_SPRITE_ONE_SIDED);
RESET(sp->cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN); RESET(sp->cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
w = hit_wall; w = hit_wall;
@ -20822,8 +20822,8 @@ int QueueFloorBlood(short hit_sprite)
sp->ang = RANDOM_P2(2048); // Just make it any old angle sp->ang = RANDOM_P2(2048); // Just make it any old angle
sp->shade -= 5; // Brighten it up just a bit sp->shade -= 5; // Brighten it up just a bit
SET(sp->cstat, CSTAT_SPRITE_FLOOR); SET(sp->cstat, CSTAT_SPRITE_ALIGNMENT_FLOOR);
SET(sp->cstat, CSTAT_SPRITE_ONE_SIDE); SET(sp->cstat, CSTAT_SPRITE_ONE_SIDED);
RESET(sp->cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN); RESET(sp->cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
RESET(u->Flags, SPR_SHADOW); RESET(u->Flags, SPR_SHADOW);
@ -20943,8 +20943,8 @@ int QueueFootPrint(short hit_sprite)
left_foot = !left_foot; left_foot = !left_foot;
if (left_foot) if (left_foot)
SET(sp->cstat, CSTAT_SPRITE_XFLIP); SET(sp->cstat, CSTAT_SPRITE_XFLIP);
SET(sp->cstat, CSTAT_SPRITE_FLOOR); SET(sp->cstat, CSTAT_SPRITE_ALIGNMENT_FLOOR);
SET(sp->cstat, CSTAT_SPRITE_ONE_SIDE); SET(sp->cstat, CSTAT_SPRITE_ONE_SIDED);
RESET(sp->cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN); RESET(sp->cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
return SpriteNum; return SpriteNum;
@ -21064,8 +21064,8 @@ int QueueWallBlood(short hit_sprite, short ang)
sp->shade -= 5; // Brighten it up just a bit sp->shade -= 5; // Brighten it up just a bit
sp->yvel = hitinfo.wall; // pass hitinfo.wall in yvel sp->yvel = hitinfo.wall; // pass hitinfo.wall in yvel
SET(sp->cstat, CSTAT_SPRITE_WALL); SET(sp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL);
SET(sp->cstat, CSTAT_SPRITE_ONE_SIDE); SET(sp->cstat, CSTAT_SPRITE_ONE_SIDED);
SET(sp->cstat, CSTAT_SPRITE_YCENTER); SET(sp->cstat, CSTAT_SPRITE_YCENTER);
RESET(sp->cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN); RESET(sp->cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
@ -21689,7 +21689,7 @@ DoItemFly(int16_t SpriteNum)
hit_sprite = NORM_SPRITE(u->ret); hit_sprite = NORM_SPRITE(u->ret);
hsp = &sprite[hit_sprite]; hsp = &sprite[hit_sprite];
if (TEST(hsp->cstat, CSTAT_SPRITE_WALL)) if (TEST(hsp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL))
{ {
wall_ang = NORM_ANGLE(hsp->ang); wall_ang = NORM_ANGLE(hsp->ang);
WallBounce(SpriteNum, wall_ang); WallBounce(SpriteNum, wall_ang);