diff --git a/source/games/exhumed/src/2d.cpp b/source/games/exhumed/src/2d.cpp index 534b40774..effaadd11 100644 --- a/source/games/exhumed/src/2d.cpp +++ b/source/games/exhumed/src/2d.cpp @@ -148,6 +148,7 @@ void menu_DoPlasma() for (int y = 0; y < kPlasmaHeight - 2; y++) { uint8_t al = *r_edx; + uint8_t cl; if (al != 96) { @@ -165,8 +166,8 @@ void menu_DoPlasma() } else { - uint8_t al = *(r_edx + 1); - uint8_t cl = *(r_edx - 1); + al = *(r_edx + 1); + cl = *(r_edx - 1); if (al <= cl) { al = cl; diff --git a/source/games/exhumed/src/enginesubs.cpp b/source/games/exhumed/src/enginesubs.cpp index 565940515..06c1f59d4 100644 --- a/source/games/exhumed/src/enginesubs.cpp +++ b/source/games/exhumed/src/enginesubs.cpp @@ -60,7 +60,7 @@ void precache() if (wal.twoSided()) { - int j = wal.overpicnum; + j = wal.overpicnum; markTileForPrecache(j, wal.pal); if (picanm[j].sf & PICANM_ANIMTYPE_MASK) for (int k = 1; k <= picanm[j].num; k++) markTileForPrecache(j + k, wal.pal); diff --git a/source/games/exhumed/src/lighting.cpp b/source/games/exhumed/src/lighting.cpp index 9bc25fd72..b9022fbe5 100644 --- a/source/games/exhumed/src/lighting.cpp +++ b/source/games/exhumed/src/lighting.cpp @@ -342,8 +342,8 @@ void AddFlash(sectortype* pSector, int x, int y, int z, int val) pSector->ceilingpal += 7; - int edx = pSector->ceilingshade + var_28; - int eax = edx; + edx = pSector->ceilingshade + var_28; + eax = edx; if (edx < -127) { eax = -127; @@ -368,7 +368,7 @@ void AddFlash(sectortype* pSector, int x, int y, int z, int val) pActor->spr.pal += 7; - int eax = -255; + eax = -255; if (!var_18) { diff --git a/source/games/exhumed/src/map.cpp b/source/games/exhumed/src/map.cpp index 35cdd401e..dcdb13c52 100644 --- a/source/games/exhumed/src/map.cpp +++ b/source/games/exhumed/src/map.cpp @@ -94,9 +94,6 @@ bool GameInterface::DrawAutomapPlayer(int mx, int my, int x, int y, int z, int a GetActorExtents(pPlayerActor, &nTop, &nBottom); int nScale = (pPlayerActor->spr.yrepeat + ((floorZ - nBottom) >> 8)) * z; 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 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); diff --git a/source/games/exhumed/src/move.cpp b/source/games/exhumed/src/move.cpp index 059974898..960445702 100644 --- a/source/games/exhumed/src/move.cpp +++ b/source/games/exhumed/src/move.cpp @@ -928,7 +928,6 @@ void MoveSector(sectortype* pSector, int nAngle, int *nXVel, int *nYVel) { pos = { x_b, y_b, nZVal }; - Collision scratch; clipmove(pos, &pSectorB, nXVect, nYVect, pBlockInfo->field_8, 0, 0, CLIPMASK1, scratch); int ebx = pos.X; @@ -994,7 +993,6 @@ void MoveSector(sectortype* pSector, int nAngle, int *nXVel, int *nYVel) pos.Y = pActor->spr.pos.Y; pSectorB = pSector; - Collision scratch; clipmove(pos, &pSectorB, -xvect, -yvect, 4 * pActor->spr.clipdist, 0, 0, CLIPMASK0, scratch); if (pSectorB) { @@ -1011,7 +1009,6 @@ void MoveSector(sectortype* pSector, int nAngle, int *nXVel, int *nYVel) pos = pActor->spr.pos; pSectorB = pNextSector; - Collision scratch; clipmove(pos, &pSectorB, -xvect - (bcos(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)) { pSectorB = pSector; - Collision scratch; clipmove(pActor->spr.pos, &pSectorB, xvect, yvect, 4 * pActor->spr.clipdist, 5120, -5120, CLIPMASK0, scratch); } } diff --git a/source/games/exhumed/src/movie.cpp b/source/games/exhumed/src/movie.cpp index 78871efde..861f2055e 100644 --- a/source/games/exhumed/src/movie.cpp +++ b/source/games/exhumed/src/movie.cpp @@ -169,7 +169,7 @@ public: if (nPixels) { - int nRead = (int)fp.Read(pFrame, nPixels); + nRead = (int)fp.Read(pFrame, nPixels); pFrame += nRead; nSize -= nRead; } diff --git a/source/games/exhumed/src/mummy.cpp b/source/games/exhumed/src/mummy.cpp index 4c2e6a4ad..9d61df9d8 100644 --- a/source/games/exhumed/src/mummy.cpp +++ b/source/games/exhumed/src/mummy.cpp @@ -174,7 +174,7 @@ void AIMummy::Tick(RunListEvent* ev) if (pTarget == nullptr) { - auto pTarget = FindPlayer(pActor, 100); + pTarget = FindPlayer(pActor, 100); if (pTarget != nullptr) { D3PlayFX(StaticSound[kSound7], pActor); diff --git a/source/games/exhumed/src/object.cpp b/source/games/exhumed/src/object.cpp index 107d9a36d..d06260a6c 100644 --- a/source/games/exhumed/src/object.cpp +++ b/source/games/exhumed/src/object.cpp @@ -642,8 +642,8 @@ void MoveSectorSprites(sectortype* pSector, int z) ExhumedSectIterator it(pSector); while (auto pActor = it.Next()) { - int z = pActor->spr.pos.Z; - if ((pActor->spr.statnum != 200 && z >= minz && z <= maxz) || pActor->spr.statnum >= 900) + int actz = pActor->spr.pos.Z; + if ((pActor->spr.statnum != 200 && actz >= minz && actz <= maxz) || pActor->spr.statnum >= 900) { pActor->spr.pos.Z = newz; } diff --git a/source/games/exhumed/src/player.cpp b/source/games/exhumed/src/player.cpp index 4db075315..85003f592 100644 --- a/source/games/exhumed/src/player.cpp +++ b/source/games/exhumed/src/player.cpp @@ -765,9 +765,7 @@ void AIPlayer::Tick(RunListEvent* ev) sPlayerInput[nPlayer].nItem = -1; } - int var_EC = PlayerList[nPlayer].nSeqSize; - - pPlayerActor->spr.picnum = seq_GetSeqPicnum(PlayerList[nPlayer].nSeq, PlayerSeq[nHeightTemplate[nAction]].a, var_EC); + pPlayerActor->spr.picnum = seq_GetSeqPicnum(PlayerList[nPlayer].nSeq, PlayerSeq[nHeightTemplate[nAction]].a, PlayerList[nPlayer].nSeqSize); pDopple->spr.picnum = pPlayerActor->spr.picnum; if (PlayerList[nPlayer].nTorch > 0) diff --git a/source/games/exhumed/src/roach.cpp b/source/games/exhumed/src/roach.cpp index 864dbed7c..b3235a324 100644 --- a/source/games/exhumed/src/roach.cpp +++ b/source/games/exhumed/src/roach.cpp @@ -226,7 +226,7 @@ void AIRoach::Tick(RunListEvent* ev) if (((pActor->nPhase & 0xF) == (totalmoves & 0xF)) && pTarget == nullptr) { - auto pTarget = FindPlayer(pActor, 50); + pTarget = FindPlayer(pActor, 50); if (pTarget) { pActor->nAction = 2; @@ -244,7 +244,7 @@ void AIRoach::Tick(RunListEvent* ev) // partly the same as case 0. if (((pActor->nPhase & 0xF) == (totalmoves & 0xF)) && pTarget == nullptr) { - auto pTarget = FindPlayer(pActor, 100); + pTarget = FindPlayer(pActor, 100); if (pTarget) { pActor->nAction = 2; diff --git a/source/games/exhumed/src/sequence.cpp b/source/games/exhumed/src/sequence.cpp index fbb956ac6..70b0d62bc 100644 --- a/source/games/exhumed/src/sequence.cpp +++ b/source/games/exhumed/src/sequence.cpp @@ -619,7 +619,7 @@ int seq_PlotSequence(int nSprite, int16_t edx, int16_t nFrame, int16_t ecx) { 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) { edx = 1; } diff --git a/source/games/exhumed/src/view.cpp b/source/games/exhumed/src/view.cpp index 0fc837d6d..a1c9cc856 100644 --- a/source/games/exhumed/src/view.cpp +++ b/source/games/exhumed/src/view.cpp @@ -105,8 +105,8 @@ static void analyzesprites(tspritetype* tsprite, int& spritesortcnt, int x, int if (pTSprite->sector() != nullptr) { - sectortype *pSector = pTSprite->sector(); - int nSectShade = (pSector->ceilingstat & CSTAT_SECTOR_SKY) ? pSector->ceilingshade : pSector->floorshade; + sectortype *pTSector = pTSprite->sector(); + int nSectShade = (pTSector->ceilingstat & CSTAT_SECTOR_SKY) ? pTSector->ceilingshade : pTSector->floorshade; int nShade = pTSprite->shade + nSectShade + 6; pTSprite->shade = clamp(nShade, -128, 127); }