diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-05-25 22:07:05 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-05-25 22:07:05 +0300 |
commit | 2b681b167c1d307f550a8dc7b56a94d13886827e (patch) | |
tree | 8ab235ab55893ce4c97a34babd83d71750082de9 /src/gui/widgets/playerbox.cpp | |
parent | 1f4410ab9ac4064ff0cfb0fd31b4e942bee82277 (diff) | |
download | manaverse-2b681b167c1d307f550a8dc7b56a94d13886827e.tar.gz manaverse-2b681b167c1d307f550a8dc7b56a94d13886827e.tar.bz2 manaverse-2b681b167c1d307f550a8dc7b56a94d13886827e.tar.xz manaverse-2b681b167c1d307f550a8dc7b56a94d13886827e.zip |
Add method safeDrawFrame for safe OpenGL renderer.
Diffstat (limited to 'src/gui/widgets/playerbox.cpp')
-rw-r--r-- | src/gui/widgets/playerbox.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gui/widgets/playerbox.cpp b/src/gui/widgets/playerbox.cpp index 09ebe610d..e69d3e35b 100644 --- a/src/gui/widgets/playerbox.cpp +++ b/src/gui/widgets/playerbox.cpp @@ -160,6 +160,23 @@ void PlayerBox::drawFrame(Graphics *graphics) BLOCK_END("PlayerBox::drawFrame") } +void PlayerBox::safeDrawFrame(Graphics *graphics) +{ + BLOCK_START("PlayerBox::drawFrame") + if (mDrawBackground) + { + const int bs = mFrameSize * 2; + const int w = mDimension.width + bs; + const int h = mDimension.height + bs; + + if (!mSelected) + graphics->drawImageRect(0, 0, w, h, mBackground); + else + graphics->drawImageRect(0, 0, w, h, mSelectedBackground); + } + BLOCK_END("PlayerBox::drawFrame") +} + void PlayerBox::mouseReleased(MouseEvent& event) { if (event.getButton() == MouseButton::LEFT) |