aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kiewitz2010-02-05 20:48:06 +0000
committerMartin Kiewitz2010-02-05 20:48:06 +0000
commit16efee3c0df7e796b21ec198064a8499d2a28dac (patch)
tree4f729584063c4ec7e8fe77d31c0999b92cc5304b
parent248bc560f32ee78a25e606b8ff54a449be6bf6e2 (diff)
downloadscummvm-rg350-16efee3c0df7e796b21ec198064a8499d2a28dac.tar.gz
scummvm-rg350-16efee3c0df7e796b21ec198064a8499d2a28dac.tar.bz2
scummvm-rg350-16efee3c0df7e796b21ec198064a8499d2a28dac.zip
SCI: drawMenuBar, drawStatus now called directly and w/o SciGui
svn-id: r47913
-rw-r--r--engines/sci/engine/kmenu.cpp4
-rw-r--r--engines/sci/graphics/gui.cpp22
-rw-r--r--engines/sci/graphics/gui.h3
-rw-r--r--engines/sci/graphics/menu.cpp22
-rw-r--r--engines/sci/graphics/menu.h3
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();