- Exhumed: Clean up local functions variables to prevent redefinition conflicts.

This commit is contained in:
Mitchell Richters 2021-12-24 20:48:35 +11:00 committed by Christoph Oelckers
parent c26b5d2303
commit 95d270fbdd
12 changed files with 17 additions and 25 deletions

View file

@ -148,6 +148,7 @@ void menu_DoPlasma()
for (int y = 0; y < kPlasmaHeight - 2; y++) for (int y = 0; y < kPlasmaHeight - 2; y++)
{ {
uint8_t al = *r_edx; uint8_t al = *r_edx;
uint8_t cl;
if (al != 96) if (al != 96)
{ {
@ -165,8 +166,8 @@ void menu_DoPlasma()
} }
else else
{ {
uint8_t al = *(r_edx + 1); al = *(r_edx + 1);
uint8_t cl = *(r_edx - 1); cl = *(r_edx - 1);
if (al <= cl) { if (al <= cl) {
al = cl; al = cl;

View file

@ -60,7 +60,7 @@ void precache()
if (wal.twoSided()) if (wal.twoSided())
{ {
int j = wal.overpicnum; j = wal.overpicnum;
markTileForPrecache(j, wal.pal); markTileForPrecache(j, wal.pal);
if (picanm[j].sf & PICANM_ANIMTYPE_MASK) if (picanm[j].sf & PICANM_ANIMTYPE_MASK)
for (int k = 1; k <= picanm[j].num; k++) markTileForPrecache(j + k, wal.pal); for (int k = 1; k <= picanm[j].num; k++) markTileForPrecache(j + k, wal.pal);

View file

@ -342,8 +342,8 @@ void AddFlash(sectortype* pSector, int x, int y, int z, int val)
pSector->ceilingpal += 7; pSector->ceilingpal += 7;
int edx = pSector->ceilingshade + var_28; edx = pSector->ceilingshade + var_28;
int eax = edx; eax = edx;
if (edx < -127) { if (edx < -127) {
eax = -127; eax = -127;
@ -368,7 +368,7 @@ void AddFlash(sectortype* pSector, int x, int y, int z, int val)
pActor->spr.pal += 7; pActor->spr.pal += 7;
int eax = -255; eax = -255;
if (!var_18) if (!var_18)
{ {

View file

@ -94,9 +94,6 @@ bool GameInterface::DrawAutomapPlayer(int mx, int my, int x, int y, int z, int a
GetActorExtents(pPlayerActor, &nTop, &nBottom); GetActorExtents(pPlayerActor, &nTop, &nBottom);
int nScale = (pPlayerActor->spr.yrepeat + ((floorZ - nBottom) >> 8)) * z; int nScale = (pPlayerActor->spr.yrepeat + ((floorZ - nBottom) >> 8)) * z;
nScale = clamp(nScale, 8000, 65536 << 1); nScale = clamp(nScale, 8000, 65536 << 1);
// Players on automap
double x = xdim / 2. + x1 / double(1 << 12);
double y = ydim / 2. + y1 / double(1 << 12);
// This very likely needs fixing later // This very likely needs fixing later
DrawTexture(twod, tileGetTexture(nTile /*+ ((PlayClock >> 4) & 3)*/, true), xx, yy, DTA_ClipLeft, windowxy1.X, DTA_ClipTop, windowxy1.Y, DTA_ScaleX, z / 1536., DTA_ScaleY, z / 1536., DTA_CenterOffset, true, DrawTexture(twod, tileGetTexture(nTile /*+ ((PlayClock >> 4) & 3)*/, true), xx, yy, DTA_ClipLeft, windowxy1.X, DTA_ClipTop, windowxy1.Y, DTA_ScaleX, z / 1536., DTA_ScaleY, z / 1536., DTA_CenterOffset, true,
DTA_ClipRight, windowxy2.X + 1, DTA_ClipBottom, windowxy2.Y + 1, DTA_Alpha, (pPlayerActor->spr.cstat & CSTAT_SPRITE_TRANSLUCENT ? 0.5 : 1.), TAG_DONE); DTA_ClipRight, windowxy2.X + 1, DTA_ClipBottom, windowxy2.Y + 1, DTA_Alpha, (pPlayerActor->spr.cstat & CSTAT_SPRITE_TRANSLUCENT ? 0.5 : 1.), TAG_DONE);

View file

@ -928,7 +928,6 @@ void MoveSector(sectortype* pSector, int nAngle, int *nXVel, int *nYVel)
{ {
pos = { x_b, y_b, nZVal }; pos = { x_b, y_b, nZVal };
Collision scratch;
clipmove(pos, &pSectorB, nXVect, nYVect, pBlockInfo->field_8, 0, 0, CLIPMASK1, scratch); clipmove(pos, &pSectorB, nXVect, nYVect, pBlockInfo->field_8, 0, 0, CLIPMASK1, scratch);
int ebx = pos.X; int ebx = pos.X;
@ -994,7 +993,6 @@ void MoveSector(sectortype* pSector, int nAngle, int *nXVel, int *nYVel)
pos.Y = pActor->spr.pos.Y; pos.Y = pActor->spr.pos.Y;
pSectorB = pSector; pSectorB = pSector;
Collision scratch;
clipmove(pos, &pSectorB, -xvect, -yvect, 4 * pActor->spr.clipdist, 0, 0, CLIPMASK0, scratch); clipmove(pos, &pSectorB, -xvect, -yvect, 4 * pActor->spr.clipdist, 0, 0, CLIPMASK0, scratch);
if (pSectorB) { if (pSectorB) {
@ -1011,7 +1009,6 @@ void MoveSector(sectortype* pSector, int nAngle, int *nXVel, int *nYVel)
pos = pActor->spr.pos; pos = pActor->spr.pos;
pSectorB = pNextSector; pSectorB = pNextSector;
Collision scratch;
clipmove(pos, &pSectorB, clipmove(pos, &pSectorB,
-xvect - (bcos(nAngle) * (4 * pActor->spr.clipdist)), -xvect - (bcos(nAngle) * (4 * pActor->spr.clipdist)),
-yvect - (bsin(nAngle) * (4 * pActor->spr.clipdist)), -yvect - (bsin(nAngle) * (4 * pActor->spr.clipdist)),
@ -1058,7 +1055,6 @@ void MoveSector(sectortype* pSector, int nAngle, int *nXVel, int *nYVel)
if (pActor->spr.statnum >= 99 && nZVal == pActor->spr.pos.Z && !(pActor->spr.cstat & CSTAT_SPRITE_INVISIBLE)) if (pActor->spr.statnum >= 99 && nZVal == pActor->spr.pos.Z && !(pActor->spr.cstat & CSTAT_SPRITE_INVISIBLE))
{ {
pSectorB = pSector; pSectorB = pSector;
Collision scratch;
clipmove(pActor->spr.pos, &pSectorB, xvect, yvect, 4 * pActor->spr.clipdist, 5120, -5120, CLIPMASK0, scratch); clipmove(pActor->spr.pos, &pSectorB, xvect, yvect, 4 * pActor->spr.clipdist, 5120, -5120, CLIPMASK0, scratch);
} }
} }

View file

@ -169,7 +169,7 @@ public:
if (nPixels) if (nPixels)
{ {
int nRead = (int)fp.Read(pFrame, nPixels); nRead = (int)fp.Read(pFrame, nPixels);
pFrame += nRead; pFrame += nRead;
nSize -= nRead; nSize -= nRead;
} }

View file

@ -174,7 +174,7 @@ void AIMummy::Tick(RunListEvent* ev)
if (pTarget == nullptr) if (pTarget == nullptr)
{ {
auto pTarget = FindPlayer(pActor, 100); pTarget = FindPlayer(pActor, 100);
if (pTarget != nullptr) if (pTarget != nullptr)
{ {
D3PlayFX(StaticSound[kSound7], pActor); D3PlayFX(StaticSound[kSound7], pActor);

View file

@ -642,8 +642,8 @@ void MoveSectorSprites(sectortype* pSector, int z)
ExhumedSectIterator it(pSector); ExhumedSectIterator it(pSector);
while (auto pActor = it.Next()) while (auto pActor = it.Next())
{ {
int z = pActor->spr.pos.Z; int actz = pActor->spr.pos.Z;
if ((pActor->spr.statnum != 200 && z >= minz && z <= maxz) || pActor->spr.statnum >= 900) if ((pActor->spr.statnum != 200 && actz >= minz && actz <= maxz) || pActor->spr.statnum >= 900)
{ {
pActor->spr.pos.Z = newz; pActor->spr.pos.Z = newz;
} }

View file

@ -765,9 +765,7 @@ void AIPlayer::Tick(RunListEvent* ev)
sPlayerInput[nPlayer].nItem = -1; sPlayerInput[nPlayer].nItem = -1;
} }
int var_EC = PlayerList[nPlayer].nSeqSize; pPlayerActor->spr.picnum = seq_GetSeqPicnum(PlayerList[nPlayer].nSeq, PlayerSeq[nHeightTemplate[nAction]].a, PlayerList[nPlayer].nSeqSize);
pPlayerActor->spr.picnum = seq_GetSeqPicnum(PlayerList[nPlayer].nSeq, PlayerSeq[nHeightTemplate[nAction]].a, var_EC);
pDopple->spr.picnum = pPlayerActor->spr.picnum; pDopple->spr.picnum = pPlayerActor->spr.picnum;
if (PlayerList[nPlayer].nTorch > 0) if (PlayerList[nPlayer].nTorch > 0)

View file

@ -226,7 +226,7 @@ void AIRoach::Tick(RunListEvent* ev)
if (((pActor->nPhase & 0xF) == (totalmoves & 0xF)) && pTarget == nullptr) if (((pActor->nPhase & 0xF) == (totalmoves & 0xF)) && pTarget == nullptr)
{ {
auto pTarget = FindPlayer(pActor, 50); pTarget = FindPlayer(pActor, 50);
if (pTarget) if (pTarget)
{ {
pActor->nAction = 2; pActor->nAction = 2;
@ -244,7 +244,7 @@ void AIRoach::Tick(RunListEvent* ev)
// partly the same as case 0. // partly the same as case 0.
if (((pActor->nPhase & 0xF) == (totalmoves & 0xF)) && pTarget == nullptr) if (((pActor->nPhase & 0xF) == (totalmoves & 0xF)) && pTarget == nullptr)
{ {
auto pTarget = FindPlayer(pActor, 100); pTarget = FindPlayer(pActor, 100);
if (pTarget) if (pTarget)
{ {
pActor->nAction = 2; pActor->nAction = 2;

View file

@ -619,7 +619,7 @@ int seq_PlotSequence(int nSprite, int16_t edx, int16_t nFrame, int16_t ecx)
{ {
pTSprite->picnum = nShadowPic; pTSprite->picnum = nShadowPic;
int edx = ((tileWidth(nPict) << 5) / nShadowWidth) - ((nFloorZ - pTSprite->pos.Z) >> 10); edx = ((tileWidth(nPict) << 5) / nShadowWidth) - ((nFloorZ - pTSprite->pos.Z) >> 10);
if (edx < 1) { if (edx < 1) {
edx = 1; edx = 1;
} }

View file

@ -105,8 +105,8 @@ static void analyzesprites(tspritetype* tsprite, int& spritesortcnt, int x, int
if (pTSprite->sector() != nullptr) if (pTSprite->sector() != nullptr)
{ {
sectortype *pSector = pTSprite->sector(); sectortype *pTSector = pTSprite->sector();
int nSectShade = (pSector->ceilingstat & CSTAT_SECTOR_SKY) ? pSector->ceilingshade : pSector->floorshade; int nSectShade = (pTSector->ceilingstat & CSTAT_SECTOR_SKY) ? pTSector->ceilingshade : pTSector->floorshade;
int nShade = pTSprite->shade + nSectShade + 6; int nShade = pTSprite->shade + nSectShade + 6;
pTSprite->shade = clamp(nShade, -128, 127); pTSprite->shade = clamp(nShade, -128, 127);
} }