Fix compile error

This commit is contained in:
nukeykt 2019-09-06 14:18:12 +09:00 committed by Christoph Oelckers
parent 48d95eee00
commit 67f370f17c
8 changed files with 69 additions and 69 deletions

View file

@ -701,7 +701,7 @@ void bail2dos(const char *fmt, ...)
void faketimerhandler()
{
if ((totalclock < ototalclock + 1) || bInMove)
if (((int)totalclock < ototalclock + 1) || bInMove)
return;
ototalclock++;
@ -1264,7 +1264,7 @@ void DoCredits()
videoNextPage();
FadeIn();
while (totalclock + 600 > totalclock)
while ((int)totalclock + 600 > (int)totalclock)
{
if (KB_KeyDown[sc_F12])
{
@ -2085,7 +2085,7 @@ LOOP3:
ResetMoveFifo();
moveframes = 0;
bInMove = kFalse;
tclocks = totalclock;
tclocks = (int)totalclock;
nPlayerDAng = 0;
lPlayerXVel = 0;
lPlayerYVel = 0;
@ -2099,7 +2099,7 @@ LOOP3:
mysetbrightness((uint8_t)nGamma);
//int edi = totalclock;
tclocks2 = totalclock;
tclocks2 = (int)totalclock;
CONTROL_BindsEnabled = 1;
// Game Loop
while (1)
@ -2167,13 +2167,13 @@ LOOP3:
bInMove = kTrue;
moveframes = (totalclock - tclocks2) / 4;
moveframes = ((int)totalclock - tclocks2) / 4;
if (moveframes > 4)
moveframes = 4;
if (moveframes != 0)
tclocks2 = totalclock;
tclocks2 = (int)totalclock;
if (bPlayback)
{
@ -2316,8 +2316,8 @@ LOOP3:
// loc_12149:
if (bInDemo)
{
while (tclocks > totalclock) { HandleAsync(); }
tclocks = totalclock;
while (tclocks > (int)totalclock) { HandleAsync(); }
tclocks = (int)totalclock;
}
bInMove = kFalse;
@ -2594,9 +2594,9 @@ void DoTitle()
PlayLocalSound(StaticSound[61], 0);
}
int nStartTime = totalclock;
int nStartTime = (int)totalclock;
int nCount = 0;
int var_18 = totalclock;
int var_18 = (int)totalclock;
int var_4 = 0;
int esi = 130;
@ -2620,7 +2620,7 @@ void DoTitle()
y = ydim - 16;
myprintext((xdim / 2 - nStringWidth / 2), y, b, 0);
if (totalclock > var_18)
if ((int)totalclock > var_18)
{
nCount++;
@ -2925,7 +2925,7 @@ void InitSpiritHead()
sprite[nSpiritSprite].cstat &= 0x7FFF;
nHeadTimeStart = totalclock;
nHeadTimeStart = (int)totalclock;
memset(worktile, -1, sizeof(worktile));
@ -2951,8 +2951,8 @@ void InitSpiritHead()
StartSwirlies();
sprintf(filename, "LEV%d.PUP", levelnum);
lNextStateChange = totalclock;
lHeadStartClock = totalclock;
lNextStateChange = (int)totalclock;
lHeadStartClock = (int)totalclock;
headfd = kopen4load(filename, 512); // 512??
nPupData = kread(headfd, cPupData, sizeof(cPupData));
@ -3014,7 +3014,7 @@ int DoSpiritHead()
if (nHeadStage < 2 || nHeadStage != 5)
{
nPixelsToShow = (totalclock - nHeadTimeStart) * 15;
nPixelsToShow = ((int)totalclock - nHeadTimeStart) * 15;
if (nPixelsToShow > nPixels) {
nPixelsToShow = nPixels;
@ -3037,10 +3037,10 @@ int DoSpiritHead()
if (!nHeadStage)
{
if ((totalclock - nHeadTimeStart) > 480)
if (((int)totalclock - nHeadTimeStart) > 480)
{
nHeadStage = 1;
nHeadTimeStart = totalclock + 480;
nHeadTimeStart = (int)totalclock + 480;
}
// int ecx = 0;
@ -3247,7 +3247,7 @@ int DoSpiritHead()
//*pVal = pixelval[i];
}
if ((totalclock - lHeadStartClock) > 600) {
if (((int)totalclock - lHeadStartClock) > 600) {
CopyHeadToWorkTile(kTileRamsesGold);
}
@ -3288,7 +3288,7 @@ int DoSpiritHead()
}
else
{
if (lNextStateChange <= totalclock)
if (lNextStateChange <= (int)totalclock)
{
if (nPupData)
{
@ -3408,7 +3408,7 @@ int DoSpiritHead()
}
else if (nHeadStage == 5)
{
if (lNextStateChange <= totalclock)
if (lNextStateChange <= (int)totalclock)
{
if (nPupData)
{
@ -3508,7 +3508,7 @@ int DoSpiritHead()
return 1;
}
nPixelsToShow = (totalclock - nHeadTimeStart) * 15;
nPixelsToShow = ((int)totalclock - nHeadTimeStart) * 15;
if (nPixelsToShow > nPixels) {
nPixelsToShow = nPixels;
@ -3531,10 +3531,10 @@ int DoSpiritHead()
if (!nHeadStage)
{
if ((totalclock - nHeadTimeStart) > 480)
if (((int)totalclock - nHeadTimeStart) > 480)
{
nHeadStage = 1;
nHeadTimeStart = totalclock + 480;
nHeadTimeStart = (int)totalclock + 480;
}
// int ecx = 0;
@ -3701,7 +3701,7 @@ int DoSpiritHead()
//*pVal = pixelval[i];
}
if ((totalclock - lHeadStartClock) > 600) {
if (((int)totalclock - lHeadStartClock) > 600) {
CopyHeadToWorkTile(kTileRamsesGold);
}

View file

@ -423,8 +423,8 @@ void ResetEngine()
resettiming();
totalclock = 0;
ototalclock = totalclock;
localclock = totalclock;
ototalclock = (int)totalclock;
localclock = (int)totalclock;
numframes = 0;
}

View file

@ -155,9 +155,9 @@ void ClearAllKeys()
void WaitNoKey(int nSecs, void (*pFunc) (void))
{
int nTotalTime = (kTimerTicks * nSecs) + totalclock;
int nTotalTime = (kTimerTicks * nSecs) + (int)totalclock;
while (nTotalTime > totalclock)
while (nTotalTime > (int)totalclock)
{
#ifdef _MSC_VER
HandleAsync();
@ -170,14 +170,14 @@ void WaitNoKey(int nSecs, void (*pFunc) (void))
int WaitAnyKey(int nSecs)
{
int nTotalTime = totalclock + (kTimerTicks * nSecs);
int nTotalTime = (int)totalclock + (kTimerTicks * nSecs);
while (1)
{
#ifdef _MSC_VER
HandleAsync();
#endif
if (nTotalTime <= totalclock || nSecs == -1) {
if (nTotalTime <= (int)totalclock || nSecs == -1) {
return -1;
}

View file

@ -192,8 +192,8 @@ void WaitTicks(int nTicks)
{
if (htimer)
{
nTicks += totalclock;
while (nTicks > totalclock) { HandleAsync(); }
nTicks += (int)totalclock;
while (nTicks > (int)totalclock) { HandleAsync(); }
}
else
{

View file

@ -304,7 +304,7 @@ void menu_DoPlasma()
//uint32_t t = time(0) << 16;
//uint32_t t2 = time(0) | t;
nRandom = totalclock;
nRandom = (int)totalclock;
for (int i = 0; i < 5; i++)
{
@ -513,14 +513,14 @@ void menu_DoPlasma()
}
// draw the fire urn/lamp thingies
int dword_9AB5F = (totalclock/16) & 3;
int dword_9AB5F = ((int)totalclock/16) & 3;
overwritesprite(50, 150, kTile3512 + dword_9AB5F, 0, 3, kPalNormal);
overwritesprite(270, 150, kTile3512 + ((dword_9AB5F + 2) & 3), 0, 3, kPalNormal);
// TEMP
int time = totalclock + 4;
while (totalclock < time) {
int time = (int)totalclock + 4;
while ((int)totalclock < time) {
HandleAsync();
}
}
@ -626,7 +626,7 @@ int menu_DrawTheMap(int nLevel, int nLevelNew, int nLevelBest)
int var_38 = 0;
int bFadeDone = kFalse;
int startTime = totalclock;
int startTime = (int)totalclock;
ClearAllKeys();
UnMaskStatus();
@ -668,13 +668,13 @@ int menu_DrawTheMap(int nLevel, int nLevelNew, int nLevelBest)
{
HandleAsync();
if ((totalclock - startTime) / kTimerTicks)
if (((int)totalclock - startTime) / kTimerTicks)
{
var_38++;
startTime = totalclock;
startTime = (int)totalclock;
}
int var_3C = totalclock;
int var_3C = (int)totalclock;
int tileY = y1;
@ -694,7 +694,7 @@ int menu_DrawTheMap(int nLevel, int nLevelNew, int nLevelBest)
{
for (int j = 0; j < MapLevelFires[i].nFires; j++)
{
int nFireFrame = ((totalclock >> 4) & 3);
int nFireFrame = (((int)totalclock >> 4) & 3);
assert(nFireFrame >= 0 && nFireFrame < 4);
int nFireType = MapLevelFires[i].fires[j].nFireType;
@ -708,7 +708,7 @@ int menu_DrawTheMap(int nLevel, int nLevelNew, int nLevelBest)
}
}
int t = (((totalclock & 16) >> 4));
int t = ((((int)totalclock & 16) >> 4));
int nTile = mapNamePlaques[i].tiles[t].nTile;
@ -722,7 +722,7 @@ int menu_DrawTheMap(int nLevel, int nLevelNew, int nLevelBest)
if (nLevelNew == i)
{
shade = (Sin(16 * totalclock) + 31) >> 8;
shade = (Sin(16 * (int)totalclock) + 31) >> 8;
}
else if (nLevelBest >= i)
{
@ -742,7 +742,7 @@ int menu_DrawTheMap(int nLevel, int nLevelNew, int nLevelBest)
{
bFadeDone = kTrue;
FadeIn();
var_3C = totalclock;
var_3C = (int)totalclock;
}
if (y1 == y2)
@ -799,7 +799,7 @@ int menu_DrawTheMap(int nLevel, int nLevelNew, int nLevelBest)
}
else
{
y1 += var_2C * ((totalclock - var_3C) / 2);
y1 += var_2C * (((int)totalclock - var_3C) / 2);
if (KB_KeyDown[sc_Escape] || KB_KeyDown[sc_Space] || KB_KeyDown[sc_Return])
{
@ -839,7 +839,7 @@ void menu_AdjustVolume()
menu_DoPlasma();
overwritesprite(80, 50, kMenuMusicTile, (Sin(totalclock << 4) >> 9) * (nOption == 0), 2, kPalNormal);
overwritesprite(80, 50, kMenuMusicTile, (Sin((int)totalclock << 4) >> 9) * (nOption == 0), 2, kPalNormal);
overwritesprite(55, 75, kMenuBlankTitleTile, 0, 2, kPalNormal);
seq_DrawGunSequence(
@ -850,7 +850,7 @@ void menu_AdjustVolume()
0,
0);
overwritesprite(80, 110, kMenuSoundFxTile, (Sin(totalclock << 4) >> 9) * (nOption == 1), 2, kPalNormal);
overwritesprite(80, 110, kMenuSoundFxTile, (Sin((int)totalclock << 4) >> 9) * (nOption == 1), 2, kPalNormal);
overwritesprite(55, 135, kMenuBlankTitleTile, 0, 2, kPalNormal);
seq_DrawGunSequence(
@ -899,11 +899,11 @@ void menu_AdjustVolume()
KB_KeyDown[sc_DownArrow] = 0;
}
if (totalclock <= var_8) {
if ((int)totalclock <= var_8) {
continue;
}
var_8 = totalclock + 5;
var_8 = (int)totalclock + 5;
if (KB_KeyDown[sc_LeftArrow])
{
@ -1040,7 +1040,7 @@ int menu_NewGameMenu()
for (int i = 0; i < 5; i++)
{
// CHECKME
int8_t shade = ((Sin(totalclock << 4) >> 9) * (i == nSlot)) + ((i != nSlot) * 31);
int8_t shade = ((Sin((int)totalclock << 4) >> 9) * (i == nSlot)) + ((i != nSlot) * 31);
overwritesprite(55, arg_4A, kMenuBlankTitleTile, shade, 2, kPalNormal);
myprintext(63, arg_4E, nameList[i], 0);
@ -1244,7 +1244,7 @@ int menu_NewGameMenu()
// loc_399FD:
menu_DoPlasma();
int arg_5E = (totalclock / 30) & 1;
int arg_5E = ((int)totalclock / 30) & 1;
int y = 90;
int arg_42 = 98;
@ -1365,7 +1365,7 @@ int menu_LoadGameMenu()
void menu_ResetKeyTimer()
{
keytimer = totalclock + 2400;
keytimer = (int)totalclock + 2400;
}
void menu_GameLoad2(FILE *fp)
@ -1505,7 +1505,7 @@ int menu_Menu(int nVal)
}
// menu idle timer
if (!nVal && totalclock > keytimer) {
if (!nVal && (int)totalclock > keytimer) {
return 9;
}
@ -1520,7 +1520,7 @@ int menu_Menu(int nVal)
int8_t shade;
if (nMenu == j) { // currently selected menu item
shade = Sin(totalclock << 4) >> 9;
shade = Sin((int)totalclock << 4) >> 9;
}
else if (ptr[j]) {
shade = 0;
@ -1868,7 +1868,7 @@ uint8_t AdvanceCinemaText()
if (tmp || nCDTrackLength && nCDTrackLength > 0)
{
nextclock = totalclock + 14;
nextclock = (int)totalclock + 14;
if (tmp > 0)
{
@ -1898,7 +1898,7 @@ uint8_t AdvanceCinemaText()
if (var_1C || nCDTrackLength)
{
if (nextclock <= totalclock) {
if (nextclock <= (int)totalclock) {
return kTrue;
}
}
@ -2219,13 +2219,13 @@ void DoLastLevelCinema()
int var_24 = 16;
int var_28 = 12;
int nEndTime = totalclock + 240;
int nEndTime = (int)totalclock + 240;
while (KB_KeyWaiting()) {
KB_GetCh();
}
while (nEndTime > totalclock)
while (nEndTime > (int)totalclock)
{
HandleAsync();
@ -2310,13 +2310,13 @@ LABEL_11:
KB_FlushKeyboardQueue();
KB_ClearKeysDown();
int v11 = kTimerTicks * (var_1C + 2) + totalclock;
int v11 = kTimerTicks * (var_1C + 2) + (int)totalclock;
do
{
HandleAsync();
if (v11 <= totalclock)
if (v11 <= (int)totalclock)
goto LABEL_11;
} while (!KB_KeyWaiting());
}

View file

@ -173,7 +173,7 @@ void MoveThings()
void ResetMoveFifo()
{
localclock = totalclock;
localclock = (int)totalclock;
movefifoend = 0;
movefifopos = 0;
}

View file

@ -1519,20 +1519,20 @@ void DoFinale()
{
StopLocalSound();
PlayLocalSound(StaticSound[kSound76], 0);
dword_1542FC = totalclock + 120;
dword_1542FC = (int)totalclock + 120;
++nFinaleStage;
}
}
else if (nFinaleStage <= 2)
{
if (totalclock >= dword_1542FC)
if ((int)totalclock >= dword_1542FC)
{
PlayLocalSound(StaticSound[kSound77], 0);
nFinaleStage++;
dword_1542FC = totalclock + 360;
dword_1542FC = (int)totalclock + 360;
}
}
else if (nFinaleStage == 3 && totalclock >= dword_1542FC)
else if (nFinaleStage == 3 && (int)totalclock >= dword_1542FC)
{
FinishLevel();
}
@ -1703,7 +1703,7 @@ void ExplodeEnergyBlock(int nSprite)
else
{
nFinaleSpr = nSprite;
lFinaleStart = totalclock;
lFinaleStart = (int)totalclock;
if (!lFinaleStart) {
lFinaleStart = lFinaleStart + 1;

View file

@ -739,7 +739,7 @@ void DrawStatus()
int shade;
if (totalclock / kTimerTicks & 1) {
if ((int)totalclock / kTimerTicks & 1) {
shade = -100;
}
else {
@ -756,14 +756,14 @@ void DrawStatus()
if (word_9AD54[i] == nScore)
{
int v9 = dword_9AD64[i];
if (v9 && v9 <= totalclock) {
if (v9 && v9 <= (int)totalclock) {
dword_9AD64[i] = 0;
}
}
else
{
word_9AD54[i] = nScore;
dword_9AD64[i] = totalclock + 30;
dword_9AD64[i] = (int)totalclock + 30;
}
overwritesprite(x, 7, nTile, 0, 3, kPalNormal);