diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-08-18 16:19:01 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-08-18 16:20:17 +0300 |
commit | 8eb694f537eafa137aaee7111e4971f75358164b (patch) | |
tree | a108207ed092e3faf3074897876af6eb693c2232 /src | |
parent | 0cc939c1c9f82e5688e2903e38d164db5bc749c1 (diff) | |
download | manaplus-8eb694f537eafa137aaee7111e4971f75358164b.tar.gz manaplus-8eb694f537eafa137aaee7111e4971f75358164b.tar.bz2 manaplus-8eb694f537eafa137aaee7111e4971f75358164b.tar.xz manaplus-8eb694f537eafa137aaee7111e4971f75358164b.zip |
Improve "auto adjust perfomance".
Diffstat (limited to 'src')
-rw-r--r-- | src/game.cpp | 12 | ||||
-rw-r--r-- | src/game.h | 1 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/game.cpp b/src/game.cpp index 8457cf079..82f919976 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -338,7 +338,8 @@ Game::Game(): mValidSpeed(true), mLastAction(0), mNextAdjustTime(cur_time + adjustDelay), - mAdjustLevel(0) + mAdjustLevel(0), + mLowerCounter(0) { spellManager = new SpellManager; spellShortcut = new SpellShortcut; @@ -586,6 +587,13 @@ void Game::adjustPerfomance() if (fps < maxFps - 10) { + if (mLowerCounter < 2) + { + mLowerCounter ++; + mNextAdjustTime = cur_time + 1; + return; + } + mLowerCounter = 0; mAdjustLevel ++; switch (mAdjustLevel) { @@ -604,6 +612,7 @@ void Game::adjustPerfomance() else { mNextAdjustTime = cur_time + 1; + mLowerCounter = 2; } break; } @@ -621,6 +630,7 @@ void Game::adjustPerfomance() else { mNextAdjustTime = cur_time + 1; + mLowerCounter = 2; } break; case 3: diff --git a/src/game.h b/src/game.h index 88dc9166b..84dca08e9 100644 --- a/src/game.h +++ b/src/game.h @@ -117,6 +117,7 @@ class Game unsigned mNextAdjustTime; int mAdjustLevel; bool mAdjustPerfomance; + int mLowerCounter; static Game *mInstance; }; |