- shorts replaced in Exhumed

only a small part, the easy stuff
This commit is contained in:
Christoph Oelckers 2021-11-16 18:45:07 +01:00
parent d63b6cda37
commit b9b4f1e037
6 changed files with 87 additions and 87 deletions

View file

@ -57,12 +57,12 @@ struct bulletInfo
int16_t nDamage; // 0 int16_t nDamage; // 0
int16_t field_2; // 2 int16_t field_2; // 2
int field_4; // 4 int field_4; // 4
short field_8; // 8 int16_t field_8; // 8
short nSeq; // 10 int16_t nSeq; // 10
short field_C; // 12 int16_t field_C; // 12
short nFlags; int16_t nFlags;
short nRadius; // damage radius int16_t nRadius; // damage radius
short xyRepeat; int16_t xyRepeat;
}; };
extern bulletInfo BulletInfo[]; extern bulletInfo BulletInfo[];
@ -161,9 +161,9 @@ extern short nItemMagic[];
void BuildItemAnim(DExhumedActor* nSprite); void BuildItemAnim(DExhumedActor* nSprite);
void ItemFlash(); void ItemFlash();
void FillItems(short nPlayer); void FillItems(short nPlayer);
void UseItem(short nPlayer, short nItem); void UseItem(short nPlayer, int nItem);
void UseCurItem(short nPlayer); void UseCurItem(short nPlayer);
int GrabItem(short nPlayer, short nItem); int GrabItem(short nPlayer, int nItem);
void DropMagic(DExhumedActor* actor); void DropMagic(DExhumedActor* actor);
void InitItems(); void InitItems();
void StartRegenerate(DExhumedActor* nSprite); void StartRegenerate(DExhumedActor* nSprite);
@ -766,9 +766,9 @@ std::pair<int, int> BuildSwNotOnPause(int nChannel, int nLink, int nSector, int
int BuildLink(int nCount, ...); int BuildLink(int nCount, ...);
std::pair<int, int> BuildSwPressSector(int nChannel, int nLink, int nSector, int ecx); std::pair<int, int> BuildSwPressSector(int nChannel, int nLink, int nSector, int ecx);
std::pair<int, int> BuildSwStepOn(int nChannel, int nLink, int nSector); std::pair<int, int> BuildSwStepOn(int nChannel, int nLink, int nSector);
std::pair<int, int> BuildSwReady(int nChannel, short nLink); std::pair<int, int> BuildSwReady(int nChannel, int nLink);
std::pair<int, int> BuildSwPressWall(short nChannel, short nLink, int nWall); std::pair<int, int> BuildSwPressWall(int nChannel, int nLink, int nWall);
// wasp // wasp

View file

@ -803,8 +803,8 @@ void ExamineSprites()
int nStatus = pSprite->statnum; int nStatus = pSprite->statnum;
if (!nStatus) if (!nStatus)
{ {
short lotag = pSprite->lotag; int lotag = pSprite->lotag;
short hitag = pSprite->hitag; int hitag = pSprite->hitag;
if ((nStatus < kMaxStatus) && lotag) if ((nStatus < kMaxStatus) && lotag)
{ {
@ -849,8 +849,8 @@ void LoadObjects()
for (int nSector = 0; nSector < numsectors; nSector++) for (int nSector = 0; nSector < numsectors; nSector++)
{ {
auto sectp = &sector[nSector]; auto sectp = &sector[nSector];
short hitag = sectp->hitag; int hitag = sectp->hitag;
short lotag = sectp->lotag; int lotag = sectp->lotag;
sectp->hitag = 0; sectp->hitag = 0;
sectp->lotag = 0; sectp->lotag = 0;
@ -869,8 +869,8 @@ void LoadObjects()
{ {
wall[nWall].extra = -1; wall[nWall].extra = -1;
short lotag = wall[nWall].lotag; int lotag = wall[nWall].lotag;
short hitag = wall[nWall].hitag; int hitag = wall[nWall].hitag;
wall[nWall].lotag = 0; wall[nWall].lotag = 0;

View file

@ -261,7 +261,7 @@ static bool UseHand(short nPlayer)
return true; return true;
} }
void UseItem(short nPlayer, short nItem) void UseItem(short nPlayer, int nItem)
{ {
bool didit = false; bool didit = false;
switch (nItem) switch (nItem)
@ -313,7 +313,7 @@ void UseItem(short nPlayer, short nItem)
} }
// TODO - bool return type? // TODO - bool return type?
int GrabItem(short nPlayer, short nItem) int GrabItem(short nPlayer, int nItem)
{ {
if (PlayerList[nPlayer].items[nItem] >= 5) { if (PlayerList[nPlayer].items[nItem] >= 5) {
return 0; return 0;

View file

@ -1972,7 +1972,7 @@ void AIObject::Tick(RunListEvent* ev)
if (!pActor) return; if (!pActor) return;
auto pSprite = &pActor->s(); auto pSprite = &pActor->s();
short nStat = pSprite->statnum; short nStat = pSprite->statnum;
short bx = pActor->nIndex; int bx = pActor->nIndex;
if (nStat == 97 || (!(pSprite->cstat & 0x101))) { if (nStat == 97 || (!(pSprite->cstat & 0x101))) {
return; return;
@ -2088,7 +2088,7 @@ void AIObject::Damage(RunListEvent* ev)
auto pActor = ev->pObjActor; auto pActor = ev->pObjActor;
if (!pActor) return; if (!pActor) return;
auto pSprite = &pActor->s(); auto pSprite = &pActor->s();
short nStat = pSprite->statnum; int nStat = pSprite->statnum;
if (nStat >= 150 || pActor->nHealth <= 0) { if (nStat >= 150 || pActor->nHealth <= 0) {
return; return;
@ -2119,7 +2119,7 @@ void AIObject::Draw(RunListEvent* ev)
{ {
auto pActor = ev->pObjActor; auto pActor = ev->pObjActor;
if (!pActor) return; if (!pActor) return;
short bx = pActor->nIndex; int bx = pActor->nIndex;
if (bx > -1) if (bx > -1)
{ {

View file

@ -60,23 +60,23 @@ struct Player
{ {
DExhumedActor* Actor() { return pActor; } DExhumedActor* Actor() { return pActor; }
DExhumedActor* pActor; DExhumedActor* pActor;
short nHealth; int16_t nHealth;
short nLives; int16_t nLives;
short nDouble; int16_t nDouble;
short nInvisible; int16_t nInvisible;
short nTorch; int16_t nTorch;
short field_2; int16_t field_2;
short nAction; int16_t nAction;
short bIsMummified; int16_t bIsMummified;
short invincibility; int16_t invincibility;
short nAir; int16_t nAir;
short nSeq; int16_t nSeq;
short nMaskAmount; int16_t nMaskAmount;
uint16_t keys; uint16_t keys;
short nMagic; int16_t nMagic;
short nItem; int16_t nItem;
uint8_t items[8]; uint8_t items[8];
short nAmmo[7]; // TODO - kMaxWeapons? int16_t nAmmo[7]; // TODO - kMaxWeapons?
short nCurrentWeapon; short nCurrentWeapon;
short field_3FOUR; short field_3FOUR;
@ -91,21 +91,21 @@ struct Player
PlayerHorizon horizon; PlayerHorizon horizon;
PlayerAngle angle; PlayerAngle angle;
short nBreathTimer; int16_t nBreathTimer;
short nPlayerSwear; int16_t nPlayerSwear;
short nPlayerPushSect; int nPlayerPushSect;
short nDeathType; int16_t nDeathType;
short nPlayerScore; int16_t nPlayerScore;
short nPlayerColor; int16_t nPlayerColor;
int16_t nPistolClip;
int nPlayerDY; int nPlayerDY;
int nPlayerDX; int nPlayerDX;
short nPistolClip;
int nXDamage; int nXDamage;
int nYDamage; int nYDamage;
short nPlayerOldWeapon; int16_t nPlayerOldWeapon;
short nPlayerClip; int16_t nPlayerClip;
short nPlayerPushSound; int16_t nPlayerPushSound;
short nTauntTimer; int16_t nTauntTimer;
uint16_t nPlayerWeapons; // each set bit represents a weapon the player has uint16_t nPlayerWeapons; // each set bit represents a weapon the player has
short nPlayerViewSect; short nPlayerViewSect;
PlayerSave sPlayerSave; PlayerSave sPlayerSave;

View file

@ -39,8 +39,8 @@ struct Switch
{ {
short nWaitTimer; short nWaitTimer;
short nWait; short nWait;
short nChannel; int nChannel;
short nLink; int nLink;
short nRunPtr; short nRunPtr;
int nSector; int nSector;
short nRun2; short nRun2;
@ -122,7 +122,7 @@ void InitSwitch()
memset(SwitchData, 0, sizeof(SwitchData)); memset(SwitchData, 0, sizeof(SwitchData));
} }
std::pair<int, int> BuildSwReady(int nChannel, short nLink) std::pair<int, int> BuildSwReady(int nChannel, int nLink)
{ {
if (SwitchCount <= 0 || nLink < 0) { if (SwitchCount <= 0 || nLink < 0) {
I_Error("Too many switch readys!\n"); I_Error("Too many switch readys!\n");
@ -137,11 +137,11 @@ std::pair<int, int> BuildSwReady(int nChannel, short nLink)
void AISWReady::Process(RunListEvent* ev) void AISWReady::Process(RunListEvent* ev)
{ {
short nSwitch = RunData[ev->nRun].nObjIndex; int nSwitch = RunData[ev->nRun].nObjIndex;
assert(nSwitch >= 0 && nSwitch < kMaxSwitches); assert(nSwitch >= 0 && nSwitch < kMaxSwitches);
short nChannel = SwitchData[nSwitch].nChannel; int nChannel = SwitchData[nSwitch].nChannel;
short nLink = SwitchData[nSwitch].nLink; int nLink = SwitchData[nSwitch].nLink;
assert(sRunChannels[nChannel].c < 8); assert(sRunChannels[nChannel].c < 8);
int8_t nVal = LinkMap[nLink].v[sRunChannels[nChannel].c]; int8_t nVal = LinkMap[nLink].v[sRunChannels[nChannel].c];
@ -175,7 +175,7 @@ std::pair<int, int> BuildSwPause(int nChannel, int nLink, int ebx)
void AISWPause::ProcessChannel(RunListEvent* ev) void AISWPause::ProcessChannel(RunListEvent* ev)
{ {
short nSwitch = RunData[ev->nRun].nObjIndex; int nSwitch = RunData[ev->nRun].nObjIndex;
if (SwitchData[nSwitch].nRunPtr >= 0) if (SwitchData[nSwitch].nRunPtr >= 0)
{ {
runlist_SubRunRec(SwitchData[nSwitch].nRunPtr); runlist_SubRunRec(SwitchData[nSwitch].nRunPtr);
@ -185,9 +185,9 @@ void AISWPause::ProcessChannel(RunListEvent* ev)
void AISWPause::Tick(RunListEvent* ev) void AISWPause::Tick(RunListEvent* ev)
{ {
short nSwitch = RunData[ev->nRun].nObjIndex; int nSwitch = RunData[ev->nRun].nObjIndex;
short nChannel = SwitchData[nSwitch].nChannel; int nChannel = SwitchData[nSwitch].nChannel;
short nLink = SwitchData[nSwitch].nLink; int nLink = SwitchData[nSwitch].nLink;
SwitchData[nSwitch].nWaitTimer--; SwitchData[nSwitch].nWaitTimer--;
if (SwitchData[nSwitch].nWaitTimer <= 0) if (SwitchData[nSwitch].nWaitTimer <= 0)
@ -204,9 +204,9 @@ void AISWPause::Tick(RunListEvent* ev)
void AISWPause::Process(RunListEvent* ev) void AISWPause::Process(RunListEvent* ev)
{ {
short nSwitch = RunData[ev->nRun].nObjIndex; int nSwitch = RunData[ev->nRun].nObjIndex;
short nChannel = SwitchData[nSwitch].nChannel; int nChannel = SwitchData[nSwitch].nChannel;
short nLink = SwitchData[nSwitch].nLink; int nLink = SwitchData[nSwitch].nLink;
assert(sRunChannels[nChannel].c < 8); assert(sRunChannels[nChannel].c < 8);
if (LinkMap[nLink].v[sRunChannels[nChannel].c] < 0) { if (LinkMap[nLink].v[sRunChannels[nChannel].c] < 0) {
@ -250,11 +250,11 @@ std::pair<int, int> BuildSwStepOn(int nChannel, int nLink, int nSector)
void AISWStepOn::ProcessChannel(RunListEvent* ev) void AISWStepOn::ProcessChannel(RunListEvent* ev)
{ {
short nSwitch = RunData[ev->nRun].nObjIndex; int nSwitch = RunData[ev->nRun].nObjIndex;
assert(nSwitch >= 0 && nSwitch < kMaxSwitches); assert(nSwitch >= 0 && nSwitch < kMaxSwitches);
short nLink = SwitchData[nSwitch].nLink; int nLink = SwitchData[nSwitch].nLink;
short nChannel = SwitchData[nSwitch].nChannel; int nChannel = SwitchData[nSwitch].nChannel;
int nSector =SwitchData[nSwitch].nSector; int nSector =SwitchData[nSwitch].nSector;
assert(sRunChannels[nChannel].c < 8); assert(sRunChannels[nChannel].c < 8);
@ -275,11 +275,11 @@ void AISWStepOn::ProcessChannel(RunListEvent* ev)
void AISWStepOn::TouchFloor(RunListEvent* ev) void AISWStepOn::TouchFloor(RunListEvent* ev)
{ {
short nSwitch = RunData[ev->nRun].nObjIndex; int nSwitch = RunData[ev->nRun].nObjIndex;
assert(nSwitch >= 0 && nSwitch < kMaxSwitches); assert(nSwitch >= 0 && nSwitch < kMaxSwitches);
short nLink = SwitchData[nSwitch].nLink; int nLink = SwitchData[nSwitch].nLink;
short nChannel = SwitchData[nSwitch].nChannel; int nChannel = SwitchData[nSwitch].nChannel;
int nSector =SwitchData[nSwitch].nSector; int nSector =SwitchData[nSwitch].nSector;
assert(sRunChannels[nChannel].c < 8); assert(sRunChannels[nChannel].c < 8);
@ -316,7 +316,7 @@ std::pair<int, int> BuildSwNotOnPause(int nChannel, int nLink, int nSector, int
void AISWNotOnPause::ProcessChannel(RunListEvent* ev) void AISWNotOnPause::ProcessChannel(RunListEvent* ev)
{ {
short nSwitch = RunData[ev->nRun].nObjIndex; int nSwitch = RunData[ev->nRun].nObjIndex;
assert(nSwitch >= 0 && nSwitch < kMaxSwitches); assert(nSwitch >= 0 && nSwitch < kMaxSwitches);
if (SwitchData[nSwitch].nRun2 >= 0) if (SwitchData[nSwitch].nRun2 >= 0)
@ -336,11 +336,11 @@ void AISWNotOnPause::ProcessChannel(RunListEvent* ev)
void AISWNotOnPause::Tick(RunListEvent* ev) void AISWNotOnPause::Tick(RunListEvent* ev)
{ {
short nSwitch = RunData[ev->nRun].nObjIndex; int nSwitch = RunData[ev->nRun].nObjIndex;
assert(nSwitch >= 0 && nSwitch < kMaxSwitches); assert(nSwitch >= 0 && nSwitch < kMaxSwitches);
short nChannel = SwitchData[nSwitch].nChannel; int nChannel = SwitchData[nSwitch].nChannel;
short nLink = SwitchData[nSwitch].nLink; int nLink = SwitchData[nSwitch].nLink;
SwitchData[nSwitch].nWaitTimer -= 4; SwitchData[nSwitch].nWaitTimer -= 4;
if (SwitchData[nSwitch].nWaitTimer <= 0) if (SwitchData[nSwitch].nWaitTimer <= 0)
@ -353,11 +353,11 @@ void AISWNotOnPause::Tick(RunListEvent* ev)
void AISWNotOnPause::Process(RunListEvent* ev) void AISWNotOnPause::Process(RunListEvent* ev)
{ {
short nSwitch = RunData[ev->nRun].nObjIndex; int nSwitch = RunData[ev->nRun].nObjIndex;
assert(nSwitch >= 0 && nSwitch < kMaxSwitches); assert(nSwitch >= 0 && nSwitch < kMaxSwitches);
short nChannel = SwitchData[nSwitch].nChannel; int nChannel = SwitchData[nSwitch].nChannel;
short nLink = SwitchData[nSwitch].nLink; int nLink = SwitchData[nSwitch].nLink;
assert(sRunChannels[nChannel].c < 8); assert(sRunChannels[nChannel].c < 8);
@ -377,7 +377,7 @@ void AISWNotOnPause::Process(RunListEvent* ev)
void AISWNotOnPause::TouchFloor(RunListEvent* ev) void AISWNotOnPause::TouchFloor(RunListEvent* ev)
{ {
short nSwitch = RunData[ev->nRun].nObjIndex; int nSwitch = RunData[ev->nRun].nObjIndex;
SwitchData[nSwitch].nWaitTimer = SwitchData[nSwitch].nWait; SwitchData[nSwitch].nWaitTimer = SwitchData[nSwitch].nWait;
return; return;
@ -401,11 +401,11 @@ std::pair<int, int> BuildSwPressSector(int nChannel, int nLink, int nSector, int
void AISWPressSector::ProcessChannel(RunListEvent* ev) void AISWPressSector::ProcessChannel(RunListEvent* ev)
{ {
short nSwitch = RunData[ev->nRun].nObjIndex; int nSwitch = RunData[ev->nRun].nObjIndex;
assert(nSwitch >= 0 && nSwitch < kMaxSwitches); assert(nSwitch >= 0 && nSwitch < kMaxSwitches);
short nChannel = SwitchData[nSwitch].nChannel; int nChannel = SwitchData[nSwitch].nChannel;
short nLink = SwitchData[nSwitch].nLink; int nLink = SwitchData[nSwitch].nLink;
if (SwitchData[nSwitch].nRun2 >= 0) if (SwitchData[nSwitch].nRun2 >= 0)
{ {
@ -426,11 +426,11 @@ void AISWPressSector::ProcessChannel(RunListEvent* ev)
void AISWPressSector::Use(RunListEvent* ev) void AISWPressSector::Use(RunListEvent* ev)
{ {
short nSwitch = RunData[ev->nRun].nObjIndex; int nSwitch = RunData[ev->nRun].nObjIndex;
assert(nSwitch >= 0 && nSwitch < kMaxSwitches); assert(nSwitch >= 0 && nSwitch < kMaxSwitches);
short nChannel = SwitchData[nSwitch].nChannel; int nChannel = SwitchData[nSwitch].nChannel;
short nLink = SwitchData[nSwitch].nLink; int nLink = SwitchData[nSwitch].nLink;
int nPlayer = ev->nParam; int nPlayer = ev->nParam;
if ((PlayerList[nPlayer].keys & SwitchData[nSwitch].nKeyMask) == SwitchData[nSwitch].nKeyMask) if ((PlayerList[nPlayer].keys & SwitchData[nSwitch].nKeyMask) == SwitchData[nSwitch].nKeyMask)
@ -450,7 +450,7 @@ void AISWPressSector::Use(RunListEvent* ev)
} }
std::pair<int, int> BuildSwPressWall(short nChannel, short nLink, int nWall) std::pair<int, int> BuildSwPressWall(int nChannel, int nLink, int nWall)
{ {
if (SwitchCount <= 0 || nLink < 0 || nWall < 0) { if (SwitchCount <= 0 || nLink < 0 || nWall < 0) {
I_Error("Too many switches!\n"); I_Error("Too many switches!\n");
@ -468,11 +468,11 @@ std::pair<int, int> BuildSwPressWall(short nChannel, short nLink, int nWall)
void AISWPressWall::Process(RunListEvent* ev) void AISWPressWall::Process(RunListEvent* ev)
{ {
short nSwitch = RunData[ev->nRun].nObjIndex; int nSwitch = RunData[ev->nRun].nObjIndex;
assert(nSwitch >= 0 && nSwitch < kMaxSwitches); assert(nSwitch >= 0 && nSwitch < kMaxSwitches);
short nChannel = SwitchData[nSwitch].nChannel; int nChannel = SwitchData[nSwitch].nChannel;
short nLink = SwitchData[nSwitch].nLink; int nLink = SwitchData[nSwitch].nLink;
if (SwitchData[nSwitch].nRun3 >= 0) if (SwitchData[nSwitch].nRun3 >= 0)
{ {
@ -489,11 +489,11 @@ void AISWPressWall::Process(RunListEvent* ev)
void AISWPressWall::Use(RunListEvent* ev) void AISWPressWall::Use(RunListEvent* ev)
{ {
short nSwitch = RunData[ev->nRun].nObjIndex; int nSwitch = RunData[ev->nRun].nObjIndex;
assert(nSwitch >= 0 && nSwitch < kMaxSwitches); assert(nSwitch >= 0 && nSwitch < kMaxSwitches);
short nChannel = SwitchData[nSwitch].nChannel; int nChannel = SwitchData[nSwitch].nChannel;
short nLink = SwitchData[nSwitch].nLink; int nLink = SwitchData[nSwitch].nLink;
int8_t cx = LinkMap[nLink].v[sRunChannels[nChannel].c]; int8_t cx = LinkMap[nLink].v[sRunChannels[nChannel].c];