diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-12-01 18:41:00 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-12-01 22:58:18 +0300 |
commit | 212f1eaecc51ca4a112d0e1e22b4a02faec838f3 (patch) | |
tree | 51cb1b963b47f245d5540f1d977e8b977daaf177 /src | |
parent | ca77e0ed33845eebc9dcd9d68a1be3b2bf4afaf1 (diff) | |
download | ManaVerse-212f1eaecc51ca4a112d0e1e22b4a02faec838f3.tar.gz ManaVerse-212f1eaecc51ca4a112d0e1e22b4a02faec838f3.tar.bz2 ManaVerse-212f1eaecc51ca4a112d0e1e22b4a02faec838f3.tar.xz ManaVerse-212f1eaecc51ca4a112d0e1e22b4a02faec838f3.zip |
Add batch drawing to tab.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/widgets/tab.cpp | 28 | ||||
-rw-r--r-- | src/gui/widgets/tab.h | 4 |
2 files changed, 20 insertions, 12 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]); diff --git a/src/gui/widgets/tab.h b/src/gui/widgets/tab.h index 3589b2905..17237edd7 100644 --- a/src/gui/widgets/tab.h +++ b/src/gui/widgets/tab.h @@ -31,7 +31,7 @@ #include "localconsts.h" -class GraphicsVertexes; +class ImageCollection; class ImageRect; class Label; class Skin; @@ -151,7 +151,7 @@ class Tab : public gcn::BasicContainer, const gcn::Color *mFlashColor; const gcn::Color *mPlayerFlashColor; int mFlash; - GraphicsVertexes *mVertexes; + ImageCollection *mVertexes; bool mRedraw; int mMode; }; |