[Scummvm-cvs-logs] SF.net SVN: scummvm:[52913] scummvm/trunk/engines/sci/graphics

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Sun Sep 26 20:23:53 CEST 2010


Revision: 52913
          http://scummvm.svn.sourceforge.net/scummvm/?rev=52913&view=rev
Author:   m_kiewitz
Date:     2010-09-26 18:23:53 +0000 (Sun, 26 Sep 2010)

Log Message:
-----------
SCI: adding separate status drawing code

now also draws "IV" in KQ4 correctly. This wasn't the case before because we reused the regular drawing code, which would see the 0xA ("IV") as linebreak

save for backport

Modified Paths:
--------------
    scummvm/trunk/engines/sci/graphics/menu.cpp
    scummvm/trunk/engines/sci/graphics/text16.cpp
    scummvm/trunk/engines/sci/graphics/text16.h

Modified: scummvm/trunk/engines/sci/graphics/menu.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/menu.cpp	2010-09-26 15:54:04 UTC (rev 52912)
+++ scummvm/trunk/engines/sci/graphics/menu.cpp	2010-09-26 18:23:53 UTC (rev 52913)
@@ -905,7 +905,7 @@
 	_paint16->fillRect(_ports->_menuBarRect, 1, colorBack);
 	_ports->penColor(colorPen);
 	_ports->moveTo(0, 1);
-	_text16->Draw_String(text);
+	_text16->Draw_Status(text);
 	_paint16->bitsShow(_ports->_menuBarRect);
 	_ports->setPort(oldPort);
 }

Modified: scummvm/trunk/engines/sci/graphics/text16.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/text16.cpp	2010-09-26 15:54:04 UTC (rev 52912)
+++ scummvm/trunk/engines/sci/graphics/text16.cpp	2010-09-26 18:23:53 UTC (rev 52913)
@@ -491,6 +491,32 @@
 	_ports->penColor(previousPenColor);
 }
 
+// we need to have a separate status drawing code
+//  In KQ4 the IV char is actually 0xA, which would otherwise get considered as linebreak and not printed
+void GfxText16::Draw_Status(const char *text) {
+	uint16 curChar, charWidth;
+	uint16 textLen = strlen(text);
+	Common::Rect rect;
+
+	GetFont();
+	if (!_font)
+		return;
+
+	rect.top = _ports->_curPort->curTop;
+	rect.bottom = rect.top + _ports->_curPort->fontHeight;
+	while (textLen--) {
+		curChar = (*(const byte *)text++);
+		switch (curChar) {
+		case 0:
+			break;
+		default:
+			charWidth = _font->getCharWidth(curChar);
+			_font->draw(curChar, _ports->_curPort->top + _ports->_curPort->curTop, _ports->_curPort->left + _ports->_curPort->curLeft, _ports->_curPort->penClr, _ports->_curPort->greyedOutput);
+			_ports->_curPort->curLeft += charWidth;
+		}
+	}
+}
+
 // Sierra did this in their PC98 interpreter only, they identify a text as being
 // sjis and then switch to font 900
 bool GfxText16::SwitchToFont900OnSjis(const char *text) {

Modified: scummvm/trunk/engines/sci/graphics/text16.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/text16.h	2010-09-26 15:54:04 UTC (rev 52912)
+++ scummvm/trunk/engines/sci/graphics/text16.h	2010-09-26 18:23:53 UTC (rev 52913)
@@ -64,6 +64,7 @@
 	void Show(const char *text, int16 from, int16 len, GuiResourceId orgFontId, int16 orgPenColor);
 	void Box(const char *text, int16 bshow, const Common::Rect &rect, TextAlignment alignment, GuiResourceId fontId);
 	void Draw_String(const char *text);
+	void Draw_Status(const char *text);
 
 	GfxFont *_font;
 


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