From e179b9332ded2bc6eb6e7e8d687fda5a41186c30 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 21 Nov 2021 21:09:27 +0100 Subject: [PATCH] - all shorts reviewed. Should be all clear now - the biggest limiter in Exhumed is the run list with ~25000 entries which may need more work if it is to be extended. --- source/games/exhumed/src/object.cpp | 216 +++++++++++++-------------- source/games/exhumed/src/player.cpp | 12 +- source/games/exhumed/src/player.h | 10 +- source/games/exhumed/src/rex.cpp | 8 +- source/games/exhumed/src/runlist.cpp | 28 ++-- source/games/exhumed/src/set.cpp | 12 +- source/games/exhumed/src/spider.cpp | 4 +- source/games/exhumed/src/status.cpp | 2 +- source/games/exhumed/src/switch.cpp | 12 +- source/games/exhumed/src/trigdat.cpp | 15 +- source/games/exhumed/src/view.cpp | 12 +- source/games/exhumed/src/view.h | 8 +- 12 files changed, 156 insertions(+), 183 deletions(-) diff --git a/source/games/exhumed/src/object.cpp b/source/games/exhumed/src/object.cpp index a1243e139..a7ca73b9f 100644 --- a/source/games/exhumed/src/object.cpp +++ b/source/games/exhumed/src/object.cpp @@ -60,7 +60,7 @@ struct Bob { int nSector; int z; - uint8_t field_2; + uint8_t nPhase; uint8_t field_3; uint16_t sBobID; }; @@ -116,10 +116,10 @@ struct slideData int16_t nRunRec; int16_t nRunC; - int field_0; - int field_4; - int field_8; - int field_C; + int nStartWall; + int nWall1; + int nWall2; + int nWall3; int x1; int y1; int x2; @@ -137,27 +137,20 @@ struct slideData struct Point { int nSector; - short field_2; - short field_4; - short field_6; - short field_8; - short field_A; - short field_C; - short nNext; + int16_t nNext; }; struct Trap { DExhumedActor* pActor; - short field_0; - short nType; - int field_6; - int field_8; // wallnum - short field_A; - short field_C; - short field_E; - short nTrapInterval; + int16_t nState; + int16_t nType; + int nWallNum2; + int nWallNum; + int16_t nPicnum2; + int16_t nPicnum; + int16_t nTrapInterval; }; @@ -212,7 +205,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, Bob& w, Bob* def) if (arc.BeginObject(keyname)) { arc("sector", w.nSector) - ("at2", w.field_2) + ("at2", w.nPhase) ("at3", w.field_3) ("z", w.z) ("id", w.sBobID) @@ -281,10 +274,10 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, slideData& w, slid { if (arc.BeginObject(keyname)) { - arc("at0", w.field_0) - ("at4", w.field_4) - ("at8", w.field_8) - ("atc", w.field_C) + arc("at0", w.nStartWall) + ("at4", w.nWall1) + ("at8", w.nWall2) + ("atc", w.nWall3) ("x1", w.x1) ("y1", w.y1) ("x2", w.x2) @@ -311,12 +304,6 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, Point& w, Point* d if (arc.BeginObject(keyname)) { arc("at0", w.nSector) - ("at2", w.field_2) - ("at4", w.field_4) - ("at6", w.field_6) - ("at8", w.field_8) - ("ata", w.field_A) - ("atc", w.field_C) ("ate", w.nNext) .EndObject(); } @@ -326,14 +313,13 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, Trap& w, Trap* def { if (arc.BeginObject(keyname)) { - arc("at0", w.field_0) + arc("at0", w.nState) ("sprite", w.pActor) ("type", w.nType) - ("at6", w.field_6) - ("at8", w.field_8) - ("ata", w.field_A) - ("atc", w.field_C) - ("ate", w.field_E) + ("at6", w.nWallNum2) + ("at8", w.nWallNum) + ("ata", w.nPicnum2) + ("atc", w.nPicnum) ("interval", w.nTrapInterval) .EndObject(); } @@ -660,7 +646,7 @@ void MoveSectorSprites(int nSector, int z) void StartElevSound(DExhumedActor* pActor, int nVal) { - short nSound; + int nSound; if (nVal & 2) { nSound = nElevSound; @@ -675,7 +661,7 @@ void StartElevSound(DExhumedActor* pActor, int nVal) void AIElev::ProcessChannel(RunListEvent* ev) { int nRun = ev->nRun; - short nElev = RunData[nRun].nObjIndex; + int nElev = RunData[nRun].nObjIndex; assert(nElev >= 0 && nElev < (int)Elevator.Size()); int nChannel = Elevator[nElev].nChannel; @@ -683,8 +669,8 @@ void AIElev::ProcessChannel(RunListEvent* ev) assert(nChannel >= 0 && nChannel < kMaxChannels); - // short ax = var_18 & 8; - short dx = sRunChannels[nChannel].c; + // int ax = var_18 & 8; + int dx = sRunChannels[nChannel].c; int edi = 999; // FIXME CHECKME - this isn't default set to anything in the ASM that I can see - if ax is 0 and var_24 is 0, this will never be set to a known value otherwise! @@ -756,11 +742,11 @@ void AIElev::ProcessChannel(RunListEvent* ev) void AIElev::Tick(RunListEvent* ev) { int nRun = ev->nRun; - short nElev = RunData[nRun].nObjIndex; + int nElev = RunData[nRun].nObjIndex; assert(nElev >= 0 && nElev < (int)Elevator.Size()); - short nChannel = Elevator[nElev].nChannel; - short var_18 = Elevator[nElev].nFlags; + int nChannel = Elevator[nElev].nChannel; + int var_18 = Elevator[nElev].nFlags; assert(nChannel >= 0 && nChannel < kMaxChannels); @@ -774,7 +760,7 @@ void AIElev::Tick(RunListEvent* ev) int nZOffset = Elevator[nElev].nCurZOffset; int nZVal = Elevator[nElev].zOffsets[nZOffset]; - short nSectorB = nSector; + int nSectorB = nSector; StartInterpolation(nSector, Interp_Sect_Floorz); int nVal = LongSeek((int*)§or[nSector].floorz, nZVal, Elevator[nElev].nParam1, Elevator[nElev].nParam2); @@ -991,7 +977,7 @@ int BuildSlide(int nChannel, int nStartWall, int nWall1, int ecx, int nWall2, in for (int nWall = startwall; nWall < endwall; nWall++) { - short ax = SlideData[nSlide].nStart; + int ax = SlideData[nSlide].nStart; if (ax >= 0) { @@ -1018,10 +1004,10 @@ int BuildSlide(int nChannel, int nStartWall, int nWall1, int ecx, int nWall2, in } } - SlideData[nSlide].field_0 = nStartWall; - SlideData[nSlide].field_4 = nWall1; - SlideData[nSlide].field_8 = nWall2; - SlideData[nSlide].field_C = nWall3; + SlideData[nSlide].nStartWall = nStartWall; + SlideData[nSlide].nWall1 = nWall1; + SlideData[nSlide].nWall2 = nWall2; + SlideData[nSlide].nWall3 = nWall3; SlideData[nSlide].x1 = wall[nStartWall].x; SlideData[nSlide].y1 = wall[nStartWall].y; @@ -1075,7 +1061,7 @@ void AISlide::ProcessChannel(RunListEvent* ev) int nSlide = RunData[nRun].nObjIndex; assert(nSlide >= 0 && nSlide < (int)SlideData.Size()); - short nChannel = SlideData[nSlide].nChannel; + int nChannel = SlideData[nSlide].nChannel; if (SlideData[nSlide].nRunRec >= 0) { @@ -1102,16 +1088,16 @@ void AISlide::Tick(RunListEvent* ev) int nSlide = RunData[nRun].nObjIndex; assert(nSlide >= 0 && nSlide < (int)SlideData.Size()); - short nChannel = SlideData[nSlide].nChannel; + int nChannel = SlideData[nSlide].nChannel; int ebp = 0; - short cx = sRunChannels[nChannel].c; + int cx = sRunChannels[nChannel].c; int clipmask = ebp + 1; // RENAME if (cx == 1) { - int nWall = SlideData[nSlide].field_4; + int nWall = SlideData[nSlide].nWall1; int x = wall[nWall].x; int y = wall[nWall].y; @@ -1123,7 +1109,7 @@ void AISlide::Tick(RunListEvent* ev) int var_2C = nSeekB; int var_24 = nSeekB; - dragpoint(SlideData[nSlide].field_4, x, y); + dragpoint(SlideData[nSlide].nWall1, x, y); movesprite(SlideData[nSlide].pActor, var_34 << 14, var_2C << 14, 0, 0, 0, CLIPMASK1); if (var_34 == 0) @@ -1134,14 +1120,14 @@ void AISlide::Tick(RunListEvent* ev) } } - nWall = SlideData[nSlide].field_0; + nWall = SlideData[nSlide].nStartWall; y = wall[nWall].y + var_24; x = wall[nWall].x + var_20; - dragpoint(SlideData[nSlide].field_0, x, y); + dragpoint(SlideData[nSlide].nStartWall, x, y); - nWall = SlideData[nSlide].field_C; + nWall = SlideData[nSlide].nWall3; x = wall[nWall].x; y = wall[nWall].y; @@ -1154,22 +1140,22 @@ void AISlide::Tick(RunListEvent* ev) int edi = nSeekD; var_24 = nSeekD; - dragpoint(SlideData[nSlide].field_C, x, y); + dragpoint(SlideData[nSlide].nWall3, x, y); if (var_30 == 0 && edi == 0) { ebp++; } - nWall = SlideData[nSlide].field_8; + nWall = SlideData[nSlide].nWall2; x = wall[nWall].x + var_20; y = wall[nWall].y + var_24; - dragpoint(SlideData[nSlide].field_8, x, y); + dragpoint(SlideData[nSlide].nWall2, x, y); } else if (cx == 0) // right branch { - int nWall = SlideData[nSlide].field_0; + int nWall = SlideData[nSlide].nStartWall; int x = wall[nWall].x; int y = wall[nWall].y; @@ -1181,20 +1167,20 @@ void AISlide::Tick(RunListEvent* ev) int ecx = nSeekB; int var_28 = nSeekB; - dragpoint(SlideData[nSlide].field_0, x, y); + dragpoint(SlideData[nSlide].nStartWall, x, y); if (edi == 0 && ecx == 0) { ebp = clipmask; } - nWall = SlideData[nSlide].field_4; + nWall = SlideData[nSlide].nWall1; y = wall[nWall].y + var_28; x = wall[nWall].x + var_1C; - dragpoint(SlideData[nSlide].field_4, x, y); + dragpoint(SlideData[nSlide].nWall1, x, y); - nWall = SlideData[nSlide].field_8; + nWall = SlideData[nSlide].nWall2; x = wall[nWall].x; y = wall[nWall].y; @@ -1207,18 +1193,18 @@ void AISlide::Tick(RunListEvent* ev) ecx = nSeekD; var_28 = nSeekD; - dragpoint(SlideData[nSlide].field_8, x, y); + dragpoint(SlideData[nSlide].nWall2, x, y); if (edi == 0 && ecx == 0) { ebp++; } - nWall = SlideData[nSlide].field_C; + nWall = SlideData[nSlide].nWall3; y = wall[nWall].y + var_28; x = wall[nWall].x + var_1C; - dragpoint(SlideData[nSlide].field_C, x, y); + dragpoint(SlideData[nSlide].nWall3, x, y); } // loc_21A51: @@ -1258,22 +1244,22 @@ int BuildTrap(DExhumedActor* pActor, int edx, int ebx, int ecx) sTrap[nTrap].pActor = pActor; sTrap[nTrap].nType = (var_14 == 0) + 14; - sTrap[nTrap].field_0 = -1; + sTrap[nTrap].nState = -1; sTrap[nTrap].nTrapInterval = 64 - (2 * var_10); if (sTrap[nTrap].nTrapInterval < 5) { sTrap[nTrap].nTrapInterval = 5; } - sTrap[nTrap].field_C = 0; - sTrap[nTrap].field_A = 0; + sTrap[nTrap].nPicnum = 0; + sTrap[nTrap].nPicnum2 = 0; if (var_18 == -1) { return nTrap; } - sTrap[nTrap].field_6 = -1; - sTrap[nTrap].field_8 = -1; + sTrap[nTrap].nWallNum2 = -1; + sTrap[nTrap].nWallNum = -1; int nSector =pSprite->sectnum; int nWall = sector[nSector].wallptr; @@ -1288,16 +1274,16 @@ int BuildTrap(DExhumedActor* pActor, int edx, int ebx, int ecx) if (var_18 == wall[nWall].hitag) { - if (sTrap[nTrap].field_6 != -1) + if (sTrap[nTrap].nWallNum2 != -1) { - sTrap[nTrap].field_8 = nWall; - sTrap[nTrap].field_C = wall[nWall].picnum; + sTrap[nTrap].nWallNum = nWall; + sTrap[nTrap].nPicnum = wall[nWall].picnum; break; } else { - sTrap[nTrap].field_6 = nWall; - sTrap[nTrap].field_A = wall[nWall].picnum; + sTrap[nTrap].nWallNum2 = nWall; + sTrap[nTrap].nPicnum2 = wall[nWall].picnum; } } @@ -1310,57 +1296,57 @@ int BuildTrap(DExhumedActor* pActor, int edx, int ebx, int ecx) void AITrap::ProcessChannel(RunListEvent* ev) { - short nChannel = ev->nParam & 0x3FFF; - short nTrap = RunData[ev->nRun].nObjIndex; + int nChannel = ev->nParam & 0x3FFF; + int nTrap = RunData[ev->nRun].nObjIndex; if (sRunChannels[nChannel].c > 0) { - sTrap[nTrap].field_0 = 12; + sTrap[nTrap].nState = 12; } else { - sTrap[nTrap].field_0 = -1; + sTrap[nTrap].nState = -1; } } void AITrap::Tick(RunListEvent* ev) { - short nTrap = RunData[ev->nRun].nObjIndex; + int nTrap = RunData[ev->nRun].nObjIndex; auto pActor = sTrap[nTrap].pActor; auto pSprite = &pActor->s(); - if (sTrap[nTrap].field_0 >= 0) + if (sTrap[nTrap].nState >= 0) { - sTrap[nTrap].field_0--; - if (sTrap[nTrap].field_0 > 10) { + sTrap[nTrap].nState--; + if (sTrap[nTrap].nState > 10) { return; } - short nType = sTrap[nTrap].nType; + int nType = sTrap[nTrap].nType; - if (sTrap[nTrap].field_0 == 0) + if (sTrap[nTrap].nState == 0) { - sTrap[nTrap].field_0 = sTrap[nTrap].nTrapInterval; + sTrap[nTrap].nState = sTrap[nTrap].nTrapInterval; if (nType == 14) { - int nWall = sTrap[nTrap].field_6; + int nWall = sTrap[nTrap].nWallNum2; if (nWall > -1) { - wall[nWall].picnum = sTrap[nTrap].field_A; + wall[nWall].picnum = sTrap[nTrap].nPicnum2; } - nWall = sTrap[nTrap].field_8; + nWall = sTrap[nTrap].nWallNum; if (nWall > -1) { - wall[nWall].picnum = sTrap[nTrap].field_C; + wall[nWall].picnum = sTrap[nTrap].nPicnum; } } } else { // loc_21D92: - if (sTrap[nTrap].field_0 != 5) { + if (sTrap[nTrap].nState != 5) { return; } @@ -1376,16 +1362,16 @@ void AITrap::Tick(RunListEvent* ev) { pBullet->s().clipdist = 50; - int nWall = sTrap[nTrap].field_6; + int nWall = sTrap[nTrap].nWallNum2; if (nWall > -1) { - wall[nWall].picnum = sTrap[nTrap].field_A + 1; + wall[nWall].picnum = sTrap[nTrap].nPicnum2 + 1; } - nWall = sTrap[nTrap].field_8; + nWall = sTrap[nTrap].nWallNum; if (nWall > -1) { - wall[nWall].picnum = sTrap[nTrap].field_C + 1; + wall[nWall].picnum = sTrap[nTrap].nPicnum + 1; } D3PlayFX(StaticSound[kSound36], pBullet); @@ -1524,7 +1510,7 @@ void AISpark::Tick(RunListEvent* ev) void DimLights() { - static short word_96786 = 0; + static int word_96786 = 0; word_96786 = word_96786 == 0; if (word_96786 == 0) @@ -1641,7 +1627,7 @@ DExhumedActor* BuildEnergyBlock(int nSector) auto spr = &pActor->s(); - short nextsector = wall[startwall].nextsector; + int nextsector = wall[startwall].nextsector; spr->x = xAvg; spr->y = yAvg; @@ -1713,7 +1699,7 @@ void ExplodeEnergyBlock(DExhumedActor* pActor) for (i = 0; i < nWalls; i++) { - short nextwall = wall[startwall + i].nextwall; + int nextwall = wall[startwall + i].nextwall; if (wall[nextwall].pal >= 4) { wall[nextwall].pal = 7; @@ -1894,7 +1880,7 @@ DExhumedActor* BuildObject(DExhumedActor* pActor, int nOjectType, int nHitag) pActor->nRun = runlist_AddRunRec(NewRun, pActor, 0x170000); - short nSeq = ObjectSeq[nOjectType]; + int nSeq = ObjectSeq[nOjectType]; if (nSeq > -1) { @@ -1951,7 +1937,7 @@ void AIObject::Tick(RunListEvent* ev) auto pActor = ev->pObjActor; if (!pActor) return; auto pSprite = &pActor->s(); - short nStat = pSprite->statnum; + int nStat = pSprite->statnum; int bx = pActor->nIndex; if (nStat == 97 || (!(pSprite->cstat & 0x101))) { @@ -2114,7 +2100,7 @@ void AIObject::RadialDamage(RunListEvent* ev) if (!pActor) return; auto pSprite = &pActor->s(); - short nStat = pSprite->statnum; + int nStat = pSprite->statnum; if (pActor->nHealth > 0 && pSprite->cstat & 0x101 && (nStat != kStatExplodeTarget @@ -2151,7 +2137,7 @@ void AIObject::RadialDamage(RunListEvent* ev) if (pSprite->statnum == kStatExplodeTarget) { pActor->nHealth = -1; - short ax = pActor->nIndex2; + int ax = pActor->nIndex2; if (ax < 0 || ObjectList[ax]->nHealth <= 0) { return; @@ -2191,7 +2177,7 @@ void DoDrips() auto pActor = sDrip[i].pActor; auto pSprite = &pActor->s(); - short nSeqOffset = SeqOffsets[kSeqDrips]; + int nSeqOffset = SeqOffsets[kSeqDrips]; if (!(pSprite->sector()->Flag & kSectLava)) { nSeqOffset++; @@ -2205,9 +2191,9 @@ void DoDrips() for (unsigned i = 0; i < sBob.Size(); i++) { - sBob[i].field_2 += 4; + sBob[i].nPhase += 4; - int edx = bsin(sBob[i].field_2 << 3, -4); + int edx = bsin(sBob[i].nPhase << 3, -4); int nSector =sBob[i].nSector; if (sBob[i].field_3) @@ -2263,7 +2249,7 @@ void SnapBobs(int nSectorA, int nSectorB) return; } - sBob[ecx].field_2 = sBob[ebx].field_2; + sBob[ecx].nPhase = sBob[ebx].nPhase; } void AddSectorBob(int nSector, int nHitag, int bx) @@ -2281,7 +2267,7 @@ void AddSectorBob(int nSector, int nHitag, int bx) } sBob[nBobs].z = z; - sBob[nBobs].field_2 = nHitag << 4; + sBob[nBobs].nPhase = nHitag << 4; sBob[nBobs].sBobID = nHitag; sBob[nBobs].nSector = nSector; @@ -2371,7 +2357,7 @@ void AddMovingSector(int nSector, int edx, int ebx, int ecx) CreatePushBlock(nSector); setsectinterpolate(nSector); - short nTrail = FindTrail(ebx); + int nTrail = FindTrail(ebx); auto nMoveSects = sMoveSect.Reserve(1); @@ -2410,7 +2396,7 @@ void DoMovingSects() } int nSector =sMoveSect[i].nSector; - short nBlock = sector[nSector].extra; + int nBlock = sector[nSector].extra; BlockInfo* pBlockInfo = &sBlockInfo[nBlock]; @@ -2421,7 +2407,7 @@ void DoMovingSects() runlist_ChangeChannel(sMoveSect[i].nChannel, 0); } - short ax; + int ax; if (sMoveSect[i].nFlags & 0x10) { @@ -2443,7 +2429,7 @@ void DoMovingSects() sMoveSect[i].nTrailPoint = ax; } - short nTrail = sMoveSect[i].nTrailPoint; + int nTrail = sMoveSect[i].nTrailPoint; // TrailPoint *pTrail = &sTrailPoint[nTrail]; // loc_23872: diff --git a/source/games/exhumed/src/player.cpp b/source/games/exhumed/src/player.cpp index e247080a8..e69a6c5e3 100644 --- a/source/games/exhumed/src/player.cpp +++ b/source/games/exhumed/src/player.cpp @@ -40,11 +40,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. BEGIN_PS_NS -extern short nStatusSeqOffset; +extern int nStatusSeqOffset; int lPlayerXVel = 0; int lPlayerYVel = 0; -short obobangle = 0, bobangle = 0; +int obobangle = 0, bobangle = 0; static actionSeq PlayerSeq[] = { {18, 0}, {0, 0}, {9, 0}, {27, 0}, {63, 0}, @@ -79,13 +79,13 @@ Player PlayerList[kMaxPlayers]; DExhumedActor* nNetStartSprite[kMaxPlayers] = { }; -short nStandHeight; +int nStandHeight; -short PlayerCount; -short nNetStartSprites; -short nCurStartSprite; +int PlayerCount; +int nNetStartSprites; +int nCurStartSprite; void RestoreSavePoint(int nPlayer, int *x, int *y, int *z, int *nSector, int16_t *nAngle) { diff --git a/source/games/exhumed/src/player.h b/source/games/exhumed/src/player.h index f7f9b2a5f..5f9867e2d 100644 --- a/source/games/exhumed/src/player.h +++ b/source/games/exhumed/src/player.h @@ -106,7 +106,7 @@ struct Player int16_t nPlayerPushSound; int16_t nTauntTimer; uint16_t nPlayerWeapons; // each set bit represents a weapon the player has - short nPlayerViewSect; + int nPlayerViewSect; PlayerSave sPlayerSave; int ototalvel; int totalvel; @@ -117,15 +117,15 @@ struct Player }; -extern short PlayerCount; +extern int PlayerCount; extern Player PlayerList[kMaxPlayers]; -extern short obobangle, bobangle; +extern int obobangle, bobangle; extern DExhumedActor* nNetStartSprite[kMaxPlayers]; -extern short nNetStartSprites; -extern short nCurStartSprite; +extern int nNetStartSprites; +extern int nCurStartSprite; int GetPlayerFromActor(DExhumedActor* actor); void SetPlayerMummified(int nPlayer, int bIsMummified); diff --git a/source/games/exhumed/src/rex.cpp b/source/games/exhumed/src/rex.cpp index 96714c646..859096507 100644 --- a/source/games/exhumed/src/rex.cpp +++ b/source/games/exhumed/src/rex.cpp @@ -100,7 +100,7 @@ void AIRex::RadialDamage(RunListEvent* ev) auto pActor = ev->pObjActor; if (!pActor) return; - short nAction = pActor->nAction; + int nAction = pActor->nAction; if (nAction == 5) { @@ -114,7 +114,7 @@ void AIRex::Damage(RunListEvent* ev) auto pActor = ev->pObjActor; if (!pActor) return; - short nAction = pActor->nAction; + int nAction = pActor->nAction; auto pSprite = &pActor->s(); if (ev->nDamage) @@ -155,7 +155,7 @@ void AIRex::Draw(RunListEvent* ev) auto pActor = ev->pObjActor; if (!pActor) return; - short nAction = pActor->nAction; + int nAction = pActor->nAction; seq_PlotSequence(ev->nParam, SeqOffsets[kSeqRex] + RexSeq[nAction].a, pActor->nFrame, RexSeq[nAction].b); return; @@ -166,7 +166,7 @@ void AIRex::Tick(RunListEvent* ev) auto pActor = ev->pObjActor; if (!pActor) return; - short nAction = pActor->nAction; + int nAction = pActor->nAction; auto pSprite = &pActor->s(); bool bVal = false; diff --git a/source/games/exhumed/src/runlist.cpp b/source/games/exhumed/src/runlist.cpp index 43752c8b2..6498a6fc5 100644 --- a/source/games/exhumed/src/runlist.cpp +++ b/source/games/exhumed/src/runlist.cpp @@ -33,14 +33,14 @@ enum DExhumedActor* pRadialActor; -short nStackCount = 0; -short word_966BE = 0; -short ChannelList = -1; -short ChannelLast = -1; +int nStackCount = 0; +int word_966BE = 0; +int ChannelList = -1; +int ChannelLast = -1; int nDamageRadius; int nRadialDamage; -short RunChain; +int RunChain; int NewRun; int sRunStack[kMaxRunStack]; @@ -359,7 +359,7 @@ void runlist_SendMessage(int nRun, int nObject, void(ExhumedAI::* func)(RunListE void runlist_ExplodeSignalRun() { - short nextPtr = RunChain; + int nextPtr = RunChain; if (nextPtr >= 0) { @@ -491,11 +491,11 @@ void runlist_ReadyChannel(int eax) void runlist_ProcessChannels() { #if 1 - short v0; - short v1; + int v0; + int v1; int v5; - short b; - short d; + int b; + int d; do { @@ -548,7 +548,7 @@ void runlist_ProcessChannels() while (1) { - short nChannel = ChannelList; + int nChannel = ChannelList; if (nChannel < 0) { ChannelList = esi; @@ -563,8 +563,8 @@ void runlist_ProcessChannels() } } - short b = sRunChannels[nChannel].b; - short d = sRunChannels[nChannel].d; + int b = sRunChannels[nChannel].b; + int d = sRunChannels[nChannel].d; if (d & 2) { @@ -1596,7 +1596,7 @@ void runlist_ProcessWallTag(int nWall, int nLotag, int nHitag) int nLastWall = 0; int n2ndLastWall = 0; - short nStart = nWall; + int nStart = nWall; while (1) { diff --git a/source/games/exhumed/src/set.cpp b/source/games/exhumed/src/set.cpp index 288b36c75..e05436a0b 100644 --- a/source/games/exhumed/src/set.cpp +++ b/source/games/exhumed/src/set.cpp @@ -177,7 +177,7 @@ void AISet::RadialDamage(RunListEvent* ev) { auto pActor = ev->pObjActor; if (!pActor) return; - short nAction = pActor->nAction; + int nAction = pActor->nAction; if (nAction == 5) { @@ -192,7 +192,7 @@ void AISet::Damage(RunListEvent* ev) auto pActor = ev->pObjActor; if (!pActor) return; - short nAction = pActor->nAction; + int nAction = pActor->nAction; auto pSprite = &pActor->s(); if (ev->nDamage && pActor->nHealth > 0) @@ -231,7 +231,7 @@ void AISet::Draw(RunListEvent* ev) { auto pActor = ev->pObjActor; if (!pActor) return; - short nAction = pActor->nAction; + int nAction = pActor->nAction; seq_PlotSequence(ev->nParam, SeqOffsets[kSeqSet] + SetSeq[nAction].a, pActor->nFrame, SetSeq[nAction].b); return; @@ -242,14 +242,14 @@ void AISet::Tick(RunListEvent* ev) auto pActor = ev->pObjActor; if (!pActor) return; - short nAction = pActor->nAction; + int nAction = pActor->nAction; auto pSprite = &pActor->s(); bool bVal = false; Gravity(pActor); - short nSeq = SeqOffsets[kSeqSet] + SetSeq[pActor->nAction].a; + int nSeq = SeqOffsets[kSeqSet] + SetSeq[pActor->nAction].a; pSprite->picnum = seq_GetSeqPicnum2(nSeq, pActor->nFrame); seq_MoveSequence(pActor, nSeq, pActor->nFrame); @@ -267,7 +267,7 @@ void AISet::Tick(RunListEvent* ev) bVal = true; } - short nFlag = FrameFlag[SeqBase[nSeq] + pActor->nFrame]; + int nFlag = FrameFlag[SeqBase[nSeq] + pActor->nFrame]; auto pTarget = pActor->pTarget; if (pTarget && nAction < 10) diff --git a/source/games/exhumed/src/spider.cpp b/source/games/exhumed/src/spider.cpp index 26e4b4921..97faacf2b 100644 --- a/source/games/exhumed/src/spider.cpp +++ b/source/games/exhumed/src/spider.cpp @@ -98,7 +98,7 @@ void AISpider::Tick(RunListEvent* ev) if (!spp) return; auto sp = &spp->s(); - short nAction = spp->nAction; + int nAction = spp->nAction; int nVel = 6; @@ -345,7 +345,7 @@ void AISpider::Draw(RunListEvent* ev) auto spp = ev->pObjActor; if (!spp) return; - short nAction = spp->nAction; + int nAction = spp->nAction; seq_PlotSequence(ev->nParam, SeqOffsets[kSeqSpider] + SpiderSeq[nAction].a, spp->nFrame, SpiderSeq[nAction].b); } diff --git a/source/games/exhumed/src/status.cpp b/source/games/exhumed/src/status.cpp index 44bfe6858..41f6f3490 100644 --- a/source/games/exhumed/src/status.cpp +++ b/source/games/exhumed/src/status.cpp @@ -43,7 +43,7 @@ BEGIN_PS_NS // All this must be moved into the status bar once it is made persistent! -short nStatusSeqOffset; +int nStatusSeqOffset; void InitStatus() { diff --git a/source/games/exhumed/src/switch.cpp b/source/games/exhumed/src/switch.cpp index fdf550278..1575ece90 100644 --- a/source/games/exhumed/src/switch.cpp +++ b/source/games/exhumed/src/switch.cpp @@ -28,7 +28,7 @@ BEGIN_PS_NS enum { kMaxSwitches = 1024 }; -short SwitchCount = -1; +int SwitchCount = -1; struct Link { @@ -37,15 +37,15 @@ struct Link struct Switch { - short nWaitTimer; - short nWait; + int16_t nWaitTimer; + int16_t nWait; int nChannel; int nLink; - short nRunPtr; + int16_t nRunPtr; int nSector; - short nRun2; + int16_t nRun2; int nWall; - short nRun3; + int16_t nRun3; uint16_t nKeyMask; }; diff --git a/source/games/exhumed/src/trigdat.cpp b/source/games/exhumed/src/trigdat.cpp index e6b0addfc..ff383f991 100644 --- a/source/games/exhumed/src/trigdat.cpp +++ b/source/games/exhumed/src/trigdat.cpp @@ -26,7 +26,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. BEGIN_PS_NS -short AngTable[] = {0,0,0,0,1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,6,6,7,7,7,7,7,7,7,8,8,8,8,8,8,9,9,9,9,9,9,10,10,10,10,10,10,10,11,11,11,11,11,11,12,12,12,12,12,12,13,13,13,13,13,13,14,14,14,14,14,14,14,15,15,15,15,15,15,16,16,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,19,19,19,19,19,19,20,20,20,20,20,20,20,21,21,21,21,21,21,22,22,22,22,22,22,23,23,23,23,23,23,24,24,24,24,24,24,24,25,25,25,25,25,25,26,26,26,26,26,26,27,27,27,27,27,27,27,28,28,28,28,28,28,29,29,29,29,29,29,30,30,30,30,30,30,30,31,31,31,31,31,31,32,32,32,32,32,32,33,33,33,33,33,33,33,34,34,34,34,34,34,35,35,35,35,35,35,35,36,36,36,36,36,36,37,37,37,37,37,37,38,38,38,38,38,38,38,39,39,39,39,39,39,40,40,40,40,40,40,41,41,41,41,41,41,41,42,42,42,42,42,42,43,43,43,43,43,43,43,44,44,44,44,44,44,45,45,45,45,45,45,46,46,46,46,46,46,46,47,47,47,47,47,47,48,48,48,48,48,48,48,49,49,49,49,49,49,50,50,50,50,50,50,51,51,51,51,51,51,51,52,52,52,52,52,52,53,53,53,53,53,53,53,54,54,54,54,54,54,55,55,55,55,55,55,55,56,56,56,56,56,56,57,57,57,57,57,57,57,58,58,58,58,58,58,59,59,59,59,59,59,59,60,60,60,60,60,60,61,61,61,61,61,61,61,62,62,62,62,62,62,63,63,63,63,63,63,63,64,64,64,64,64,64,65,65,65,65,65,65,65,66,66,66,66,66,66,67,67,67,67,67,67,67,68,68,68,68,68,68,69,69,69,69,69,69,69,70,70,70,70,70,70,70,71,71,71,71,71,71,72,72,72,72,72,72,72,73,73,73,73,73,73,74,74,74,74,74,74,74,75,75,75,75,75,75,75,76,76,76,76,76,76,77,77,77,77,77,77,77,78,78,78,78,78,78,78,79,79,79,79,79,79,80,80,80,80,80,80,80,81,81,81,81,81,81,81,82,82,82,82,82,82,83,83,83,83,83,83,83,84,84,84,84,84,84,84,85,85,85,85,85,85,86,86,86,86,86,86,86,87,87,87,87,87,87,87,88,88,88,88,88,88,88,89,89,89,89,89,89,90,90,90,90,90,90,90,91,91,91,91,91,91,91,92,92,92,92,92,92,92,93,93,93,93,93,93,93,94,94,94,94,94,94,94,95,95,95,95,95,95,96,96,96,96,96,96,96,97,97,97,97,97,97,97,98,98,98,98,98,98,98,99,99,99,99,99,99,99,100,100,100,100,100,100,100,101,101,101,101,101,101,101,102,102,102,102,102,102,102,103,103,103,103,103,103,103,104,104,104,104,104,104,104,105,105,105,105,105,105,105,106,106,106,106,106,106,106,107,107,107,107,107,107,107,108,108,108,108,108,108,108,109,109,109,109,109,109,109,110,110,110,110,110,110,110,111,111,111,111,111,111,111,112,112,112,112,112,112,112,113,113,113,113,113,113,113,114,114,114,114,114,114,114,115,115,115,115,115,115,115,116,116,116,116,116,116,116,117,117,117,117,117,117,117,117,118,118,118,118,118,118,118,119,119,119,119,119,119,119,120,120,120,120,120,120,120,121,121,121,121,121,121,121,122,122,122,122,122,122,122,122,123,123,123,123,123,123,123,124,124,124,124,124,124,124,125,125,125,125,125,125,125,125,126,126,126,126,126,126,126,127,127,127,127,127,127,127,128,128,128,128,128,128,128,128,129,129,129,129,129,129,129,130,130,130,130,130,130,130,131,131,131,131,131,131,131,131,132,132,132,132,132,132,132,133,133,133,133,133,133,133,133,134,134,134,134,134,134,134,135,135,135,135,135,135,135,135,136,136,136,136,136,136,136,137,137,137,137,137,137,137,137,138,138,138,138,138,138,138,139,139,139,139,139,139,139,139,140,140,140,140,140,140,140,141,141,141,141,141,141,141,141,142,142,142,142,142,142,142,142,143,143,143,143,143,143,143,144,144,144,144,144,144,144,144,145,145,145,145,145,145,145,145,146,146,146,146,146,146,146,146,147,147,147,147,147,147,147,148,148,148,148,148,148,148,148,149,149,149,149,149,149,149,149,150,150,150,150,150,150,150,150,151,151,151,151,151,151,151,151,152,152,152,152,152,152,152,153,153,153,153,153,153,153,153,154,154,154,154,154,154,154,154,155,155,155,155,155,155,155,155,156,156,156,156,156,156,156,156,157,157,157,157,157,157,157,157,158,158,158,158,158,158,158,158,159,159,159,159,159,159,159,159,160,160,160,160,160,160,160,160,161,161,161,161,161,161,161,161,162,162,162,162,162,162,162,162,162,163,163,163,163,163,163,163,163,164,164,164,164,164,164,164,164,165,165,165,165,165,165,165,165,166,166,166,166,166,166,166,166,167,167,167,167,167,167,167,167,167,168,168,168,168,168,168,168,168,169,169,169,169,169,169,169,169,170,170,170,170,170,170,170,170,170,171,171,171,171,171,171,171,171,172,172,172,172,172,172,172,172,173,173,173,173,173,173,173,173,173,174,174,174,174,174,174,174,174,175,175,175,175,175,175,175,175,175,176,176,176,176,176,176,176,176,177,177,177,177,177,177,177,177,177,178,178,178,178,178,178,178,178,178,179,179,179,179,179,179,179,179,180,180,180,180,180,180,180,180,180,181,181,181,181,181,181,181,181,181,182,182,182,182,182,182,182,182,183,183,183,183,183,183,183,183,183,184,184,184,184,184,184,184,184,184,185,185,185,185,185,185,185,185,185,186,186,186,186,186,186,186,186,186,187,187,187,187,187,187,187,187,188,188,188,188,188,188,188,188,188,189,189,189,189,189,189,189,189,189,190,190,190,190,190,190,190,190,190,191,191,191,191,191,191,191,191,191,192,192,192,192,192,192,192,192,192,192,193,193,193,193,193,193,193,193,193,194,194,194,194,194,194,194,194,194,195,195,195,195,195,195,195,195,195,196,196,196,196,196,196,196,196,196,197,197,197,197,197,197,197,197,197,197,198,198,198,198,198,198,198,198,198,199,199,199,199,199,199,199,199,199,200,200,200,200,200,200,200,200,200,200,201,201,201,201,201,201,201,201,201,202,202,202,202,202,202,202,202,202,202,203,203,203,203,203,203,203,203,203,204,204,204,204,204,204,204,204,204,204,205,205,205,205,205,205,205,205,205,206,206,206,206,206,206,206,206,206,206,207,207,207,207,207,207,207,207,207,207,208,208,208,208,208,208,208,208,208,209,209,209,209,209,209,209,209,209,209,210,210,210,210,210,210,210,210,210,210,211,211,211,211,211,211,211,211,211,211,212,212,212,212,212,212,212,212,212,212,213,213,213,213,213,213,213,213,213,213,214,214,214,214,214,214,214,214,214,214,215,215,215,215,215,215,215,215,215,215,216,216,216,216,216,216,216,216,216,216,217,217,217,217,217,217,217,217,217,217,218,218,218,218,218,218,218,218,218,218,219,219,219,219,219,219,219,219,219,219,219,220,220,220,220,220,220,220,220,220,220,221,221,221,221,221,221,221,221,221,221,222,222,222,222,222,222,222,222,222,222,222,223,223,223,223,223,223,223,223,223,223,224,224,224,224,224,224,224,224,224,224,224,225,225,225,225,225,225,225,225,225,225,226,226,226,226,226,226,226,226,226,226,226,227,227,227,227,227,227,227,227,227,227,228,228,228,228,228,228,228,228,228,228,228,229,229,229,229,229,229,229,229,229,229,229,230,230,230,230,230,230,230,230,230,230,230,231,231,231,231,231,231,231,231,231,231,231,232,232,232,232,232,232,232,232,232,232,232,233,233,233,233,233,233,233,233,233,233,233,234,234,234,234,234,234,234,234,234,234,234,235,235,235,235,235,235,235,235,235,235,235,236,236,236,236,236,236,236,236,236,236,236,237,237,237,237,237,237,237,237,237,237,237,238,238,238,238,238,238,238,238,238,238,238,238,239,239,239,239,239,239,239,239,239,239,239,240,240,240,240,240,240,240,240,240,240,240,240,241,241,241,241,241,241,241,241,241,241,241,242,242,242,242,242,242,242,242,242,242,242,242,243,243,243,243,243,243,243,243,243,243,243,244,244,244,244,244,244,244,244,244,244,244,244,245,245,245,245,245,245,245,245,245,245,245,245,246,246,246,246,246,246,246,246,246,246,246,246,247,247,247,247,247,247,247,247,247,247,247,248,248,248,248,248,248,248,248,248,248,248,248,249,249,249,249,249,249,249,249,249,249,249,249,249,250,250,250,250,250,250,250,250,250,250,250,250,251,251,251,251,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,255,255,255,255,255,255,255,255,255,255,255,255,256,256,256,256,256,256}; +static const uint16_t AngTable[] = {0,0,0,0,1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,6,6,7,7,7,7,7,7,7,8,8,8,8,8,8,9,9,9,9,9,9,10,10,10,10,10,10,10,11,11,11,11,11,11,12,12,12,12,12,12,13,13,13,13,13,13,14,14,14,14,14,14,14,15,15,15,15,15,15,16,16,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,19,19,19,19,19,19,20,20,20,20,20,20,20,21,21,21,21,21,21,22,22,22,22,22,22,23,23,23,23,23,23,24,24,24,24,24,24,24,25,25,25,25,25,25,26,26,26,26,26,26,27,27,27,27,27,27,27,28,28,28,28,28,28,29,29,29,29,29,29,30,30,30,30,30,30,30,31,31,31,31,31,31,32,32,32,32,32,32,33,33,33,33,33,33,33,34,34,34,34,34,34,35,35,35,35,35,35,35,36,36,36,36,36,36,37,37,37,37,37,37,38,38,38,38,38,38,38,39,39,39,39,39,39,40,40,40,40,40,40,41,41,41,41,41,41,41,42,42,42,42,42,42,43,43,43,43,43,43,43,44,44,44,44,44,44,45,45,45,45,45,45,46,46,46,46,46,46,46,47,47,47,47,47,47,48,48,48,48,48,48,48,49,49,49,49,49,49,50,50,50,50,50,50,51,51,51,51,51,51,51,52,52,52,52,52,52,53,53,53,53,53,53,53,54,54,54,54,54,54,55,55,55,55,55,55,55,56,56,56,56,56,56,57,57,57,57,57,57,57,58,58,58,58,58,58,59,59,59,59,59,59,59,60,60,60,60,60,60,61,61,61,61,61,61,61,62,62,62,62,62,62,63,63,63,63,63,63,63,64,64,64,64,64,64,65,65,65,65,65,65,65,66,66,66,66,66,66,67,67,67,67,67,67,67,68,68,68,68,68,68,69,69,69,69,69,69,69,70,70,70,70,70,70,70,71,71,71,71,71,71,72,72,72,72,72,72,72,73,73,73,73,73,73,74,74,74,74,74,74,74,75,75,75,75,75,75,75,76,76,76,76,76,76,77,77,77,77,77,77,77,78,78,78,78,78,78,78,79,79,79,79,79,79,80,80,80,80,80,80,80,81,81,81,81,81,81,81,82,82,82,82,82,82,83,83,83,83,83,83,83,84,84,84,84,84,84,84,85,85,85,85,85,85,86,86,86,86,86,86,86,87,87,87,87,87,87,87,88,88,88,88,88,88,88,89,89,89,89,89,89,90,90,90,90,90,90,90,91,91,91,91,91,91,91,92,92,92,92,92,92,92,93,93,93,93,93,93,93,94,94,94,94,94,94,94,95,95,95,95,95,95,96,96,96,96,96,96,96,97,97,97,97,97,97,97,98,98,98,98,98,98,98,99,99,99,99,99,99,99,100,100,100,100,100,100,100,101,101,101,101,101,101,101,102,102,102,102,102,102,102,103,103,103,103,103,103,103,104,104,104,104,104,104,104,105,105,105,105,105,105,105,106,106,106,106,106,106,106,107,107,107,107,107,107,107,108,108,108,108,108,108,108,109,109,109,109,109,109,109,110,110,110,110,110,110,110,111,111,111,111,111,111,111,112,112,112,112,112,112,112,113,113,113,113,113,113,113,114,114,114,114,114,114,114,115,115,115,115,115,115,115,116,116,116,116,116,116,116,117,117,117,117,117,117,117,117,118,118,118,118,118,118,118,119,119,119,119,119,119,119,120,120,120,120,120,120,120,121,121,121,121,121,121,121,122,122,122,122,122,122,122,122,123,123,123,123,123,123,123,124,124,124,124,124,124,124,125,125,125,125,125,125,125,125,126,126,126,126,126,126,126,127,127,127,127,127,127,127,128,128,128,128,128,128,128,128,129,129,129,129,129,129,129,130,130,130,130,130,130,130,131,131,131,131,131,131,131,131,132,132,132,132,132,132,132,133,133,133,133,133,133,133,133,134,134,134,134,134,134,134,135,135,135,135,135,135,135,135,136,136,136,136,136,136,136,137,137,137,137,137,137,137,137,138,138,138,138,138,138,138,139,139,139,139,139,139,139,139,140,140,140,140,140,140,140,141,141,141,141,141,141,141,141,142,142,142,142,142,142,142,142,143,143,143,143,143,143,143,144,144,144,144,144,144,144,144,145,145,145,145,145,145,145,145,146,146,146,146,146,146,146,146,147,147,147,147,147,147,147,148,148,148,148,148,148,148,148,149,149,149,149,149,149,149,149,150,150,150,150,150,150,150,150,151,151,151,151,151,151,151,151,152,152,152,152,152,152,152,153,153,153,153,153,153,153,153,154,154,154,154,154,154,154,154,155,155,155,155,155,155,155,155,156,156,156,156,156,156,156,156,157,157,157,157,157,157,157,157,158,158,158,158,158,158,158,158,159,159,159,159,159,159,159,159,160,160,160,160,160,160,160,160,161,161,161,161,161,161,161,161,162,162,162,162,162,162,162,162,162,163,163,163,163,163,163,163,163,164,164,164,164,164,164,164,164,165,165,165,165,165,165,165,165,166,166,166,166,166,166,166,166,167,167,167,167,167,167,167,167,167,168,168,168,168,168,168,168,168,169,169,169,169,169,169,169,169,170,170,170,170,170,170,170,170,170,171,171,171,171,171,171,171,171,172,172,172,172,172,172,172,172,173,173,173,173,173,173,173,173,173,174,174,174,174,174,174,174,174,175,175,175,175,175,175,175,175,175,176,176,176,176,176,176,176,176,177,177,177,177,177,177,177,177,177,178,178,178,178,178,178,178,178,178,179,179,179,179,179,179,179,179,180,180,180,180,180,180,180,180,180,181,181,181,181,181,181,181,181,181,182,182,182,182,182,182,182,182,183,183,183,183,183,183,183,183,183,184,184,184,184,184,184,184,184,184,185,185,185,185,185,185,185,185,185,186,186,186,186,186,186,186,186,186,187,187,187,187,187,187,187,187,188,188,188,188,188,188,188,188,188,189,189,189,189,189,189,189,189,189,190,190,190,190,190,190,190,190,190,191,191,191,191,191,191,191,191,191,192,192,192,192,192,192,192,192,192,192,193,193,193,193,193,193,193,193,193,194,194,194,194,194,194,194,194,194,195,195,195,195,195,195,195,195,195,196,196,196,196,196,196,196,196,196,197,197,197,197,197,197,197,197,197,197,198,198,198,198,198,198,198,198,198,199,199,199,199,199,199,199,199,199,200,200,200,200,200,200,200,200,200,200,201,201,201,201,201,201,201,201,201,202,202,202,202,202,202,202,202,202,202,203,203,203,203,203,203,203,203,203,204,204,204,204,204,204,204,204,204,204,205,205,205,205,205,205,205,205,205,206,206,206,206,206,206,206,206,206,206,207,207,207,207,207,207,207,207,207,207,208,208,208,208,208,208,208,208,208,209,209,209,209,209,209,209,209,209,209,210,210,210,210,210,210,210,210,210,210,211,211,211,211,211,211,211,211,211,211,212,212,212,212,212,212,212,212,212,212,213,213,213,213,213,213,213,213,213,213,214,214,214,214,214,214,214,214,214,214,215,215,215,215,215,215,215,215,215,215,216,216,216,216,216,216,216,216,216,216,217,217,217,217,217,217,217,217,217,217,218,218,218,218,218,218,218,218,218,218,219,219,219,219,219,219,219,219,219,219,219,220,220,220,220,220,220,220,220,220,220,221,221,221,221,221,221,221,221,221,221,222,222,222,222,222,222,222,222,222,222,222,223,223,223,223,223,223,223,223,223,223,224,224,224,224,224,224,224,224,224,224,224,225,225,225,225,225,225,225,225,225,225,226,226,226,226,226,226,226,226,226,226,226,227,227,227,227,227,227,227,227,227,227,228,228,228,228,228,228,228,228,228,228,228,229,229,229,229,229,229,229,229,229,229,229,230,230,230,230,230,230,230,230,230,230,230,231,231,231,231,231,231,231,231,231,231,231,232,232,232,232,232,232,232,232,232,232,232,233,233,233,233,233,233,233,233,233,233,233,234,234,234,234,234,234,234,234,234,234,234,235,235,235,235,235,235,235,235,235,235,235,236,236,236,236,236,236,236,236,236,236,236,237,237,237,237,237,237,237,237,237,237,237,238,238,238,238,238,238,238,238,238,238,238,238,239,239,239,239,239,239,239,239,239,239,239,240,240,240,240,240,240,240,240,240,240,240,240,241,241,241,241,241,241,241,241,241,241,241,242,242,242,242,242,242,242,242,242,242,242,242,243,243,243,243,243,243,243,243,243,243,243,244,244,244,244,244,244,244,244,244,244,244,244,245,245,245,245,245,245,245,245,245,245,245,245,246,246,246,246,246,246,246,246,246,246,246,246,247,247,247,247,247,247,247,247,247,247,247,248,248,248,248,248,248,248,248,248,248,248,248,249,249,249,249,249,249,249,249,249,249,249,249,249,250,250,250,250,250,250,250,250,250,250,250,250,251,251,251,251,251,251,251,251,251,251,251,251,252,252,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,253,253,253,253,253,254,254,254,254,254,254,254,254,254,254,254,254,254,255,255,255,255,255,255,255,255,255,255,255,255,256,256,256,256,256,256}; int GetMyAngle(int x, int y) @@ -130,19 +130,6 @@ int AngleDiff(int a, int b) return diff; } -// unused -int AnglePick(short a, short b) -{ - int nRet = b; - - if (AngleDiff(a, b) > 512) - { - nRet ^= 0x400; - } - - return nRet; -} - int AngleDelta(int a, int b, int c) { int diff = b - a; diff --git a/source/games/exhumed/src/view.cpp b/source/games/exhumed/src/view.cpp index 42ac66fb1..e02d2f7cf 100644 --- a/source/games/exhumed/src/view.cpp +++ b/source/games/exhumed/src/view.cpp @@ -40,28 +40,28 @@ bool bSubTitles = true; int zbob; -short dVertPan[kMaxPlayers]; +int16_t dVertPan[kMaxPlayers]; int nCamerax; int nCameray; int nCameraz; -short bTouchFloor; +bool bTouchFloor; -short nQuake[kMaxPlayers] = { 0 }; +int16_t nQuake[kMaxPlayers] = { 0 }; -short nChunkTotal = 0; +int nChunkTotal = 0; binangle nCameraa; fixedhoriz nCamerapan; -short nViewTop; +int nViewTop; bool bCamera = false; int viewz; DExhumedActor* pEnemy; -short nEnemyPal = 0; +int nEnemyPal = 0; // We cannot drag these through the entire event system... :( spritetype* mytsprite; diff --git a/source/games/exhumed/src/view.h b/source/games/exhumed/src/view.h index 92396ebed..da537671b 100644 --- a/source/games/exhumed/src/view.h +++ b/source/games/exhumed/src/view.h @@ -31,13 +31,13 @@ void ResetView(); void NoClip(); void Clip(); -extern short dVertPan[]; -extern short nQuake[]; +extern int16_t dVertPan[]; +extern int16_t nQuake[]; extern int nCamerax; extern int nCameray; extern int nCameraz; -extern short bTouchFloor; -extern short nChunkTotal; +extern bool bTouchFloor; +extern int nChunkTotal; extern int gFov; extern spritetype* mytsprite;