diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/engine/kmenu.cpp | 4 | ||||
-rw-r--r-- | engines/sci/graphics/gui.cpp | 22 | ||||
-rw-r--r-- | engines/sci/graphics/gui.h | 3 | ||||
-rw-r--r-- | engines/sci/graphics/menu.cpp | 22 | ||||
-rw-r--r-- | engines/sci/graphics/menu.h | 3 |
5 files changed, 27 insertions, 27 deletions
diff --git a/engines/sci/engine/kmenu.cpp b/engines/sci/engine/kmenu.cpp index 2f08e63e63..a785a8f368 100644 --- a/engines/sci/engine/kmenu.cpp +++ b/engines/sci/engine/kmenu.cpp @@ -77,7 +77,7 @@ reg_t kDrawStatus(EngineState *s, int argc, reg_t *argv) { // Sometimes this is called without giving text, if thats the case dont process it text = s->_segMan->getString(textReference); - s->_gui->drawStatus(s->strSplit(text.c_str(), NULL).c_str(), colorPen, colorBack); + s->_gfxMenu->kernelDrawStatus(s->strSplit(text.c_str(), NULL).c_str(), colorPen, colorBack); } return s->r_acc; } @@ -85,7 +85,7 @@ reg_t kDrawStatus(EngineState *s, int argc, reg_t *argv) { reg_t kDrawMenuBar(EngineState *s, int argc, reg_t *argv) { bool clear = argv[0].isNull() ? true : false; - s->_gui->drawMenuBar(clear); + s->_gfxMenu->kernelDrawMenuBar(clear); return s->r_acc; } diff --git a/engines/sci/graphics/gui.cpp b/engines/sci/graphics/gui.cpp index 4227f1a9de..387b058d6c 100644 --- a/engines/sci/graphics/gui.cpp +++ b/engines/sci/graphics/gui.cpp @@ -247,28 +247,6 @@ void SciGui::textColors(int argc, reg_t *argv) { _text16->CodeSetColors(argc, argv); } -void SciGui::drawStatus(const char *text, int16 colorPen, int16 colorBack) { - Port *oldPort = _ports->setPort(_ports->_menuPort); - - _paint16->fillRect(_ports->_menuBarRect, 1, colorBack); - _ports->penColor(colorPen); - _ports->moveTo(0, 1); - _text16->Draw_String(text); - _paint16->bitsShow(_ports->_menuBarRect); - _ports->setPort(oldPort); -} - -void SciGui::drawMenuBar(bool clear) { - if (!clear) { - Port *oldPort = _ports->setPort(_ports->_menuPort); - _menu->drawBar(); - _paint16->bitsShow(_ports->_menuBarRect); - _ports->setPort(oldPort); - } else { - drawStatus("", 0, 0); - } -} - void SciGui::graphAdjustPriority(int top, int bottom) { if (_usesOldGfxFunctions) { _ports->priorityBandsInit(15, top, bottom); diff --git a/engines/sci/graphics/gui.h b/engines/sci/graphics/gui.h index 6c3c3f13e2..21e7288d92 100644 --- a/engines/sci/graphics/gui.h +++ b/engines/sci/graphics/gui.h @@ -72,9 +72,6 @@ public: virtual void textFonts(int argc, reg_t *argv); virtual void textColors(int argc, reg_t *argv); - virtual void drawStatus(const char *text, int16 colorPen, int16 colorBack); - virtual void drawMenuBar(bool clear); - virtual void graphAdjustPriority(int top, int bottom); virtual void shakeScreen(uint16 shakeCount, uint16 directions); diff --git a/engines/sci/graphics/menu.cpp b/engines/sci/graphics/menu.cpp index b3ddf46837..ead575fc80 100644 --- a/engines/sci/graphics/menu.cpp +++ b/engines/sci/graphics/menu.cpp @@ -836,4 +836,26 @@ GuiMenuItemEntry *GfxMenu::interactiveWithMouse() { return NULL; } +void GfxMenu::kernelDrawStatus(const char *text, int16 colorPen, int16 colorBack) { + Port *oldPort = _ports->setPort(_ports->_menuPort); + + _paint16->fillRect(_ports->_menuBarRect, 1, colorBack); + _ports->penColor(colorPen); + _ports->moveTo(0, 1); + _text16->Draw_String(text); + _paint16->bitsShow(_ports->_menuBarRect); + _ports->setPort(oldPort); +} + +void GfxMenu::kernelDrawMenuBar(bool clear) { + if (!clear) { + Port *oldPort = _ports->setPort(_ports->_menuPort); + drawBar(); + _paint16->bitsShow(_ports->_menuBarRect); + _ports->setPort(oldPort); + } else { + kernelDrawStatus("", 0, 0); + } +} + } // End of namespace Sci diff --git a/engines/sci/graphics/menu.h b/engines/sci/graphics/menu.h index 7f983efb4a..b515ba4826 100644 --- a/engines/sci/graphics/menu.h +++ b/engines/sci/graphics/menu.h @@ -92,6 +92,9 @@ public: void drawBar(); reg_t kernelSelect(reg_t eventObject); + void kernelDrawStatus(const char *text, int16 colorPen, int16 colorBack); + void kernelDrawMenuBar(bool clear); + private: GuiMenuItemEntry *findItem(uint16 menuId, uint16 itemId); void calculateTextWidth(); |