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,13 +28,10 @@ void FramerateManager::framerateDelay()
|
|||||||
{
|
{
|
||||||
Duration timeSpentBusy = Clock::now() - lastTimePoint;
|
Duration timeSpentBusy = Clock::now() - lastTimePoint;
|
||||||
|
|
||||||
if(!vsyncEnabled)
|
if(!vsyncEnabled && timeSpentBusy < targetFrameTime)
|
||||||
{
|
{
|
||||||
// if FPS is higher than it should be, then wait some time
|
// if FPS is higher than it should be, then wait some time
|
||||||
if(timeSpentBusy < targetFrameTime)
|
boost::this_thread::sleep_for(targetFrameTime - timeSpentBusy);
|
||||||
{
|
|
||||||
boost::this_thread::sleep_for(targetFrameTime - timeSpentBusy);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// compute actual timeElapsed taking into account actual sleep interval
|
// compute actual timeElapsed taking into account actual sleep interval
|
||||||
|
|||||||
Reference in New Issue
Block a user