mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-06 09:09:40 +02:00
FramerateManager.cpp: Merge this "if" statement with the enclosing one.
Collapsible "if" statements should be merged
This commit is contained in:
@@ -28,14 +28,11 @@ void FramerateManager::framerateDelay()
|
||||
{
|
||||
Duration timeSpentBusy = Clock::now() - lastTimePoint;
|
||||
|
||||
if(!vsyncEnabled)
|
||||
if(!vsyncEnabled && timeSpentBusy < targetFrameTime)
|
||||
{
|
||||
// if FPS is higher than it should be, then wait some time
|
||||
if(timeSpentBusy < targetFrameTime)
|
||||
{
|
||||
boost::this_thread::sleep_for(targetFrameTime - timeSpentBusy);
|
||||
}
|
||||
}
|
||||
|
||||
// compute actual timeElapsed taking into account actual sleep interval
|
||||
// limit it to 100 ms to avoid breaking animation in case of huge lag (e.g. triggered breakpoint)
|
||||
|
||||
Reference in New Issue
Block a user