[Scummvm-cvs-logs] CVS: residual README,1.28,1.29 TODO,1.52,1.53 lua.cpp,1.144,1.145

Erich Edgar Hoover compholio at users.sourceforge.net
Tue Jul 26 22:35:01 CEST 2005


Update of /cvsroot/scummvm/residual
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29138

Modified Files:
	README TODO lua.cpp 
Log Message:
Fixed TurnActorTo/PointActorAt issue with pigeons - slight change when failing to load sounds to prevent crashing

Index: README
===================================================================
RCS file: /cvsroot/scummvm/residual/README,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- README	26 Jul 2005 01:46:45 -0000	1.28
+++ README	27 Jul 2005 05:33:40 -0000	1.29
@@ -63,19 +63,14 @@
 
 Game currently playable to:
 	The Demon Beaver Dam (Petrified Forest)
-Caveats:
-1) When Manny goes onto the DOD roof for the pigeon eggs the pigeons
-   don't always act quite right
-2) Walking around objects toward an objective (such as the bread deposit
-   on the DOD roof) can hang the user input since the game does not yet
-   know how to navigate around an object to reach a destination
-3) Video of Copal's death (among other movies) plays at *almost* 2x
+Caveats (in order of appearance):
+1) Sound track destruction doesn't do quite a good enough job when
+   entering the spider web area (sp.set) in the Petrified Forest
+2) Video of Copal's death (among other movies) plays at *almost* 2x
    the correct speed, this causes buffer overflows in the audio.
    While hardcoding the speed to the correct value used by the other
    movies works, it is not a good fix and so it is not implemented
-4) Sound track destruction doesn't do quite a good enough job when
-   entering the spider web area (sp.set) in the Petrified Forest
-5) When you return from getting the shocks at the tree pump in the
+3) When you return from getting the shocks at the tree pump in the
    Petrified Forest the scene doesn't change correctly and the game
    stops allowing input
 

Index: TODO
===================================================================
RCS file: /cvsroot/scummvm/residual/TODO,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -d -r1.52 -r1.53
--- TODO	26 Jul 2005 01:46:46 -0000	1.52
+++ TODO	27 Jul 2005 05:33:40 -0000	1.53
@@ -9,7 +9,8 @@
    (Ender: May just need the blending of the lighting values (p2->r, ->g, ->b)
     to the result of pp[_a] in the non-24bpp PUT_PIXEL macro of 
     ztriangle.cpp/ZB_FillTriangleMappingPerspective. Maybe. :)
- * Improve actor rotating/turning (compholio)
+ * Figure out problem changing scenes after getting shocks (compholio)
+ * Improve actor colormap supprt (compholio)
  * Improve SMUSH looping support (compholio)
  * Improve menu support (compholio)
 

Index: lua.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/lua.cpp,v
retrieving revision 1.144
retrieving revision 1.145
diff -u -d -r1.144 -r1.145
--- lua.cpp	26 Jul 2005 01:46:49 -0000	1.144
+++ lua.cpp	27 Jul 2005 05:33:40 -0000	1.145
@@ -1099,13 +1099,15 @@
 /* Turn the actor to a point specified in the 3D space,
  * this should not have the actor look toward the point
  * but should rotate the entire actor toward it.
+ *
+ * This function must use a yaw value around the unit
+ * circle and not just a difference in angles.
  */
 static void TurnActorTo() {
 	float x, y, z, yaw;
 	Actor *act;
 
 	DEBUG_FUNCTION();
-	stubWarning("VERIFY: TurnActorTo");
 	act = check_actor(1);
 	if (lua_isnumber(lua_getparam(2))) {
 		x = luaL_check_number(2);
@@ -1124,13 +1126,19 @@
 		return;
 	}
 	
+	// Find the vector pointing from the actor to the desired location
 	Vector3d turnToVector(x, y, z);
-	Vector3d baseVector(std::sin(0), std::cos(0), 0);
 	Vector3d lookVector = turnToVector - act->pos();
 	lookVector.z() = 0;
-	yaw = angle(baseVector, lookVector) * (180 / M_PI);
+	// must convert to use a unit vector
+	lookVector /= lookVector.magnitude();
+	// find the angle on the upper half of the unit circle
+	yaw = std::acos(lookVector.x()) * (180 / M_PI);
+	// adjust for the lower half of the unit circle
 	if (lookVector.y() < 0)
-		yaw = -yaw;
+		yaw = 360.0 - yaw;
+	// yaw is offset from forward by 90 degrees
+	yaw -= 90.0;
 	act->turnTo(0, yaw, 0);
 	
 	// Game will lock in elevator if this doesn't return false
@@ -1710,8 +1718,14 @@
 	if (g_imuse->startSound(soundName, group, 0, 127, 0, priority)) {
 		lua_pushstring(soundName);
 	} else {
-		if (debugLevel == DEBUG_IMUSE || debugLevel == DEBUG_ERROR || debugLevel == DEBUG_ALL)
-			error("ImStartSound failed to start '%s'", soundName);
+		// Allow soft failing when loading sounds, hard failing when not
+		if (priority == 127) {
+			if (debugLevel == DEBUG_IMUSE || debugLevel == DEBUG_WARN || debugLevel == DEBUG_ALL)
+				warning("ImStartSound failed to load '%s'", soundName);
+		} else {
+			if (debugLevel == DEBUG_IMUSE || debugLevel == DEBUG_ERROR || debugLevel == DEBUG_ALL)
+				error("ImStartSound failed to start '%s'", soundName);
+		}
 		lua_pushnil();
 	}
 }





More information about the Scummvm-git-logs mailing list