Skip to content

Commit

Permalink
do not count fps when the counter is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
NEDJIMAbelgacem authored and wonder-sk committed Dec 8, 2020
1 parent 8125353 commit eb181d7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/3d/qgs3dmapscene.cpp
Expand Up @@ -503,6 +503,14 @@ void Qgs3DMapScene::onFrameTriggered( float dt )
// lock changing the FPS counter to 5 fps
static int frameCount = 0;
static float accumulatedTime = 0.0f;

if ( !mMap.isFpsCounterEnabled() )
{
frameCount = 0;
accumulatedTime = 0;
return;
}

frameCount++;
accumulatedTime += dt;
if ( accumulatedTime >= 0.2f )
Expand Down

0 comments on commit eb181d7

Please sign in to comment.