From fdc6524fb30b5e52114558adf619e3293d87a552 Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Sat, 31 Oct 2009 22:50:05 +0000 Subject: SCI/newgui: fixing kDisposeWindow so that reanimate is correctly called (fixes cels disappearing after removing windows) svn-id: r45588 --- engines/sci/engine/kgraphics.cpp | 6 ++++-- engines/sci/gui/gui.cpp | 4 ++-- engines/sci/gui/gui.h | 2 +- engines/sci/gui/gui_windowmgr.cpp | 4 ++-- engines/sci/gui/gui_windowmgr.h | 2 +- engines/sci/gui32/gui32.cpp | 2 +- engines/sci/gui32/gui32.h | 2 +- 7 files changed, 12 insertions(+), 10 deletions(-) (limited to 'engines') 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); -- cgit v1.2.3