diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-11-06 21:13:16 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-11-07 12:46:08 +0300 |
commit | d812d9fac7bae4eff66a5ce8275be19d0ca77a32 (patch) | |
tree | 7f9619d23a44202a76282849bb1284773302309f /src/game.cpp | |
parent | 1bcaac517036751a8fee9ff3d6561f5866e6969e (diff) | |
download | manaplus-d812d9fac7bae4eff66a5ce8275be19d0ca77a32.tar.gz manaplus-d812d9fac7bae4eff66a5ce8275be19d0ca77a32.tar.bz2 manaplus-d812d9fac7bae4eff66a5ce8275be19d0ca77a32.tar.xz manaplus-d812d9fac7bae4eff66a5ce8275be19d0ca77a32.zip |
Add own profiler and profiler info to some code.
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/game.cpp b/src/game.cpp index 7993fa25c..3cf000229 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -557,6 +557,7 @@ bool Game::saveScreenshot(SDL_Surface *const screenshot) void Game::logic() { + BLOCK_START("Game::logic") handleInput(); // Handle all necessary game logic @@ -569,10 +570,12 @@ void Game::logic() mCurrentMap->update(); cur_time = static_cast<int>(time(nullptr)); + BLOCK_END("Game::logic") } void Game::slowLogic() { + BLOCK_START("Game::slowLogic") if (player_node) player_node->slowLogic(); if (botCheckerWindow) @@ -645,10 +648,12 @@ void Game::slowLogic() disconnectedDialog = nullptr; } } + BLOCK_END("Game::slowLogic") } void Game::adjustPerfomance() { + FUNC_BLOCK("Game::adjustPerfomance", 1) if (mNextAdjustTime <= adjustDelay) { mNextAdjustTime = cur_time + adjustDelay; @@ -907,6 +912,7 @@ void Game::handleActive(const SDL_Event &event) */ void Game::handleInput() { + BLOCK_START("Game::handleInput 1") if (joystick) joystick->logic(); @@ -914,6 +920,7 @@ void Game::handleInput() SDL_Event event; while (SDL_PollEvent(&event)) { + BLOCK_START("Game::handleInput 2") updateHistory(event); checkKeys(); @@ -935,6 +942,7 @@ void Game::handleInput() { Client::setState(STATE_EXIT); } + BLOCK_END("Game::handleInput 2") } // End while // If the user is configuring the keys then don't respond. @@ -951,6 +959,7 @@ void Game::handleInput() handleMove(); inputManager.handleRepeat(); + BLOCK_END("Game::handleInput 1") } /** |