[Scummvm-cvs-logs] SF.net SVN: scummvm: [25213] scummvm/trunk/engines/parallaction/graphics. cpp

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Sat Jan 27 00:21:05 CET 2007


Revision: 25213
          http://scummvm.svn.sourceforge.net/scummvm/?rev=25213&view=rev
Author:   peres001
Date:     2007-01-26 15:21:04 -0800 (Fri, 26 Jan 2007)

Log Message:
-----------
added NULLity checks

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/graphics.cpp

Modified: scummvm/trunk/engines/parallaction/graphics.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.cpp	2007-01-26 23:19:50 UTC (rev 25212)
+++ scummvm/trunk/engines/parallaction/graphics.cpp	2007-01-26 23:21:04 UTC (rev 25213)
@@ -352,7 +352,7 @@
 
 
 void Graphics::flatBlit(uint16 w, uint16 h, int16 x, int16 y, byte *data, Graphics::Buffers buffer) {
-//	printf("Graphics::flatBlit(%i, %i, %i, %i)\n", w, h, x, y);
+	printf("Graphics::flatBlit(%i, %i, %i, %i)\n", w, h, x, y);
 
     // source coordinates
 	int16 left = 0, top = 0;
@@ -376,6 +376,8 @@
 	byte *s = data + left + top * w;
 	byte *d = _buffers[buffer] + x + y * SCREEN_WIDTH;
 
+	printf("Graphics::flatBlit CLIPPED (%i, %i, %i, %i) -> (%i, %i) %x %x\n", left, top, right, bottom, x, y, (uint32)s, (uint32)d);
+
 	for (uint16 i = top; i < bottom; i++) {
 		for (uint16 j = left; j < right; j++) {
 			if (*s != 0) *d = *s;
@@ -387,8 +389,12 @@
 		d += (SCREEN_WIDTH - right + left);
 	}
 
+	printf("Graphics::flatBlit BLITTED\n");
+
 	if (buffer == kBitFront) updateScreen();
 
+	printf("Graphics::flatBlit DONE\n");
+
 	return;
 
 }
@@ -614,6 +620,7 @@
 //	strings
 //
 void Graphics::displayString(uint16 x, uint16 y, const char *text) {
+    if (text == NULL) return;
 
 	uint16 len = strlen(text);
 	StaticCnv tmp;
@@ -718,6 +725,8 @@
 
 
 uint16 Graphics::getStringWidth(const char *text) {
+	if (text == NULL) return 0;
+
 	uint16 len = strlen(text);
 
 	if (_proportionalFont == 0) {


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