mirror of
https://github.com/ZDoom/Raze.git
synced 2025-02-21 11:01:01 +00:00
- Exhumed: Tidy up BuildAnim()
.
* Also rename two rather unnamed args to something more appropriate.
This commit is contained in:
parent
b5d4bc8573
commit
a2bd2b17a2
2 changed files with 14 additions and 19 deletions
|
@ -35,7 +35,7 @@ enum
|
||||||
|
|
||||||
void InitAnims();
|
void InitAnims();
|
||||||
void DestroyAnim(DExhumedActor* nAnim);
|
void DestroyAnim(DExhumedActor* nAnim);
|
||||||
DExhumedActor* BuildAnim(DExhumedActor* actor, int val, int val2, const DVector3& pos, sectortype* pSector, double nScale, int nFlag);
|
DExhumedActor* BuildAnim(DExhumedActor* actor, int nSeq, int nOffset, const DVector3& pos, sectortype* pSector, double nScale, int nFlag);
|
||||||
void UnlinkIgnitedAnim(DExhumedActor* pActor);
|
void UnlinkIgnitedAnim(DExhumedActor* pActor);
|
||||||
void FuncAnim(int, int, int, int);
|
void FuncAnim(int, int, int, int);
|
||||||
void BuildExplosion(DExhumedActor* actor);
|
void BuildExplosion(DExhumedActor* actor);
|
||||||
|
|
|
@ -96,13 +96,10 @@ void DestroyAnim(DExhumedActor* pActor)
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
DExhumedActor* BuildAnim(DExhumedActor* pActor, int val, int val2, const DVector3& pos, sectortype* pSector, double nScale, int nFlag)
|
DExhumedActor* BuildAnim(DExhumedActor* pActor, int nSeq, int nOffset, const DVector3& pos, sectortype* pSector, double nScale, int nFlag)
|
||||||
{
|
{
|
||||||
if (pActor == nullptr) {
|
if (pActor == nullptr)
|
||||||
pActor = insertActor(pSector, 500);
|
pActor = insertActor(pSector, 500);
|
||||||
}
|
|
||||||
pActor->spr.pos = pos;
|
|
||||||
pActor->spr.cstat = 0;
|
|
||||||
|
|
||||||
if (nFlag & 4)
|
if (nFlag & 4)
|
||||||
{
|
{
|
||||||
|
@ -115,6 +112,15 @@ DExhumedActor* BuildAnim(DExhumedActor* pActor, int val, int val2, const DVector
|
||||||
pActor->spr.shade = -12;
|
pActor->spr.shade = -12;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CHECKME - where is hitag set otherwise?
|
||||||
|
if (pActor->spr.statnum < 900)
|
||||||
|
pActor->spr.hitag = -1;
|
||||||
|
|
||||||
|
if (nFlag & 0x80)
|
||||||
|
pActor->spr.cstat |= CSTAT_SPRITE_TRANSLUCENT; // set transluscence
|
||||||
|
|
||||||
|
pActor->spr.pos = pos;
|
||||||
|
pActor->spr.cstat = 0;
|
||||||
pActor->clipdist = 2.5;
|
pActor->clipdist = 2.5;
|
||||||
pActor->spr.scale = DVector2(nScale, nScale);
|
pActor->spr.scale = DVector2(nScale, nScale);
|
||||||
pActor->spr.picnum = 1;
|
pActor->spr.picnum = 1;
|
||||||
|
@ -124,28 +130,17 @@ DExhumedActor* BuildAnim(DExhumedActor* pActor, int val, int val2, const DVector
|
||||||
pActor->vel.X = 0;
|
pActor->vel.X = 0;
|
||||||
pActor->vel.Y = 0;
|
pActor->vel.Y = 0;
|
||||||
pActor->vel.Z = 0;
|
pActor->vel.Z = 0;
|
||||||
pActor->backuppos();
|
|
||||||
|
|
||||||
// CHECKME - where is hitag set otherwise?
|
|
||||||
if (pActor->spr.statnum < 900) {
|
|
||||||
pActor->spr.hitag = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
pActor->spr.lotag = runlist_HeadRun() + 1;
|
pActor->spr.lotag = runlist_HeadRun() + 1;
|
||||||
pActor->spr.intowner = -1;
|
pActor->spr.intowner = -1;
|
||||||
pActor->spr.extra = runlist_AddRunRec(pActor->spr.lotag - 1, pActor, 0x100000);
|
pActor->spr.extra = runlist_AddRunRec(pActor->spr.lotag - 1, pActor, 0x100000);
|
||||||
|
|
||||||
pActor->nRun = runlist_AddRunRec(NewRun, pActor, 0x100000);
|
pActor->nRun = runlist_AddRunRec(NewRun, pActor, 0x100000);
|
||||||
pActor->nAction = nFlag;
|
pActor->nAction = nFlag;
|
||||||
pActor->nIndex = 0;
|
pActor->nIndex = 0;
|
||||||
pActor->nIndex2 = SeqOffsets[val] + val2;
|
pActor->nIndex2 = SeqOffsets[nSeq] + nOffset;
|
||||||
pActor->pTarget = nullptr;
|
pActor->pTarget = nullptr;
|
||||||
pActor->nDamage = pActor->nRun;
|
pActor->nDamage = pActor->nRun;
|
||||||
pActor->nPhase = ITEM_MAGIC;
|
pActor->nPhase = ITEM_MAGIC;
|
||||||
|
pActor->backuppos();
|
||||||
if (nFlag & 0x80) {
|
|
||||||
pActor->spr.cstat |= CSTAT_SPRITE_TRANSLUCENT; // set transluscence
|
|
||||||
}
|
|
||||||
|
|
||||||
return pActor;
|
return pActor;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue