mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 08:51:24 +00:00
- converted FuncBullets into a class.
This commit is contained in:
parent
832b394561
commit
8f9e9de4b4
2 changed files with 59 additions and 59 deletions
|
@ -452,6 +452,12 @@ struct AIBubble : ExhumedAI
|
|||
void Draw(RunListEvent* ev) override;
|
||||
};
|
||||
|
||||
class AIBullet : public ExhumedAI
|
||||
{
|
||||
void Tick(RunListEvent* ev) override;
|
||||
void Draw(RunListEvent* ev) override;
|
||||
};
|
||||
|
||||
|
||||
void runlist_DispatchEvent(ExhumedAI* ai, int nObject, int nMessage, int nDamage, int nRun);
|
||||
|
||||
|
|
|
@ -811,19 +811,15 @@ int BuildBullet(short nSprite, int nType, int, int, int val1, int nAngle, int va
|
|||
return nBulletSprite | (nBullet << 16);
|
||||
}
|
||||
|
||||
void FuncBullet(int nObject, int nMessage, int, int nRun)
|
||||
void AIBullet::Tick(RunListEvent* ev)
|
||||
{
|
||||
short nBullet = RunData[nRun].nVal;
|
||||
short nBullet = RunData[ev->nRun].nVal;
|
||||
assert(nBullet >= 0 && nBullet < kMaxBullets);
|
||||
|
||||
short nSeq = SeqOffsets[BulletList[nBullet].nSeq];
|
||||
short nSprite = BulletList[nBullet].nSprite;
|
||||
auto pSprite = &sprite[nSprite];
|
||||
|
||||
switch (nMessage)
|
||||
{
|
||||
case 0x20000:
|
||||
{
|
||||
short nFlag = FrameFlag[SeqBase[nSeq] + BulletList[nBullet].nFrame];
|
||||
|
||||
seq_MoveSequence(nSprite, nSeq, BulletList[nBullet].nFrame);
|
||||
|
@ -853,12 +849,16 @@ void FuncBullet(int nObject, int nMessage, int, int nRun)
|
|||
{
|
||||
MoveBullet(nBullet);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case 0x90000:
|
||||
void AIBullet::Draw(RunListEvent* ev)
|
||||
{
|
||||
short nSprite2 = nObject;
|
||||
short nBullet = RunData[ev->nRun].nVal;
|
||||
assert(nBullet >= 0 && nBullet < kMaxBullets);
|
||||
|
||||
short nSeq = SeqOffsets[BulletList[nBullet].nSeq];
|
||||
|
||||
short nSprite2 = ev->nIndex;
|
||||
mytsprite[nSprite2].statnum = 1000;
|
||||
|
||||
if (BulletList[nBullet].nType == 15)
|
||||
|
@ -868,19 +868,13 @@ void FuncBullet(int nObject, int nMessage, int, int nRun)
|
|||
else
|
||||
{
|
||||
seq_PlotSequence(nSprite2, nSeq, BulletList[nBullet].nFrame, 0);
|
||||
mytsprite[nSprite2].owner = -1;
|
||||
ev->pTSprite->owner = -1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case 0xA0000:
|
||||
break;
|
||||
|
||||
default:
|
||||
void FuncBullet(int nObject, int nMessage, int nDamage, int nRun)
|
||||
{
|
||||
Printf("unknown msg %d for bullet\n", nMessage);
|
||||
return;
|
||||
}
|
||||
}
|
||||
AIBullet ai;
|
||||
runlist_DispatchEvent(&ai, nObject, nMessage, nDamage, nRun);
|
||||
}
|
||||
END_PS_NS
|
||||
|
|
Loading…
Reference in a new issue