- renamed fields in Anim to match DExhumedActor.

This commit is contained in:
Christoph Oelckers 2021-10-24 20:13:17 +02:00
parent e8e0294929
commit 3b0df0e9b4
3 changed files with 30 additions and 30 deletions

View file

@ -27,13 +27,13 @@ BEGIN_PS_NS
struct Anim
{
short nSeq;
short field_2;
short nIndex2;
short nIndex;
short field_4;
short nSprite;
short AnimRunRec;
uint8_t AnimFlags;
short nRun;
uint8_t nAction;
};

View file

@ -35,12 +35,12 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, Anim& w, Anim* def
{
if (arc.BeginObject(keyname))
{
arc("seq", w.nSeq)
("val1", w.field_2)
arc("seq", w.nIndex2)
("val1", w.nIndex)
("val2", w.field_4)
("sprite", w.nSprite)
("runrec", w.AnimRunRec)
("flags", w.AnimFlags)
("runrec", w.nRun)
("flags", w.nAction)
.EndObject();
}
return arc;
@ -75,7 +75,7 @@ void DestroyAnim(int nAnim)
{
auto pSprite = &sprite[nSprite];
StopSpriteSound(nSprite);
runlist_SubRunRec(pActor->AnimRunRec);
runlist_SubRunRec(pActor->nRun);
runlist_DoSubRunRec(pSprite->extra);
runlist_FreeRun(pSprite->lotag - 1);
}
@ -133,11 +133,11 @@ int BuildAnim(int nSprite, int val, int val2, int x, int y, int z, int nSector,
pSprite->owner = -1;
pSprite->extra = runlist_AddRunRec(pSprite->lotag - 1, nAnim, 0x100000);
pActor->AnimRunRec = runlist_AddRunRec(NewRun, nAnim, 0x100000);
pActor->nRun = runlist_AddRunRec(NewRun, nAnim, 0x100000);
pActor->nSprite = nSprite;
pActor->AnimFlags = nFlag;
pActor->field_2 = 0;
pActor->nSeq = SeqOffsets[val] + val2;
pActor->nAction = nFlag;
pActor->nIndex = 0;
pActor->nIndex2 = SeqOffsets[val] + val2;
pActor->field_4 = 256;
if (nFlag & 0x80) {
@ -160,12 +160,12 @@ void AIAnim::Tick(RunListEvent* ev)
auto pActor = &AnimList[nAnim];
short nSprite = pActor->nSprite;
short nSeq = pActor->nSeq;
short nSeq = pActor->nIndex2;
auto pSprite = &sprite[nSprite];
assert(nSprite != -1);
short var_1C = pActor->field_2;
short var_1C = pActor->nIndex;
if (!(pSprite->cstat & 0x8000))
{
@ -237,26 +237,26 @@ void AIAnim::Tick(RunListEvent* ev)
}
}
pActor->field_2++;
if (pActor->field_2 >= SeqSize[nSeq])
pActor->nIndex++;
if (pActor->nIndex >= SeqSize[nSeq])
{
if (pActor->AnimFlags & 0x10)
if (pActor->nAction & 0x10)
{
pActor->field_2 = 0;
pActor->nIndex = 0;
}
else if (nSeq == nPreMagicSeq)
{
pActor->field_2 = 0;
pActor->nSeq = nMagicSeq;
pActor->nIndex = 0;
pActor->nIndex2 = nMagicSeq;
short nAnimSprite = pActor->nSprite;
pActor->AnimFlags |= 0x10;
pActor->nAction |= 0x10;
sprite[nAnimSprite].cstat |= 2;
}
else if (nSeq == nSavePointSeq)
{
pActor->field_2 = 0;
pActor->nSeq++;
pActor->AnimFlags |= 0x10;
pActor->nIndex = 0;
pActor->nIndex2++;
pActor->nAction |= 0x10;
}
else
{
@ -271,9 +271,9 @@ void AIAnim::Draw(RunListEvent* ev)
short nAnim = RunData[ev->nRun].nObjIndex;
assert(nAnim >= 0 && nAnim < kMaxAnims);
auto pActor = &AnimList[nAnim];
short nSeq = pActor->nSeq;
short nSeq = pActor->nIndex2;
seq_PlotSequence(ev->nParam, nSeq, pActor->field_2, 0x101);
seq_PlotSequence(ev->nParam, nSeq, pActor->nIndex, 0x101);
ev->pTSprite->owner = -1;
}

View file

@ -2257,9 +2257,9 @@ sectdone:
if (nLocalPlayer == nPlayer)
{
short nAnim = pSprite->owner;
AnimList[nAnim].nSeq++;
AnimList[nAnim].AnimFlags &= 0xEF;
AnimList[nAnim].field_2 = 0;
AnimList[nAnim].nIndex2++;
AnimList[nAnim].nAction &= 0xEF;
AnimList[nAnim].nIndex = 0;
changespritestat(nValB, 899);
}