diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-03-26 05:07:12 +0200 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-03-26 05:50:44 +0200 |
commit | 8403dcf857c9cc639e8162edd5d4df4af07274bc (patch) | |
tree | 2f127213e0df4691b06c549a8f20b3d5225b9220 /src/gui/widgets/progressbar.h | |
parent | fc24490f1ecd186f3c294915fadee62c3053d841 (diff) | |
download | manaverse-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.h | 19 |
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; |