[Scummvm-cvs-logs] SF.net SVN: scummvm:[44674] scummvm/trunk/engines/sci
m_kiewitz at users.sourceforge.net
m_kiewitz at users.sourceforge.net
Mon Oct 5 21:46:38 CEST 2009
Revision: 44674
http://scummvm.svn.sourceforge.net/scummvm/?rev=44674&view=rev
Author: m_kiewitz
Date: 2009-10-05 19:46:38 +0000 (Mon, 05 Oct 2009)
Log Message:
-----------
SCI: kDrawStatus changed, dont call gui if no text received
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/kmenu.cpp
scummvm/trunk/engines/sci/gui/gui.cpp
Modified: scummvm/trunk/engines/sci/engine/kmenu.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kmenu.cpp 2009-10-05 19:39:47 UTC (rev 44673)
+++ scummvm/trunk/engines/sci/engine/kmenu.cpp 2009-10-05 19:46:38 UTC (rev 44674)
@@ -67,17 +67,16 @@
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;
}
Modified: scummvm/trunk/engines/sci/gui/gui.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.cpp 2009-10-05 19:39:47 UTC (rev 44673)
+++ scummvm/trunk/engines/sci/gui/gui.cpp 2009-10-05 19:46:38 UTC (rev 44674)
@@ -234,15 +234,13 @@
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) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list