summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-11-04 00:49:33 +0300
committerAndrei Karas <akaras@inbox.ru>2013-11-04 00:49:33 +0300
commitdb57c5be30ff61394b7fff8b0c7fa0101e66d6c0 (patch)
tree5bd683f3aeb3cfef458eaa45726f3e06c721b3b6 /src
parent1485b138c5b906546381f1ae4a91553a3c2fc6c4 (diff)
downloadplus-db57c5be30ff61394b7fff8b0c7fa0101e66d6c0.tar.gz
plus-db57c5be30ff61394b7fff8b0c7fa0101e66d6c0.tar.bz2
plus-db57c5be30ff61394b7fff8b0c7fa0101e66d6c0.tar.xz
plus-db57c5be30ff61394b7fff8b0c7fa0101e66d6c0.zip
improve checking for batch draw mode support by renderer.
Diffstat (limited to 'src')
-rw-r--r--src/gui/widgets/avatarlistbox.cpp2
-rw-r--r--src/gui/widgets/button.cpp2
-rw-r--r--src/gui/widgets/emotepage.cpp2
-rw-r--r--src/gui/widgets/popup.cpp2
-rw-r--r--src/gui/widgets/progressbar.cpp2
-rw-r--r--src/gui/widgets/scrollarea.cpp4
-rw-r--r--src/gui/widgets/shortcutcontainer.cpp2
-rw-r--r--src/gui/widgets/slider.cpp2
-rw-r--r--src/gui/widgets/tabs/tab.cpp2
-rw-r--r--src/gui/widgets/window.cpp2
-rw-r--r--src/gui/windows/equipmentwindow.cpp2
-rw-r--r--src/render/renderers.h2
-rw-r--r--src/touchmanager.cpp2
13 files changed, 15 insertions, 13 deletions
diff --git a/src/gui/widgets/avatarlistbox.cpp b/src/gui/widgets/avatarlistbox.cpp
index 664263518..123f7f843 100644
--- a/src/gui/widgets/avatarlistbox.cpp
+++ b/src/gui/widgets/avatarlistbox.cpp
@@ -113,7 +113,7 @@ void AvatarListBox::draw(gcn::Graphics *gcnGraphics)
// Draw the list elements
graphics->setColorAll(mForegroundColor, mForegroundColor2);
ImageCollection vertexes;
- const bool useCaching = openGLMode != RENDER_SAFE_OPENGL;
+ const bool useCaching = isBatchDrawRenders(openGLMode);
for (int i = 0, y = 0;
i < model->getNumberOfElements();
diff --git a/src/gui/widgets/button.cpp b/src/gui/widgets/button.cpp
index 0c71bf8bd..e1f95c334 100644
--- a/src/gui/widgets/button.cpp
+++ b/src/gui/widgets/button.cpp
@@ -471,7 +471,7 @@ void Button::draw(gcn::Graphics *graphics)
}
}
- if (openGLMode != RENDER_SAFE_OPENGL)
+ if (isBatchDrawRenders(openGLMode))
{
if (recalc)
{
diff --git a/src/gui/widgets/emotepage.cpp b/src/gui/widgets/emotepage.cpp
index ce61a865f..5af84e88d 100644
--- a/src/gui/widgets/emotepage.cpp
+++ b/src/gui/widgets/emotepage.cpp
@@ -73,7 +73,7 @@ void EmotePage::draw(gcn::Graphics *graphics)
unsigned int x = 0;
unsigned int y = 0;
- if (openGLMode != RENDER_SAFE_OPENGL)
+ if (isBatchDrawRenders(openGLMode))
{
if (mRedraw)
{
diff --git a/src/gui/widgets/popup.cpp b/src/gui/widgets/popup.cpp
index 774640fc3..7a43b2c47 100644
--- a/src/gui/widgets/popup.cpp
+++ b/src/gui/widgets/popup.cpp
@@ -101,7 +101,7 @@ void Popup::draw(gcn::Graphics *graphics)
if (mSkin)
{
- if (openGLMode != RENDER_SAFE_OPENGL)
+ if (isBatchDrawRenders(openGLMode))
{
if (mRedraw)
{
diff --git a/src/gui/widgets/progressbar.cpp b/src/gui/widgets/progressbar.cpp
index b0972a314..de30feeef 100644
--- a/src/gui/widgets/progressbar.cpp
+++ b/src/gui/widgets/progressbar.cpp
@@ -177,7 +177,7 @@ void ProgressBar::render(Graphics *graphics)
if (!mSkin)
return;
- if (openGLMode != RENDER_SAFE_OPENGL)
+ if (isBatchDrawRenders(openGLMode))
{
if (mRedraw || graphics->getRedraw())
{
diff --git a/src/gui/widgets/scrollarea.cpp b/src/gui/widgets/scrollarea.cpp
index b537dd2ed..948014cca 100644
--- a/src/gui/widgets/scrollarea.cpp
+++ b/src/gui/widgets/scrollarea.cpp
@@ -257,7 +257,7 @@ void ScrollArea::draw(gcn::Graphics *graphics)
BLOCK_START("ScrollArea::draw")
if (mVBarVisible || mHBarVisible)
{
- if (openGLMode != RENDER_SAFE_OPENGL)
+ if (isBatchDrawRenders(openGLMode))
{
if (!mOpaque)
updateCalcFlag(graphics);
@@ -358,7 +358,7 @@ void ScrollArea::drawFrame(gcn::Graphics *graphics)
updateCalcFlag(graphics);
- if (openGLMode != RENDER_SAFE_OPENGL)
+ if (isBatchDrawRenders(openGLMode))
{
if (mRedraw)
{
diff --git a/src/gui/widgets/shortcutcontainer.cpp b/src/gui/widgets/shortcutcontainer.cpp
index d7d9eae41..2fb5c4099 100644
--- a/src/gui/widgets/shortcutcontainer.cpp
+++ b/src/gui/widgets/shortcutcontainer.cpp
@@ -90,7 +90,7 @@ void ShortcutContainer::drawBackground(Graphics *g)
{
if (mBackgroundImg)
{
- if (openGLMode != RENDER_SAFE_OPENGL)
+ if (isBatchDrawRenders(openGLMode))
{
if (mRedraw)
{
diff --git a/src/gui/widgets/slider.cpp b/src/gui/widgets/slider.cpp
index 27b5fa43a..20fc6b21b 100644
--- a/src/gui/widgets/slider.cpp
+++ b/src/gui/widgets/slider.cpp
@@ -138,7 +138,7 @@ void Slider::draw(gcn::Graphics *graphics)
updateAlpha();
- if (openGLMode != RENDER_SAFE_OPENGL)
+ if (isBatchDrawRenders(openGLMode))
{
if (mRedraw || g->getRedraw())
{
diff --git a/src/gui/widgets/tabs/tab.cpp b/src/gui/widgets/tabs/tab.cpp
index 1f09f28fd..cdaa84d14 100644
--- a/src/gui/widgets/tabs/tab.cpp
+++ b/src/gui/widgets/tabs/tab.cpp
@@ -207,7 +207,7 @@ void Tab::draw(gcn::Graphics *graphics)
Graphics *const g = static_cast<Graphics*>(graphics);
// draw tab
- if (openGLMode != RENDER_SAFE_OPENGL)
+ if (isBatchDrawRenders(openGLMode))
{
const ImageRect &rect = skin->getBorder();
if (mRedraw || mode != mMode || g->getRedraw())
diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp
index 542b0141f..02f6cf35e 100644
--- a/src/gui/widgets/window.cpp
+++ b/src/gui/widgets/window.cpp
@@ -216,7 +216,7 @@ void Window::draw(gcn::Graphics *graphics)
Graphics *const g = static_cast<Graphics*>(graphics);
bool update = false;
- if (openGLMode != RENDER_SAFE_OPENGL)
+ if (isBatchDrawRenders(openGLMode))
{
if (mResizeHandles != mOldResizeHandles)
{
diff --git a/src/gui/windows/equipmentwindow.cpp b/src/gui/windows/equipmentwindow.cpp
index 688fb814a..9f1ed11bf 100644
--- a/src/gui/windows/equipmentwindow.cpp
+++ b/src/gui/windows/equipmentwindow.cpp
@@ -169,7 +169,7 @@ void EquipmentWindow::draw(gcn::Graphics *graphics)
gcn::Font *const font = getFont();
const int fontHeight = font->getHeight();
- if (openGLMode != RENDER_SAFE_OPENGL)
+ if (isBatchDrawRenders(openGLMode))
{
if (mLastRedraw)
{
diff --git a/src/render/renderers.h b/src/render/renderers.h
index 3ce1fdb81..3c79103c1 100644
--- a/src/render/renderers.h
+++ b/src/render/renderers.h
@@ -34,4 +34,6 @@ enum RenderType
RenderType intToRenderType(const int mode);
+#define isBatchDrawRenders(val) (val) != RENDER_SAFE_OPENGL
+
#endif // RENDER_RENDERERS_H
diff --git a/src/touchmanager.cpp b/src/touchmanager.cpp
index 2620e9a17..a60680407 100644
--- a/src/touchmanager.cpp
+++ b/src/touchmanager.cpp
@@ -186,7 +186,7 @@ void TouchManager::clear()
void TouchManager::draw()
{
- if (openGLMode != RENDER_SAFE_OPENGL)
+ if (isBatchDrawRenders(openGLMode))
{
if (mRedraw)
{