diff options
Diffstat (limited to 'engines/sci/gui')
-rw-r--r-- | engines/sci/gui/gui.cpp | 26 | ||||
-rw-r--r-- | engines/sci/gui/gui.h | 10 | ||||
-rw-r--r-- | engines/sci/gui/gui_menu.cpp | 51 | ||||
-rw-r--r-- | engines/sci/gui/gui_menu.h | 47 |
4 files changed, 127 insertions, 7 deletions
diff --git a/engines/sci/gui/gui.cpp b/engines/sci/gui/gui.cpp index 633340335b..ccfaecd960 100644 --- a/engines/sci/gui/gui.cpp +++ b/engines/sci/gui/gui.cpp @@ -37,6 +37,7 @@ #include "sci/gui/gui_windowmgr.h" #include "sci/gui/gui_animate.h" #include "sci/gui/gui_controls.h" +#include "sci/gui/gui_menu.h" #include "sci/gui/gui_text.h" #include "sci/gui/gui_transitions.h" #include "sci/gui/gui_view.h" @@ -61,6 +62,7 @@ SciGui::SciGui(EngineState *state, SciGuiScreen *screen, SciGuiPalette *palette, _text = new SciGuiText(_s->resMan, _gfx, _screen); _windowMgr = new SciGuiWindowMgr(this, _screen, _gfx, _text); _controls = new SciGuiControls(_s->_segMan, _gfx, _text); + _menu = new SciGuiMenu(_gfx, _text, _screen); // _gui32 = new SciGui32(_s, _screen, _palette, _cursor); // for debug purposes } @@ -301,13 +303,27 @@ void SciGui::drawStatus(const char *text, int16 colorPen, int16 colorBack) { _gfx->SetPort(oldPort); } -void SciGui::drawMenuBar() { - // TODO: Implement menubar - warning("TODO: drawMenuBar()"); +void SciGui::drawMenuBar(bool clear) { + if (!clear) { + warning("TODO: drawMenuBar()"); + } else { + drawStatus("", 0, 0); + } +} + +void SciGui::menuAdd(Common::String title, Common::String content, reg_t entriesBase) { + warning("menuAdd"); +} + +void SciGui::menuSet(int argc, reg_t *argv) { } -void SciGui::clearMenuBar() { - drawStatus("", 0, 0); +reg_t SciGui::menuGet(uint16 menuId, uint16 itemId, uint16 attributeId) { + return NULL_REG; +} + +reg_t SciGui::menuSelect(reg_t eventObject) { + return NULL_REG; } void SciGui::drawPicture(GuiResourceId pictureId, int16 animationNr, bool animationBlackoutFlag, bool mirroredFlag, bool addToFlag, int16 EGApaletteNo) { diff --git a/engines/sci/gui/gui.h b/engines/sci/gui/gui.h index ca0073bc7c..9208562f25 100644 --- a/engines/sci/gui/gui.h +++ b/engines/sci/gui/gui.h @@ -48,6 +48,7 @@ class SciGuiGfx; class SciGuiWindowMgr; class SciGuiAnimate; class SciGuiControls; +class SciGuiMenu; class SciGuiText; class SciGuiTransitions; class SciGui32; // for debug purposes @@ -79,8 +80,12 @@ public: virtual void textColors(int argc, reg_t *argv); virtual void drawStatus(const char *text, int16 colorPen, int16 colorBack); - virtual void drawMenuBar(); - virtual void clearMenuBar(); + virtual void drawMenuBar(bool clear); + virtual void menuAdd(Common::String title, Common::String content, reg_t entriesBase); + virtual void menuSet(int argc, reg_t *argv); + virtual reg_t menuGet(uint16 menuId, uint16 itemId, uint16 attributeId); + virtual reg_t menuSelect(reg_t eventObject); + virtual void drawPicture(GuiResourceId pictureId, int16 animationNr, bool animationBlackoutFlag, bool mirroredFlag, bool addToFlag, int16 EGApaletteNo); virtual void drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, int16 origHeight = -1); virtual void drawControlButton(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 style, bool hilite); @@ -159,6 +164,7 @@ private: SciGuiWindowMgr *_windowMgr; SciGuiAnimate *_animate; SciGuiControls *_controls; + SciGuiMenu *_menu; SciGuiText *_text; SciGuiTransitions *_transitions; // SciGui32 *_gui32; // for debug purposes diff --git a/engines/sci/gui/gui_menu.cpp b/engines/sci/gui/gui_menu.cpp new file mode 100644 index 0000000000..89a5fefa9c --- /dev/null +++ b/engines/sci/gui/gui_menu.cpp @@ -0,0 +1,51 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + +#include "common/util.h" +#include "common/stack.h" +#include "graphics/primitives.h" + +#include "sci/sci.h" +#include "sci/engine/state.h" +#include "sci/gui/gui_gfx.h" +#include "sci/gui/gui_font.h" +#include "sci/gui/gui_text.h" +#include "sci/gui/gui_screen.h" +#include "sci/gui/gui_menu.h" + +namespace Sci { + +SciGuiMenu::SciGuiMenu(SciGuiGfx *gfx, SciGuiText *text, SciGuiScreen *screen) + : _gfx(gfx), _text(text), _screen(screen) { + init(); +} + +SciGuiMenu::~SciGuiMenu() { +} + +void SciGuiMenu::init() { +} + +} // End of namespace Sci diff --git a/engines/sci/gui/gui_menu.h b/engines/sci/gui/gui_menu.h new file mode 100644 index 0000000000..d3119f2084 --- /dev/null +++ b/engines/sci/gui/gui_menu.h @@ -0,0 +1,47 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + +#ifndef SCI_GUI_MENU_H +#define SCI_GUI_MENU_H + +namespace Sci { + +class SciGuiMenu { +public: + SciGuiMenu(SciGuiGfx *gfx, SciGuiText *text, SciGuiScreen *screen); + ~SciGuiMenu(); + + +private: + void init(void); + + SciGuiGfx *_gfx; + SciGuiText *_text; + SciGuiScreen *_screen; +}; + +} // End of namespace Sci + +#endif |