diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-06-22 20:58:13 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-06-22 20:58:13 +0300 |
commit | 8ad99cc3f4dd98f0b73a2ece9323f01099a81e80 (patch) | |
tree | 33115940e6efabec34efb71e0be6b6d7dfd7e4df /src/eventsmanager.cpp | |
parent | 04f47f060f94ec0e2dfc3cccf62cff167e0ecd68 (diff) | |
download | manaplus-8ad99cc3f4dd98f0b73a2ece9323f01099a81e80.tar.gz manaplus-8ad99cc3f4dd98f0b73a2ece9323f01099a81e80.tar.bz2 manaplus-8ad99cc3f4dd98f0b73a2ece9323f01099a81e80.tar.xz manaplus-8ad99cc3f4dd98f0b73a2ece9323f01099a81e80.zip |
Add profiler lines into some functions.
Diffstat (limited to 'src/eventsmanager.cpp')
-rw-r--r-- | src/eventsmanager.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/eventsmanager.cpp b/src/eventsmanager.cpp index e7b2eb977..15197c087 100644 --- a/src/eventsmanager.cpp +++ b/src/eventsmanager.cpp @@ -69,6 +69,7 @@ void EventsManager::shutdown() bool EventsManager::handleCommonEvents(const SDL_Event &event) const { + BLOCK_START("EventsManager::handleCommonEvents") if (mLogInput) logEvent(event); @@ -77,23 +78,28 @@ bool EventsManager::handleCommonEvents(const SDL_Event &event) const case SDL_QUIT: client->setState(STATE_EXIT); logger->log1("force exit"); + BLOCK_END("EventsManager::handleCommonEvents") return true; #ifdef USE_SDL2 case SDL_WINDOWEVENT: handleSDL2WindowEvent(event); + BLOCK_END("EventsManager::handleCommonEvents") return true; #else case SDL_VIDEORESIZE: WindowManager::resizeVideo(event.resize.w, event.resize.h, false); + BLOCK_END("EventsManager::handleCommonEvents") return true; case SDL_ACTIVEEVENT: handleActive(event); + BLOCK_END("EventsManager::handleCommonEvents") return true; #ifdef ANDROID case SDL_KEYBOARDSHOW: WindowManager::updateScreenKeyboard(event.user.code); + BLOCK_END("EventsManager::handleCommonEvents") return true; case SDL_ACCELEROMETER: break; @@ -104,13 +110,18 @@ bool EventsManager::handleCommonEvents(const SDL_Event &event) const } if (inputManager.handleEvent(event)) + { + BLOCK_END("EventsManager::handleCommonEvents") return true; + } + BLOCK_END("EventsManager::handleCommonEvents") return false; } bool EventsManager::handleEvents() const { + BLOCK_START("EventsManager::handleEvents") if (Game::instance()) { // Let the game handle the events while it is active @@ -156,13 +167,18 @@ bool EventsManager::handleEvents() const #endif } if (client->getState() == STATE_EXIT) + { + BLOCK_END("EventsManager::handleEvents") return true; + } } + BLOCK_END("EventsManager::handleEvents") return false; } void EventsManager::handleGameEvents() const { + BLOCK_START("EventsManager::handleGameEvents") Game *const game = Game::instance(); // Events @@ -176,6 +192,7 @@ void EventsManager::handleGameEvents() const if (handleCommonEvents(event)) break; } // End while + BLOCK_END("EventsManager::handleGameEvents") } void EventsManager::optionChanged(const std::string &name) |