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/gui/sdlfont.cpp | |
parent | 1bcaac517036751a8fee9ff3d6561f5866e6969e (diff) | |
download | plus-d812d9fac7bae4eff66a5ce8275be19d0ca77a32.tar.gz plus-d812d9fac7bae4eff66a5ce8275be19d0ca77a32.tar.bz2 plus-d812d9fac7bae4eff66a5ce8275be19d0ca77a32.tar.xz plus-d812d9fac7bae4eff66a5ce8275be19d0ca77a32.zip |
Add own profiler and profiler info to some code.
Diffstat (limited to 'src/gui/sdlfont.cpp')
-rw-r--r-- | src/gui/sdlfont.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gui/sdlfont.cpp b/src/gui/sdlfont.cpp index 33581767d..7ecf7cb4f 100644 --- a/src/gui/sdlfont.cpp +++ b/src/gui/sdlfont.cpp @@ -66,6 +66,7 @@ class SDLTextChunk final void generate(TTF_Font *const font, const float alpha) { + BLOCK_START("SDLTextChunk::generate") SDL_Color sdlCol; sdlCol.b = static_cast<uint8_t>(color.b); sdlCol.r = static_cast<uint8_t>(color.r); @@ -80,11 +81,13 @@ class SDLTextChunk final if (!surface) { img = nullptr; + BLOCK_END("SDLTextChunk::generate") return; } img = imageHelper->createTextSurface(surface, alpha); SDL_FreeSurface(surface); + BLOCK_END("SDLTextChunk::generate") } Image *img; @@ -192,8 +195,12 @@ void SDLFont::drawString(gcn::Graphics *const graphics, const std::string &text, const int x, const int y) { + BLOCK_START("SDLFont::drawString") if (text.empty()) + { + BLOCK_END("SDLFont::drawString") return; + } Graphics *const g = dynamic_cast<Graphics *const>(graphics); @@ -260,11 +267,12 @@ void SDLFont::drawString(gcn::Graphics *const graphics, image->setAlpha(alpha); g->drawImage(image, x, y); } - + BLOCK_END("SDLFont::drawString") } void SDLFont::slowLogic() { + BLOCK_START("SDLFont::slowLogic") if (!mCleanTime) { mCleanTime = cur_time + CLEAN_TIME; @@ -274,6 +282,7 @@ void SDLFont::slowLogic() doClean(); mCleanTime = cur_time + CLEAN_TIME; } + BLOCK_END("SDLFont::slowLogic") } void SDLFont::createSDLTextChunk(SDLTextChunk *const chunk) |