diff --git a/engines/sci/graphics/gui.cpp b/engines/sci/graphics/gui.cpp index e0cb16965a6..dc449ff1826 100644 --- a/engines/sci/graphics/gui.cpp +++ b/engines/sci/graphics/gui.cpp @@ -57,7 +57,7 @@ SciGui::SciGui(EngineState *state, Screen *screen, SciPalette *palette, Cursor * _text = new Text(_s->resMan, _gfx, _screen); _windowMgr = new WindowMgr(this, _screen, _gfx, _text); _controls = new Controls(_s->_segMan, _gfx, _text); - _menu = new Menu(_s->_event, _s->_segMan, _gfx, _text, _screen, _cursor); + _menu = new Menu(_s->_event, _s->_segMan, this, _gfx, _text, _screen, _cursor); } SciGui::SciGui() { @@ -337,7 +337,7 @@ void SciGui::drawMenuBar(bool clear) { void SciGui::menuReset() { delete _menu; - _menu = new Menu(_s->_event, _s->_segMan, _gfx, _text, _screen, _cursor); + _menu = new Menu(_s->_event, _s->_segMan, this, _gfx, _text, _screen, _cursor); } void SciGui::menuAdd(Common::String title, Common::String content, reg_t contentVmPtr) { diff --git a/engines/sci/graphics/menu.cpp b/engines/sci/graphics/menu.cpp index 705f5774e18..483161c835a 100644 --- a/engines/sci/graphics/menu.cpp +++ b/engines/sci/graphics/menu.cpp @@ -32,6 +32,7 @@ #include "sci/engine/state.h" #include "sci/graphics/helpers.h" #include "sci/graphics/gfx.h" +#include "sci/graphics/animate.h" #include "sci/graphics/cursor.h" #include "sci/graphics/font.h" #include "sci/graphics/text.h" @@ -40,8 +41,8 @@ namespace Sci { -Menu::Menu(SciEvent *event, SegManager *segMan, Gfx *gfx, Text *text, Screen *screen, Cursor *cursor) - : _event(event), _segMan(segMan), _gfx(gfx), _text(text), _screen(screen), _cursor(cursor) { +Menu::Menu(SciEvent *event, SegManager *segMan, SciGui *gui, Gfx *gfx, Text *text, Screen *screen, Cursor *cursor) + : _event(event), _segMan(segMan), _gui(gui), _gfx(gfx), _text(text), _screen(screen), _cursor(cursor) { _listCount = 0; // We actually set active item in here and remember last selection of the user @@ -408,9 +409,8 @@ reg_t Menu::select(reg_t eventObject) { if (!_menuSaveHandle.isNull()) { _gfx->BitsRestore(_menuSaveHandle); - _gfx->BitsShow(_menuRect); + _gui->graphRedrawBox(_menuRect); _menuSaveHandle = NULL_REG; - // TODO: Change to ReAnimate() } if (!_barSaveHandle.isNull()) { _gfx->BitsRestore(_barSaveHandle); @@ -472,8 +472,7 @@ void Menu::drawMenu(uint16 oldMenuId, uint16 newMenuId) { // Remove menu, if one is displayed if (!_menuSaveHandle.isNull()) { _gfx->BitsRestore(_menuSaveHandle); - _gfx->BitsShow(_menuRect); - // TODO: Change to ReAnimate() + _gui->graphRedrawBox(_menuRect); } // First calculate rect of menu and also invert old and new menu text diff --git a/engines/sci/graphics/menu.h b/engines/sci/graphics/menu.h index 65e03b00eba..f594bdb496e 100644 --- a/engines/sci/graphics/menu.h +++ b/engines/sci/graphics/menu.h @@ -78,7 +78,7 @@ typedef Common::List GuiMenuItemList; class Menu { public: - Menu(SciEvent *event, SegManager *segMan, Gfx *gfx, Text *text, Screen *screen, Cursor *cursor); + Menu(SciEvent *event, SegManager *segMan, SciGui *gui, Gfx *gfx, Text *text, Screen *screen, Cursor *cursor); ~Menu(); void reset(); @@ -104,6 +104,7 @@ private: SciEvent *_event; SegManager *_segMan; + SciGui *_gui; Gfx *_gfx; Text *_text; Screen *_screen;