mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-09 11:20:56 +00:00
SCI: implemented reset for GfxMenu, not recreating object anymore
svn-id: r47793
This commit is contained in:
parent
845c245ff3
commit
a20f4ef1fc
@ -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
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user