From baa3e531d4b40ad6d476c2f043481bc9d24b9b98 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 9 Nov 2021 17:32:50 +0100 Subject: [PATCH] - Exhumed: more ints for shorts --- source/games/exhumed/src/aistuff.h | 6 ++--- source/games/exhumed/src/engine.h | 2 +- source/games/exhumed/src/init.cpp | 2 +- source/games/exhumed/src/lighting.cpp | 12 +++++----- source/games/exhumed/src/move.cpp | 6 ++--- source/games/exhumed/src/object.cpp | 34 +++++++++++++-------------- source/games/exhumed/src/ramses.cpp | 4 ++-- source/games/exhumed/src/sound.cpp | 2 +- source/games/exhumed/src/switch.cpp | 10 ++++---- 9 files changed, 39 insertions(+), 39 deletions(-) diff --git a/source/games/exhumed/src/aistuff.h b/source/games/exhumed/src/aistuff.h index 788ba68ad..9bf25a247 100644 --- a/source/games/exhumed/src/aistuff.h +++ b/source/games/exhumed/src/aistuff.h @@ -236,7 +236,7 @@ void BuildNear(int x, int y, int walldist, int nSector); int PlotCourseToSprite(DExhumedActor* nSprite1, DExhumedActor* nSprite2); void CheckSectorFloor(int nSector, int z, int *x, int *y); int GetAngleToSprite(DExhumedActor* nSprite1, DExhumedActor* nSprite2); -int GetWallNormal(short nWall); +int GetWallNormal(int nWall); int GetUpAngle(DExhumedActor* nSprite1, int nVal, DExhumedActor* nSprite2, int ecx); void MoveSector(int nSector, int nAngle, int *nXVel, int *nYVel); Collision AngleChase(DExhumedActor* nSprite, DExhumedActor* nSprite2, int ebx, int ecx, int push1); @@ -295,7 +295,7 @@ void BuildDrip(DExhumedActor* nSprite); DExhumedActor* BuildEnergyBlock(int nSector); int BuildElevC(int arg1, int nChannel, int nSector, DExhumedActor* nWallSprite, int arg5, int arg6, int nCount, ...); int BuildElevF(int nChannel, int nSector, DExhumedActor* nWallSprite, int arg_4, int arg_5, int nCount, ...); -int BuildWallFace(short nChannel, short nWall, int nCount, ...); +int BuildWallFace(short nChannel, int nWall, int nCount, ...); int BuildSlide(int nChannel, int edx, int ebx, int ecx, int arg1, int arg2, int arg3); // queen @@ -768,7 +768,7 @@ std::pair BuildSwPressSector(int nChannel, int nLink, int nSector, int std::pair BuildSwStepOn(int nChannel, int nLink, int nSector); std::pair BuildSwReady(int nChannel, short nLink); -std::pair BuildSwPressWall(short nChannel, short nLink, short nWall); +std::pair BuildSwPressWall(short nChannel, short nLink, int nWall); // wasp diff --git a/source/games/exhumed/src/engine.h b/source/games/exhumed/src/engine.h index 3cdb4119c..4b865cfa3 100644 --- a/source/games/exhumed/src/engine.h +++ b/source/games/exhumed/src/engine.h @@ -96,7 +96,7 @@ extern short SectSpeed[]; extern int SectBelow[]; extern short SectFlag[]; extern int SectDepth[]; -extern short SectSoundSect[]; +extern int SectSoundSect[]; extern int SectAbove[]; void LoadObjects(); diff --git a/source/games/exhumed/src/init.cpp b/source/games/exhumed/src/init.cpp index 276a29f65..ba9d9bdb1 100644 --- a/source/games/exhumed/src/init.cpp +++ b/source/games/exhumed/src/init.cpp @@ -52,7 +52,7 @@ int movefifopos; short nCurBodyGunNum; -short SectSoundSect[kMaxSectors] = { 0 }; +int SectSoundSect[kMaxSectors] = { 0 }; short SectSound[kMaxSectors] = { 0 }; short SectFlag[kMaxSectors] = { 0 }; int SectDepth[kMaxSectors] = { 0 }; diff --git a/source/games/exhumed/src/lighting.cpp b/source/games/exhumed/src/lighting.cpp index 95de9f625..af9cf2ea7 100644 --- a/source/games/exhumed/src/lighting.cpp +++ b/source/games/exhumed/src/lighting.cpp @@ -62,8 +62,8 @@ struct Flicker struct Flow { - short objindex; - short type; + int objindex; + int type; int xdelta; int ydelta; int angcos; @@ -404,12 +404,12 @@ void UndoFlashes() int edi = -1; - for (short nFlash = nFirstFlash; nFlash >= 0; nFlash = sFlash[nFlash].next) + for (int nFlash = nFirstFlash; nFlash >= 0; nFlash = sFlash[nFlash].next) { assert(nFlash < 2000 && nFlash >= 0); uint8_t type = sFlash[nFlash].nType & 0x3F; - short nIndex = sFlash[nFlash].nIndex; + int nIndex = sFlash[nFlash].nIndex; if (sFlash[nFlash].nType & 0x80) { @@ -748,7 +748,7 @@ void DoFlows() case 2: { - short nWall = sFlowInfo[i].objindex; + int nWall = sFlowInfo[i].objindex; wall[nWall].setxpan(sFlowInfo[i].xdelta / 16384.f); wall[nWall].setypan(sFlowInfo[i].ydelta / 16384.f); @@ -768,7 +768,7 @@ void DoFlows() case 3: { - short nWall = sFlowInfo[i].objindex; + int nWall = sFlowInfo[i].objindex; wall[nWall].setxpan(sFlowInfo[i].xdelta / 16384.f); wall[nWall].setypan(sFlowInfo[i].ydelta / 16384.f); diff --git a/source/games/exhumed/src/move.cpp b/source/games/exhumed/src/move.cpp index 48befbf03..f6870b02d 100644 --- a/source/games/exhumed/src/move.cpp +++ b/source/games/exhumed/src/move.cpp @@ -239,8 +239,8 @@ void BuildNear(int x, int y, int walldist, int nSector) { int nSector =NearSector[i]; - short nWall = sector[nSector].wallptr; - short nWallCount = sector[nSector].wallnum; + int nWall = sector[nSector].wallptr; + int nWallCount = sector[nSector].wallnum; while (1) { @@ -1298,7 +1298,7 @@ Collision AngleChase(DExhumedActor* pActor, DExhumedActor* pActor2, int ebx, int return movesprite(pActor, x >> 2, y >> 2, (z >> 13) + bsin(ecx, -5), 0, 0, nClipType); } -int GetWallNormal(short nWall) +int GetWallNormal(int nWall) { nWall &= kMaxWalls-1; diff --git a/source/games/exhumed/src/object.cpp b/source/games/exhumed/src/object.cpp index 43cf95dab..0a1653f2e 100644 --- a/source/games/exhumed/src/object.cpp +++ b/source/games/exhumed/src/object.cpp @@ -105,7 +105,7 @@ struct MoveSect struct wallFace { short nChannel; - short nWall; + int nWall; short field_4; short field_6[8]; }; @@ -908,7 +908,7 @@ void InitWallFace() WallFace.Clear(); } -int BuildWallFace(short nChannel, short nWall, int nCount, ...) +int BuildWallFace(short nChannel, int nWall, int nCount, ...) { auto WallFaceCount = WallFace.Reserve(1); @@ -1006,8 +1006,8 @@ int BuildSlide(int nChannel, int nStartWall, int nWall1, int ecx, int nWall2, in PointList[nPoint].nNext = -1; PointList[nPoint].nSector = nSector; - short startwall = sector[nSector].wallptr; - short endwall = startwall + sector[nSector].wallnum; + int startwall = sector[nSector].wallptr; + int endwall = startwall + sector[nSector].wallnum; for (int nWall = startwall; nWall < endwall; nWall++) { @@ -1131,7 +1131,7 @@ void AISlide::Tick(RunListEvent* ev) if (cx == 1) { - short nWall = SlideData[nSlide].field_4; + int nWall = SlideData[nSlide].field_4; int x = wall[nWall].x; int y = wall[nWall].y; @@ -1189,7 +1189,7 @@ void AISlide::Tick(RunListEvent* ev) } else if (cx == 0) // right branch { - short nWall = SlideData[nSlide].field_0; + int nWall = SlideData[nSlide].field_0; int x = wall[nWall].x; int y = wall[nWall].y; @@ -1296,7 +1296,7 @@ int BuildTrap(DExhumedActor* pActor, int edx, int ebx, int ecx) sTrap[nTrap].field_8 = -1; int nSector =pSprite->sectnum; - short nWall = sector[nSector].wallptr; + int nWall = sector[nSector].wallptr; int i = 0; @@ -1364,7 +1364,7 @@ void AITrap::Tick(RunListEvent* ev) if (nType == 14) { - short nWall = sTrap[nTrap].field_6; + int nWall = sTrap[nTrap].field_6; if (nWall > -1) { wall[nWall].picnum = sTrap[nTrap].field_A; @@ -1396,7 +1396,7 @@ void AITrap::Tick(RunListEvent* ev) { pBullet->s().clipdist = 50; - short nWall = sTrap[nTrap].field_6; + int nWall = sTrap[nTrap].field_6; if (nWall > -1) { wall[nWall].picnum = sTrap[nTrap].field_A + 1; @@ -1558,8 +1558,8 @@ void DimLights() if (sector[i].floorshade < 100) sector[i].floorshade++; - short startwall = sector[i].wallptr; - short endwall = startwall + sector[i].wallnum; + int startwall = sector[i].wallptr; + int endwall = startwall + sector[i].wallnum; for (int nWall = startwall; nWall < endwall; nWall++) { @@ -1638,8 +1638,8 @@ void DoFinale() DExhumedActor* BuildEnergyBlock(int nSector) { - short startwall = sector[nSector].wallptr; - short nWalls = sector[nSector].wallnum; + int startwall = sector[nSector].wallptr; + int nWalls = sector[nSector].wallnum; int x = 0; int y = 0; @@ -1726,8 +1726,8 @@ void ExplodeEnergyBlock(DExhumedActor* pActor) int nSector =pSprite->sectnum; - short startwall = sector[nSector].wallptr; - short nWalls = sector[nSector].wallnum; + int startwall = sector[nSector].wallptr; + int nWalls = sector[nSector].wallnum; int i; @@ -1805,8 +1805,8 @@ void ExplodeEnergyBlock(DExhumedActor* pActor) sector[i].floorpal = 0; } - short startwall = sector[i].wallptr; - short endwall = startwall + sector[i].wallnum; + int startwall = sector[i].wallptr; + int endwall = startwall + sector[i].wallnum; for (int nWall = startwall; nWall < endwall; nWall++) { diff --git a/source/games/exhumed/src/ramses.cpp b/source/games/exhumed/src/ramses.cpp index 15ccab033..0db4c11ec 100644 --- a/source/games/exhumed/src/ramses.cpp +++ b/source/games/exhumed/src/ramses.cpp @@ -161,8 +161,8 @@ void InitSpiritHead() void DimSector(int nSector) { - short startwall = sector[nSector].wallptr; - short nWalls = sector[nSector].wallnum; + int startwall = sector[nSector].wallptr; + int nWalls = sector[nSector].wallnum; for (int i = 0; i < nWalls; i++) { diff --git a/source/games/exhumed/src/sound.cpp b/source/games/exhumed/src/sound.cpp index 7bd9b81a7..e8b951c9e 100644 --- a/source/games/exhumed/src/sound.cpp +++ b/source/games/exhumed/src/sound.cpp @@ -678,7 +678,7 @@ void CheckAmbience(int nSector) if (!SoundEnabled()) return; if (SectSound[nSector] != -1) { - short nSector2 = SectSoundSect[nSector]; + int nSector2 = SectSoundSect[nSector]; walltype* pWall = &wall[sector[nSector2].wallptr]; if (!soundEngine->IsSourcePlayingSomething(SOURCE_Ambient, &amb, 0)) { diff --git a/source/games/exhumed/src/switch.cpp b/source/games/exhumed/src/switch.cpp index 3bc2ff6b3..f76e6830b 100644 --- a/source/games/exhumed/src/switch.cpp +++ b/source/games/exhumed/src/switch.cpp @@ -44,7 +44,7 @@ struct Switch short nRunPtr; int nSector; short nRun2; - short nWall; + int nWall; short nRun3; uint16_t nKeyMask; }; @@ -288,7 +288,7 @@ void AISWStepOn::TouchFloor(RunListEvent* ev) if (var_14 != sRunChannels[nChannel].c) { - short nWall = sector[nSector].wallptr; + int nWall = sector[nSector].wallptr; PlayFXAtXYZ(StaticSound[nSwitchSound], wall[nWall].x, wall[nWall].y, sector[nSector].floorz, nSector); assert(sRunChannels[nChannel].c < 8); @@ -450,7 +450,7 @@ void AISWPressSector::Use(RunListEvent* ev) } -std::pair BuildSwPressWall(short nChannel, short nLink, short nWall) +std::pair BuildSwPressWall(short nChannel, short nLink, int nWall) { if (SwitchCount <= 0 || nLink < 0 || nWall < 0) { I_Error("Too many switches!\n"); @@ -482,7 +482,7 @@ void AISWPressWall::Process(RunListEvent* ev) if (LinkMap[nLink].v[sRunChannels[nChannel].c] >= 0) { - short nWall = SwitchData[nSwitch].nWall; + int nWall = SwitchData[nSwitch].nWall; SwitchData[nSwitch].nRun3 = runlist_AddRunRec(wall[nWall].lotag - 1, &RunData[ev->nRun]); } } @@ -505,7 +505,7 @@ void AISWPressWall::Use(RunListEvent* ev) SwitchData[nSwitch].nRun3 = -1; } - short nWall = SwitchData[nSwitch].nWall; + int nWall = SwitchData[nSwitch].nWall; int nSector =SwitchData[nSwitch].nSector; // CHECKME - where is this set?? PlayFXAtXYZ(StaticSound[nSwitchSound], wall[nWall].x, wall[nWall].y, 0, nSector, CHANF_LISTENERZ);