mirror of
https://github.com/ZDoom/Raze.git
synced 2025-03-23 17:31:14 +00:00
- Exhumed: Wrap all access to SeqOffsets[]
array and make static.
This commit is contained in:
parent
4cc3664287
commit
53b7235adf
26 changed files with 78 additions and 67 deletions
|
@ -49,9 +49,9 @@ void SerializeAnim(FSerializer& arc)
|
|||
|
||||
void InitAnims()
|
||||
{
|
||||
nMagicSeq = SeqOffsets[kSeqItems] + 21;
|
||||
nPreMagicSeq = SeqOffsets[kSeqMagic2];
|
||||
nSavePointSeq = SeqOffsets[kSeqItems] + 12;
|
||||
nMagicSeq = getSeqFromId(kSeqItems, 21);
|
||||
nPreMagicSeq = getSeqFromId(kSeqMagic2);
|
||||
nSavePointSeq = getSeqFromId(kSeqItems, 12);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -135,7 +135,7 @@ DExhumedActor* BuildAnim(DExhumedActor* pActor, int nSeq, int nOffset, const DVe
|
|||
pActor->nRun = runlist_AddRunRec(NewRun, pActor, 0x100000);
|
||||
pActor->nAction = nFlag;
|
||||
pActor->nIndex = 0;
|
||||
pActor->nIndex2 = SeqOffsets[nSeq] + nOffset;
|
||||
pActor->nIndex2 = getSeqFromId(nSeq, nOffset);
|
||||
pActor->pTarget = nullptr;
|
||||
pActor->nDamage = pActor->nRun;
|
||||
pActor->nPhase = ITEM_MAGIC;
|
||||
|
|
|
@ -120,7 +120,7 @@ void AIAnubis::Tick(RunListEvent* ev)
|
|||
{
|
||||
const auto ap = ev->pObjActor;
|
||||
const int nAction = ap->nAction;
|
||||
const int nSeq = SeqOffsets[kSeqAnubis] + AnubisSeq[nAction].a;
|
||||
const int nSeq = getSeqFromId(kSeqAnubis, AnubisSeq[nAction].a);
|
||||
const int nFrame = SeqBase[nSeq] + ap->nFrame;
|
||||
const int nFlag = FrameFlag[nFrame];
|
||||
bool bVal = false;
|
||||
|
@ -340,7 +340,7 @@ void AIAnubis::Draw(RunListEvent* ev)
|
|||
const auto ap = ev->pObjActor;
|
||||
if (!ap) return;
|
||||
|
||||
seq_PlotSequence(ev->nParam, SeqOffsets[kSeqAnubis] + AnubisSeq[ap->nAction].a, ap->nFrame, AnubisSeq[ap->nAction].b);
|
||||
seq_PlotSequence(ev->nParam, getSeqFromId(kSeqAnubis, AnubisSeq[ap->nAction].a), ap->nFrame, AnubisSeq[ap->nAction].b);
|
||||
}
|
||||
|
||||
void AIAnubis::RadialDamage(RunListEvent* ev)
|
||||
|
|
|
@ -77,7 +77,7 @@ static DExhumedActor* BuildBubble(const DVector3& pos, sectortype* pSector, cons
|
|||
// GrabTimeSlot(3);
|
||||
|
||||
pActor->nFrame = 0;
|
||||
pActor->nIndex = SeqOffsets[kSeqBubble] + nSize;
|
||||
pActor->nIndex = getSeqFromId(kSeqBubble, nSize);
|
||||
pActor->spr.intowner = runlist_AddRunRec(pActor->spr.lotag - 1, pActor, 0x140000);
|
||||
pActor->nRun = runlist_AddRunRec(NewRun, pActor, 0x140000);
|
||||
|
||||
|
|
|
@ -799,7 +799,7 @@ void AIBullet::Tick(RunListEvent* ev)
|
|||
int nBullet = RunData[ev->nRun].nObjIndex;
|
||||
assert(nBullet >= 0 && nBullet < kMaxBullets);
|
||||
|
||||
int nSeq = SeqOffsets[BulletList[nBullet].nSeq];
|
||||
int nSeq = getSeqFromId(BulletList[nBullet].nSeq);
|
||||
DExhumedActor* pActor = BulletList[nBullet].pActor;
|
||||
|
||||
int nFlag = FrameFlag[SeqBase[nSeq] + BulletList[nBullet].nFrame];
|
||||
|
@ -844,7 +844,7 @@ void AIBullet::Draw(RunListEvent* ev)
|
|||
int nBullet = RunData[ev->nRun].nObjIndex;
|
||||
assert(nBullet >= 0 && nBullet < kMaxBullets);
|
||||
|
||||
int nSeq = SeqOffsets[BulletList[nBullet].nSeq];
|
||||
int nSeq = getSeqFromId(BulletList[nBullet].nSeq);
|
||||
|
||||
ev->pTSprite->statnum = 1000;
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ void BuildFishLimb(DExhumedActor* pActor, int anim)
|
|||
auto pChunkActor = insertActor(pActor->sector(), 99);
|
||||
|
||||
pChunkActor->nCount = anim + 40;
|
||||
pChunkActor->nFrame = RandomSize(3) % SeqSize[SeqOffsets[kSeqFish] + anim + 40];
|
||||
pChunkActor->nFrame = RandomSize(3) % SeqSize[getSeqFromId(kSeqFish, pChunkActor->nCount)];
|
||||
|
||||
pChunkActor->spr.pos = pActor->spr.pos;
|
||||
pChunkActor->spr.cstat = 0;
|
||||
|
@ -92,7 +92,7 @@ void AIFishLimb::Tick(RunListEvent* ev)
|
|||
auto pActor = ev->pObjActor;
|
||||
if (!pActor) return;
|
||||
|
||||
int nSeq = SeqOffsets[kSeqFish] + pActor->nCount;
|
||||
int nSeq = getSeqFromId(kSeqFish, pActor->nCount);
|
||||
|
||||
pActor->spr.picnum = seq_GetSeqPicnum2(nSeq, pActor->nFrame);
|
||||
|
||||
|
@ -149,7 +149,7 @@ void AIFishLimb::Draw(RunListEvent* ev)
|
|||
{
|
||||
auto pActor = ev->pObjActor;
|
||||
if (pActor == nullptr) return;
|
||||
int nSeq = SeqOffsets[kSeqFish] + pActor->nCount;
|
||||
int nSeq = getSeqFromId(kSeqFish, pActor->nCount);
|
||||
seq_PlotSequence(ev->nParam, nSeq, pActor->nFrame, 1);
|
||||
}
|
||||
|
||||
|
@ -258,7 +258,7 @@ void AIFish::Draw(RunListEvent* ev)
|
|||
if (pActor == nullptr) return;
|
||||
int nAction = pActor->nAction;
|
||||
|
||||
seq_PlotSequence(ev->nParam, SeqOffsets[kSeqFish] + FishSeq[nAction].a, pActor->nFrame, FishSeq[nAction].b);
|
||||
seq_PlotSequence(ev->nParam, getSeqFromId(kSeqFish, FishSeq[nAction].a), pActor->nFrame, FishSeq[nAction].b);
|
||||
ev->pTSprite->ownerActor = nullptr;
|
||||
return;
|
||||
}
|
||||
|
@ -362,7 +362,7 @@ void AIFish::Tick(RunListEvent* ev)
|
|||
Gravity(pActor);
|
||||
}
|
||||
|
||||
int nSeq = SeqOffsets[kSeqFish] + FishSeq[nAction].a;
|
||||
int nSeq = getSeqFromId(kSeqFish, FishSeq[nAction].a);
|
||||
|
||||
pActor->spr.picnum = seq_GetSeqPicnum2(nSeq, pActor->nFrame);
|
||||
|
||||
|
|
|
@ -237,7 +237,7 @@ void AIGrenade::Draw(RunListEvent* ev)
|
|||
auto pActor = ev->pObjActor;
|
||||
if (!pActor) return;
|
||||
|
||||
int nSeq = pActor->nFrame ? SeqOffsets[kSeqGrenBoom] : SeqOffsets[kSeqGrenRoll] + pActor->nIndex;
|
||||
int nSeq = pActor->nFrame ? getSeqFromId(kSeqGrenBoom) : getSeqFromId(kSeqGrenRoll, pActor->nIndex);
|
||||
seq_PlotSequence(ev->nParam, nSeq, pActor->nHealth >> 8, 1);
|
||||
}
|
||||
|
||||
|
@ -253,7 +253,7 @@ void AIGrenade::Tick(RunListEvent* ev)
|
|||
auto pActor = ev->pObjActor;
|
||||
if (!pActor) return;
|
||||
|
||||
int nSeq = pActor->nFrame ? SeqOffsets[kSeqGrenBoom] : SeqOffsets[kSeqGrenRoll] + pActor->nIndex;
|
||||
int nSeq = pActor->nFrame ? getSeqFromId(kSeqGrenBoom) : getSeqFromId(kSeqGrenRoll, pActor->nIndex);
|
||||
|
||||
seq_MoveSequence(pActor, nSeq, pActor->nHealth >> 8);
|
||||
pActor->spr.picnum = seq_GetSeqPicnum2(nSeq, pActor->nHealth >> 8);
|
||||
|
|
|
@ -376,7 +376,7 @@ void MoveWeapons(int nPlayer)
|
|||
int eax = pPlayer->nState;
|
||||
int nSeq = WeaponInfo[nWeapon].nSeq;
|
||||
|
||||
int var_3C = WeaponInfo[nWeapon].b[eax] + SeqOffsets[nSeq];
|
||||
int var_3C = getSeqFromId(nSeq, WeaponInfo[nWeapon].b[eax]);
|
||||
|
||||
int var_1C = (pPlayer->nDouble > 0) + 1;
|
||||
|
||||
|
@ -568,7 +568,7 @@ void MoveWeapons(int nPlayer)
|
|||
SelectNewWeapon(nPlayer);
|
||||
pPlayer->nState = 5;
|
||||
|
||||
pPlayer->nSeqSize2 = SeqSize[WeaponInfo[kWeaponGrenade].b[0] + SeqOffsets[nSeq]] - 1; // CHECKME
|
||||
pPlayer->nSeqSize2 = SeqSize[getSeqFromId(nSeq, WeaponInfo[kWeaponGrenade].b[0])] - 1; // CHECKME
|
||||
goto loc_flag; // FIXME
|
||||
}
|
||||
}
|
||||
|
@ -618,7 +618,7 @@ void MoveWeapons(int nPlayer)
|
|||
}
|
||||
|
||||
// loc_26FC5
|
||||
var_3C = SeqOffsets[WeaponInfo[nWeapon].nSeq] + WeaponInfo[nWeapon].b[pPlayer->nState];
|
||||
var_3C = getSeqFromId(WeaponInfo[nWeapon].nSeq, WeaponInfo[nWeapon].b[pPlayer->nState]);
|
||||
pPlayer->nSeqSize2 = 0;
|
||||
}
|
||||
else
|
||||
|
@ -919,7 +919,7 @@ void DrawWeapons(double interpfrac)
|
|||
}
|
||||
int var_34 = PlayerList[nLocalPlayer].nState;
|
||||
|
||||
int var_30 = SeqOffsets[WeaponInfo[nWeapon].nSeq];
|
||||
int var_30 = getSeqFromId(WeaponInfo[nWeapon].nSeq);
|
||||
|
||||
int var_28 = var_30 + WeaponInfo[nWeapon].b[var_34];
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ void AILavaDudeLimb::Draw(RunListEvent* ev)
|
|||
{
|
||||
auto pActor = ev->pObjActor;
|
||||
if (!pActor) return;
|
||||
seq_PlotSequence(ev->nParam, (SeqOffsets[kSeqLavag] + 30) + pActor->spr.picnum, 0, 1);
|
||||
seq_PlotSequence(ev->nParam, getSeqFromId(kSeqLavag, 30) + pActor->spr.picnum, 0, 1);
|
||||
}
|
||||
|
||||
|
||||
|
@ -150,7 +150,7 @@ void AILavaDude::Draw(RunListEvent* ev)
|
|||
if (!pActor) return;
|
||||
|
||||
int nAction = pActor->nAction;
|
||||
int nSeq = LavadudeSeq[nAction].a + SeqOffsets[kSeqLavag];
|
||||
int nSeq = getSeqFromId(kSeqLavag, LavadudeSeq[nAction].a);
|
||||
|
||||
seq_PlotSequence(ev->nParam, nSeq, pActor->nFrame, LavadudeSeq[nAction].b);
|
||||
ev->pTSprite->ownerActor = nullptr;
|
||||
|
@ -213,7 +213,7 @@ void AILavaDude::Tick(RunListEvent* ev)
|
|||
if (!pActor) return;
|
||||
|
||||
int nAction = pActor->nAction;
|
||||
int nSeq = LavadudeSeq[nAction].a + SeqOffsets[kSeqLavag];
|
||||
int nSeq = getSeqFromId(kSeqLavag, LavadudeSeq[nAction].a);
|
||||
|
||||
pActor->spr.picnum = seq_GetSeqPicnum2(nSeq, pActor->nFrame);
|
||||
int var_38 = pActor->nFrame;
|
||||
|
|
|
@ -93,7 +93,7 @@ void AILion::Draw(RunListEvent* ev)
|
|||
if (!pActor) return;
|
||||
int nAction = pActor->nAction;
|
||||
|
||||
seq_PlotSequence(ev->nParam, SeqOffsets[kSeqLion] + LionSeq[nAction].a, pActor->nFrame, LionSeq[nAction].b);
|
||||
seq_PlotSequence(ev->nParam, getSeqFromId(kSeqLion, LionSeq[nAction].a), pActor->nFrame, LionSeq[nAction].b);
|
||||
}
|
||||
|
||||
void AILion::RadialDamage(RunListEvent* ev)
|
||||
|
@ -198,7 +198,7 @@ void AILion::Tick(RunListEvent* ev)
|
|||
Gravity(pActor);
|
||||
}
|
||||
|
||||
int nSeq = SeqOffsets[kSeqLion] + LionSeq[nAction].a;
|
||||
int nSeq = getSeqFromId(kSeqLion, LionSeq[nAction].a);
|
||||
|
||||
pActor->spr.picnum = seq_GetSeqPicnum2(nSeq, pActor->nFrame);
|
||||
|
||||
|
|
|
@ -139,7 +139,7 @@ void AIMummy::Tick(RunListEvent* ev)
|
|||
|
||||
Gravity(pActor);
|
||||
|
||||
int nSeq = SeqOffsets[kSeqMummy] + MummySeq[nAction].a;
|
||||
int nSeq = getSeqFromId(kSeqMummy, MummySeq[nAction].a);
|
||||
|
||||
pActor->spr.picnum = seq_GetSeqPicnum2(nSeq, pActor->nFrame);
|
||||
|
||||
|
@ -419,7 +419,7 @@ void AIMummy::Draw(RunListEvent* ev)
|
|||
if (!pActor) return;
|
||||
int nAction = pActor->nAction;
|
||||
|
||||
seq_PlotSequence(ev->nParam, SeqOffsets[kSeqMummy] + MummySeq[nAction].a, pActor->nFrame, MummySeq[nAction].b);
|
||||
seq_PlotSequence(ev->nParam, getSeqFromId(kSeqMummy, MummySeq[nAction].a), pActor->nFrame, MummySeq[nAction].b);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -1889,7 +1889,7 @@ DExhumedActor* BuildObject(DExhumedActor* pActor, int nOjectType, int nHitag)
|
|||
|
||||
if (nSeq > -1)
|
||||
{
|
||||
pActor->nIndex = SeqOffsets[nSeq];
|
||||
pActor->nIndex = getSeqFromId(nSeq);
|
||||
|
||||
if (!nOjectType) // if not Explosion Trigger (e.g. Exploding Fire Cauldron)
|
||||
{
|
||||
|
@ -2199,7 +2199,7 @@ void DoDrips()
|
|||
{
|
||||
DExhumedActor* pActor = sDrip[i].pActor;
|
||||
if (!pActor) continue;
|
||||
int nSeqOffset = SeqOffsets[kSeqDrips];
|
||||
int nSeqOffset = getSeqFromId(kSeqDrips);
|
||||
|
||||
if (!(pActor->sector()->Flag & kSectLava)) {
|
||||
nSeqOffset++;
|
||||
|
|
|
@ -529,7 +529,7 @@ void AIPlayer::Draw(RunListEvent* ev)
|
|||
const auto pPlayer = &PlayerList[nPlayer];
|
||||
const auto nAction = pPlayer->nAction;
|
||||
|
||||
seq_PlotSequence(ev->nParam, SeqOffsets[pPlayer->nSeq] + PlayerSeq[nAction].a, pPlayer->nSeqSize, PlayerSeq[nAction].b);
|
||||
seq_PlotSequence(ev->nParam, getSeqFromId(pPlayer->nSeq, PlayerSeq[nAction].a), pPlayer->nSeqSize, PlayerSeq[nAction].b);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -1912,7 +1912,7 @@ static bool doPlayerDeathRestart(Player* const pPlayer)
|
|||
static void doPlayerActionSequence(Player* const pPlayer)
|
||||
{
|
||||
const auto pPlayerActor = pPlayer->pActor;
|
||||
const auto nSeq = SeqOffsets[pPlayer->nSeq] + PlayerSeq[pPlayer->nAction].a;
|
||||
const auto nSeq = getSeqFromId(pPlayer->nSeq, PlayerSeq[pPlayer->nAction].a);
|
||||
|
||||
seq_MoveSequence(pPlayerActor, nSeq, pPlayer->nSeqSize);
|
||||
pPlayer->nSeqSize++;
|
||||
|
|
|
@ -542,7 +542,7 @@ void AIQueenEgg::Tick(RunListEvent* ev)
|
|||
Gravity(pActor);
|
||||
}
|
||||
|
||||
int nSeq = SeqOffsets[kSeqQueenEgg] + EggSeq[nAction].a;
|
||||
int nSeq = getSeqFromId(kSeqQueenEgg, EggSeq[nAction].a);
|
||||
|
||||
pActor->spr.picnum = seq_GetSeqPicnum2(nSeq, pEgg->nFrame);
|
||||
|
||||
|
@ -725,7 +725,7 @@ void AIQueenEgg::Draw(RunListEvent* ev)
|
|||
{
|
||||
int nEgg = RunData[ev->nRun].nObjIndex;
|
||||
Egg* pEgg = &QueenEgg[nEgg];
|
||||
seq_PlotSequence(ev->nParam, SeqOffsets[kSeqQueenEgg] + EggSeq[pEgg->nAction].a, pEgg->nFrame, EggSeq[pEgg->nAction].b);
|
||||
seq_PlotSequence(ev->nParam, getSeqFromId(kSeqQueenEgg, EggSeq[pEgg->nAction].a), pEgg->nFrame, EggSeq[pEgg->nAction].b);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -798,7 +798,7 @@ void AIQueenHead::Tick(RunListEvent* ev)
|
|||
Gravity(pActor);
|
||||
}
|
||||
|
||||
int nSeq = SeqOffsets[kSeqQueen] + HeadSeq[QueenHead.nAction].a;
|
||||
int nSeq = getSeqFromId(kSeqQueen, HeadSeq[QueenHead.nAction].a);
|
||||
|
||||
seq_MoveSequence(pActor, nSeq, QueenHead.nFrame);
|
||||
|
||||
|
@ -1129,7 +1129,7 @@ void AIQueenHead::Draw(RunListEvent* ev)
|
|||
int nHead = RunData[ev->nRun].nObjIndex;
|
||||
int nAction = QueenHead.nAction;
|
||||
|
||||
int nSeq = SeqOffsets[kSeqQueen];
|
||||
int nSeq = getSeqFromId(kSeqQueen);
|
||||
|
||||
int edx;
|
||||
|
||||
|
@ -1239,7 +1239,7 @@ void AIQueen::Tick(RunListEvent* ev)
|
|||
Gravity(pActor);
|
||||
}
|
||||
|
||||
int nSeq = SeqOffsets[kSeqQueen] + QueenSeq[nAction].a;
|
||||
int nSeq = getSeqFromId(kSeqQueen, QueenSeq[nAction].a);
|
||||
|
||||
pActor->spr.picnum = seq_GetSeqPicnum2(nSeq, QueenList[nQueen].nFrame);
|
||||
|
||||
|
@ -1572,7 +1572,7 @@ void AIQueen::Draw(RunListEvent* ev)
|
|||
int nQueen = RunData[ev->nRun].nObjIndex;
|
||||
assert(nQueen >= 0 && nQueen < kMaxQueens);
|
||||
int nAction = QueenList[nQueen].nAction;
|
||||
seq_PlotSequence(ev->nParam, SeqOffsets[kSeqQueen] + QueenSeq[nAction].a, QueenList[nQueen].nFrame, QueenSeq[nAction].b);
|
||||
seq_PlotSequence(ev->nParam, getSeqFromId(kSeqQueen, QueenSeq[nAction].a), QueenList[nQueen].nFrame, QueenSeq[nAction].b);
|
||||
}
|
||||
|
||||
END_PS_NS
|
||||
|
|
|
@ -209,7 +209,7 @@ void AIRa::Tick(RunListEvent* ev)
|
|||
int nPlayer = RunData[ev->nRun].nObjIndex;
|
||||
int nCurrentWeapon = PlayerList[nPlayer].nCurrentWeapon;
|
||||
|
||||
int nSeq = SeqOffsets[kSeqEyeHit] + RaSeq[Ra[nPlayer].nAction].a;
|
||||
int nSeq = getSeqFromId(kSeqEyeHit, RaSeq[Ra[nPlayer].nAction].a);
|
||||
DExhumedActor* pActor = Ra[nPlayer].pActor;
|
||||
if (!pActor) return;
|
||||
|
||||
|
@ -336,7 +336,7 @@ void AIRa::Tick(RunListEvent* ev)
|
|||
void AIRa::Draw(RunListEvent* ev)
|
||||
{
|
||||
int nPlayer = RunData[ev->nRun].nObjIndex;
|
||||
int nSeq = SeqOffsets[kSeqEyeHit] + RaSeq[Ra[nPlayer].nAction].a;
|
||||
int nSeq = getSeqFromId(kSeqEyeHit, RaSeq[Ra[nPlayer].nAction].a);
|
||||
|
||||
seq_PlotSequence(ev->nParam, nSeq, Ra[nPlayer].nFrame, 1);
|
||||
ev->pTSprite->ownerActor = nullptr;
|
||||
|
|
|
@ -224,7 +224,7 @@ void AIRat::Draw(RunListEvent* ev)
|
|||
if (!pActor) return;
|
||||
int nAction = pActor->nAction;
|
||||
|
||||
seq_PlotSequence(ev->nParam, SeqOffsets[kSeqRat] + RatSeq[nAction].a, pActor->nFrame, RatSeq[nAction].b);
|
||||
seq_PlotSequence(ev->nParam, getSeqFromId(kSeqRat, RatSeq[nAction].a), pActor->nFrame, RatSeq[nAction].b);
|
||||
}
|
||||
|
||||
|
||||
|
@ -244,7 +244,7 @@ void AIRat::Tick(RunListEvent* ev)
|
|||
|
||||
bool bVal = false;
|
||||
|
||||
int nSeq = SeqOffsets[kSeqRat] + RatSeq[nAction].a;
|
||||
int nSeq = getSeqFromId(kSeqRat, RatSeq[nAction].a);
|
||||
pActor->spr.picnum = seq_GetSeqPicnum2(nSeq, pActor->nFrame);
|
||||
|
||||
seq_MoveSequence(pActor, nSeq, pActor->nFrame);
|
||||
|
|
|
@ -171,7 +171,7 @@ void AIRex::Draw(RunListEvent* ev)
|
|||
|
||||
int nAction = pActor->nAction;
|
||||
|
||||
seq_PlotSequence(ev->nParam, SeqOffsets[kSeqRex] + RexSeq[nAction].a, pActor->nFrame, RexSeq[nAction].b);
|
||||
seq_PlotSequence(ev->nParam, getSeqFromId(kSeqRex, RexSeq[nAction].a), pActor->nFrame, RexSeq[nAction].b);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -192,7 +192,7 @@ void AIRex::Tick(RunListEvent* ev)
|
|||
|
||||
Gravity(pActor);
|
||||
|
||||
int nSeq = SeqOffsets[kSeqRex] + RexSeq[nAction].a;
|
||||
int nSeq = getSeqFromId(kSeqRex, RexSeq[nAction].a);
|
||||
|
||||
pActor->spr.picnum = seq_GetSeqPicnum2(nSeq, pActor->nFrame);
|
||||
|
||||
|
|
|
@ -110,7 +110,7 @@ void AIRoach::Draw(RunListEvent* ev)
|
|||
if (!pActor) return;
|
||||
int nAction = pActor->nAction;
|
||||
|
||||
seq_PlotSequence(ev->nParam, RoachSeq[nAction].a + SeqOffsets[kSeqRoach], pActor->nFrame, RoachSeq[nAction].b);
|
||||
seq_PlotSequence(ev->nParam, getSeqFromId(kSeqRoach, RoachSeq[nAction].a), pActor->nFrame, RoachSeq[nAction].b);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -211,7 +211,7 @@ void AIRoach::Tick(RunListEvent* ev)
|
|||
|
||||
Gravity(pActor);
|
||||
|
||||
int nSeq = SeqOffsets[kSeqRoach] + RoachSeq[pActor->nAction].a;
|
||||
int nSeq = getSeqFromId(kSeqRoach, RoachSeq[nAction].a);
|
||||
|
||||
pActor->spr.picnum = seq_GetSeqPicnum2(nSeq, pActor->nFrame);
|
||||
seq_MoveSequence(pActor, nSeq, pActor->nFrame);
|
||||
|
|
|
@ -105,7 +105,7 @@ void AIScorp::Draw(RunListEvent* ev)
|
|||
|
||||
int nAction = pActor->nAction;
|
||||
|
||||
seq_PlotSequence(ev->nParam, SeqOffsets[kSeqScorp] + ScorpSeq[nAction].a, pActor->nFrame, ScorpSeq[nAction].b);
|
||||
seq_PlotSequence(ev->nParam, getSeqFromId(kSeqScorp, ScorpSeq[nAction].a), pActor->nFrame, ScorpSeq[nAction].b);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -206,7 +206,7 @@ void AIScorp::Tick(RunListEvent* ev)
|
|||
Gravity(pActor);
|
||||
}
|
||||
|
||||
int nSeq = SeqOffsets[kSeqScorp] + ScorpSeq[nAction].a;
|
||||
int nSeq = getSeqFromId(kSeqScorp, ScorpSeq[nAction].a);
|
||||
|
||||
pActor->spr.picnum = seq_GetSeqPicnum2(nSeq, pActor->nFrame);
|
||||
seq_MoveSequence(pActor, nSeq, pActor->nFrame);
|
||||
|
|
|
@ -148,9 +148,20 @@ const char *SeqNames[kMaxSEQFiles] =
|
|||
"rat"
|
||||
};
|
||||
|
||||
int16_t SeqOffsets[kMaxSEQFiles];
|
||||
static int16_t SeqOffsets[kMaxSEQFiles];
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
int getSeqFromId(const int nSeqFileId, const int nSeq)
|
||||
{
|
||||
return SeqOffsets[nSeqFileId] + nSeq;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
|
@ -307,7 +318,7 @@ int seq_ReadSequence(const char *seqName)
|
|||
|
||||
int seq_GetFirstSeqPicnum(int nSeq)
|
||||
{
|
||||
int i = SeqOffsets[nSeq];
|
||||
int i = getSeqFromId(nSeq);
|
||||
i = SeqBase[i];
|
||||
i = FrameBase[i];
|
||||
i = ChunkPict[i];
|
||||
|
@ -360,13 +371,13 @@ void seq_LoadSequences()
|
|||
|
||||
nBackgroundPic = seq_GetFirstSeqPicnum(kSeqBackgrnd);
|
||||
|
||||
nPilotLightBase = SeqBase[SeqOffsets[kSeqFlamer] + 3];
|
||||
nPilotLightCount = SeqSize[SeqOffsets[kSeqFlamer] + 3];
|
||||
nPilotLightBase = SeqBase[getSeqFromId(kSeqFlamer, 3)];
|
||||
nPilotLightCount = SeqSize[getSeqFromId(kSeqFlamer, 3)];
|
||||
nPilotLightFrame = 0;
|
||||
|
||||
nFontFirstChar = seq_GetFirstSeqPicnum(kSeqFont2);
|
||||
|
||||
int16_t nSize = SeqSize[SeqOffsets[kSeqFont2]];
|
||||
int16_t nSize = SeqSize[getSeqFromId(kSeqFont2)];
|
||||
|
||||
for (i = 0; i < nSize; i++)
|
||||
{
|
||||
|
@ -514,8 +525,7 @@ int seq_GetSeqPicnum2(int16_t nSeq, int16_t nFrame)
|
|||
|
||||
int seq_GetSeqPicnum(int16_t nSeq, int16_t edx, int16_t ebx)
|
||||
{
|
||||
edx += SeqOffsets[nSeq];
|
||||
ebx += SeqBase[edx];
|
||||
ebx += SeqBase[getSeqFromId(nSeq, edx)];
|
||||
int16_t c = FrameBase[ebx];
|
||||
|
||||
return ChunkPict[c];
|
||||
|
|
|
@ -112,7 +112,6 @@ extern int16_t frames;
|
|||
|
||||
extern int16_t SeqBase[];
|
||||
extern int16_t SeqSize[];
|
||||
extern int16_t SeqOffsets[];
|
||||
extern int16_t FrameFlag[];
|
||||
|
||||
extern int16_t nShadowWidth;
|
||||
|
@ -143,5 +142,7 @@ 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);
|
||||
|
||||
int getSeqFromId(const int nSeqFileId, const int nSeq = 0);
|
||||
|
||||
END_PS_NS
|
||||
|
||||
|
|
|
@ -142,7 +142,7 @@ void AISoul::Tick(RunListEvent* ev)
|
|||
auto pActor = ev->pObjActor;
|
||||
if (!pActor) return;
|
||||
|
||||
seq_MoveSequence(pActor, SeqOffsets[kSeqSet] + 75, 0);
|
||||
seq_MoveSequence(pActor, getSeqFromId(kSeqSet, 75), 0);
|
||||
|
||||
if (pActor->spr.scale.X < 0.5)
|
||||
{
|
||||
|
@ -248,7 +248,7 @@ void AISet::Draw(RunListEvent* ev)
|
|||
if (!pActor) return;
|
||||
int nAction = pActor->nAction;
|
||||
|
||||
seq_PlotSequence(ev->nParam, SeqOffsets[kSeqSet] + SetSeq[nAction].a, pActor->nFrame, SetSeq[nAction].b);
|
||||
seq_PlotSequence(ev->nParam, getSeqFromId(kSeqSet, SetSeq[nAction].a), pActor->nFrame, SetSeq[nAction].b);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -269,7 +269,7 @@ void AISet::Tick(RunListEvent* ev)
|
|||
|
||||
Gravity(pActor);
|
||||
|
||||
int nSeq = SeqOffsets[kSeqSet] + SetSeq[pActor->nAction].a;
|
||||
int nSeq = getSeqFromId(kSeqSet, SetSeq[nAction].a);
|
||||
pActor->spr.picnum = seq_GetSeqPicnum2(nSeq, pActor->nFrame);
|
||||
seq_MoveSequence(pActor, nSeq, pActor->nFrame);
|
||||
|
||||
|
|
|
@ -339,7 +339,7 @@ void AISnake::Tick(RunListEvent* ev)
|
|||
DExhumedActor* pActor = SnakeList[nSnake].pSprites[0];
|
||||
if (!pActor) return;
|
||||
|
||||
seq_MoveSequence(pActor, SeqOffsets[kSeqSnakehed], 0);
|
||||
seq_MoveSequence(pActor, getSeqFromId(kSeqSnakehed), 0);
|
||||
|
||||
DExhumedActor* pEnemySprite = SnakeList[nSnake].pEnemy;
|
||||
|
||||
|
@ -428,10 +428,10 @@ void AISnake::Draw(RunListEvent* ev)
|
|||
int nSprite = ev->nParam;
|
||||
|
||||
if ((nSnake & 0xFF) == 0) {
|
||||
seq_PlotSequence(nSprite, SeqOffsets[kSeqSnakehed], 0, 0);
|
||||
seq_PlotSequence(nSprite, getSeqFromId(kSeqSnakehed), 0, 0);
|
||||
}
|
||||
else {
|
||||
seq_PlotSequence(nSprite, SeqOffsets[kSeqSnakBody], 0, 0);
|
||||
seq_PlotSequence(nSprite, getSeqFromId(kSeqSnakBody), 0, 0);
|
||||
}
|
||||
|
||||
ev->pTSprite->ownerActor = nullptr;
|
||||
|
|
|
@ -718,7 +718,7 @@ void UpdateCreepySounds()
|
|||
{
|
||||
if (nCreaturesKilled < nCreaturesTotal && !(PlayerList[nLocalPlayer].pPlayerViewSect->Flag & 0x2000))
|
||||
{
|
||||
int vsi = seq_GetFrameSound(SeqOffsets[kSeqCreepy], totalmoves % SeqSize[SeqOffsets[kSeqCreepy]]);
|
||||
int vsi = seq_GetFrameSound(getSeqFromId(kSeqCreepy), totalmoves % SeqSize[getSeqFromId(kSeqCreepy)]);
|
||||
if (vsi >= 0 && (vsi & 0x1ff) < kMaxSounds)
|
||||
{
|
||||
DVector2 adder;
|
||||
|
|
|
@ -117,7 +117,7 @@ void AISpider::Tick(RunListEvent* ev)
|
|||
}
|
||||
}
|
||||
|
||||
int nSeq = SeqOffsets[kSeqSpider] + SpiderSeq[nAction].a;
|
||||
int nSeq = getSeqFromId(kSeqSpider, SpiderSeq[nAction].a);
|
||||
|
||||
spp->spr.picnum = seq_GetSeqPicnum2(nSeq, spp->nFrame);
|
||||
|
||||
|
@ -354,7 +354,7 @@ void AISpider::Draw(RunListEvent* ev)
|
|||
|
||||
int nAction = spp->nAction;
|
||||
|
||||
seq_PlotSequence(ev->nParam, SeqOffsets[kSeqSpider] + SpiderSeq[nAction].a, spp->nFrame, SpiderSeq[nAction].b);
|
||||
seq_PlotSequence(ev->nParam, getSeqFromId(kSeqSpider, SpiderSeq[nAction].a), spp->nFrame, SpiderSeq[nAction].b);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
|
|
@ -47,7 +47,7 @@ int nStatusSeqOffset;
|
|||
|
||||
void InitStatus()
|
||||
{
|
||||
nStatusSeqOffset = SeqOffsets[kSeqStatus];
|
||||
nStatusSeqOffset = getSeqFromId(kSeqStatus);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -122,7 +122,7 @@ void AIWasp::Draw(RunListEvent* ev)
|
|||
if (!pActor) return;
|
||||
int nAction = pActor->nAction;
|
||||
|
||||
seq_PlotSequence(ev->nParam, SeqOffsets[kSeqWasp] + WaspSeq[nAction].a, pActor->nFrame, WaspSeq[nAction].b);
|
||||
seq_PlotSequence(ev->nParam, getSeqFromId(kSeqWasp, WaspSeq[nAction].a), pActor->nFrame, WaspSeq[nAction].b);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -214,7 +214,7 @@ void AIWasp::Tick(RunListEvent* ev)
|
|||
|
||||
bool bVal = false;
|
||||
|
||||
int nSeq = SeqOffsets[kSeqWasp] + WaspSeq[nAction].a;
|
||||
int nSeq = getSeqFromId(kSeqWasp, WaspSeq[nAction].a);
|
||||
|
||||
pActor->spr.picnum = seq_GetSeqPicnum2(nSeq, pActor->nFrame);
|
||||
|
||||
|
|
Loading…
Reference in a new issue