From 7eab9ea57500ee7010fc33c8f825e3e70ef85cbd Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 29 Aug 2013 17:42:08 +0300 Subject: fix some more missign checks. --- src/gui/widgets/popup.cpp | 29 ++++++++++++++++------------- src/gui/widgets/tab.cpp | 35 +++++++++++++++++++---------------- src/localconsts.h | 2 +- 3 files changed, 36 insertions(+), 30 deletions(-) diff --git a/src/gui/widgets/popup.cpp b/src/gui/widgets/popup.cpp index 1372c89e2..438b5db29 100644 --- a/src/gui/widgets/popup.cpp +++ b/src/gui/widgets/popup.cpp @@ -101,23 +101,26 @@ void Popup::draw(gcn::Graphics *graphics) BLOCK_START("Popup::draw") Graphics *const g = static_cast(graphics); - if (openGLMode != 2) + if (mSkin) { - if (mRedraw) + if (openGLMode != 2) + { + if (mRedraw) + { + mRedraw = false; + mVertexes->clear(); + g->calcWindow(mVertexes, 0, 0, + mDimension.width, mDimension.height, + mSkin->getBorder()); + } + + g->drawTile(mVertexes); + } + else { - mRedraw = false; - mVertexes->clear(); - g->calcWindow(mVertexes, 0, 0, - mDimension.width, mDimension.height, + g->drawImageRect(0, 0, mDimension.width, mDimension.height, mSkin->getBorder()); } - - g->drawTile(mVertexes); - } - else - { - g->drawImageRect(0, 0, mDimension.width, mDimension.height, - mSkin->getBorder()); } drawChildren(graphics); diff --git a/src/gui/widgets/tab.cpp b/src/gui/widgets/tab.cpp index 99a69897d..ac91442fb 100644 --- a/src/gui/widgets/tab.cpp +++ b/src/gui/widgets/tab.cpp @@ -218,25 +218,28 @@ void Tab::draw(gcn::Graphics *graphics) Graphics *const g = static_cast(graphics); - // draw tab - if (openGLMode != 2) + if (skin) { - const ImageRect &rect = skin->getBorder(); - if (mRedraw || mode != mMode || g->getRedraw()) + // draw tab + if (openGLMode != 2) { - mMode = mode; - mRedraw = false; - mVertexes->clear(); - g->calcWindow(mVertexes, 0, 0, - mDimension.width, mDimension.height, rect); - } + const ImageRect &rect = skin->getBorder(); + if (mRedraw || mode != mMode || g->getRedraw()) + { + mMode = mode; + mRedraw = false; + mVertexes->clear(); + g->calcWindow(mVertexes, 0, 0, + mDimension.width, mDimension.height, rect); + } - g->drawTile(mVertexes); - } - else - { - g->drawImageRect(0, 0, - mDimension.width, mDimension.height, skin->getBorder()); + g->drawTile(mVertexes); + } + else + { + g->drawImageRect(0, 0, + mDimension.width, mDimension.height, skin->getBorder()); + } } if (mImage) diff --git a/src/localconsts.h b/src/localconsts.h index 436fc987e..205920746 100644 --- a/src/localconsts.h +++ b/src/localconsts.h @@ -103,6 +103,6 @@ // #define DEBUG_SDL_SURFACES 1 // use file access fuzzer -#define USE_FUZZER 1 +// #define USE_FUZZER 1 #include "utils/perfomance.h" -- cgit v1.2.3-70-g09d2