summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-12-01 19:33:45 +0300
committerAndrei Karas <akaras@inbox.ru>2012-12-01 22:58:18 +0300
commit5238a8fd782d5dc703aa788126748050f0cd604e (patch)
tree45a8b26f6570057c071c586914ce4face58db643 /src/gui
parent2cdc186cf733795f73c30f9c1d437562d6be6eb8 (diff)
downloadmv-5238a8fd782d5dc703aa788126748050f0cd604e.tar.gz
mv-5238a8fd782d5dc703aa788126748050f0cd604e.tar.bz2
mv-5238a8fd782d5dc703aa788126748050f0cd604e.tar.xz
mv-5238a8fd782d5dc703aa788126748050f0cd604e.zip
Add batch drawing to popup.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/widgets/popup.cpp24
-rw-r--r--src/gui/widgets/popup.h4
2 files changed, 17 insertions, 11 deletions
diff --git a/src/gui/widgets/popup.cpp b/src/gui/widgets/popup.cpp
index 03beec766..ee00a07d2 100644
--- a/src/gui/widgets/popup.cpp
+++ b/src/gui/widgets/popup.cpp
@@ -43,7 +43,7 @@ Popup::Popup(const std::string &name,
mMinHeight(40),
mMaxWidth(mainGraphics->mWidth),
mMaxHeight(mainGraphics->mHeight),
- mVertexes(new GraphicsVertexes()),
+ mVertexes(new ImageCollection),
mRedraw(true)
{
logger->log("Popup::Popup(\"%s\")", name.c_str());
@@ -105,16 +105,22 @@ void Popup::draw(gcn::Graphics *graphics)
BLOCK_START("Popup::draw")
Graphics *const g = static_cast<Graphics*>(graphics);
- if (mRedraw)
+ if (openGLMode != 2)
{
- mRedraw = false;
- g->calcWindow(mVertexes, 0, 0, getWidth(),
- getHeight(), mSkin->getBorder());
- }
-
- g->drawImageRect2(mVertexes, mSkin->getBorder());
+ if (mRedraw)
+ {
+ mRedraw = false;
+ mVertexes->clear();
+ g->calcWindow(mVertexes, 0, 0, getWidth(),
+ getHeight(), mSkin->getBorder());
+ }
-// g->drawImageRect(0, 0, getWidth(), getHeight(), mSkin->getBorder());
+ g->drawTile(mVertexes);
+ }
+ else
+ {
+ g->drawImageRect(0, 0, getWidth(), getHeight(), mSkin->getBorder());
+ }
drawChildren(graphics);
BLOCK_END("Popup::draw")
diff --git a/src/gui/widgets/popup.h b/src/gui/widgets/popup.h
index bc2acffe3..ac4cc6e94 100644
--- a/src/gui/widgets/popup.h
+++ b/src/gui/widgets/popup.h
@@ -30,7 +30,7 @@
#include <guichan/mouselistener.hpp>
#include <guichan/widgetlistener.hpp>
-class GraphicsVertexes;
+class ImageCollection;
class Skin;
class WindowContainer;
@@ -177,7 +177,7 @@ class Popup : public Container, public gcn::MouseListener,
int mPadding; /**< Holds the padding of the popup. */
Skin *mSkin; /**< Skin in use by this popup */
- GraphicsVertexes *mVertexes;
+ ImageCollection *mVertexes;
bool mRedraw;
};