summaryrefslogtreecommitdiff
path: root/src/gui/widgets/tab.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-12-01 18:41:00 +0300
committerAndrei Karas <akaras@inbox.ru>2012-12-01 22:58:18 +0300
commit212f1eaecc51ca4a112d0e1e22b4a02faec838f3 (patch)
tree51cb1b963b47f245d5540f1d977e8b977daaf177 /src/gui/widgets/tab.cpp
parentca77e0ed33845eebc9dcd9d68a1be3b2bf4afaf1 (diff)
downloadmanaplus-212f1eaecc51ca4a112d0e1e22b4a02faec838f3.tar.gz
manaplus-212f1eaecc51ca4a112d0e1e22b4a02faec838f3.tar.bz2
manaplus-212f1eaecc51ca4a112d0e1e22b4a02faec838f3.tar.xz
manaplus-212f1eaecc51ca4a112d0e1e22b4a02faec838f3.zip
Add batch drawing to tab.
Diffstat (limited to 'src/gui/widgets/tab.cpp')
-rw-r--r--src/gui/widgets/tab.cpp28
1 files changed, 18 insertions, 10 deletions
diff --git a/src/gui/widgets/tab.cpp b/src/gui/widgets/tab.cpp
index 6747b19e0..fdcace308 100644
--- a/src/gui/widgets/tab.cpp
+++ b/src/gui/widgets/tab.cpp
@@ -68,7 +68,7 @@ Tab::Tab(const Widget2 *const widget) :
mTabSelectedColor(&getThemeColor(Theme::TAB_SELECTED)),
mFlashColor(&getThemeColor(Theme::TAB_FLASH)),
mPlayerFlashColor(&getThemeColor(Theme::TAB_PLAYER_FLASH)),
- mVertexes(new GraphicsVertexes()),
+ mVertexes(new ImageCollection),
mRedraw(true),
mMode(0)
{
@@ -192,18 +192,26 @@ void Tab::draw(gcn::Graphics *graphics)
updateAlpha();
- ImageRect &rect = skin->getBorder();
// draw tab
- if (mRedraw || mode != mMode
- || static_cast<Graphics*>(graphics)->getRedraw())
+ if (openGLMode != 2)
{
- mMode = mode;
- mRedraw = false;
- static_cast<Graphics*>(graphics)->calcWindow(mVertexes, 0, 0,
- getWidth(), getHeight(), rect);
- }
+ ImageRect &rect = skin->getBorder();
+ if (mRedraw || mode != mMode
+ || static_cast<Graphics*>(graphics)->getRedraw())
+ {
+ mMode = mode;
+ mRedraw = false;
+ static_cast<Graphics*>(graphics)->calcWindow(mVertexes, 0, 0,
+ getWidth(), getHeight(), rect);
+ }
- static_cast<Graphics*>(graphics)->drawImageRect2(mVertexes, rect);
+ static_cast<Graphics*>(graphics)->drawTile(mVertexes);
+ }
+ else
+ {
+ static_cast<Graphics*>(graphics)->
+ drawImageRect(0, 0, getWidth(), getHeight(), skin->getBorder());
+ }
// static_cast<Graphics*>(graphics)->
// drawImageRect(0, 0, getWidth(), getHeight(), tabImg[mode]);