[Scummvm-cvs-logs] SF.net SVN: scummvm: [29859] scummvm/trunk/engines/cine/various.cpp

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Fri Dec 14 14:55:19 CET 2007


Revision: 29859
          http://scummvm.svn.sourceforge.net/scummvm/?rev=29859&view=rev
Author:   thebluegr
Date:     2007-12-14 05:55:18 -0800 (Fri, 14 Dec 2007)

Log Message:
-----------
Added a note, switched to CLIP template for clipping, some cleanup

Modified Paths:
--------------
    scummvm/trunk/engines/cine/various.cpp

Modified: scummvm/trunk/engines/cine/various.cpp
===================================================================
--- scummvm/trunk/engines/cine/various.cpp	2007-12-14 13:51:41 UTC (rev 29858)
+++ scummvm/trunk/engines/cine/various.cpp	2007-12-14 13:55:18 UTC (rev 29859)
@@ -1960,6 +1960,7 @@
 						partVar2 = pPart->height;
 
 						if (pPart->ptr1) {
+							// NOTE: is the mask supposed to be in ptr1? Shouldn't that be ptr2, like below?
 							drawSprite(currentOverlay, pPart->ptr1, pPart->ptr1, partVar1, partVar2, page1Raw, x, y);
 						}
 					} else {
@@ -2373,9 +2374,9 @@
 }
 
 void processSeqListElement(SeqListElement *element) {
-	int16 x;
-	int16 y;
-	byte *ptr1;
+	int16 x = objectTable[element->var6].x;
+	int16 y = objectTable[element->var6].y;
+	byte *ptr1 = animDataTable[element->varA].ptr1;
 	int16 var_10;
 	int16 var_4;
 	int16 var_2;
@@ -2387,17 +2388,10 @@
 
 	element->var12 = 0;
 
-	x = objectTable[element->var6].x;
-	y = objectTable[element->var6].y;
-	ptr1 = animDataTable[element->varA].ptr1;
-
 	if (ptr1) {
-		uint16 param1;
-		uint16 param2;
+		uint16 param1 = ptr1[1];
+		uint16 param2 = ptr1[2];
 
-		param1 = ptr1[1];
-		param2 = ptr1[2];
-
 		if (element->varC != 255) {
 			// FIXME: Why is this here? Fingolfin gets lots of these
 			// in his copy of Operation Stealth (value 0 or 236) under
@@ -2484,6 +2478,7 @@
 
 
 bool makeTextEntryMenu(const char *messagePtr, char *inputString, int stringMaxLength, int y) {
+	int16 color = 2;
 	byte color2 = defaultMenuBoxColor2;
 	byte endOfMessageReached = 0;
 	int16 localX, localY, localWidth;
@@ -2496,14 +2491,9 @@
 	const char *endOfMessagePtr;
 	byte currentChar, characterWidth;
 
-	if (width > 250)
-		width = 250;
+	width = CLIP((int)width, 180, 250);
 
-	if (width < 180)
-		width = 180;
-
 	int16 x = (320 - width) / 2;
-	int16 color = 2;
 
 	gfxDrawPlainBoxRaw(x - margins, y, x + width + margins, y + 4, color2, page1Raw);
 


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