Restore Doom Classic Frame Rate (35 Hz) following background slowdown change

This commit is contained in:
SRSaunders 2025-02-13 00:26:28 -05:00
parent 210b294246
commit 59e5b087eb
3 changed files with 8 additions and 2 deletions

View file

@ -1955,8 +1955,6 @@ void idCommonLocal::PerformGameSwitch()
return;
}
const int DOOM_CLASSIC_HZ = 35;
if( idealCurrentGame == DOOM_CLASSIC || idealCurrentGame == DOOM2_CLASSIC )
{
// Pause Doom 3 sound.

View file

@ -691,6 +691,7 @@ private:
static const int DOOMCLASSIC_RENDERHEIGHT = 200 * 3;
static const int DOOMCLASSIC_BYTES_PER_PIXEL = 4;
static const int DOOMCLASSIC_IMAGE_SIZE_IN_BYTES = DOOMCLASSIC_RENDERWIDTH * DOOMCLASSIC_RENDERHEIGHT * DOOMCLASSIC_BYTES_PER_PIXEL;
static constexpr float DOOM_CLASSIC_HZ = 35.0f;
idArray< byte, DOOMCLASSIC_IMAGE_SIZE_IN_BYTES > doomClassicImageData;
#endif

View file

@ -649,6 +649,13 @@ void idCommonLocal::Frame()
com_engineHz_denominator = 100LL * backgroundEngineHz;
com_engineHz_latched = backgroundEngineHz;
}
#if defined(USE_DOOMCLASSIC)
else if( IsPlayingDoomClassic() )
{
com_engineHz_denominator = 100LL * DOOM_CLASSIC_HZ;
com_engineHz_latched = DOOM_CLASSIC_HZ;
}
#endif
else
{
// allow com_engineHz to be changed between map loads