diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-11-04 00:49:33 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-11-04 00:49:33 +0300 |
commit | db57c5be30ff61394b7fff8b0c7fa0101e66d6c0 (patch) | |
tree | 5bd683f3aeb3cfef458eaa45726f3e06c721b3b6 /src | |
parent | 1485b138c5b906546381f1ae4a91553a3c2fc6c4 (diff) | |
download | manaverse-db57c5be30ff61394b7fff8b0c7fa0101e66d6c0.tar.gz manaverse-db57c5be30ff61394b7fff8b0c7fa0101e66d6c0.tar.bz2 manaverse-db57c5be30ff61394b7fff8b0c7fa0101e66d6c0.tar.xz manaverse-db57c5be30ff61394b7fff8b0c7fa0101e66d6c0.zip |
improve checking for batch draw mode support by renderer.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/widgets/avatarlistbox.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/button.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/emotepage.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/popup.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/progressbar.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/scrollarea.cpp | 4 | ||||
-rw-r--r-- | src/gui/widgets/shortcutcontainer.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/slider.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/tabs/tab.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/window.cpp | 2 | ||||
-rw-r--r-- | src/gui/windows/equipmentwindow.cpp | 2 | ||||
-rw-r--r-- | src/render/renderers.h | 2 | ||||
-rw-r--r-- | src/touchmanager.cpp | 2 |
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) { |