aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorMartin Kiewitz2010-02-09 18:24:54 +0000
committerMartin Kiewitz2010-02-09 18:24:54 +0000
commita4039182ce8ce21b33b13d3df675113325f555b9 (patch)
tree15163f5ae8a0eb014437923e5840330fa875b7c6 /engines/sci
parenta4f46767d9f2a279b98e8fe33011e75318ab9ebc (diff)
downloadscummvm-rg350-a4039182ce8ce21b33b13d3df675113325f555b9.tar.gz
scummvm-rg350-a4039182ce8ce21b33b13d3df675113325f555b9.tar.bz2
scummvm-rg350-a4039182ce8ce21b33b13d3df675113325f555b9.zip
SCI: also reset some variables inside reset(), so we dont error() out in lsl2 and other games that reset game engine inbetween
svn-id: r48015
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/graphics/menu.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/engines/sci/graphics/menu.cpp b/engines/sci/graphics/menu.cpp
index b5f4335b59..beeed27885 100644
--- a/engines/sci/graphics/menu.cpp
+++ b/engines/sci/graphics/menu.cpp
@@ -46,15 +46,11 @@ namespace Sci {
GfxMenu::GfxMenu(SciEvent *event, SegManager *segMan, SciGui *gui, GfxPorts *ports, GfxPaint16 *paint16, GfxText16 *text16, GfxScreen *screen, GfxCursor *cursor)
: _event(event), _segMan(segMan), _gui(gui), _ports(ports), _paint16(paint16), _text16(text16), _screen(screen), _cursor(cursor) {
- _listCount = 0;
- // We actually set active item in here and remember last selection of the user
- // sierra sci always defaulted to first item every time menu was called via ESC, we dont follow that logic
- _curMenuId = 1;
- _curItemId = 1;
-
_menuSaveHandle = NULL_REG;
_barSaveHandle = NULL_REG;
_oldPort = NULL;
+
+ reset();
}
GfxMenu::~GfxMenu() {
@@ -65,6 +61,12 @@ GfxMenu::~GfxMenu() {
void GfxMenu::reset() {
_list.clear();
_itemList.clear();
+ _listCount = 0;
+
+ // We actually set active item in here and remember last selection of the user
+ // sierra sci always defaulted to first item every time menu was called via ESC, we dont follow that logic
+ _curMenuId = 1;
+ _curItemId = 1;
}
void GfxMenu::kernelAddEntry(Common::String title, Common::String content, reg_t contentVmPtr) {