From 04f47f060f94ec0e2dfc3cccf62cff167e0ecd68 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 22 Jun 2014 15:55:34 +0300 Subject: Reoder some text and image drawing for better batching. --- src/gui/gui.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/gui/gui.cpp') diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 17ad60ac0..779bec99c 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -467,12 +467,6 @@ void Gui::draw() && mMouseCursors && mCustomCursor && mMouseCursorAlpha > 0.0F) { const Image *const image = dragDrop.getItemImage(); - if (image) - { - const int posX = mouseX - (image->mBounds.w / 2); - const int posY = mouseY - (image->mBounds.h / 2); - mGraphics->drawImage(image, posX, posY); - } if (mGuiFont) { const std::string &str = dragDrop.getText(); @@ -484,7 +478,12 @@ void Gui::draw() mGuiFont->drawString(mGraphics, str, posX, posY); } } - + if (image) + { + const int posX = mouseX - (image->mBounds.w / 2); + const int posY = mouseY - (image->mBounds.h / 2); + mGraphics->drawImage(image, posX, posY); + } Image *const mouseCursor = mMouseCursors->get(mCursorType); if (mouseCursor) { -- cgit v1.2.3-60-g2f50