diff --git a/source/games/exhumed/src/anubis.cpp b/source/games/exhumed/src/anubis.cpp index 4dbb927fd..0bcfd832d 100644 --- a/source/games/exhumed/src/anubis.cpp +++ b/source/games/exhumed/src/anubis.cpp @@ -122,7 +122,7 @@ void AIAnubis::Tick(RunListEvent* ev) const int nAction = ap->nAction; const int nSeq = getSeqFromId(kSeqAnubis, AnubisSeq[nAction].a); const int nFrame = getSeqFrame(nSeq, ap->nFrame); - const int nFlag = FrameFlag[nFrame]; + const int nFlag = getSeqFrameFlags(nFrame); bool bVal = false; if (nAction < 11) diff --git a/source/games/exhumed/src/bullet.cpp b/source/games/exhumed/src/bullet.cpp index a63a19f8f..2039b8672 100644 --- a/source/games/exhumed/src/bullet.cpp +++ b/source/games/exhumed/src/bullet.cpp @@ -802,7 +802,7 @@ void AIBullet::Tick(RunListEvent* ev) int nSeq = getSeqFromId(BulletList[nBullet].nSeq); DExhumedActor* pActor = BulletList[nBullet].pActor; - int nFlag = FrameFlag[getSeqFrame(nSeq, BulletList[nBullet].nFrame)]; + int nFlag = getSeqFrameFlags(getSeqFrame(nSeq, BulletList[nBullet].nFrame)); seq_MoveSequence(pActor, nSeq, BulletList[nBullet].nFrame); diff --git a/source/games/exhumed/src/gun.cpp b/source/games/exhumed/src/gun.cpp index 50a1dcb68..b2b0a7e03 100644 --- a/source/games/exhumed/src/gun.cpp +++ b/source/games/exhumed/src/gun.cpp @@ -645,7 +645,7 @@ void MoveWeapons(int nPlayer) loc_flag: // loc_27001 - int nFrameFlag = seq_GetFrameFlag(var_3C, pPlayer->nSeqSize2); + int nFrameFlag = getSeqFrameFlags(getSeqFrame(var_3C, pPlayer->nSeqSize2)); if (((!(nSectFlag & kSectUnderwater)) || nWeapon == kWeaponRing) && (nFrameFlag & 4)) { diff --git a/source/games/exhumed/src/lavadude.cpp b/source/games/exhumed/src/lavadude.cpp index 2ebaf4109..0e2b9f8ce 100644 --- a/source/games/exhumed/src/lavadude.cpp +++ b/source/games/exhumed/src/lavadude.cpp @@ -218,7 +218,7 @@ void AILavaDude::Tick(RunListEvent* ev) pActor->spr.picnum = seq_GetSeqPicnum2(nSeq, pActor->nFrame); int var_38 = pActor->nFrame; - int nFlag = FrameFlag[getSeqFrame(nSeq, var_38)]; + int nFlag = getSeqFrameFlags(getSeqFrame(nSeq, var_38)); int var_1C = 0; diff --git a/source/games/exhumed/src/lion.cpp b/source/games/exhumed/src/lion.cpp index 1508e4696..b6150b390 100644 --- a/source/games/exhumed/src/lion.cpp +++ b/source/games/exhumed/src/lion.cpp @@ -211,7 +211,7 @@ void AILion::Tick(RunListEvent* ev) bVal = true; } - int nFlag = FrameFlag[getSeqFrame(nSeq, pActor->nFrame)]; + int nFlag = getSeqFrameFlags(getSeqFrame(nSeq, pActor->nFrame)); DExhumedActor* pTarget = pActor->pTarget; auto nMov = MoveCreatureWithCaution(pActor); diff --git a/source/games/exhumed/src/mummy.cpp b/source/games/exhumed/src/mummy.cpp index e9a475ec0..3eac08d4f 100644 --- a/source/games/exhumed/src/mummy.cpp +++ b/source/games/exhumed/src/mummy.cpp @@ -144,7 +144,7 @@ void AIMummy::Tick(RunListEvent* ev) pActor->spr.picnum = seq_GetSeqPicnum2(nSeq, pActor->nFrame); int nFrame = getSeqFrame(nSeq, pActor->nFrame); - int nFrameFlag = FrameFlag[nFrame]; + int nFrameFlag = getSeqFrameFlags(nFrame); seq_MoveSequence(pActor, nSeq, pActor->nFrame); diff --git a/source/games/exhumed/src/queen.cpp b/source/games/exhumed/src/queen.cpp index 85b4845bf..d4359e4f2 100644 --- a/source/games/exhumed/src/queen.cpp +++ b/source/games/exhumed/src/queen.cpp @@ -1252,7 +1252,7 @@ void AIQueen::Tick(RunListEvent* ev) bVal = true; } - int nFlag = FrameFlag[getSeqFrame(nSeq, QueenList[nQueen].nFrame)]; + int nFlag = getSeqFrameFlags(getSeqFrame(nSeq, QueenList[nQueen].nFrame)); if (pActor != nullptr) { diff --git a/source/games/exhumed/src/rex.cpp b/source/games/exhumed/src/rex.cpp index a676275c3..c6ddb1981 100644 --- a/source/games/exhumed/src/rex.cpp +++ b/source/games/exhumed/src/rex.cpp @@ -215,7 +215,7 @@ void AIRex::Tick(RunListEvent* ev) } } - int nFlag = FrameFlag[getSeqFrame(nSeq, pActor->nFrame)]; + int nFlag = getSeqFrameFlags(getSeqFrame(nSeq, pActor->nFrame)); DExhumedActor* pTarget = pActor->pTarget; diff --git a/source/games/exhumed/src/roach.cpp b/source/games/exhumed/src/roach.cpp index 1bc9dc83a..74ee3f188 100644 --- a/source/games/exhumed/src/roach.cpp +++ b/source/games/exhumed/src/roach.cpp @@ -223,7 +223,7 @@ void AIRoach::Tick(RunListEvent* ev) pActor->nFrame = 0; } - int nFlag = FrameFlag[getSeqFrame(nSeq, pActor->nFrame)]; + int nFlag = getSeqFrameFlags(getSeqFrame(nSeq, pActor->nFrame)); DExhumedActor* pTarget = pActor->pTarget; if (nAction > 5) { diff --git a/source/games/exhumed/src/scorp.cpp b/source/games/exhumed/src/scorp.cpp index 0f4fa1094..6e14ae909 100644 --- a/source/games/exhumed/src/scorp.cpp +++ b/source/games/exhumed/src/scorp.cpp @@ -219,7 +219,7 @@ void AIScorp::Tick(RunListEvent* ev) bVal = true; } - int nFlag = FrameFlag[getSeqFrame(nSeq, pActor->nFrame)]; + int nFlag = getSeqFrameFlags(getSeqFrame(nSeq, pActor->nFrame)); pTarget = pActor->pTarget; switch (nAction) diff --git a/source/games/exhumed/src/sequence.cpp b/source/games/exhumed/src/sequence.cpp index 442932071..6c3669f46 100644 --- a/source/games/exhumed/src/sequence.cpp +++ b/source/games/exhumed/src/sequence.cpp @@ -58,7 +58,7 @@ static int16_t SeqFlag[kMaxSequences]; // not used at all. int16_t FrameSound[kMaxSEQFrames]; int16_t FrameSize[kMaxSEQFrames]; static int16_t FrameBase[kMaxSEQFrames]; -int16_t FrameFlag[kMaxSEQFrames]; +static int16_t FrameFlag[kMaxSEQFrames]; int16_t ChunkYpos[kMaxSEQChunks]; int16_t ChunkXpos[kMaxSEQChunks]; @@ -201,6 +201,17 @@ int getSeqFrameChunk(const int nFrame) // //--------------------------------------------------------------------------- +int getSeqFrameFlags(const int nFrame) +{ + return FrameFlag[nFrame]; +} + +//--------------------------------------------------------------------------- +// +// +// +//--------------------------------------------------------------------------- + int seq_ReadSequence(const char *seqName) { const int16_t StartFrameCount = frames; @@ -420,17 +431,6 @@ void seq_LoadSequences() // //--------------------------------------------------------------------------- -int16_t seq_GetFrameFlag(int16_t val, int16_t nFrame) -{ - return FrameFlag[getSeqFrame(val, nFrame)]; -} - -//--------------------------------------------------------------------------- -// -// -// -//--------------------------------------------------------------------------- - void seq_DrawPilotLightSeq(double xOffset, double yOffset) { auto pSect = PlayerList[nLocalPlayer].pPlayerViewSect; @@ -468,7 +468,7 @@ int seq_DrawGunSequence(int nSeqOffset, int16_t dx, double xOffs, double yOffs, int nFrame = getSeqFrame(nSeqOffset, dx); int nFrameBase = getSeqFrameChunk(nFrame); int nFrameSize = FrameSize[nFrame]; - int frameFlag = FrameFlag[nFrame]; + int frameFlag = getSeqFrameFlags(nFrame); while (1) { @@ -585,7 +585,7 @@ int seq_PlotArrowSequence(int nSprite, int16_t nSeq, int nVal) nStat &= ~(CSTAT_SPRITE_ALIGNMENT_WALL | CSTAT_SPRITE_YFLIP); } - if (FrameFlag[nFrame] & 4) { + if (getSeqFrameFlags(nFrame) & 4) { nShade -= 100; } @@ -639,7 +639,7 @@ int seq_PlotSequence(int nSprite, int16_t edx, int16_t nFrame, int16_t ecx) int8_t shade = pTSprite->shade; - if (FrameFlag[eax] & 4) + if (getSeqFrameFlags(eax) & 4) { shade -= 100; } diff --git a/source/games/exhumed/src/sequence.h b/source/games/exhumed/src/sequence.h index fabade680..ff54debe4 100644 --- a/source/games/exhumed/src/sequence.h +++ b/source/games/exhumed/src/sequence.h @@ -110,8 +110,6 @@ struct actionSeq extern int16_t frames; -extern int16_t FrameFlag[]; - extern int16_t nShadowWidth; extern int16_t nFlameHeight; @@ -134,7 +132,6 @@ int seq_GetSeqPicnum(int16_t nSeq, int16_t edx, int16_t ebx); void seq_DrawStatusSequence(int16_t nSequence, uint16_t edx, int16_t ebx); int seq_DrawGunSequence(int nSeqOffset, int16_t dx, double xOffs, double yOffs, int nShade, int nPal, DAngle angle, bool align = false); -int16_t seq_GetFrameFlag(int16_t val, int16_t nFrame); int seq_PlotSequence(int nSprite, int16_t edx, int16_t nFrame, int16_t ecx); int seq_PlotArrowSequence(int nSprite, int16_t nSeq, int nVal); void seq_DrawPilotLightSeq(double xOffset, double yOffset); @@ -143,6 +140,7 @@ int getSeqFromId(const int nSeqFileId, const int nSeq = 0); int getSeqFrame(const int nSeq, const int nFrame = 0); int getSeqFrameCount(const int nSeq); int getSeqFrameChunk(const int nFrame); +int getSeqFrameFlags(const int nFrame); END_PS_NS diff --git a/source/games/exhumed/src/set.cpp b/source/games/exhumed/src/set.cpp index a26ff1a91..0aa3b189a 100644 --- a/source/games/exhumed/src/set.cpp +++ b/source/games/exhumed/src/set.cpp @@ -287,7 +287,7 @@ void AISet::Tick(RunListEvent* ev) bVal = true; } - int nFlag = FrameFlag[getSeqFrame(nSeq, pActor->nFrame)]; + int nFlag = getSeqFrameFlags(getSeqFrame(nSeq, pActor->nFrame)); DExhumedActor* pTarget = pActor->pTarget; if (pTarget && nAction < 10) diff --git a/source/games/exhumed/src/spider.cpp b/source/games/exhumed/src/spider.cpp index 00c910b80..61d6dd8a4 100644 --- a/source/games/exhumed/src/spider.cpp +++ b/source/games/exhumed/src/spider.cpp @@ -123,7 +123,7 @@ void AISpider::Tick(RunListEvent* ev) seq_MoveSequence(spp, nSeq, spp->nFrame); - int nFrameFlag = FrameFlag[getSeqFrame(nSeq, spp->nFrame)]; + int nFrameFlag = getSeqFrameFlags(getSeqFrame(nSeq, spp->nFrame)); spp->nFrame++; if (spp->nFrame >= getSeqFrameCount(nSeq)) {