diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/engine/kmenu.cpp | 11 | ||||
-rw-r--r-- | engines/sci/gui/gui.cpp | 16 |
2 files changed, 12 insertions, 15 deletions
diff --git a/engines/sci/engine/kmenu.cpp b/engines/sci/engine/kmenu.cpp index 7e0e2da2c4..5f3f00d1e6 100644 --- a/engines/sci/engine/kmenu.cpp +++ b/engines/sci/engine/kmenu.cpp @@ -67,17 +67,16 @@ reg_t kGetMenu(EngineState *s, int argc, reg_t *argv) { reg_t kDrawStatus(EngineState *s, int argc, reg_t *argv) { reg_t textReference = argv[0]; - Common::String textCommon; - const char *text = NULL; + Common::String text; int16 colorPen = (argc > 1) ? argv[1].toSint16() : 0; // old code was: s->status_bar_foreground; int16 colorBack = (argc > 2) ? argv[2].toSint16() : 255; // s->status_bar_background; if (!textReference.isNull()) { - textCommon = s->strSplit(s->_segMan->getString(textReference).c_str(), NULL); - text = textCommon.c_str(); - } + // Sometimes this is called without giving text, if thats the case dont process it + text = s->_segMan->getString(textReference); - s->gui->drawStatus(text, colorPen, colorBack); + s->gui->drawStatus(s->strSplit(text.c_str(), NULL).c_str(), colorPen, colorBack); + } return s->r_acc; } diff --git a/engines/sci/gui/gui.cpp b/engines/sci/gui/gui.cpp index e7ba5d5d12..8def52c46e 100644 --- a/engines/sci/gui/gui.cpp +++ b/engines/sci/gui/gui.cpp @@ -234,15 +234,13 @@ void SciGui::textColors(int argc, reg_t *argv) { void SciGui::drawStatus(const char *text, int16 colorPen, int16 colorBack) { GuiPort *oldPort = _gfx->SetPort(_gfx->_menuPort); - if (text) { - _gfx->FillRect(_gfx->_menuRect, 1, colorBack); - _gfx->PenColor(colorPen); - _gfx->MoveTo(0, 1); - _gfx->Draw_String(text); - _gfx->SetPort(oldPort); - // _gfx->ShowBits(*_theMenuBar, 1); - _screen->copyToScreen(); - } + _gfx->FillRect(_gfx->_menuRect, 1, colorBack); + _gfx->PenColor(colorPen); + _gfx->MoveTo(0, 1); + _gfx->Draw_String(text); + _gfx->SetPort(oldPort); + // _gfx->ShowBits(*_theMenuBar, 1); + _screen->copyToScreen(); } void SciGui::drawPicture(GuiResourceId pictureId, uint16 style, uint16 flags, int16 EGApaletteNo) { |