summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-12-01 18:31:21 +0300
committerAndrei Karas <akaras@inbox.ru>2012-12-01 22:58:18 +0300
commitca77e0ed33845eebc9dcd9d68a1be3b2bf4afaf1 (patch)
tree18d26d217adb645c94fdb527c1f4819aa20ce255
parent1400bf32a5de7864c1461e82da75645d93eed579 (diff)
downloadplus-ca77e0ed33845eebc9dcd9d68a1be3b2bf4afaf1.tar.gz
plus-ca77e0ed33845eebc9dcd9d68a1be3b2bf4afaf1.tar.bz2
plus-ca77e0ed33845eebc9dcd9d68a1be3b2bf4afaf1.tar.xz
plus-ca77e0ed33845eebc9dcd9d68a1be3b2bf4afaf1.zip
Add batch drawing to progressbar.
-rw-r--r--src/gui/widgets/progressbar.cpp22
-rw-r--r--src/gui/widgets/progressbar.h4
2 files changed, 17 insertions, 9 deletions
diff --git a/src/gui/widgets/progressbar.cpp b/src/gui/widgets/progressbar.cpp
index ef3aa19a0..babf3f0e2 100644
--- a/src/gui/widgets/progressbar.cpp
+++ b/src/gui/widgets/progressbar.cpp
@@ -50,7 +50,7 @@ ProgressBar::ProgressBar(const Widget2 *const widget, float progress,
mSmoothProgress(true),
mProgressPalette(color),
mSmoothColorChange(true),
- mVertexes(new GraphicsVertexes()),
+ mVertexes(new ImageCollection),
mRedraw(true),
mPadding(2),
mFillPadding(3)
@@ -185,14 +185,22 @@ void ProgressBar::render(Graphics *graphics)
gcn::Font *const oldFont = graphics->getFont();
const gcn::Color oldColor = graphics->getColor();
- if (mRedraw || graphics->getRedraw())
+ if (openGLMode != 2)
{
- mRedraw = false;
- graphics->calcWindow(mVertexes, 0, 0,
- mDimension.width, mDimension.height, mSkin->getBorder());
- }
+ if (mRedraw || graphics->getRedraw())
+ {
+ mRedraw = false;
+ graphics->calcWindow(mVertexes, 0, 0,
+ mDimension.width, mDimension.height, mSkin->getBorder());
+ }
- graphics->drawImageRect2(mVertexes, mSkin->getBorder());
+ graphics->drawTile(mVertexes);
+ }
+ else
+ {
+ graphics->drawImageRect(0, 0, mDimension.width, mDimension.height,
+ mSkin->getBorder());
+ }
// The bar
if (mProgress > 0)
diff --git a/src/gui/widgets/progressbar.h b/src/gui/widgets/progressbar.h
index 599292da5..fe03ac7e1 100644
--- a/src/gui/widgets/progressbar.h
+++ b/src/gui/widgets/progressbar.h
@@ -33,7 +33,7 @@
#include "localconsts.h"
class Graphics;
-class GraphicsVertexes;
+class ImageCollection;
class ImageRect;
class Skin;
@@ -149,7 +149,7 @@ class ProgressBar final : public gcn::Widget,
bool mSmoothColorChange;
std::string mText;
- GraphicsVertexes *mVertexes;
+ ImageCollection *mVertexes;
bool mRedraw;
unsigned int mPadding;
unsigned int mFillPadding;