aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMartin Kiewitz2009-10-31 22:50:05 +0000
committerMartin Kiewitz2009-10-31 22:50:05 +0000
commitfdc6524fb30b5e52114558adf619e3293d87a552 (patch)
treea5475d1d4eb4d820f10f70894ba348562c870209 /engines
parent4d2cfd544973e3d2840d325e0f0ab385bb53ca71 (diff)
downloadscummvm-rg350-fdc6524fb30b5e52114558adf619e3293d87a552.tar.gz
scummvm-rg350-fdc6524fb30b5e52114558adf619e3293d87a552.tar.bz2
scummvm-rg350-fdc6524fb30b5e52114558adf619e3293d87a552.zip
SCI/newgui: fixing kDisposeWindow so that reanimate is correctly called (fixes cels disappearing after removing windows)
svn-id: r45588
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/engine/kgraphics.cpp6
-rw-r--r--engines/sci/gui/gui.cpp4
-rw-r--r--engines/sci/gui/gui.h2
-rw-r--r--engines/sci/gui/gui_windowmgr.cpp4
-rw-r--r--engines/sci/gui/gui_windowmgr.h2
-rw-r--r--engines/sci/gui32/gui32.cpp2
-rw-r--r--engines/sci/gui32/gui32.h2
7 files changed, 12 insertions, 10 deletions
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index 9c855d49a9..033401f20e 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -917,9 +917,11 @@ reg_t kDrawCel(EngineState *s, int argc, reg_t *argv) {
reg_t kDisposeWindow(EngineState *s, int argc, reg_t *argv) {
int goner_nr = argv[0].toSint16();
- int arg2 = (argc != 2 || argv[2].toUint16() == 0 ? 0 : 1);
+ bool reanimate = false;
+ if ((argc == 2) && (argv[1].isNull()))
+ reanimate = true;
- s->_gui->disposeWindow(goner_nr, arg2);
+ s->_gui->disposeWindow(goner_nr, reanimate);
return s->r_acc;
}
diff --git a/engines/sci/gui/gui.cpp b/engines/sci/gui/gui.cpp
index d2794b34b9..98de5e397d 100644
--- a/engines/sci/gui/gui.cpp
+++ b/engines/sci/gui/gui.cpp
@@ -168,9 +168,9 @@ reg_t SciGui::newWindow(Common::Rect dims, Common::Rect restoreRect, uint16 styl
return make_reg(0, wnd->id);
}
-void SciGui::disposeWindow(uint16 windowPtr, int16 arg2) {
+void SciGui::disposeWindow(uint16 windowPtr, bool reanimate) {
GuiWindow *wnd = (GuiWindow *)_windowMgr->getPortById(windowPtr);
- _windowMgr->DisposeWindow(wnd, arg2);
+ _windowMgr->DisposeWindow(wnd, reanimate);
}
#define SCI_DISPLAY_MOVEPEN 100
diff --git a/engines/sci/gui/gui.h b/engines/sci/gui/gui.h
index 56b5e2fd7c..ca0073bc7c 100644
--- a/engines/sci/gui/gui.h
+++ b/engines/sci/gui/gui.h
@@ -70,7 +70,7 @@ public:
virtual int16 priorityToCoordinate(int16 priority);
virtual reg_t newWindow(Common::Rect dims, Common::Rect restoreRect, uint16 style, int16 priority, int16 colorPen, int16 colorBack, const char *title);
- virtual void disposeWindow(uint16 windowPtr, int16 arg2);
+ virtual void disposeWindow(uint16 windowPtr, bool reanimate);
virtual void display(const char *text, int argc, reg_t *argv);
diff --git a/engines/sci/gui/gui_windowmgr.cpp b/engines/sci/gui/gui_windowmgr.cpp
index ba0464b57b..b957abde14 100644
--- a/engines/sci/gui/gui_windowmgr.cpp
+++ b/engines/sci/gui/gui_windowmgr.cpp
@@ -250,11 +250,11 @@ void SciGuiWindowMgr::DrawWindow(GuiWindow *pWnd) {
_gfx->SetPort(oldport);
}
-void SciGuiWindowMgr::DisposeWindow(GuiWindow *pWnd, int16 arg2) {
+void SciGuiWindowMgr::DisposeWindow(GuiWindow *pWnd, bool reanimate) {
_gfx->SetPort(_wmgrPort);
_gfx->BitsRestore(pWnd->hSaved1);
_gfx->BitsRestore(pWnd->hSaved2);
- if (arg2)
+ if (!reanimate)
_gfx->BitsShow(pWnd->restoreRect);
else
_gui->graphRedrawBox(pWnd->restoreRect);
diff --git a/engines/sci/gui/gui_windowmgr.h b/engines/sci/gui/gui_windowmgr.h
index 01796b078b..09c8951717 100644
--- a/engines/sci/gui/gui_windowmgr.h
+++ b/engines/sci/gui/gui_windowmgr.h
@@ -43,7 +43,7 @@ public:
void EndUpdate(GuiWindow *wnd);
GuiWindow *NewWindow(const Common::Rect &dims, const Common::Rect *restoreRect, const char *title, uint16 style, int16 priority, bool draw);
void DrawWindow(GuiWindow *wnd);
- void DisposeWindow(GuiWindow *pWnd, int16 arg2);
+ void DisposeWindow(GuiWindow *pWnd, bool reanimate);
void UpdateWindow(GuiWindow *wnd);
GuiPort *getPortById(uint16 id) const { return _windowsById[id]; }
diff --git a/engines/sci/gui32/gui32.cpp b/engines/sci/gui32/gui32.cpp
index 8d6cabafaf..60652163f3 100644
--- a/engines/sci/gui32/gui32.cpp
+++ b/engines/sci/gui32/gui32.cpp
@@ -555,7 +555,7 @@ reg_t SciGui32::newWindow(Common::Rect dims, Common::Rect restoreRect, uint16 st
return make_reg(0, window->_ID);
}
-void SciGui32::disposeWindow(uint16 windowPtr, int16 arg2) {
+void SciGui32::disposeWindow(uint16 windowPtr, bool reanimate) {
GfxPort *goner;
GfxPort *pred;
diff --git a/engines/sci/gui32/gui32.h b/engines/sci/gui32/gui32.h
index 66c0772ff7..e7a5fb0908 100644
--- a/engines/sci/gui32/gui32.h
+++ b/engines/sci/gui32/gui32.h
@@ -50,7 +50,7 @@ public:
int16 priorityToCoordinate(int16 priority);
reg_t newWindow(Common::Rect dims, Common::Rect restoreRect, uint16 style, int16 priority, int16 colorPen, int16 colorBack, const char *title);
- void disposeWindow(uint16 windowPtr, int16 arg2);
+ void disposeWindow(uint16 windowPtr, bool reanimate);
void display(const char *text, int argc, reg_t *argv);