[Scummvm-cvs-logs] CVS: scummvm/queen cutaway.cpp,1.37,1.38 cutaway.h,1.16,1.17

David Eriksson twogood at users.sourceforge.net
Sun Oct 19 08:19:23 CEST 2003


Update of /cvsroot/scummvm/scummvm/queen
In directory sc8-pr-cvs1:/tmp/cvs-serv29292

Modified Files:
	cutaway.cpp cutaway.h 
Log Message:
Added scaling of objects in cutaways.


Index: cutaway.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/cutaway.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- cutaway.cpp	19 Oct 2003 11:01:23 -0000	1.37
+++ cutaway.cpp	19 Oct 2003 11:41:24 -0000	1.38
@@ -473,7 +473,7 @@
 	for (int i = 0; i < object.personCount; i++) {
 		object.person[i] = (int16)READ_BE_UINT16(ptr);
 		ptr += 2;
-		debug(0, "[%i] Turn on person %i", i, object.person[i]);
+		//debug(0, "[%i] Turn on person %i", i, object.person[i]);
 	}
 
 	return ptr;
@@ -545,10 +545,10 @@
 					}
 				}
 
-				debug(0, "Person '%s' (%i) is %s", 
+				/*debug(0, "Person '%s' (%i) is %s", 
 						_logic->objectName(objectData->name),
 						objectData->name,
-						on ? "on" : "off");
+						on ? "on" : "off");*/
 
 				if (on) {
 					// It is needed, so ensure it's ON
@@ -597,12 +597,6 @@
 	_temporaryRoom = _logic->currentRoom();
 
 	restorePersonData();
-
-	// XXX CUTAWAY_SCALE(OBJECT);
-	// XXX SF=Param;
-	// XXX if(SCALE_FACTOR>0 && SCALE_FACTOR<100)
-	// XXX   SF=SCALE_FACTOR;
-
 }
 
 Cutaway::ObjectType Cutaway::getObjectType(CutawayObject &object) {
@@ -899,7 +893,7 @@
 
 					if (0 == objAnim[i].object) {
 						// Scale Joe
-						// XXX bob->scale = SF;
+						bob->scale = scale(object);
 					}
 				}
 
@@ -990,7 +984,7 @@
 
 		if (object.bobStartX || object.bobStartY) {
 			BobSlot *bob = _graphics->bob(p.actor->bobNum);
-			bob->scale = 100; // XXX SF;
+			bob->scale = scale(object);
 			bob->x = object.bobStartX;
 			bob->y = object.bobStartY;
 		}
@@ -1501,6 +1495,35 @@
 
 	return (tmp * 2) / _logic->talkSpeed();
 
+}
+
+int Cutaway::scale(CutawayObject &object) {
+	int scaling = 100;
+
+	if (object.scale > 0)
+		scaling = object.scale;
+	else if (!object.objectNumber) {
+		// Only scale Joe 
+		int x, y;
+		
+		if (object.bobStartX > 0 || object.bobStartY > 0) {
+			x = object.bobStartX;
+			y = object.bobStartY;
+		}
+		else {
+			BobSlot *bob = _graphics->bob(0);
+			x = bob->x;
+			y = bob->y;
+		}
+
+		int zone = _logic->zoneInArea(0, x, y);
+		if (zone > 0) {
+			Area *area = _logic->area(_logic->currentRoom(), zone);
+			scaling = area->calcScale(y);
+		}
+	}
+
+	return scaling;
 }
 
 } // End of namespace Queen

Index: cutaway.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/cutaway.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- cutaway.h	19 Oct 2003 11:01:22 -0000	1.16
+++ cutaway.h	19 Oct 2003 11:41:24 -0000	1.17
@@ -281,6 +281,9 @@
 		//! Used by handleText()
 		int countSpaces(ObjectType type, const char *segment);
 
+		//! Scale Joe
+		int scale(CutawayObject &object);
+
 		//! Dump CutawayAnum data with debug()
 		static void dumpCutawayAnim(CutawayAnim &anim);
 





More information about the Scummvm-git-logs mailing list