- fixed timer screwups in Exhumed.

The leveltime ticker only runs at 30 fps so all places where it replaces totalclock need to multiply it by 4.
This commit is contained in:
Christoph Oelckers 2020-09-05 22:41:02 +02:00
parent 7dbae8b8f4
commit ac0eb92367
4 changed files with 17 additions and 17 deletions

View file

@ -1529,20 +1529,20 @@ void DoFinale()
{
StopLocalSound();
PlayLocalSound(StaticSound[kSound76], 0);
nextstage = leveltime + 120;
nextstage = leveltime*4 + 120;
nFinaleStage++;
}
}
else if (nFinaleStage <= 2)
{
if (leveltime >= nextstage)
if (leveltime*4 >= nextstage)
{
PlayLocalSound(StaticSound[kSound77], 0);
nFinaleStage++;
nextstage = leveltime + 360;
nextstage = leveltime*4 + 360;
}
}
else if (nFinaleStage == 3 && leveltime >= nextstage)
else if (nFinaleStage == 3 && leveltime*4 >= nextstage)
{
EndLevel = 13;
}
@ -1706,7 +1706,7 @@ void ExplodeEnergyBlock(int nSprite)
else
{
nFinaleSpr = nSprite;
lFinaleStart = leveltime;
lFinaleStart = leveltime*4;
if (!lFinaleStart) {
lFinaleStart = lFinaleStart + 1;

View file

@ -127,7 +127,7 @@ void InitSpiritHead()
sprite[nSpiritSprite].cstat &= 0x7FFF;
nHeadTimeStart = leveltime;
nHeadTimeStart = leveltime*4;
memset(Worktile, TRANSPARENT_INDEX, WorktileSize);
TileFiles.InvalidateTile(kTileRamsesWorkTile);
@ -152,8 +152,8 @@ void InitSpiritHead()
StartSwirlies();
sprintf(filename, "LEV%d.PUP", currentLevel->levelNumber);
lNextStateChange = leveltime;
lHeadStartClock = leveltime;
lNextStateChange = leveltime*4;
lHeadStartClock = leveltime*4;
auto headfd = fileSystem.OpenFileReader(filename);
if (!headfd.isOpen())
@ -219,7 +219,7 @@ int DoSpiritHead()
if (nHeadStage < 2 || nHeadStage != 5)
{
nPixelsToShow = (leveltime - nHeadTimeStart) * 15;
nPixelsToShow = (leveltime*4 - nHeadTimeStart) * 15;
if (nPixelsToShow > nPixels) {
nPixelsToShow = nPixels;
@ -242,10 +242,10 @@ int DoSpiritHead()
if (!nHeadStage)
{
if ((leveltime - nHeadTimeStart) > 480)
if ((leveltime*4 - nHeadTimeStart) > 480)
{
nHeadStage = 1;
nHeadTimeStart = leveltime + 480;
nHeadTimeStart = leveltime*4 + 480;
}
for (int i = 0; i < nPixelsToShow; i++)
@ -426,7 +426,7 @@ int DoSpiritHead()
Worktile[kSpiritX + ecx] = pixelval[i];
}
if ((leveltime - lHeadStartClock) > 600)
if ((leveltime*4 - lHeadStartClock) > 600)
{
CopyHeadToWorkTile(kTileRamsesGold);
}
@ -467,7 +467,7 @@ int DoSpiritHead()
}
else
{
if (lNextStateChange <= leveltime)
if (lNextStateChange <= leveltime*4)
{
if (nPupData)
{

View file

@ -450,7 +450,7 @@ void EXSoundEngine::CalcPosVel(int type, const void* source, const float pt[3],
else if (type == SOURCE_Swirly)
{
int which = *(int*)source;
float phase = (leveltime << (4 + which)) * (M_PI / 1024);
float phase = (leveltime << (6 + which)) * (M_PI / 1024);
pos->X = fcampos.X + 256 * cos(phase);
pos->Z = fcampos.Z + 256 * sin(phase);
}

View file

@ -631,7 +631,7 @@ private:
int shade;
if (leveltime / kTimerTicks & 1) {
if ((leveltime / 30) & 1) {
shade = -100;
}
else {
@ -649,14 +649,14 @@ private:
if (word_9AD54[i] == nScore)
{
int v9 = dword_9AD64[i];
if (v9 && v9 <= leveltime) {
if (v9 && v9 <= leveltime*4) {
dword_9AD64[i] = 0;
}
}
else
{
word_9AD54[i] = nScore;
dword_9AD64[i] = leveltime + 30;
dword_9AD64[i] = leveltime*4 + 30;
}
DrawGraphic(tileGetTexture(nTile), x, 7, DI_ITEM_CENTER, 1, -1, -1, 1, 1);