- Exhumed: more ints for shorts

This commit is contained in:
Christoph Oelckers 2021-11-09 17:32:50 +01:00
parent c46c8a68cd
commit baa3e531d4
9 changed files with 39 additions and 39 deletions

View file

@ -236,7 +236,7 @@ void BuildNear(int x, int y, int walldist, int nSector);
int PlotCourseToSprite(DExhumedActor* nSprite1, DExhumedActor* nSprite2); int PlotCourseToSprite(DExhumedActor* nSprite1, DExhumedActor* nSprite2);
void CheckSectorFloor(int nSector, int z, int *x, int *y); void CheckSectorFloor(int nSector, int z, int *x, int *y);
int GetAngleToSprite(DExhumedActor* nSprite1, DExhumedActor* nSprite2); int GetAngleToSprite(DExhumedActor* nSprite1, DExhumedActor* nSprite2);
int GetWallNormal(short nWall); int GetWallNormal(int nWall);
int GetUpAngle(DExhumedActor* nSprite1, int nVal, DExhumedActor* nSprite2, int ecx); int GetUpAngle(DExhumedActor* nSprite1, int nVal, DExhumedActor* nSprite2, int ecx);
void MoveSector(int nSector, int nAngle, int *nXVel, int *nYVel); void MoveSector(int nSector, int nAngle, int *nXVel, int *nYVel);
Collision AngleChase(DExhumedActor* nSprite, DExhumedActor* nSprite2, int ebx, int ecx, int push1); Collision AngleChase(DExhumedActor* nSprite, DExhumedActor* nSprite2, int ebx, int ecx, int push1);
@ -295,7 +295,7 @@ void BuildDrip(DExhumedActor* nSprite);
DExhumedActor* BuildEnergyBlock(int nSector); DExhumedActor* BuildEnergyBlock(int nSector);
int BuildElevC(int arg1, int nChannel, int nSector, DExhumedActor* nWallSprite, int arg5, int arg6, int nCount, ...); 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 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); int BuildSlide(int nChannel, int edx, int ebx, int ecx, int arg1, int arg2, int arg3);
// queen // queen
@ -768,7 +768,7 @@ std::pair<int, int> BuildSwPressSector(int nChannel, int nLink, int nSector, int
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, short nLink);
std::pair<int, int> BuildSwPressWall(short nChannel, short nLink, short nWall); std::pair<int, int> BuildSwPressWall(short nChannel, short nLink, int nWall);
// wasp // wasp

View file

@ -96,7 +96,7 @@ extern short SectSpeed[];
extern int SectBelow[]; extern int SectBelow[];
extern short SectFlag[]; extern short SectFlag[];
extern int SectDepth[]; extern int SectDepth[];
extern short SectSoundSect[]; extern int SectSoundSect[];
extern int SectAbove[]; extern int SectAbove[];
void LoadObjects(); void LoadObjects();

View file

@ -52,7 +52,7 @@ int movefifopos;
short nCurBodyGunNum; short nCurBodyGunNum;
short SectSoundSect[kMaxSectors] = { 0 }; int SectSoundSect[kMaxSectors] = { 0 };
short SectSound[kMaxSectors] = { 0 }; short SectSound[kMaxSectors] = { 0 };
short SectFlag[kMaxSectors] = { 0 }; short SectFlag[kMaxSectors] = { 0 };
int SectDepth[kMaxSectors] = { 0 }; int SectDepth[kMaxSectors] = { 0 };

View file

@ -62,8 +62,8 @@ struct Flicker
struct Flow struct Flow
{ {
short objindex; int objindex;
short type; int type;
int xdelta; int xdelta;
int ydelta; int ydelta;
int angcos; int angcos;
@ -404,12 +404,12 @@ void UndoFlashes()
int edi = -1; 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); assert(nFlash < 2000 && nFlash >= 0);
uint8_t type = sFlash[nFlash].nType & 0x3F; uint8_t type = sFlash[nFlash].nType & 0x3F;
short nIndex = sFlash[nFlash].nIndex; int nIndex = sFlash[nFlash].nIndex;
if (sFlash[nFlash].nType & 0x80) if (sFlash[nFlash].nType & 0x80)
{ {
@ -748,7 +748,7 @@ void DoFlows()
case 2: case 2:
{ {
short nWall = sFlowInfo[i].objindex; int nWall = sFlowInfo[i].objindex;
wall[nWall].setxpan(sFlowInfo[i].xdelta / 16384.f); wall[nWall].setxpan(sFlowInfo[i].xdelta / 16384.f);
wall[nWall].setypan(sFlowInfo[i].ydelta / 16384.f); wall[nWall].setypan(sFlowInfo[i].ydelta / 16384.f);
@ -768,7 +768,7 @@ void DoFlows()
case 3: case 3:
{ {
short nWall = sFlowInfo[i].objindex; int nWall = sFlowInfo[i].objindex;
wall[nWall].setxpan(sFlowInfo[i].xdelta / 16384.f); wall[nWall].setxpan(sFlowInfo[i].xdelta / 16384.f);
wall[nWall].setypan(sFlowInfo[i].ydelta / 16384.f); wall[nWall].setypan(sFlowInfo[i].ydelta / 16384.f);

View file

@ -239,8 +239,8 @@ void BuildNear(int x, int y, int walldist, int nSector)
{ {
int nSector =NearSector[i]; int nSector =NearSector[i];
short nWall = sector[nSector].wallptr; int nWall = sector[nSector].wallptr;
short nWallCount = sector[nSector].wallnum; int nWallCount = sector[nSector].wallnum;
while (1) 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); 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; nWall &= kMaxWalls-1;

View file

@ -105,7 +105,7 @@ struct MoveSect
struct wallFace struct wallFace
{ {
short nChannel; short nChannel;
short nWall; int nWall;
short field_4; short field_4;
short field_6[8]; short field_6[8];
}; };
@ -908,7 +908,7 @@ void InitWallFace()
WallFace.Clear(); WallFace.Clear();
} }
int BuildWallFace(short nChannel, short nWall, int nCount, ...) int BuildWallFace(short nChannel, int nWall, int nCount, ...)
{ {
auto WallFaceCount = WallFace.Reserve(1); 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].nNext = -1;
PointList[nPoint].nSector = nSector; PointList[nPoint].nSector = nSector;
short startwall = sector[nSector].wallptr; int startwall = sector[nSector].wallptr;
short endwall = startwall + sector[nSector].wallnum; int endwall = startwall + sector[nSector].wallnum;
for (int nWall = startwall; nWall < endwall; nWall++) for (int nWall = startwall; nWall < endwall; nWall++)
{ {
@ -1131,7 +1131,7 @@ void AISlide::Tick(RunListEvent* ev)
if (cx == 1) if (cx == 1)
{ {
short nWall = SlideData[nSlide].field_4; int nWall = SlideData[nSlide].field_4;
int x = wall[nWall].x; int x = wall[nWall].x;
int y = wall[nWall].y; int y = wall[nWall].y;
@ -1189,7 +1189,7 @@ void AISlide::Tick(RunListEvent* ev)
} }
else if (cx == 0) // right branch else if (cx == 0) // right branch
{ {
short nWall = SlideData[nSlide].field_0; int nWall = SlideData[nSlide].field_0;
int x = wall[nWall].x; int x = wall[nWall].x;
int y = wall[nWall].y; int y = wall[nWall].y;
@ -1296,7 +1296,7 @@ int BuildTrap(DExhumedActor* pActor, int edx, int ebx, int ecx)
sTrap[nTrap].field_8 = -1; sTrap[nTrap].field_8 = -1;
int nSector =pSprite->sectnum; int nSector =pSprite->sectnum;
short nWall = sector[nSector].wallptr; int nWall = sector[nSector].wallptr;
int i = 0; int i = 0;
@ -1364,7 +1364,7 @@ void AITrap::Tick(RunListEvent* ev)
if (nType == 14) if (nType == 14)
{ {
short nWall = sTrap[nTrap].field_6; int nWall = sTrap[nTrap].field_6;
if (nWall > -1) if (nWall > -1)
{ {
wall[nWall].picnum = sTrap[nTrap].field_A; wall[nWall].picnum = sTrap[nTrap].field_A;
@ -1396,7 +1396,7 @@ void AITrap::Tick(RunListEvent* ev)
{ {
pBullet->s().clipdist = 50; pBullet->s().clipdist = 50;
short nWall = sTrap[nTrap].field_6; int nWall = sTrap[nTrap].field_6;
if (nWall > -1) if (nWall > -1)
{ {
wall[nWall].picnum = sTrap[nTrap].field_A + 1; wall[nWall].picnum = sTrap[nTrap].field_A + 1;
@ -1558,8 +1558,8 @@ void DimLights()
if (sector[i].floorshade < 100) if (sector[i].floorshade < 100)
sector[i].floorshade++; sector[i].floorshade++;
short startwall = sector[i].wallptr; int startwall = sector[i].wallptr;
short endwall = startwall + sector[i].wallnum; int endwall = startwall + sector[i].wallnum;
for (int nWall = startwall; nWall < endwall; nWall++) for (int nWall = startwall; nWall < endwall; nWall++)
{ {
@ -1638,8 +1638,8 @@ void DoFinale()
DExhumedActor* BuildEnergyBlock(int nSector) DExhumedActor* BuildEnergyBlock(int nSector)
{ {
short startwall = sector[nSector].wallptr; int startwall = sector[nSector].wallptr;
short nWalls = sector[nSector].wallnum; int nWalls = sector[nSector].wallnum;
int x = 0; int x = 0;
int y = 0; int y = 0;
@ -1726,8 +1726,8 @@ void ExplodeEnergyBlock(DExhumedActor* pActor)
int nSector =pSprite->sectnum; int nSector =pSprite->sectnum;
short startwall = sector[nSector].wallptr; int startwall = sector[nSector].wallptr;
short nWalls = sector[nSector].wallnum; int nWalls = sector[nSector].wallnum;
int i; int i;
@ -1805,8 +1805,8 @@ void ExplodeEnergyBlock(DExhumedActor* pActor)
sector[i].floorpal = 0; sector[i].floorpal = 0;
} }
short startwall = sector[i].wallptr; int startwall = sector[i].wallptr;
short endwall = startwall + sector[i].wallnum; int endwall = startwall + sector[i].wallnum;
for (int nWall = startwall; nWall < endwall; nWall++) for (int nWall = startwall; nWall < endwall; nWall++)
{ {

View file

@ -161,8 +161,8 @@ void InitSpiritHead()
void DimSector(int nSector) void DimSector(int nSector)
{ {
short startwall = sector[nSector].wallptr; int startwall = sector[nSector].wallptr;
short nWalls = sector[nSector].wallnum; int nWalls = sector[nSector].wallnum;
for (int i = 0; i < nWalls; i++) for (int i = 0; i < nWalls; i++)
{ {

View file

@ -678,7 +678,7 @@ void CheckAmbience(int nSector)
if (!SoundEnabled()) return; if (!SoundEnabled()) return;
if (SectSound[nSector] != -1) if (SectSound[nSector] != -1)
{ {
short nSector2 = SectSoundSect[nSector]; int nSector2 = SectSoundSect[nSector];
walltype* pWall = &wall[sector[nSector2].wallptr]; walltype* pWall = &wall[sector[nSector2].wallptr];
if (!soundEngine->IsSourcePlayingSomething(SOURCE_Ambient, &amb, 0)) if (!soundEngine->IsSourcePlayingSomething(SOURCE_Ambient, &amb, 0))
{ {

View file

@ -44,7 +44,7 @@ struct Switch
short nRunPtr; short nRunPtr;
int nSector; int nSector;
short nRun2; short nRun2;
short nWall; int nWall;
short nRun3; short nRun3;
uint16_t nKeyMask; uint16_t nKeyMask;
}; };
@ -288,7 +288,7 @@ void AISWStepOn::TouchFloor(RunListEvent* ev)
if (var_14 != sRunChannels[nChannel].c) 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); PlayFXAtXYZ(StaticSound[nSwitchSound], wall[nWall].x, wall[nWall].y, sector[nSector].floorz, nSector);
assert(sRunChannels[nChannel].c < 8); assert(sRunChannels[nChannel].c < 8);
@ -450,7 +450,7 @@ void AISWPressSector::Use(RunListEvent* ev)
} }
std::pair<int, int> BuildSwPressWall(short nChannel, short nLink, short nWall) std::pair<int, int> BuildSwPressWall(short nChannel, short 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");
@ -482,7 +482,7 @@ void AISWPressWall::Process(RunListEvent* ev)
if (LinkMap[nLink].v[sRunChannels[nChannel].c] >= 0) 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]); 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; SwitchData[nSwitch].nRun3 = -1;
} }
short nWall = SwitchData[nSwitch].nWall; int nWall = SwitchData[nSwitch].nWall;
int nSector =SwitchData[nSwitch].nSector; // CHECKME - where is this set?? int nSector =SwitchData[nSwitch].nSector; // CHECKME - where is this set??
PlayFXAtXYZ(StaticSound[nSwitchSound], wall[nWall].x, wall[nWall].y, 0, nSector, CHANF_LISTENERZ); PlayFXAtXYZ(StaticSound[nSwitchSound], wall[nWall].x, wall[nWall].y, 0, nSector, CHANF_LISTENERZ);