aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorMartin Kiewitz2010-02-01 10:16:45 +0000
committerMartin Kiewitz2010-02-01 10:16:45 +0000
commita20f4ef1fcd034f3f6b1e81078736c976ebf5f7c (patch)
tree9761e83cf275b09fabac2798bcf9b50f8ca9ad38 /engines/sci
parent845c245ff37fc5f269a26a6f57eb55e66b6f1530 (diff)
downloadscummvm-rg350-a20f4ef1fcd034f3f6b1e81078736c976ebf5f7c.tar.gz
scummvm-rg350-a20f4ef1fcd034f3f6b1e81078736c976ebf5f7c.tar.bz2
scummvm-rg350-a20f4ef1fcd034f3f6b1e81078736c976ebf5f7c.zip
SCI: implemented reset for GfxMenu, not recreating object anymore
svn-id: r47793
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/engine/game.cpp5
-rw-r--r--engines/sci/graphics/gui.cpp6
-rw-r--r--engines/sci/graphics/gui.h1
-rw-r--r--engines/sci/graphics/menu.cpp6
4 files changed, 9 insertions, 9 deletions
diff --git a/engines/sci/engine/game.cpp b/engines/sci/engine/game.cpp
index b209dfc608..db2d776fbf 100644
--- a/engines/sci/engine/game.cpp
+++ b/engines/sci/engine/game.cpp
@@ -35,6 +35,7 @@
#include "sci/engine/kernel_types.h"
#include "sci/engine/message.h"
#include "sci/graphics/gui.h"
+#include "sci/graphics/menu.h"
#include "sci/sound/music.h"
namespace Sci {
@@ -270,8 +271,8 @@ int game_init(EngineState *s) {
}
// Initialize menu TODO: Actually this should be another init()
- if (s->_gui)
- s->_gui->menuReset();
+ if (s->_gfxMenu)
+ s->_gfxMenu->reset();
s->successor = NULL; // No successor
diff --git a/engines/sci/graphics/gui.cpp b/engines/sci/graphics/gui.cpp
index c1ccd48264..937f0d8371 100644
--- a/engines/sci/graphics/gui.cpp
+++ b/engines/sci/graphics/gui.cpp
@@ -276,12 +276,6 @@ void SciGui::drawMenuBar(bool clear) {
}
}
-void SciGui::menuReset() {
- delete _menu;
- _menu = new GfxMenu(_s->_event, _s->_segMan, this, _ports, _paint16, _text16, _screen, _cursor);
- _s->_gfxMenu = _menu;
-}
-
void SciGui::drawPicture(GuiResourceId pictureId, int16 animationNr, bool animationBlackoutFlag, bool mirroredFlag, bool addToFlag, int16 EGApaletteNo) {
Port *oldPort = _ports->setPort((Port *)_ports->_picWind);
diff --git a/engines/sci/graphics/gui.h b/engines/sci/graphics/gui.h
index 7c461de19b..35caf41457 100644
--- a/engines/sci/graphics/gui.h
+++ b/engines/sci/graphics/gui.h
@@ -75,7 +75,6 @@ public:
virtual void drawStatus(const char *text, int16 colorPen, int16 colorBack);
virtual void drawMenuBar(bool clear);
- virtual void menuReset();
virtual void drawPicture(GuiResourceId pictureId, int16 animationNr, bool animationBlackoutFlag, bool mirroredFlag, bool addToFlag, int16 EGApaletteNo);
virtual void drawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, bool hiresMode = false, reg_t upscaledHiresHandle = NULL_REG);
diff --git a/engines/sci/graphics/menu.cpp b/engines/sci/graphics/menu.cpp
index 7f5bd969af..cff22eaefb 100644
--- a/engines/sci/graphics/menu.cpp
+++ b/engines/sci/graphics/menu.cpp
@@ -59,6 +59,12 @@ GfxMenu::GfxMenu(SciEvent *event, SegManager *segMan, SciGui *gui, GfxPorts *por
GfxMenu::~GfxMenu() {
// TODO: deallocate _list and _itemList
+ reset();
+}
+
+void GfxMenu::reset() {
+ _list.clear();
+ _itemList.clear();
}
void GfxMenu::kernelAddEntry(Common::String title, Common::String content, reg_t contentVmPtr) {