aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVicent Marti2008-07-21 21:23:23 +0000
committerVicent Marti2008-07-21 21:23:23 +0000
commit7071a95a5753861bce494f1e7906e033ce8bd7c4 (patch)
tree3b13f55b2067d8aa7e860c6e381e802f8bd35aff
parentc7b624d91eaa0444fdc454dfb5c5dd7beaa56bcc (diff)
downloadscummvm-rg350-7071a95a5753861bce494f1e7906e033ce8bd7c4.tar.gz
scummvm-rg350-7071a95a5753861bce494f1e7906e033ce8bd7c4.tar.bz2
scummvm-rg350-7071a95a5753861bce494f1e7906e033ce8bd7c4.zip
Fixed several segfaults and graphical glitches when drawing at low resolutions. Fixed dialog stack redrawing.
svn-id: r33182
-rw-r--r--graphics/VectorRenderer.cpp4
-rw-r--r--gui/ThemeRenderer.h5
-rw-r--r--gui/newgui.cpp8
3 files changed, 8 insertions, 9 deletions
diff --git a/graphics/VectorRenderer.cpp b/graphics/VectorRenderer.cpp
index 9b460e1ac0..639039fe28 100644
--- a/graphics/VectorRenderer.cpp
+++ b/graphics/VectorRenderer.cpp
@@ -440,8 +440,8 @@ drawRoundedSquare(int x, int y, int r, int w, int h) {
w <= 0 || h <= 0 || x < 0 || y < 0)
return;
- while ((r << 1) > w || (r << 1) > h)
- r <<= 1;
+ if ((r << 1) > w || (r << 1) > h)
+ r = MIN(w >> 1, h >> 1);
if (Base::_fillMode != kFillDisabled && Base::_shadowOffset
&& x + w + Base::_shadowOffset < Base::_activeSurface->w
diff --git a/gui/ThemeRenderer.h b/gui/ThemeRenderer.h
index 134e6fba87..abaff44c55 100644
--- a/gui/ThemeRenderer.h
+++ b/gui/ThemeRenderer.h
@@ -223,10 +223,7 @@ public:
/** Since the rendering pipeline changes, closing all dialogs causes no effect
TODO: remove this from the original GUI::Theme API */
- void closeAllDialogs() {
- memset(_backBuffer->pixels, 0, _backBuffer->w * _backBuffer->h * _backBuffer->bytesPerPixel);
-
- }
+ void closeAllDialogs() {}
/** Drawing area has been removed: it was too hackish. A workaround is on the works.
TODO: finish the workaround for the credits dialog
diff --git a/gui/newgui.cpp b/gui/newgui.cpp
index acbf14cae2..b9b4fa028f 100644
--- a/gui/newgui.cpp
+++ b/gui/newgui.cpp
@@ -195,15 +195,17 @@ void NewGui::redraw() {
case kRedrawFull:
case kRedrawTopDialog:
_theme->clearAll();
- _theme->closeAllDialogs();
+ _theme->openDialog(true);
for (i = 0; i < _dialogStack.size() - 1; i++) {
- _dialogStack[i]->drawDialog();
+ _dialogStack[i]->drawDialog();
}
+ _theme->finishBuffering();
+ _theme->updateScreen();
+
case kRedrawOpenDialog:
_theme->openDialog(true);
- //_theme->startBuffering();
_dialogStack.top()->drawDialog();
_theme->finishBuffering();
break;