Browse Source

Do not use "inactive FPS" if it is higher than "max FPS."

Lasse Öörni 13 years ago
parent
commit
1bf4b7d976
1 changed files with 3 additions and 3 deletions
  1. 3 3
      Engine/Engine/Engine.cpp

+ 3 - 3
Engine/Engine/Engine.cpp

@@ -374,7 +374,7 @@ void Engine::DumpResources()
 void Engine::Update()
 {
     PROFILE(Update);
-
+    
     // Logic update event
     using namespace Update;
     
@@ -395,7 +395,7 @@ void Engine::Update()
 void Engine::Render()
 {
     PROFILE(Render);
-
+    
     // Do not render if device lost
     Graphics* graphics = GetSubsystem<Graphics>();
     if (graphics && graphics->BeginFrame())
@@ -414,7 +414,7 @@ void Engine::ApplyFrameLimit()
     int maxFps = maxFps_;
     Input* input = GetSubsystem<Input>();
     if (input && !input->IsActive())
-        maxFps = maxInactiveFps_;
+        maxFps = Min(maxInactiveFps_, maxFps);
     
     long long elapsed = 0;