- fixed all warnings in Exhumed.

This commit is contained in:
Christoph Oelckers 2021-05-12 17:09:07 +02:00
parent fb21e39de5
commit 694066c4ec
11 changed files with 35 additions and 35 deletions

View file

@ -313,7 +313,7 @@ void menu_DoPlasma()
if (badOffset)
continue;
unsigned int nSmokeOffset = 0;
int nSmokeOffset = 0;
if (plasma_A[j])
{

View file

@ -644,8 +644,8 @@ int BuildBullet(short nSprite, int nType, int, int, int val1, int nAngle, int va
nRepeat = 30;
}
sprite[nBulletSprite].xrepeat = nRepeat;
sprite[nBulletSprite].yrepeat = nRepeat;
sprite[nBulletSprite].xrepeat = (uint8_t)nRepeat;
sprite[nBulletSprite].yrepeat = (uint8_t)nRepeat;
sprite[nBulletSprite].xoffset = 0;
sprite[nBulletSprite].yoffset = 0;
sprite[nBulletSprite].ang = nAngle;

View file

@ -141,8 +141,8 @@ void BuildItemAnim(short nSprite)
else
{
sprite[nSprite].owner = -1;
sprite[nSprite].yrepeat = nItemAnimInfo[nItem].repeat;
sprite[nSprite].xrepeat = nItemAnimInfo[nItem].repeat;
sprite[nSprite].yrepeat = (uint8_t)nItemAnimInfo[nItem].repeat;
sprite[nSprite].xrepeat = (uint8_t)nItemAnimInfo[nItem].repeat;
}
}
@ -476,9 +476,9 @@ void DoRegenerates()
}
sprite[nSprite].zvel = 0;
sprite[nSprite].yrepeat = sprite[nSprite].xvel;
sprite[nSprite].xrepeat = sprite[nSprite].xvel;
sprite[nSprite].pal = sprite[nSprite].yvel;
sprite[nSprite].yrepeat = (uint8_t)sprite[nSprite].xvel;
sprite[nSprite].xrepeat = (uint8_t)sprite[nSprite].xvel;
sprite[nSprite].pal = (uint8_t)sprite[nSprite].yvel;
sprite[nSprite].yvel = sprite[nSprite].zvel; // setting to 0
sprite[nSprite].xvel = sprite[nSprite].zvel; // setting to 0
nRegenerates--;

View file

@ -212,8 +212,8 @@ int BuildLava(short nSprite, int x, int y, int, short nSector, short nAngle, int
void FuncLava(int a, int nDamage, int nRun)
{
short nLava = RunData[nRun].nVal;
assert(nLava >= 0 && nLava < LavaList.Size());
unsigned nLava = RunData[nRun].nVal;
assert(nLava < LavaList.Size());
short nAction = LavaList[nLava].nAction;
short nSeq = LavadudeSeq[nAction].a + SeqOffsets[kSeqLavag];

View file

@ -216,7 +216,7 @@ void AddFlash(short nSector, int x, int y, int z, int val)
assert(nSector >= 0 && nSector < kMaxSectors);
int var_28 = 0;
unsigned int var_1C = val >> 8;
int var_1C = val >> 8;
if (var_1C >= nFlashDepth) {
return;
@ -225,7 +225,7 @@ void AddFlash(short nSector, int x, int y, int z, int val)
unsigned int var_20 = val & 0x80;
unsigned int var_18 = val & 0x40;
val = ((var_1C + 1) << 8) | char(val);
val = ((var_1C + 1) << 8) | (val & 0xff);
int var_14 = 0;
@ -387,7 +387,7 @@ void AddFlash(short nSector, int x, int y, int z, int val)
shade = -127;
}
sprite[nSprite].shade = shade;
sprite[nSprite].shade = (int8_t)shade;
}
}
}
@ -462,12 +462,12 @@ void UndoFlashes()
assert(pShade != NULL);
short var_2C = (*pShade) + 6;
int var_30 = sFlash[nFlash].shade;
int thisshade = (*pShade) + 6;
int maxshade = sFlash[nFlash].shade;
if (var_2C < var_30)
if (thisshade < maxshade)
{
*pShade = var_2C;
*pShade = (int8_t)thisshade;
edi = nFlash;
continue;
}

View file

@ -154,7 +154,7 @@ public:
uint8_t* pFrame = CurFrame;
int nRead = fp.Read(&yOffset, sizeof(yOffset));
int nRead = (int)fp.Read(&yOffset, sizeof(yOffset));
nSize -= nRead;
pFrame += yOffset * 200; // row position
@ -169,7 +169,7 @@ public:
if (nPixels)
{
int nRead = fp.Read(pFrame, nPixels);
int nRead = (int)fp.Read(pFrame, nPixels);
pFrame += nRead;
nSize -= nRead;
}

View file

@ -150,7 +150,7 @@ void InitSpiritHead()
}
else
{
nPupData = headfd.Read(cPupData, sizeof(cPupData));
nPupData = (int)headfd.Read(cPupData, sizeof(cPupData));
pPupData = cPupData;
}
nMouthTile = 0;
@ -383,13 +383,13 @@ void DoSpiritHead()
{
sprite[nSpiritSprite].xrepeat -= 2;
if (sprite[nSpiritSprite].xrepeat < nSpiritRepeatX)
sprite[nSpiritSprite].xrepeat = nSpiritRepeatX;
sprite[nSpiritSprite].xrepeat = (uint8_t)nSpiritRepeatX;
}
if (sprite[nSpiritSprite].yrepeat > nSpiritRepeatY)
{
sprite[nSpiritSprite].yrepeat -= 2;
if (sprite[nSpiritSprite].yrepeat < nSpiritRepeatY)
sprite[nSpiritSprite].yrepeat = nSpiritRepeatY;
sprite[nSpiritSprite].yrepeat = (uint8_t)nSpiritRepeatY;
}
int nCount = 0;

View file

@ -503,12 +503,12 @@ int seq_PlotArrowSequence(short nSprite, short nSeq, int nVal)
if (ChunkFlag[nFrameBase] & 1)
{
pTSprite->xoffset = ChunkXpos[nFrameBase];
pTSprite->xoffset = (int8_t)ChunkXpos[nFrameBase];
pTSprite->cstat |= 4;
}
else
{
pTSprite->xoffset = -ChunkXpos[nFrameBase];
pTSprite->xoffset = (int8_t)-ChunkXpos[nFrameBase];
}
pTSprite->yoffset = -ChunkYpos[nFrameBase];
@ -588,7 +588,7 @@ int seq_PlotSequence(short nSprite, short edx, short nFrame, short ecx)
if (ChunkFlag[nBase] & 1)
{
tsp->xoffset = ChunkXpos[nBase];
tsp->xoffset = (int8_t)ChunkXpos[nBase];
tsp->cstat |= 4; // x-flipped
}
else

View file

@ -455,9 +455,9 @@ void EXSoundEngine::CalcPosVel(int type, const void* source, const float pt[3],
else if (type == SOURCE_Swirly)
{
int which = *(int*)source;
float phase = (PlayClock << (4 + which)) * BAngRadian;
pos->X = fcampos.X + 256 * cos(phase);
pos->Z = fcampos.Z + 256 * sin(phase);
double phase = (PlayClock << (4 + which)) * BAngRadian;
pos->X = fcampos.X + float(256 * cos(phase));
pos->Z = fcampos.Z + float(256 * sin(phase));
}
else if (type == SOURCE_EXBoss)
{
@ -518,7 +518,7 @@ void GameInterface::UpdateSounds()
}
auto fv = GetSoundPos(&pos);
SoundListener listener;
listener.angle = -ang * BAngRadian; // Build uses a period of 2048.
listener.angle = float(-ang * BAngRadian); // Build uses a period of 2048.
listener.velocity.Zero();
listener.position = GetSoundPos(&pos);
listener.underwater = false;
@ -636,7 +636,7 @@ void PlayFX2(unsigned short nSound, short nSprite, int sectf, EChanFlags chanfla
FSoundChan* chan = nullptr;
if (nSprite >= 0)
{
chan = soundEngine->StartSound(SOURCE_Actor, &sprite[nSprite], nullptr, CHAN_BODY, chanflags| CHANF_OVERLAP, nSound+1, nVolume / 255.f,fullvol? 0.5 : ATTN_NORM, nullptr, (11025 + nPitch) / 11025.f);
chan = soundEngine->StartSound(SOURCE_Actor, &sprite[nSprite], nullptr, CHAN_BODY, chanflags| CHANF_OVERLAP, nSound+1, nVolume / 255.f,fullvol? 0.5f : ATTN_NORM, nullptr, (11025 + nPitch) / 11025.f);
}
else
{

View file

@ -179,13 +179,13 @@ int BuildStatusAnim(int val, int nFlags)
int nStatusAnim = StatusAnim.Get();
StatusAnim[nStatusAnim].nPrevAnim = -1;
StatusAnim[nStatusAnim].nNextAnim = nLastAnim;
StatusAnim[nStatusAnim].nNextAnim = (int8_t)nLastAnim;
if (nLastAnim < 0) {
nFirstAnim = nStatusAnim;
}
else {
StatusAnim[nLastAnim].nPrevAnim = nStatusAnim;
StatusAnim[nLastAnim].nPrevAnim = (int8_t)nStatusAnim;
}
nLastAnim = nStatusAnim;

View file

@ -336,7 +336,7 @@ void DrawView(double smoothRatio, bool sceneonly)
static uint8_t sectorCeilingPal[MAXSECTORS];
static uint8_t wallPal[MAXWALLS];
int const viewingRange = viewingrange;
int const vr = xs_CRoundToInt(65536.f * tanf(r_fov * (pi::pi() / 360.f)));
int const vr = xs_CRoundToInt(65536. * tan(r_fov * (pi::pi() / 360.)));
videoSetCorrectedAspect();
@ -360,7 +360,7 @@ void DrawView(double smoothRatio, bool sceneonly)
if (!testnewrenderer)
{
renderSetRollAngle(rotscrnang.asbuildf());
renderSetRollAngle((float)rotscrnang.asbuildf());
renderDrawRoomsQ16(nCamerax, nCameray, viewz, nCameraa.asq16(), nCamerapan.asq16(), nSector);
analyzesprites(pm_tsprite, pm_spritesortcnt, nCamerax, nCameray, viewz, smoothRatio);
renderDrawMasks();
@ -439,7 +439,7 @@ void DrawView(double smoothRatio, bool sceneonly)
{
RestoreGreenPal();
if (nEnemyPal > -1) {
sprite[enemy].pal = nEnemyPal;
sprite[enemy].pal = (uint8_t)nEnemyPal;
}
DrawMap(smoothRatio);