summaryrefslogtreecommitdiff
path: root/src/gui/gui.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-11-06 21:13:16 +0300
committerAndrei Karas <akaras@inbox.ru>2012-11-07 12:46:08 +0300
commitd812d9fac7bae4eff66a5ce8275be19d0ca77a32 (patch)
tree7f9619d23a44202a76282849bb1284773302309f /src/gui/gui.cpp
parent1bcaac517036751a8fee9ff3d6561f5866e6969e (diff)
downloadmanaverse-d812d9fac7bae4eff66a5ce8275be19d0ca77a32.tar.gz
manaverse-d812d9fac7bae4eff66a5ce8275be19d0ca77a32.tar.bz2
manaverse-d812d9fac7bae4eff66a5ce8275be19d0ca77a32.tar.xz
manaverse-d812d9fac7bae4eff66a5ce8275be19d0ca77a32.zip
Add own profiler and profiler info to some code.
Diffstat (limited to 'src/gui/gui.cpp')
-rw-r--r--src/gui/gui.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index 6e78e3ac8..956b9e8b3 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -258,11 +258,15 @@ Gui::~Gui()
void Gui::logic()
{
+ BLOCK_START("Gui::logic")
ResourceManager *const resman = ResourceManager::getInstance();
resman->clearScheduled();
if (!mTop)
+ {
+ BLOCK_END("Gui::logic")
return;
+ }
handleModalFocus();
handleModalMouseInputFocus();
@@ -271,10 +275,12 @@ void Gui::logic()
handleMouseInput();
mTop->logic();
+ BLOCK_END("Gui::logic")
}
void Gui::slowLogic()
{
+ BLOCK_START("Gui::slowLogic")
Palette::advanceGradients();
// Fade out mouse cursor after extended inactivity
@@ -297,14 +303,17 @@ void Gui::slowLogic()
mSecureFont->slowLogic();
if (boldFont)
boldFont->slowLogic();
+ BLOCK_END("Gui::slowLogic")
}
bool Gui::handleInput()
{
+ BLOCK_START("Gui::handleInput")
if (mInput)
return handleKeyInput2();
else
return false;
+ BLOCK_END("Gui::handleInput")
}
bool Gui::handleKeyInput2()
@@ -312,6 +321,7 @@ bool Gui::handleKeyInput2()
if (!guiInput)
return false;
+ BLOCK_START("Gui::handleKeyInput2")
bool consumed(false);
while (!mInput->isKeyQueueEmpty())
@@ -376,11 +386,13 @@ bool Gui::handleKeyInput2()
}
}
} // end while
+ BLOCK_END("Gui::handleKeyInput2")
return consumed;
}
void Gui::draw()
{
+ BLOCK_START("Gui::draw 1")
mGraphics->pushClipArea(getTop()->getDimension());
getTop()->draw(mGraphics);
@@ -403,6 +415,7 @@ void Gui::draw()
}
mGraphics->popClipArea();
+ BLOCK_END("Gui::draw 1")
}
void Gui::videoResized() const