summaryrefslogtreecommitdiff
path: root/src/gui/widgets/progressbar.cpp
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 /src/gui/widgets/progressbar.cpp
parent1400bf32a5de7864c1461e82da75645d93eed579 (diff)
downloadmanaverse-ca77e0ed33845eebc9dcd9d68a1be3b2bf4afaf1.tar.gz
manaverse-ca77e0ed33845eebc9dcd9d68a1be3b2bf4afaf1.tar.bz2
manaverse-ca77e0ed33845eebc9dcd9d68a1be3b2bf4afaf1.tar.xz
manaverse-ca77e0ed33845eebc9dcd9d68a1be3b2bf4afaf1.zip
Add batch drawing to progressbar.
Diffstat (limited to 'src/gui/widgets/progressbar.cpp')
-rw-r--r--src/gui/widgets/progressbar.cpp22
1 files changed, 15 insertions, 7 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)