SCI: implemented reset for GfxMenu, not recreating object anymore

svn-id: r47793
This commit is contained in:
Martin Kiewitz 2010-02-01 10:16:45 +00:00
parent 845c245ff3
commit a20f4ef1fc
4 changed files with 9 additions and 9 deletions

View File

@ -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

View File

@ -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);

View File

@ -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);

View File

@ -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) {