summaryrefslogtreecommitdiff
path: root/src/gui/widgets/progressbar.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-03-26 05:07:12 +0200
committerAndrei Karas <akaras@inbox.ru>2011-03-26 05:50:44 +0200
commit8403dcf857c9cc639e8162edd5d4df4af07274bc (patch)
tree2f127213e0df4691b06c549a8f20b3d5225b9220 /src/gui/widgets/progressbar.h
parentfc24490f1ecd186f3c294915fadee62c3053d841 (diff)
downloadmanaverse-8403dcf857c9cc639e8162edd5d4df4af07274bc.tar.gz
manaverse-8403dcf857c9cc639e8162edd5d4df4af07274bc.tar.bz2
manaverse-8403dcf857c9cc639e8162edd5d4df4af07274bc.tar.xz
manaverse-8403dcf857c9cc639e8162edd5d4df4af07274bc.zip
Precalculation vertexes for improving draw speed.
Implemented in Software and fast OpenGL backends. Not all controls using this mode because some limitations. Known issue: impossible compile without opengl. Will be fixed in next commits.
Diffstat (limited to 'src/gui/widgets/progressbar.h')
-rw-r--r--src/gui/widgets/progressbar.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/gui/widgets/progressbar.h b/src/gui/widgets/progressbar.h
index ba10f3027..52a26ddac 100644
--- a/src/gui/widgets/progressbar.h
+++ b/src/gui/widgets/progressbar.h
@@ -27,7 +27,10 @@
#include <string>
+#include <guichan/widgetlistener.hpp>
+
class Graphics;
+class GraphicsVertexes;
class ImageRect;
/**
@@ -35,7 +38,7 @@ class ImageRect;
*
* \ingroup GUI
*/
-class ProgressBar : public gcn::Widget
+class ProgressBar : public gcn::Widget, public gcn::WidgetListener
{
public:
/**
@@ -117,8 +120,20 @@ class ProgressBar : public gcn::Widget
*/
static void render(Graphics *graphics, const gcn::Rectangle &area,
const gcn::Color &color, float progress,
+ const std::string &text,
+ GraphicsVertexes *vert, bool *redraw);
+
+ /**
+ * Renders a progressbar with the given properties.
+ */
+ static void render(Graphics *graphics, const gcn::Rectangle &area,
+ const gcn::Color &color, float progress,
const std::string &text = "");
+ void widgetResized(const gcn::Event &event);
+
+ void widgetMoved(const gcn::Event &event);
+
private:
float mProgress, mProgressToGo;
bool mSmoothProgress;
@@ -129,6 +144,8 @@ class ProgressBar : public gcn::Widget
bool mSmoothColorChange;
std::string mText;
+ GraphicsVertexes *mVertexes;
+ bool mRedraw;
static ImageRect mBorder;
static int mInstances;