diff --git a/source/games/exhumed/src/fish.cpp b/source/games/exhumed/src/fish.cpp index 5b97d19a0..5a6e6d8de 100644 --- a/source/games/exhumed/src/fish.cpp +++ b/source/games/exhumed/src/fish.cpp @@ -64,7 +64,7 @@ void BuildFishLimb(DExhumedActor* pActor, int anim) pChunkActor->spr.yoffset = 0; pChunkActor->vel.Z = ((-(RandomByte() + 512)) * 2) / 256.; - seq_GetSeqPicnum(kSeqFish, pChunkActor->nCount, 0); + //getSequence(pChunkActor->nSeqFile, pChunkActor->nCount)[0].getFirstPicnum(); pChunkActor->spr.picnum = anim; pChunkActor->spr.lotag = runlist_HeadRun() + 1; @@ -175,7 +175,8 @@ void BuildFish(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, pActor->spr.pal = pActor->sector()->ceilingpal; pActor->spr.xoffset = 0; pActor->spr.yoffset = 0; - pActor->spr.picnum = seq_GetSeqPicnum(kSeqFish, FishSeq[0].nSeqId, 0); + pActor->nSeqFile = "fish"; + pActor->spr.picnum = getSequence(pActor->nSeqFile, FishSeq[0].nSeqId)[0].getFirstPicnum(); pActor->vel.X = 0; pActor->vel.Y = 0; pActor->vel.Z = 0; @@ -195,8 +196,6 @@ void BuildFish(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, pActor->spr.intowner = runlist_AddRunRec(pActor->spr.lotag - 1, pActor, 0x120000); pActor->nRun = runlist_AddRunRec(NewRun, pActor, 0x120000); - pActor->nSeqFile = "fish"; - nCreaturesTotal++; } diff --git a/source/games/exhumed/src/lavadude.cpp b/source/games/exhumed/src/lavadude.cpp index d6addbbab..8190458bc 100644 --- a/source/games/exhumed/src/lavadude.cpp +++ b/source/games/exhumed/src/lavadude.cpp @@ -123,7 +123,7 @@ void BuildLava(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, pActor->spr.xoffset = 0; pActor->spr.yoffset = 0; pActor->nSeqFile = "lavag"; - pActor->spr.picnum = seq_GetSeqPicnum(kSeqLavag, LavadudeSeq[3].nSeqId, 0); + pActor->spr.picnum = getSequence(pActor->nSeqFile, LavadudeSeq[3].nSeqId)[0].getFirstPicnum(); pActor->vel.X = 0; pActor->vel.Y = 0; pActor->vel.Z = 0; diff --git a/source/games/exhumed/src/object.cpp b/source/games/exhumed/src/object.cpp index dc9b84b1c..ee52ce076 100644 --- a/source/games/exhumed/src/object.cpp +++ b/source/games/exhumed/src/object.cpp @@ -2007,7 +2007,7 @@ void AIObject::Tick(RunListEvent* ev) if (nStat == kStatExplodeTrigger) { for (int i = 4; i < 8; i++) { - BuildCreatureChunk(pActor, seq_GetSeqPicnum(kSeqFirePot, (i >> 2) + 1, 0), true); + BuildCreatureChunk(pActor, getSequence("firepot", (i >> 2) + 1)[0].getFirstPicnum(), true); } runlist_RadialDamageEnemy(pActor, 200, 20); @@ -2015,7 +2015,7 @@ void AIObject::Tick(RunListEvent* ev) else if (nStat == kStatExplodeTarget) { for (int i = 0; i < 8; i++) { - BuildCreatureChunk(pActor, seq_GetSeqPicnum(kSeqFirePot, (i >> 1) + 3, 0), true); + BuildCreatureChunk(pActor, getSequence("firepot", (i >> 1) + 3)[0].getFirstPicnum(), true); } } diff --git a/source/games/exhumed/src/player.cpp b/source/games/exhumed/src/player.cpp index bc8146b40..cd9895733 100644 --- a/source/games/exhumed/src/player.cpp +++ b/source/games/exhumed/src/player.cpp @@ -217,7 +217,8 @@ void RestartPlayer(int nPlayer) pPlayerActor->spr.scale = DVector2(0.625, 0.625); pPlayerActor->spr.xoffset = 0; pPlayerActor->spr.yoffset = 0; - pPlayerActor->spr.picnum = seq_GetSeqPicnum(kSeqJoe, 18, 0); + pPlayerActor->nSeqFile = "joe"; + pPlayerActor->spr.picnum = getSequence(pPlayerActor->nSeqFile, 18)[0].getFirstPicnum(); pPlayerActor->spr.hitag = 0; pPlayerActor->spr.extra = -1; pPlayerActor->spr.lotag = runlist_HeadRun() + 1; @@ -228,7 +229,6 @@ void RestartPlayer(int nPlayer) pPlayerActor->vel.Z = 0; pPlayerActor->spr.Angles.Pitch = nullAngle; pPlayerActor->spr.intowner = runlist_AddRunRec(pPlayerActor->spr.lotag - 1, nPlayer, 0xA0000); - pPlayerActor->nSeqFile = "joe"; ChangeActorStat(pPlayerActor, 100); if (nTotalPlayers > 1) @@ -645,7 +645,7 @@ void AIPlayer::Damage(RunListEvent* ev) { for (int i = 122; i <= 131; i++) { - BuildCreatureChunk(pPlayerActor, seq_GetSeqPicnum(kSeqJoe, i, 0)); + BuildCreatureChunk(pPlayerActor, getSequence("joe", i)[0].getFirstPicnum()); } StartDeathSeq(nPlayer, 1); @@ -1888,7 +1888,7 @@ static bool doPlayerDeathRestart(Player* const pPlayer) if (pPlayer->nAction != 20) { const auto pPlayerActor = pPlayer->pActor; - pPlayerActor->spr.picnum = seq_GetSeqPicnum(kSeqJoe, 120, 0); + pPlayerActor->spr.picnum = getSequence("joe", 120)[0].getFirstPicnum(); pPlayerActor->spr.cstat = 0; pPlayerActor->spr.pos.Z = pPlayerActor->sector()->floorz; } @@ -2014,7 +2014,7 @@ void AIPlayer::Tick(RunListEvent* ev) const auto pPlayer = &PlayerList[nPlayer]; const auto pPlayerActor = pPlayer->pActor; - pPlayerActor->spr.picnum = seq_GetSeqPicnum(pPlayer->nSeq, PlayerSeq[nHeightTemplate[pPlayer->nAction]].nSeqId, pPlayer->nSeqSize); + pPlayerActor->spr.picnum = getSequence(pPlayerActor->nSeqFile, PlayerSeq[nHeightTemplate[pPlayer->nAction]].nSeqId)[0].getFirstPicnum(); pPlayer->pDoppleSprite->spr.picnum = pPlayerActor->spr.picnum; doPlayerCounters(pPlayer); diff --git a/source/games/exhumed/src/queen.cpp b/source/games/exhumed/src/queen.cpp index 60e8b75e7..6c4d67e3d 100644 --- a/source/games/exhumed/src/queen.cpp +++ b/source/games/exhumed/src/queen.cpp @@ -252,7 +252,7 @@ void BlowChunks(DExhumedActor* pActor) { for (int i = 0; i < 4; i++) { - BuildCreatureChunk(pActor, seq_GetSeqPicnum(16, i + 41, 0)); + BuildCreatureChunk(pActor, getSequence("spider", i + 41)[0].getFirstPicnum()); } } @@ -275,7 +275,7 @@ void DestroyEgg(int nEgg) { for (int i = 0; i < 4; i++) { - BuildCreatureChunk(pActor, seq_GetSeqPicnum(kSeqQueenEgg, (i % 2) + 24, 0)); + BuildCreatureChunk(pActor, getSequence("queenegg", (i % 2) + 24)[0].getFirstPicnum()); } } @@ -1435,16 +1435,17 @@ void AIQueen::Tick(RunListEvent* ev) if (QueenList[nQueen].nIndex <= 0) { pActor->spr.cstat = 0; + const auto queenPicnum = getSequence("queen", 57)[0].getFirstPicnum(); for (int i = 0; i < 20; i++) { - auto pChunkActor = BuildCreatureChunk(pActor, seq_GetSeqPicnum(kSeqQueen, 57, 0)); + auto pChunkActor = BuildCreatureChunk(pActor, queenPicnum); pChunkActor->spr.picnum = kQueenChunk + (i % 3); pChunkActor->spr.scale = DVector2(1.5625, 1.5625); } - auto pChunkActor = BuildCreatureChunk(pActor, seq_GetSeqPicnum(kSeqQueen, 57, 0)); + auto pChunkActor = BuildCreatureChunk(pActor, queenPicnum); pChunkActor->spr.picnum = kTile3126; pChunkActor->spr.scale = DVector2(1.5625, 1.5625); diff --git a/source/games/exhumed/src/rat.cpp b/source/games/exhumed/src/rat.cpp index dd8ac6bfb..2bef8ce66 100644 --- a/source/games/exhumed/src/rat.cpp +++ b/source/games/exhumed/src/rat.cpp @@ -67,7 +67,7 @@ void InitRats() for (int i = 122; i <= 131; i++) { - int nPic = seq_GetSeqPicnum(kSeqJoe, i, 0); + int nPic = getSequence("joe", i)[0].getFirstPicnum(); if (nPic < nMinChunk) nMinChunk = nPic; @@ -76,7 +76,7 @@ void InitRats() nMaxChunk = nPic; } - nPlayerPic = seq_GetSeqPicnum(kSeqJoe, 120, 0); + nPlayerPic = getSequence("joe", 120)[0].getFirstPicnum(); } void SetRatVel(DExhumedActor* pActor) diff --git a/source/games/exhumed/src/sequence.cpp b/source/games/exhumed/src/sequence.cpp index a25be63ba..953a304c7 100644 --- a/source/games/exhumed/src/sequence.cpp +++ b/source/games/exhumed/src/sequence.cpp @@ -761,17 +761,6 @@ void playFrameSound(DExhumedActor* actor, const SeqFrame& seqFrame) // //--------------------------------------------------------------------------- -int seq_GetSeqPicnum(int16_t nSeq, int16_t edx, int16_t ebx) -{ - return getSeqFrameChunkPicnum(getSeqFrameChunk(getSeqFrame(getSeqFromId(nSeq, edx)))); -} - -//--------------------------------------------------------------------------- -// -// -// -//--------------------------------------------------------------------------- - void seq_PlotArrowSequence(const int nSprite, const FName seqFile, const int16_t seqIndex, const int frameIndex) { tspritetype* pTSprite = mytspriteArray->get(nSprite); diff --git a/source/games/exhumed/src/sequence.h b/source/games/exhumed/src/sequence.h index ffa987876..e51aef924 100644 --- a/source/games/exhumed/src/sequence.h +++ b/source/games/exhumed/src/sequence.h @@ -144,8 +144,6 @@ void seq_PlotSequence(const int nSprite, const FName seqFile, const int16_t seqI void seq_PlotArrowSequence(const int nSprite, const FName seqFile, const int16_t seqIndex, const int frameIndex); void seq_DrawPilotLightSeq(double xOffset, double yOffset); -int seq_GetSeqPicnum(int16_t nSeq, int16_t edx, int16_t ebx); - int getSeqFromId(const int nSeqFileId, const int nSeq = 0); int getSeqFrame(const int nSeq, const int nFrame = 0); int getSeqFrameCount(const int nSeq); diff --git a/source/games/exhumed/src/set.cpp b/source/games/exhumed/src/set.cpp index c977728a4..a88f7d206 100644 --- a/source/games/exhumed/src/set.cpp +++ b/source/games/exhumed/src/set.cpp @@ -115,7 +115,8 @@ void BuildSoul(DExhumedActor* pSet) pActor->clipdist = 1.25; pActor->spr.xoffset = 0; pActor->spr.yoffset = 0; - pActor->spr.picnum = seq_GetSeqPicnum(kSeqSet, 75, 0); + pActor->nSeqFile = "set"; + pActor->spr.picnum = getSequence(pActor->nSeqFile, 75)[0].getFirstPicnum(); pActor->spr.Angles.Yaw = RandomAngle(); pActor->vel.X = 0; pActor->vel.Y = 0; @@ -608,7 +609,7 @@ void AISet::Tick(RunListEvent* ev) if (seqFrame.flags & 0x80) { pActor->spr.pos.Z -= GetActorHeight(pActor); - BuildCreatureChunk(pActor, seq_GetSeqPicnum(kSeqSet, 76, 0)); + BuildCreatureChunk(pActor, getSequence("set", 76)[0].getFirstPicnum()); pActor->spr.pos.Z += GetActorHeight(pActor); } diff --git a/source/games/exhumed/src/snake.cpp b/source/games/exhumed/src/snake.cpp index f74112668..d2e766990 100644 --- a/source/games/exhumed/src/snake.cpp +++ b/source/games/exhumed/src/snake.cpp @@ -164,7 +164,7 @@ void BuildSnake(int nPlayer, double zVal) auto pPlayerActor = PlayerList[nPlayer].pActor; auto pViewSect = PlayerList[nPlayer].pPlayerViewSect; - int nPic = seq_GetSeqPicnum(kSeqSnakBody, 0, 0); + int nPic = getSequence("snakbody", 0)[0].getFirstPicnum(); auto pos = pPlayerActor->spr.pos.plusZ(zVal - 10); diff --git a/source/games/exhumed/src/spider.cpp b/source/games/exhumed/src/spider.cpp index 1e16bc6a7..207f8b90a 100644 --- a/source/games/exhumed/src/spider.cpp +++ b/source/games/exhumed/src/spider.cpp @@ -421,7 +421,7 @@ void AISpider::Damage(RunListEvent* ev) for (int i = 0; i < 7; i++) { - BuildCreatureChunk(spp, seq_GetSeqPicnum(kSeqSpider, i + 41, 0)); + BuildCreatureChunk(spp, getSequence("spider", i + 41)[0].getFirstPicnum()); } } }