aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2009-10-05 18:00:12 +0000
committerWillem Jan Palenstijn2009-10-05 18:00:12 +0000
commit2a06f341811da796f28ae07dc03cb54e5c2850fe (patch)
tree882b754fc4cabf1644cbb6530dd777c96569f7ae
parentac9faddd1749514d188857cd2df332deb029da8e (diff)
downloadscummvm-rg350-2a06f341811da796f28ae07dc03cb54e5c2850fe.tar.gz
scummvm-rg350-2a06f341811da796f28ae07dc03cb54e5c2850fe.tar.bz2
scummvm-rg350-2a06f341811da796f28ae07dc03cb54e5c2850fe.zip
SCI: Move restoreRect adjustment from DrawWindow to NewWindow
svn-id: r44668
-rw-r--r--engines/sci/gui/gui_windowmgr.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/engines/sci/gui/gui_windowmgr.cpp b/engines/sci/gui/gui_windowmgr.cpp
index ab355ba741..756b327a7b 100644
--- a/engines/sci/gui/gui_windowmgr.cpp
+++ b/engines/sci/gui/gui_windowmgr.cpp
@@ -172,6 +172,15 @@ GuiWindow *SciGuiWindowMgr::NewWindow(const Common::Rect &dims, const Common::Re
pwnd->rect.top + pwnd->dims.top - oldtop);
if (restoreRect == 0)
pwnd->restoreRect = pwnd->dims;
+
+ // CHECKME: Is this 'kTransparent' check necessary?
+ // The shadow is already drawn if !(wndStyle & (kUser | kNoFrame)).
+ if (!(pwnd->wndStyle & (kTransparent | kUser | kNoFrame))) {
+ // The shadow is drawn slightly outside the window.
+ // Enlarge restoreRect to cover that.
+ pwnd->restoreRect.bottom++;
+ pwnd->restoreRect.right++;
+ }
if (draw)
DrawWindow(pwnd);
@@ -191,12 +200,6 @@ void SciGuiWindowMgr::DrawWindow(GuiWindow *pWnd) {
GuiPort *oldport = _gfx->SetPort(_wmgrPort);
_gfx->PenColor(0);
if ((wndStyle & kTransparent) == 0) {
- // Store the shadow, if it exists
- if (!(wndStyle & kUser) && !(wndStyle & kNoFrame)) {
- pWnd->restoreRect.bottom++;
- pWnd->restoreRect.right++;
- }
-
pWnd->hSaved1 = _gfx->SaveBits(pWnd->restoreRect, 1);
if (pWnd->uSaveFlag & 2) {
pWnd->hSaved2 = _gfx->SaveBits(pWnd->restoreRect, 2);