diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-05-25 18:07:58 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-05-25 18:07:58 +0300 |
commit | 9569e469a481076bdbc330377bf8445eb32fbaa6 (patch) | |
tree | 5afe0076206954d5f1649aedc5bcd9529757be14 /src/gui/widgets/shortcutcontainer.cpp | |
parent | 0bcc82648c49db05980e879a13baba2c76264bd4 (diff) | |
download | manaplus-9569e469a481076bdbc330377bf8445eb32fbaa6.tar.gz manaplus-9569e469a481076bdbc330377bf8445eb32fbaa6.tar.bz2 manaplus-9569e469a481076bdbc330377bf8445eb32fbaa6.tar.xz manaplus-9569e469a481076bdbc330377bf8445eb32fbaa6.zip |
Add safeDraw method into shortcutcontainer childs.
Diffstat (limited to 'src/gui/widgets/shortcutcontainer.cpp')
-rw-r--r-- | src/gui/widgets/shortcutcontainer.cpp | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/src/gui/widgets/shortcutcontainer.cpp b/src/gui/widgets/shortcutcontainer.cpp index 1ac9a9d69..e38b4c294 100644 --- a/src/gui/widgets/shortcutcontainer.cpp +++ b/src/gui/widgets/shortcutcontainer.cpp @@ -124,29 +124,30 @@ void ShortcutContainer::drawBackground(Graphics *g) { if (mBackgroundImg) { - if (isBatchDrawRenders(openGLMode)) - { - if (mRedraw) - { - mRedraw = false; - mVertexes->clear(); - for (unsigned i = 0; i < mMaxItems; i ++) - { - g->calcTileCollection(mVertexes, mBackgroundImg, - (i % mGridWidth) * mBoxWidth, - (i / mGridWidth) * mBoxHeight); - } - g->finalize(mVertexes); - } - g->drawTileCollection(mVertexes); - } - else + if (mRedraw) { + mRedraw = false; + mVertexes->clear(); for (unsigned i = 0; i < mMaxItems; i ++) { - g->drawImage(mBackgroundImg, (i % mGridWidth) * mBoxWidth, + g->calcTileCollection(mVertexes, mBackgroundImg, + (i % mGridWidth) * mBoxWidth, (i / mGridWidth) * mBoxHeight); } + g->finalize(mVertexes); + } + g->drawTileCollection(mVertexes); + } +} + +void ShortcutContainer::safeDrawBackground(Graphics *g) +{ + if (mBackgroundImg) + { + for (unsigned i = 0; i < mMaxItems; i ++) + { + g->drawImage(mBackgroundImg, (i % mGridWidth) * mBoxWidth, + (i / mGridWidth) * mBoxHeight); } } } |