[Scummvm-cvs-logs] CVS: scummvm/sky logic.cpp,1.102,1.103

Robert G?ffringmann lavosspawn at users.sourceforge.net
Fri Jun 27 07:52:06 CEST 2003


Update of /cvsroot/scummvm/scummvm/sky
In directory sc8-pr-cvs1:/tmp/cvs-serv27714/sky

Modified Files:
	logic.cpp 
Log Message:
bugfix. doesn't seem to affect anything, though.

Index: logic.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/logic.cpp,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -d -r1.102 -r1.103
--- logic.cpp	27 Jun 2003 02:54:05 -0000	1.102
+++ logic.cpp	27 Jun 2003 14:42:45 -0000	1.103
@@ -1571,8 +1571,12 @@
 	_compact->logic = L_LISTEN;
 
 	Compact *speaker = SkyState::fetchCompact(a);
-	if (c) c += speaker->extCompact->dir << 1;
-	stdSpeak(speaker, b, c, speaker->extCompact->dir << 1);
+	if (c) {
+		c += speaker->extCompact->dir << 1;
+		stdSpeak(speaker, b, c, speaker->extCompact->dir << 1);
+	} else
+		stdSpeak(speaker, b, c, 0);
+
 	return false;
 }
 
@@ -1596,20 +1600,19 @@
 		uint8 *data = lowText.textData;
 
 		// stipple the text
-		uint16 height = ((dataFileHeader *)data)->s_height;
-		uint16 width = ((dataFileHeader *)data)->s_width;
-		width >>= 1;
+		
+		uint32 size = ((dataFileHeader *)data)->s_height * ((dataFileHeader*)data)->s_width;
+		uint32 index = 0;
+		uint32 width = ((dataFileHeader*)data)->s_width;
 
 		data += sizeof(dataFileHeader);
 
-        width--;
-		for (uint16 i = 0; i < height; i++) {
-			for (uint16 j = 0; j < width; j++) {
-				if (!*data) // only change 0's
-					*data = 1;
-				data += 2;
-			}
-			data++;
+		while (index < size) {
+			if (index % width <= 1) 
+				index ^= 1; //index++;
+			if (!data[index])
+				data[index] = 1;
+			index += 2;
 		}
 
 		Compact *textCompact = SkyState::fetchCompact(lowText.compactNum);
@@ -2036,21 +2039,10 @@
 	_scriptVariables[RESULT] = 0; // assume fail
 	uint16 *list = (uint16 *)SkyState::fetchCompact(id);
 
-	while (*list) { // end of list?
-		if (*list++ >= x) // left x
-			continue;
-			
-		if (*list++ < x) // right x
-			continue;
-
-		if (*list++ >= y) // top y
-			continue;
-
-		if (*list++ < y) // bottom y
-			continue;
-
-		// get value
-		_scriptVariables[RESULT] = *list++;
+	while (*list) {
+		if ((x >= list[0]) && (x < list[1]) && (y >= list[2]) && (y < list[3]))
+			_scriptVariables[RESULT] = list[4];
+		list += 5;
 	}
 	return true;
 }





More information about the Scummvm-git-logs mailing list