- Exhumed short review

(down to < 550)
This commit is contained in:
Christoph Oelckers 2021-11-21 19:24:46 +01:00
parent 14613f2f50
commit 30b42d24a0
9 changed files with 117 additions and 125 deletions

View file

@ -75,9 +75,9 @@ extern TArray<DExhumedActor*> EnergyBlocks;
void InitBullets(); void InitBullets();
int GrabBullet(); int GrabBullet();
void DestroyBullet(short nRun); void DestroyBullet(int nRun);
int MoveBullet(short nBullet); int MoveBullet(int nBullet);
void SetBulletEnemy(short nBullet, DExhumedActor* nEnemy); void SetBulletEnemy(int nBullet, DExhumedActor* nEnemy);
DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, int val1, int nAngle, DExhumedActor* pTarget, int val3); DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, int val1, int nAngle, DExhumedActor* pTarget, int val3);
void IgniteSprite(DExhumedActor* nSprite); void IgniteSprite(DExhumedActor* nSprite);
@ -133,9 +133,9 @@ void RestoreMinAmmo(int nPlayer);
void FillWeapons(int nPlayer); void FillWeapons(int nPlayer);
void ResetPlayerWeapons(int nPlayer); void ResetPlayerWeapons(int nPlayer);
void InitWeapons(); void InitWeapons();
void SetNewWeapon(int nPlayer, short nWeapon); void SetNewWeapon(int nPlayer, int nWeapon);
void SetNewWeaponImmediate(int nPlayer, short nWeapon); void SetNewWeaponImmediate(int nPlayer, int nWeapon);
void SetNewWeaponIfBetter(int nPlayer, short nWeapon); void SetNewWeaponIfBetter(int nPlayer, int nWeapon);
void SelectNewWeapon(int nPlayer); void SelectNewWeapon(int nPlayer);
void StopFiringWeapon(int nPlayer); void StopFiringWeapon(int nPlayer);
void FireWeapon(int nPlayer); void FireWeapon(int nPlayer);

View file

@ -136,7 +136,7 @@ int GrabBullet()
return grabbed; return grabbed;
} }
void DestroyBullet(short nBullet) void DestroyBullet(int nBullet)
{ {
auto pActor = BulletList[nBullet].pActor; auto pActor = BulletList[nBullet].pActor;
auto pSprite = &pActor->s(); auto pSprite = &pActor->s();
@ -297,10 +297,10 @@ void BackUpBullet(int *x, int *y, int nAngle)
*y -= bsin(nAngle, -11); *y -= bsin(nAngle, -11);
} }
int MoveBullet(short nBullet) int MoveBullet(int nBullet)
{ {
short hitsect = -1; int hitsect = -1;
short hitwall = -1; int hitwall = -1;
DExhumedActor* hitactor = nullptr; DExhumedActor* hitactor = nullptr;
Bullet *pBullet = &BulletList[nBullet]; Bullet *pBullet = &BulletList[nBullet];
@ -563,7 +563,7 @@ HITWALL:
return nVal; return nVal;
} }
void SetBulletEnemy(short nBullet, DExhumedActor* pEnemy) void SetBulletEnemy(int nBullet, DExhumedActor* pEnemy)
{ {
if (nBullet >= 0) { if (nBullet >= 0) {
BulletList[nBullet].pEnemy = pEnemy; BulletList[nBullet].pEnemy = pEnemy;
@ -651,7 +651,7 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, int nZOffset, int n
pBulletSprite->clipdist = 25; pBulletSprite->clipdist = 25;
short nRepeat = pBulletInfo->xyRepeat; int nRepeat = pBulletInfo->xyRepeat;
if (nRepeat < 0) { if (nRepeat < 0) {
nRepeat = 30; nRepeat = 30;
} }
@ -676,7 +676,7 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, int nZOffset, int n
pBullet->field_E = pBulletInfo->field_2; pBullet->field_E = pBulletInfo->field_2;
pBullet->nFrame = 0; pBullet->nFrame = 0;
short nSeq; int nSeq;
if (pBulletInfo->field_8 != -1) if (pBulletInfo->field_8 != -1)
{ {
@ -819,14 +819,14 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, int nZOffset, int n
void AIBullet::Tick(RunListEvent* ev) void AIBullet::Tick(RunListEvent* ev)
{ {
short nBullet = RunData[ev->nRun].nObjIndex; int nBullet = RunData[ev->nRun].nObjIndex;
assert(nBullet >= 0 && nBullet < kMaxBullets); assert(nBullet >= 0 && nBullet < kMaxBullets);
short nSeq = SeqOffsets[BulletList[nBullet].nSeq]; int nSeq = SeqOffsets[BulletList[nBullet].nSeq];
auto pActor = BulletList[nBullet].pActor; auto pActor = BulletList[nBullet].pActor;
auto pSprite = &pActor->s(); auto pSprite = &pActor->s();
short nFlag = FrameFlag[SeqBase[nSeq] + BulletList[nBullet].nFrame]; int nFlag = FrameFlag[SeqBase[nSeq] + BulletList[nBullet].nFrame];
seq_MoveSequence(pActor, nSeq, BulletList[nBullet].nFrame); seq_MoveSequence(pActor, nSeq, BulletList[nBullet].nFrame);
@ -859,10 +859,10 @@ void AIBullet::Tick(RunListEvent* ev)
void AIBullet::Draw(RunListEvent* ev) void AIBullet::Draw(RunListEvent* ev)
{ {
short nBullet = RunData[ev->nRun].nObjIndex; int nBullet = RunData[ev->nRun].nObjIndex;
assert(nBullet >= 0 && nBullet < kMaxBullets); assert(nBullet >= 0 && nBullet < kMaxBullets);
short nSeq = SeqOffsets[BulletList[nBullet].nSeq]; int nSeq = SeqOffsets[BulletList[nBullet].nSeq];
ev->pTSprite->statnum = 1000; ev->pTSprite->statnum = 1000;

View file

@ -89,9 +89,9 @@ void MySetView(int x1, int y1, int x2, int y2);
char sHollyStr[40]; char sHollyStr[40];
short nFontFirstChar; int nFontFirstChar;
short nBackgroundPic; int nBackgroundPic;
short nShadowPic; int nShadowPic;
short nCreaturesKilled = 0, nCreaturesTotal = 0; short nCreaturesKilled = 0, nCreaturesTotal = 0;
@ -569,11 +569,6 @@ bool GameInterface::CanSave()
return new GameInterface; return new GameInterface;
} }
extern short cPupData[300];
extern uint8_t* Worktile;
extern int lHeadStartClock;
extern short* pPupData;
FSerializer& Serialize(FSerializer& arc, const char* keyname, DExhumedActor& w, DExhumedActor* def) FSerializer& Serialize(FSerializer& arc, const char* keyname, DExhumedActor& w, DExhumedActor* def)
{ {
if (arc.BeginObject(keyname)) if (arc.BeginObject(keyname))

View file

@ -102,9 +102,9 @@ extern int nNetTime;
extern short nTotalPlayers; extern short nTotalPlayers;
extern short nFontFirstChar; extern int nFontFirstChar;
extern short nBackgroundPic; extern int nBackgroundPic;
extern short nShadowPic; extern int nShadowPic;
extern short nCreaturesTotal, nCreaturesKilled; extern short nCreaturesTotal, nCreaturesKilled;
@ -127,7 +127,7 @@ extern short bSnakeCam;
extern short nButtonColor; extern short nButtonColor;
extern short nHeadStage; extern int nHeadStage;
extern int flash; extern int flash;

View file

@ -126,7 +126,7 @@ void InitWeapons()
for (auto& p : PlayerList) p.pPlayerGrenade = nullptr; for (auto& p : PlayerList) p.pPlayerGrenade = nullptr;
} }
void SetNewWeapon(int nPlayer, short nWeapon) void SetNewWeapon(int nPlayer, int nWeapon)
{ {
if (nWeapon == kWeaponMummified) if (nWeapon == kWeaponMummified)
{ {
@ -167,7 +167,7 @@ void SetNewWeapon(int nPlayer, short nWeapon)
PlayerList[nPlayer].field_38 = nWeapon; PlayerList[nPlayer].field_38 = nWeapon;
} }
void SetNewWeaponImmediate(int nPlayer, short nWeapon) void SetNewWeaponImmediate(int nPlayer, int nWeapon)
{ {
SetNewWeapon(nPlayer, nWeapon); SetNewWeapon(nPlayer, nWeapon);
@ -177,7 +177,7 @@ void SetNewWeaponImmediate(int nPlayer, short nWeapon)
PlayerList[nPlayer].field_3A = 0; PlayerList[nPlayer].field_3A = 0;
} }
void SetNewWeaponIfBetter(int nPlayer, short nWeapon) void SetNewWeaponIfBetter(int nPlayer, int nWeapon)
{ {
if (nWeapon > PlayerList[nPlayer].nCurrentWeapon) { if (nWeapon > PlayerList[nPlayer].nCurrentWeapon) {
SetNewWeapon(nPlayer, nWeapon); SetNewWeapon(nPlayer, nWeapon);
@ -230,12 +230,12 @@ void SetWeaponStatus(int nPlayer)
uint8_t WeaponCanFire(int nPlayer) uint8_t WeaponCanFire(int nPlayer)
{ {
short nWeapon = PlayerList[nPlayer].nCurrentWeapon; int nWeapon = PlayerList[nPlayer].nCurrentWeapon;
int nSector =PlayerList[nPlayer].nPlayerViewSect; int nSector =PlayerList[nPlayer].nPlayerViewSect;
if (!(sector[nSector].Flag & kSectUnderwater) || WeaponInfo[nWeapon].bFireUnderwater) if (!(sector[nSector].Flag & kSectUnderwater) || WeaponInfo[nWeapon].bFireUnderwater)
{ {
short nAmmoType = WeaponInfo[nWeapon].nAmmoType; int nAmmoType = WeaponInfo[nWeapon].nAmmoType;
if (WeaponInfo[nWeapon].d <= PlayerList[nPlayer].nAmmo[nAmmoType]) { if (WeaponInfo[nWeapon].d <= PlayerList[nPlayer].nAmmo[nAmmoType]) {
return true; return true;
@ -252,7 +252,7 @@ void ResetSwordSeqs()
WeaponInfo[kWeaponSword].b[3] = 7; WeaponInfo[kWeaponSword].b[3] = 7;
} }
Collision CheckCloseRange(int nPlayer, int *x, int *y, int *z, short *nSector) Collision CheckCloseRange(int nPlayer, int *x, int *y, int *z, int *nSector)
{ {
short hitSect, hitWall, hitSprite; short hitSect, hitWall, hitSprite;
int hitX, hitY, hitZ; int hitX, hitY, hitZ;
@ -628,7 +628,7 @@ void MoveWeapons(int nPlayer)
loc_flag: loc_flag:
// loc_27001 // loc_27001
short nFrameFlag = seq_GetFrameFlag(var_3C, PlayerList[nPlayer].field_3FOUR); int nFrameFlag = seq_GetFrameFlag(var_3C, PlayerList[nPlayer].field_3FOUR);
if (((!(nSectFlag & kSectUnderwater)) || nWeapon == kWeaponRing) && (nFrameFlag & 4)) if (((!(nSectFlag & kSectUnderwater)) || nWeapon == kWeaponRing) && (nFrameFlag & 4))
{ {
@ -667,7 +667,7 @@ loc_flag:
} }
} }
short nAmmoType = WeaponInfo[nWeapon].nAmmoType; int nAmmoType = WeaponInfo[nWeapon].nAmmoType;
int nAngle = pPlayerSprite->ang; int nAngle = pPlayerSprite->ang;
int theX = pPlayerSprite->x; int theX = pPlayerSprite->x;
int theY = pPlayerSprite->y; int theY = pPlayerSprite->y;
@ -708,7 +708,7 @@ loc_flag:
} }
} }
short nSectorB = pPlayerSprite->sectnum; int nSectorB = pPlayerSprite->sectnum;
switch (nWeapon) switch (nWeapon)
{ {

View file

@ -104,10 +104,10 @@ struct MoveSect
struct wallFace struct wallFace
{ {
short nChannel;
int nWall; int nWall;
short field_4; int16_t nChannel;
short field_6[8]; int16_t count;
int16_t piclist[8];
}; };
struct slideData struct slideData
@ -274,8 +274,8 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, wallFace& w, wallF
{ {
arc("channel", w.nChannel) arc("channel", w.nChannel)
("wall", w.nWall) ("wall", w.nWall)
("at4", w.field_4) ("at4", w.count)
.Array("at6", w.field_6, 8) .Array("at6", w.piclist, 8)
.EndObject(); .EndObject();
} }
return arc; return arc;
@ -898,7 +898,7 @@ int BuildWallFace(short nChannel, int nWall, int nCount, ...)
{ {
auto WallFaceCount = WallFace.Reserve(1); auto WallFaceCount = WallFace.Reserve(1);
WallFace[WallFaceCount].field_4 = 0; WallFace[WallFaceCount].count = 0;
WallFace[WallFaceCount].nWall = nWall; WallFace[WallFaceCount].nWall = nWall;
WallFace[WallFaceCount].nChannel = nChannel; WallFace[WallFaceCount].nChannel = nChannel;
@ -909,12 +909,12 @@ int BuildWallFace(short nChannel, int nWall, int nCount, ...)
va_list piclist; va_list piclist;
va_start(piclist, nCount); va_start(piclist, nCount);
while (WallFace[WallFaceCount].field_4 < nCount) while (WallFace[WallFaceCount].count < nCount)
{ {
int i = WallFace[WallFaceCount].field_4; int i = WallFace[WallFaceCount].count;
WallFace[WallFaceCount].field_4++; WallFace[WallFaceCount].count++;
WallFace[WallFaceCount].field_6[i] = (short)va_arg(piclist, int); WallFace[WallFaceCount].piclist[i] = (int16_t)va_arg(piclist, int);
} }
va_end(piclist); va_end(piclist);
@ -926,13 +926,13 @@ void AIWallFace::ProcessChannel(RunListEvent* ev)
int nWallFace = RunData[ev->nRun].nObjIndex; int nWallFace = RunData[ev->nRun].nObjIndex;
assert(nWallFace >= 0 && nWallFace < (int)WallFace.Size()); assert(nWallFace >= 0 && nWallFace < (int)WallFace.Size());
short nChannel = WallFace[nWallFace].nChannel; int16_t nChannel = WallFace[nWallFace].nChannel;
short si = sRunChannels[nChannel].c; int16_t si = sRunChannels[nChannel].c;
if ((si <= WallFace[nWallFace].field_4) && (si >= 0)) if ((si <= WallFace[nWallFace].count) && (si >= 0))
{ {
wall[WallFace[nWallFace].nWall].picnum = WallFace[nWallFace].field_6[si]; wall[WallFace[nWallFace].nWall].picnum = WallFace[nWallFace].piclist[si];
} }
} }
@ -2086,7 +2086,7 @@ void AIObject::Damage(RunListEvent* ev)
return; return;
} }
pActor->nHealth -= (short)ev->nDamage; pActor->nHealth -= (int16_t)ev->nDamage;
if (pActor->nHealth > 0) { if (pActor->nHealth > 0) {
return; return;
} }

View file

@ -54,18 +54,18 @@ static actionSeq PlayerSeq[] = {
{122, 1} {122, 1}
}; };
static short nHeightTemplate[] = { 0, 0, 0, 0, 0, 0, 7, 7, 7, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0 }; static const uint8_t nHeightTemplate[] = { 0, 0, 0, 0, 0, 0, 7, 7, 7, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0 };
short nActionEyeLevel[] = { static const int16_t nActionEyeLevel[] = {
-14080, -14080, -14080, -14080, -14080, -14080, -8320, -14080, -14080, -14080, -14080, -14080, -14080, -8320,
-8320, -8320, -8320, -8320, -8320, -8320, -14080, -8320, -8320, -8320, -8320, -8320, -8320, -14080,
-14080, -14080, -14080, -14080, -14080, -14080, -14080 -14080, -14080, -14080, -14080, -14080, -14080, -14080
}; };
uint16_t nGunLotag[] = { 52, 53, 54, 55, 56, 57 }; static const uint16_t nGunLotag[] = { 52, 53, 54, 55, 56, 57 };
uint16_t nGunPicnum[] = { 57, 488, 490, 491, 878, 899, 3455 }; static const uint16_t nGunPicnum[] = { 57, 488, 490, 491, 878, 899, 3455 };
int16_t nItemText[] = { static const int16_t nItemText[] = {
-1, -1, -1, -1, -1, -1, 18, 20, 19, 13, -1, 10, 1, 0, 2, -1, 3, -1, -1, -1, -1, -1, -1, 18, 20, 19, 13, -1, 10, 1, 0, 2, -1, 3,
-1, 4, 5, 9, 6, 7, 8, -1, 11, -1, 13, 12, 14, 15, -1, 16, 17, -1, 4, 5, 9, 6, 7, 8, -1, 11, -1, 13, 12, 14, 15, -1, 16, 17,
-1, -1, -1, 21, 22, -1, -1, -1, -1, -1, -1, 23, 24, 25, 26, 27, -1, -1, -1, 21, 22, -1, -1, -1, -1, -1, -1, 23, 24, 25, 26, 27,
@ -84,7 +84,6 @@ short nStandHeight;
short PlayerCount; short PlayerCount;
short nNetStartSprites; short nNetStartSprites;
short nCurStartSprite; short nCurStartSprite;

View file

@ -34,8 +34,6 @@ enum
kMaxTails = 7 kMaxTails = 7
}; };
short QueenCount = 0;
static actionSeq QueenSeq[] = { static actionSeq QueenSeq[] = {
{0, 0}, {0, 0},
{0, 0}, {0, 0},
@ -74,45 +72,45 @@ struct Queen
{ {
DExhumedActor* pActor; DExhumedActor* pActor;
DExhumedActor* pTarget; DExhumedActor* pTarget;
short nHealth; int16_t nHealth;
short nFrame; int16_t nFrame;
short nAction; int16_t nAction;
short nAction2; int16_t nAction2;
short nIndex; int16_t nIndex;
short nIndex2; int16_t nIndex2;
short nChannel; int16_t nChannel;
}; };
struct Egg struct Egg
{ {
DExhumedActor* pActor; DExhumedActor* pActor;
DExhumedActor* pTarget; DExhumedActor* pTarget;
short nHealth; int16_t nHealth;
short nFrame; int16_t nFrame;
short nAction; int16_t nAction;
short nRun; int16_t nRun;
short nCounter; int16_t nCounter;
}; };
struct Head struct Head
{ {
DExhumedActor* pActor; DExhumedActor* pActor;
DExhumedActor* pTarget; DExhumedActor* pTarget;
short nHealth; int16_t nHealth;
short nFrame; int16_t nFrame;
short nAction; int16_t nAction;
short nRun; int16_t nRun;
short nIndex; int16_t nIndex;
short nIndex2; int16_t nIndex2;
short nChannel; int16_t nChannel;
}; };
FreeListArray<Egg, kMaxEggs> QueenEgg; FreeListArray<Egg, kMaxEggs> QueenEgg;
int QueenCount = 0;
int nQHead = 0; int nQHead = 0;
int nHeadVel;
short nHeadVel; int nVelShift;
short nVelShift;
DExhumedActor* tailspr[kMaxTails]; DExhumedActor* tailspr[kMaxTails];
@ -123,8 +121,8 @@ Head QueenHead;
int MoveQX[25]; int MoveQX[25];
int MoveQY[25]; int MoveQY[25];
int MoveQZ[25]; int MoveQZ[25];
short MoveQS[25]; int MoveQS[25];
short MoveQA[25]; int16_t MoveQA[25];
FSerializer& Serialize(FSerializer& arc, const char* keyname, Queen& w, Queen* def) FSerializer& Serialize(FSerializer& arc, const char* keyname, Queen& w, Queen* def)
{ {
@ -369,7 +367,7 @@ int DestroyTailPart()
for (int i = 0; i < 5; i++) for (int i = 0; i < 5; i++)
{ {
short nHeight = GetActorHeight(pActor); int nHeight = GetActorHeight(pActor);
BuildLavaLimb(pActor, i, nHeight); BuildLavaLimb(pActor, i, nHeight);
} }
@ -405,7 +403,7 @@ void BuildTail()
pTailSprite->xrepeat = 80; pTailSprite->xrepeat = 80;
pTailSprite->yrepeat = 80; pTailSprite->yrepeat = 80;
pTailSprite->picnum = 1; pTailSprite->picnum = 1;
pTailSprite->pal = sector[pTailSprite->sectnum].ceilingpal; pTailSprite->pal = pTailSprite->sector()->ceilingpal;
pTailSprite->xoffset = 0; pTailSprite->xoffset = 0;
pTailSprite->yoffset = 0; pTailSprite->yoffset = 0;
pTailSprite->z = z; pTailSprite->z = z;
@ -425,7 +423,7 @@ void BuildTail()
QueenHead.nIndex2 = 7; QueenHead.nIndex2 = 7;
} }
void BuildQueenEgg(short nQueen, int nVal) void BuildQueenEgg(int nQueen, int nVal)
{ {
int nEgg = GrabEgg(); int nEgg = GrabEgg();
if (nEgg < 0) { if (nEgg < 0) {
@ -500,11 +498,11 @@ void BuildQueenEgg(short nQueen, int nVal)
void AIQueenEgg::Tick(RunListEvent* ev) void AIQueenEgg::Tick(RunListEvent* ev)
{ {
short nEgg = RunData[ev->nRun].nObjIndex; int nEgg = RunData[ev->nRun].nObjIndex;
Egg* pEgg = &QueenEgg[nEgg]; Egg* pEgg = &QueenEgg[nEgg];
auto pActor = pEgg->pActor; auto pActor = pEgg->pActor;
auto pSprite = &pActor->s(); auto pSprite = &pActor->s();
short nAction = pEgg->nAction; int nAction = pEgg->nAction;
DExhumedActor* pTarget = nullptr; DExhumedActor* pTarget = nullptr;
@ -520,7 +518,7 @@ void AIQueenEgg::Tick(RunListEvent* ev)
Gravity(pActor); Gravity(pActor);
} }
short nSeq = SeqOffsets[kSeqQueenEgg] + EggSeq[nAction].a; int nSeq = SeqOffsets[kSeqQueenEgg] + EggSeq[nAction].a;
pSprite->picnum = seq_GetSeqPicnum2(nSeq, pEgg->nFrame); pSprite->picnum = seq_GetSeqPicnum2(nSeq, pEgg->nFrame);
@ -655,7 +653,7 @@ void AIQueenEgg::Tick(RunListEvent* ev)
void AIQueenEgg::RadialDamage(RunListEvent* ev) void AIQueenEgg::RadialDamage(RunListEvent* ev)
{ {
short nEgg = RunData[ev->nRun].nObjIndex; int nEgg = RunData[ev->nRun].nObjIndex;
Egg* pEgg = &QueenEgg[nEgg]; Egg* pEgg = &QueenEgg[nEgg];
auto pActor = pEgg->pActor; auto pActor = pEgg->pActor;
auto pSprite = &pActor->s(); auto pSprite = &pActor->s();
@ -671,7 +669,7 @@ void AIQueenEgg::RadialDamage(RunListEvent* ev)
void AIQueenEgg::Damage(RunListEvent* ev) void AIQueenEgg::Damage(RunListEvent* ev)
{ {
short nEgg = RunData[ev->nRun].nObjIndex; int nEgg = RunData[ev->nRun].nObjIndex;
Egg* pEgg = &QueenEgg[nEgg]; Egg* pEgg = &QueenEgg[nEgg];
if (ev->nDamage != 0 && pEgg->nHealth > 0) if (ev->nDamage != 0 && pEgg->nHealth > 0)
@ -685,12 +683,12 @@ void AIQueenEgg::Damage(RunListEvent* ev)
void AIQueenEgg::Draw(RunListEvent* ev) void AIQueenEgg::Draw(RunListEvent* ev)
{ {
short nEgg = RunData[ev->nRun].nObjIndex; int nEgg = RunData[ev->nRun].nObjIndex;
Egg* pEgg = &QueenEgg[nEgg]; Egg* pEgg = &QueenEgg[nEgg];
seq_PlotSequence(ev->nParam, SeqOffsets[kSeqQueenEgg] + EggSeq[pEgg->nAction].a, pEgg->nFrame, EggSeq[pEgg->nAction].b); seq_PlotSequence(ev->nParam, SeqOffsets[kSeqQueenEgg] + EggSeq[pEgg->nAction].a, pEgg->nFrame, EggSeq[pEgg->nAction].b);
} }
void BuildQueenHead(short nQueen) void BuildQueenHead(int nQueen)
{ {
auto pActor = QueenList[nQueen].pActor; auto pActor = QueenList[nQueen].pActor;
auto pSprite = &pActor->s(); auto pSprite = &pActor->s();
@ -750,15 +748,15 @@ void AIQueenHead::Tick(RunListEvent* ev)
int nSector = pSprite->sectnum; int nSector = pSprite->sectnum;
assert(validSectorIndex(nSector)); assert(validSectorIndex(nSector));
short nAction = QueenHead.nAction; int nAction = QueenHead.nAction;
short nHd; int nHd;
int var_14 = 0; int var_14 = 0;
if (nAction == 0) { if (nAction == 0) {
Gravity(pActor); Gravity(pActor);
} }
short nSeq = SeqOffsets[kSeqQueen] + HeadSeq[QueenHead.nAction].a; int nSeq = SeqOffsets[kSeqQueen] + HeadSeq[QueenHead.nAction].a;
seq_MoveSequence(pActor, nSeq, QueenHead.nFrame); seq_MoveSequence(pActor, nSeq, QueenHead.nFrame);
@ -811,7 +809,7 @@ void AIQueenHead::Tick(RunListEvent* ev)
auto nMov = MoveCreature(pActor); auto nMov = MoveCreature(pActor);
// original BUG - this line doesn't exist in original code? // original BUG - this line doesn't exist in original code?
short nNewAng = pSprite->ang; int nNewAng = pSprite->ang;
if (nMov.exbits == 0) if (nMov.exbits == 0)
{ {
@ -1081,10 +1079,10 @@ void AIQueenHead::Damage(RunListEvent* ev)
void AIQueenHead::Draw(RunListEvent* ev) void AIQueenHead::Draw(RunListEvent* ev)
{ {
short nHead = RunData[ev->nRun].nObjIndex; int nHead = RunData[ev->nRun].nObjIndex;
short nAction = QueenHead.nAction; int nAction = QueenHead.nAction;
short nSeq = SeqOffsets[kSeqQueen]; int nSeq = SeqOffsets[kSeqQueen];
int edx; int edx;
@ -1106,7 +1104,7 @@ void BuildQueen(DExhumedActor* pActor, int x, int y, int z, int nSector, int nAn
{ {
QueenCount--; QueenCount--;
short nQueen = QueenCount; int nQueen = QueenCount;
if (nQueen < 0) { if (nQueen < 0) {
return; return;
} }
@ -1178,13 +1176,13 @@ void SetQueenSpeed(DExhumedActor* pActor, int nSpeed)
void AIQueen::Tick(RunListEvent* ev) void AIQueen::Tick(RunListEvent* ev)
{ {
short nQueen = RunData[ev->nRun].nObjIndex; int nQueen = RunData[ev->nRun].nObjIndex;
assert(nQueen >= 0 && nQueen < kMaxQueens); assert(nQueen >= 0 && nQueen < kMaxQueens);
auto pActor = QueenList[nQueen].pActor; auto pActor = QueenList[nQueen].pActor;
auto pSprite = &pActor->s(); auto pSprite = &pActor->s();
short nAction = QueenList[nQueen].nAction; int nAction = QueenList[nQueen].nAction;
short si = QueenList[nQueen].nAction2; int si = QueenList[nQueen].nAction2;
auto pTarget = QueenList[nQueen].pTarget; auto pTarget = QueenList[nQueen].pTarget;
bool bVal = false; bool bVal = false;
@ -1193,7 +1191,7 @@ void AIQueen::Tick(RunListEvent* ev)
Gravity(pActor); Gravity(pActor);
} }
short nSeq = SeqOffsets[kSeqQueen] + QueenSeq[nAction].a; int nSeq = SeqOffsets[kSeqQueen] + QueenSeq[nAction].a;
pSprite->picnum = seq_GetSeqPicnum2(nSeq, QueenList[nQueen].nFrame); pSprite->picnum = seq_GetSeqPicnum2(nSeq, QueenList[nQueen].nFrame);
@ -1206,7 +1204,7 @@ void AIQueen::Tick(RunListEvent* ev)
bVal = true; bVal = true;
} }
short nFlag = FrameFlag[SeqBase[nSeq] + QueenList[nQueen].nFrame]; int nFlag = FrameFlag[SeqBase[nSeq] + QueenList[nQueen].nFrame];
if (pActor != nullptr) if (pActor != nullptr)
{ {
@ -1439,7 +1437,7 @@ void AIQueen::Tick(RunListEvent* ev)
void AIQueen::RadialDamage(RunListEvent* ev) void AIQueen::RadialDamage(RunListEvent* ev)
{ {
short nQueen = RunData[ev->nRun].nObjIndex; int nQueen = RunData[ev->nRun].nObjIndex;
assert(nQueen >= 0 && nQueen < kMaxQueens); assert(nQueen >= 0 && nQueen < kMaxQueens);
auto pActor = QueenList[nQueen].pActor; auto pActor = QueenList[nQueen].pActor;
auto pSprite = &pActor->s(); auto pSprite = &pActor->s();
@ -1454,12 +1452,12 @@ void AIQueen::RadialDamage(RunListEvent* ev)
void AIQueen::Damage(RunListEvent* ev) void AIQueen::Damage(RunListEvent* ev)
{ {
short nQueen = RunData[ev->nRun].nObjIndex; int nQueen = RunData[ev->nRun].nObjIndex;
assert(nQueen >= 0 && nQueen < kMaxQueens); assert(nQueen >= 0 && nQueen < kMaxQueens);
auto pActor = QueenList[nQueen].pActor; auto pActor = QueenList[nQueen].pActor;
auto pSprite = &pActor->s(); auto pSprite = &pActor->s();
short si = QueenList[nQueen].nAction2; int si = QueenList[nQueen].nAction2;
if (QueenList[nQueen].nHealth > 0) if (QueenList[nQueen].nHealth > 0)
{ {
@ -1511,9 +1509,9 @@ void AIQueen::Damage(RunListEvent* ev)
void AIQueen::Draw(RunListEvent* ev) void AIQueen::Draw(RunListEvent* ev)
{ {
short nQueen = RunData[ev->nRun].nObjIndex; int nQueen = RunData[ev->nRun].nObjIndex;
assert(nQueen >= 0 && nQueen < kMaxQueens); assert(nQueen >= 0 && nQueen < kMaxQueens);
short nAction = QueenList[nQueen].nAction; int nAction = QueenList[nQueen].nAction;
seq_PlotSequence(ev->nParam, SeqOffsets[kSeqQueen] + QueenSeq[nAction].a, QueenList[nQueen].nFrame, QueenSeq[nAction].b); seq_PlotSequence(ev->nParam, SeqOffsets[kSeqQueen] + QueenSeq[nAction].a, QueenList[nQueen].nFrame, QueenSeq[nAction].b);
} }

View file

@ -30,16 +30,16 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_PS_NS BEGIN_PS_NS
short cPupData[300]; int16_t cPupData[300];
uint8_t *Worktile; uint8_t *Worktile;
int lHeadStartClock; int lHeadStartClock;
short* pPupData; int16_t* pPupData;
int lNextStateChange; int lNextStateChange;
int nPixels; int nPixels;
int nHeadTimeStart; int nHeadTimeStart;
short nHeadStage; int nHeadStage;
short curx[kSpiritY * kSpiritX]; int16_t curx[kSpiritY * kSpiritX];
short cury[kSpiritY * kSpiritX]; int16_t cury[kSpiritY * kSpiritX];
int8_t destvelx[kSpiritY * kSpiritX]; int8_t destvelx[kSpiritY * kSpiritX];
int8_t destvely[kSpiritY * kSpiritX]; int8_t destvely[kSpiritY * kSpiritX];
uint8_t pixelval[kSpiritY * kSpiritX]; uint8_t pixelval[kSpiritY * kSpiritX];
@ -47,9 +47,9 @@ int8_t origy[kSpiritY * kSpiritX];
int8_t origx[kSpiritY * kSpiritX]; int8_t origx[kSpiritY * kSpiritX];
int8_t velx[kSpiritY * kSpiritX]; int8_t velx[kSpiritY * kSpiritX];
int8_t vely[kSpiritY * kSpiritX]; int8_t vely[kSpiritY * kSpiritX];
short nMouthTile; int16_t nMouthTile;
short nPupData = 0; int nPupData = 0;
short word_964E8 = 0; short word_964E8 = 0;
short word_964EA = 0; short word_964EA = 0;
@ -373,8 +373,8 @@ void DoSpiritHead()
vely[i] = 0; vely[i] = 0;
} }
curx[i] = (short)(x << 8); curx[i] = (int)(x << 8);
cury[i] = (short)(y << 8); cury[i] = (int)(y << 8);
Worktile[212 * (x + 97) + 106 + y] = pixelval[i++]; Worktile[212 * (x + 97) + 106 + y] = pixelval[i++];
} }
@ -403,14 +403,14 @@ void DoSpiritHead()
dx = ((origx[i] << 8) - curx[i]) >> 3; dx = ((origx[i] << 8) - curx[i]) >> 3;
else { else {
dx = 0; dx = 0;
curx[i] = (short)(origx[i] << 8); curx[i] = (int)(origx[i] << 8);
} }
if (origy[i] << 8 == cury[i] || abs((origy[i] << 8) - cury[i]) >= 8) if (origy[i] << 8 == cury[i] || abs((origy[i] << 8) - cury[i]) >= 8)
dy = ((origy[i] << 8) - cury[i]) >> 3; dy = ((origy[i] << 8) - cury[i]) >> 3;
else { else {
dy = 0; dy = 0;
cury[i] = (short)(origy[i] << 8); cury[i] = (int)(origy[i] << 8);
} }
if ((dx | dy) != 0) if ((dx | dy) != 0)