- 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 struct Anim
{ {
short nSeq; short nIndex2;
short field_2; short nIndex;
short field_4; short field_4;
short nSprite; short nSprite;
short AnimRunRec; short nRun;
uint8_t AnimFlags; uint8_t nAction;
}; };

View file

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

View file

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