- some remaining sector flag stuff

This commit is contained in:
Christoph Oelckers 2021-12-18 13:23:08 +01:00
parent d0a06ae961
commit b0e3c6b5ec
7 changed files with 19 additions and 15 deletions

View file

@ -63,6 +63,10 @@ enum ESectorBits
CSTAT_SECTOR_TRANS_INVERT = 256, CSTAT_SECTOR_TRANS_INVERT = 256,
CSTAT_SECTOR_METHOD = 384, CSTAT_SECTOR_METHOD = 384,
CSTAT_SECTOR_FAF_BLOCK_HITSCAN = 32768, // SW only CSTAT_SECTOR_FAF_BLOCK_HITSCAN = 32768, // SW only
CSTAT_SECTOR_EXHUMED_BIT1 = 1 << 14,
CSTAT_SECTOR_EXHUMED_BIT2 = 1 << 15,
}; };
// Extended sector bit flags. // Extended sector bit flags.

View file

@ -1340,7 +1340,7 @@ void doslopetilting(PLAYER* pPlayer, double const scaleAdjust = 1)
auto* const pXSprite = pPlayer->pXSprite; auto* const pXSprite = pPlayer->pXSprite;
int const florhit = pPlayer->actor->hit.florhit.type; int const florhit = pPlayer->actor->hit.florhit.type;
bool const va = pXSprite->height < 16 && (florhit == kHitSector || florhit == 0) ? 1 : 0; bool const va = pXSprite->height < 16 && (florhit == kHitSector || florhit == 0) ? 1 : 0;
pPlayer->horizon.calcviewpitch(pSprite->pos.vec2, buildang(pSprite->ang), va, pSprite->sector()->floorstat & 2, pSprite->sector(), scaleAdjust); pPlayer->horizon.calcviewpitch(pSprite->pos.vec2, buildang(pSprite->ang), va, pSprite->sector()->floorstat & CSTAT_SECTOR_SLOPE, pSprite->sector(), scaleAdjust);
} }
void ProcessInput(PLAYER *pPlayer) void ProcessInput(PLAYER *pPlayer)

View file

@ -2316,7 +2316,7 @@ bool jibs(DDukeActor *actor, int JIBS6, bool timeout, bool callsetsprite, bool f
deletesprite(actor); deletesprite(actor);
return false; return false;
} }
if ((s->sector()->floorstat & 2)) if ((s->sector()->floorstat & CSTAT_SECTOR_SLOPE))
{ {
deletesprite(actor); deletesprite(actor);
return false; return false;
@ -2359,7 +2359,7 @@ bool bloodpool(DDukeActor* actor, bool puke, int TIRE)
if (t[0] == 0) if (t[0] == 0)
{ {
t[0] = 1; t[0] = 1;
if (sectp->floorstat & 2) if (sectp->floorstat & CSTAT_SECTOR_SLOPE)
{ {
deletesprite(actor); deletesprite(actor);
return false; return false;
@ -2737,7 +2737,7 @@ void handle_se00(DDukeActor* actor, int LASERLINE)
t[2] += (l * q); t[2] += (l * q);
} }
if (l && (sect->floorstat & 64)) if (l && (sect->floorstat & CSTAT_SECTOR_ALIGN))
{ {
int p; int p;
for (p = connecthead; p >= 0; p = connectpoint2[p]) for (p = connecthead; p >= 0; p = connectpoint2[p])
@ -3794,7 +3794,7 @@ void handle_se13(DDukeActor* actor)
//Change the shades //Change the shades
t[3]++; t[3]++;
sc->ceilingstat ^= 1; sc->ceilingstat ^= CSTAT_SECTOR_SKY;
if (s->ang == 512) if (s->ang == 512)
{ {
@ -4259,7 +4259,7 @@ void handle_se20(DDukeActor* actor)
a2->s->x += x; a2->s->x += x;
a2->s->y += l; a2->s->y += l;
SetActor(a2, a2->s->pos); SetActor(a2, a2->s->pos);
if (a2->sector()->floorstat & 2) if (a2->sector()->floorstat & CSTAT_SECTOR_SLOPE)
if (a2->s->statnum == 2) if (a2->s->statnum == 2)
makeitfall(a2); makeitfall(a2);
} }
@ -4515,7 +4515,7 @@ void handle_se24(DDukeActor *actor, const int16_t *list1, const int16_t *list2,
SetActor(a2, s2->pos); SetActor(a2, s2->pos);
if (s2->sector()->floorstat & 2) if (s2->sector()->floorstat & CSTAT_SECTOR_SLOPE)
if (s2->statnum == 2) if (s2->statnum == 2)
makeitfall(a2); makeitfall(a2);
} }
@ -5236,7 +5236,7 @@ void fall_common(DDukeActor *actor, int playernum, int JIBS6, int DRONE, int BLO
else c = gs.gravity; else c = gs.gravity;
} }
if (actor->cgg <= 0 || (s->sector()->floorstat & 2)) if (actor->cgg <= 0 || (s->sector()->floorstat & CSTAT_SECTOR_SLOPE))
{ {
getglobalz(actor); getglobalz(actor);
actor->cgg = 6; actor->cgg = 6;

View file

@ -487,7 +487,7 @@ void footprints(int snum)
auto s = actor->s; auto s = actor->s;
if (p->footprintcount > 0 && p->on_ground) if (p->footprintcount > 0 && p->on_ground)
if ((p->cursector->floorstat & 2) != 2) if ((p->cursector->floorstat & CSTAT_SECTOR_SLOPE) != 2)
{ {
int j = -1; int j = -1;
DukeSectIterator it(s->sector()); DukeSectIterator it(s->sector());

View file

@ -734,12 +734,12 @@ void spawneffector(DDukeActor* actor, TArray<DDukeActor*>* actors)
if (sectp->ceilingstat & CSTAT_SECTOR_SKY) if (sectp->ceilingstat & CSTAT_SECTOR_SKY)
{ {
sectp->ceilingstat ^= 1; sectp->ceilingstat ^= CSTAT_SECTOR_SKY;
t[3] = 1; t[3] = 1;
if (!ceiling && sp->ang == 512) if (!ceiling && sp->ang == 512)
{ {
sectp->ceilingstat ^= 1; sectp->ceilingstat ^= CSTAT_SECTOR_SKY;
t[3] = 0; t[3] = 0;
} }

View file

@ -2338,7 +2338,7 @@ void AddMovingSector(sectortype* pSector, int edx, int ebx, int ecx)
pMoveSect->nChannel = -1; pMoveSect->nChannel = -1;
} }
pSector->floorstat |= 0x40; pSector->floorstat |= CSTAT_SECTOR_ALIGN;
} }
void DoMovingSects() void DoMovingSects()
@ -2493,8 +2493,8 @@ void PostProcess()
if (pSector->Flag & kSectUnderwater) if (pSector->Flag & kSectUnderwater)
{ {
pSector->ceilingstat |= 0x40; pSector->ceilingstat |= CSTAT_SECTOR_ALIGN;
pSector->floorstat &= 0xBFFF; pSector->floorstat &= ~(CSTAT_SECTOR_EXHUMED_BIT1 | CSTAT_SECTOR_EXHUMED_BIT2);
for (unsigned j = 0; j < sMoveSect.Size(); j++) for (unsigned j = 0; j < sMoveSect.Size(); j++)
{ {

View file

@ -291,7 +291,7 @@ void AISpider::Tick(RunListEvent* ev)
if (nMov.exbits & kHitAux1 if (nMov.exbits & kHitAux1
&& sp->zvel < 0 && sp->zvel < 0
&& hiHit.type != kHitSprite && hiHit.type != kHitSprite
&& !((sp->sector()->ceilingstat) & 1)) && !((sp->sector()->ceilingstat) & CSTAT_SECTOR_SKY))
{ {
sp->cstat |= 8; sp->cstat |= 8;
sp->z = GetActorHeight(spp) + sp->sector()->ceilingz; sp->z = GetActorHeight(spp) + sp->sector()->ceilingz;