Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions GeneralsMD/Code/GameEngine/Include/Common/GameEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ class GameEngine : public SubsystemInterface

virtual void resetSubsystems();

Bool canUpdateGameLogic();
Bool canUpdateGameLogic(UnsignedInt logicTimeQueryFlags);
Bool canUpdateNetworkGameLogic();
Bool canUpdateRegularGameLogic();
Bool canUpdateRegularGameLogic(UnsignedInt logicTimeQueryFlags);

virtual FileSystem *createFileSystem(); ///< Factory for FileSystem classes
virtual LocalFileSystem *createLocalFileSystem() = 0; ///< Factory for LocalFileSystem classes
Expand Down
15 changes: 7 additions & 8 deletions GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ void GameEngine::resetSubsystems()
}

/// -----------------------------------------------------------------------------------------------
Bool GameEngine::canUpdateGameLogic()
Bool GameEngine::canUpdateGameLogic(UnsignedInt logicTimeQueryFlags)
{
// Must be first.
TheGameLogic->preUpdate();
Expand All @@ -829,7 +829,7 @@ Bool GameEngine::canUpdateGameLogic()
}
else
{
return canUpdateRegularGameLogic();
return canUpdateRegularGameLogic(logicTimeQueryFlags);
}
}

Expand All @@ -850,19 +850,18 @@ Bool GameEngine::canUpdateNetworkGameLogic()
}

/// -----------------------------------------------------------------------------------------------
Bool GameEngine::canUpdateRegularGameLogic()
Bool GameEngine::canUpdateRegularGameLogic(UnsignedInt logicTimeQueryFlags)
{
const Bool enabled = TheFramePacer->isLogicTimeScaleEnabled();
const Int logicTimeScaleFps = TheFramePacer->getLogicTimeScaleFps();
const Int maxRenderFps = TheFramePacer->getFramesPerSecondLimit();
const Int logicTimeScaleFps = TheFramePacer->getActualLogicTimeScaleFps(logicTimeQueryFlags);
const Int maxRenderFps = TheFramePacer->getActualFramesPerSecondLimit();

#if defined(_ALLOW_DEBUG_CHEATS_IN_RELEASE)
const Bool useFastMode = TheGlobalData->m_TiVOFastMode;
#else //always allow this cheat key if we're in a replay game.
const Bool useFastMode = TheGlobalData->m_TiVOFastMode && TheGameLogic->isInReplayGame();
#endif

if (useFastMode || !enabled || logicTimeScaleFps >= maxRenderFps)
if (useFastMode || logicTimeScaleFps >= maxRenderFps)
{
// Logic time scale is uncapped or larger equal Render FPS. Update straight away.
return true;
Expand Down Expand Up @@ -912,7 +911,7 @@ void GameEngine::update()
}
}

const Bool canUpdate = canUpdateGameLogic();
const Bool canUpdate = canUpdateGameLogic(FramePacer::IgnoreFrozenTime | FramePacer::IgnoreHaltedGame);
const Bool canUpdateLogic = canUpdate && !TheFramePacer->isGameHalted() && !TheFramePacer->isTimeFrozen();
const Bool canUpdateScript = canUpdate && !TheFramePacer->isGameHalted();

Expand Down
Loading