[Scummvm-cvs-logs] SF.net SVN: scummvm: [32071] scummvm/trunk/engines/made/screen.cpp

john_doe at users.sourceforge.net john_doe at users.sourceforge.net
Mon May 12 22:14:08 CEST 2008


Revision: 32071
          http://scummvm.svn.sourceforge.net/scummvm/?rev=32071&view=rev
Author:   john_doe
Date:     2008-05-12 13:14:07 -0700 (Mon, 12 May 2008)

Log Message:
-----------
Fixed printTextEx segment fault bug.

Modified Paths:
--------------
    scummvm/trunk/engines/made/screen.cpp

Modified: scummvm/trunk/engines/made/screen.cpp
===================================================================
--- scummvm/trunk/engines/made/screen.cpp	2008-05-12 19:29:46 UTC (rev 32070)
+++ scummvm/trunk/engines/made/screen.cpp	2008-05-12 20:14:07 UTC (rev 32071)
@@ -604,6 +604,7 @@
 	
 	if (!_paletteLock)
 		setRGBPalette(_palette, 0, _paletteColorCount);
+
 	_vm->_system->copyRectToScreen((const byte*)_screen2->pixels, _screen2->pitch, 0, 0, _screen2->w, _screen2->h);
 	
 	
@@ -649,7 +650,7 @@
 	if (!_font)
 		return;
 
-	int height = _font->getHeight();
+	uint width = 8, height = _font->getHeight();
 	byte *charData = _font->getChar(c);
 	
 	if (!charData)
@@ -657,10 +658,10 @@
 
 	byte p;
 	byte *dest = (byte*)_fontDrawCtx.destSurface->getBasePtr(x, y);
-	
+
 	for (int16 yc = 0; yc < height; yc++) {
 		p = charData[yc];
-		for (int16 xc = 0; xc < 8; xc++) {
+		for (int16 xc = 0; xc < width; xc++) {
 			if (p & 0x80)
 				dest[xc] = color;
 			p <<= 1;
@@ -751,7 +752,7 @@
 }
 
 void Screen::printTextEx(const char *text, int16 x, int16 y, int16 fontNum, int16 textColor, int16 outlineColor, const ClipInfo &clipInfo) {
-	if (*text == 0 || x == 0 || y == 0)
+	if (*text == 0 || x < 0 || y < 0)
 		return;
 
 	int16 oldFontNum = _currentFontNum;


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