[Scummvm-cvs-logs] SF.net SVN: scummvm:[46906] scummvm/trunk/engines/teenagent

megath at users.sourceforge.net megath at users.sourceforge.net
Sun Jan 3 01:55:56 CET 2010


Revision: 46906
          http://scummvm.svn.sourceforge.net/scummvm/?rev=46906&view=rev
Author:   megath
Date:     2010-01-03 00:55:56 +0000 (Sun, 03 Jan 2010)

Log Message:
-----------
improved mark's animation.

Modified Paths:
--------------
    scummvm/trunk/engines/teenagent/actor.cpp
    scummvm/trunk/engines/teenagent/scene.cpp

Modified: scummvm/trunk/engines/teenagent/actor.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/actor.cpp	2010-01-02 22:40:17 UTC (rev 46905)
+++ scummvm/trunk/engines/teenagent/actor.cpp	2010-01-03 00:55:56 UTC (rev 46906)
@@ -67,7 +67,8 @@
 	if (delta_frame == 0) {
 		index = 0; //static animation
 	}
-	int dx, dy;
+
+	bool mirror = orientation == kActorLeft;
 	switch (orientation) {
 	case kActorLeft:
 	case kActorRight:
@@ -81,8 +82,6 @@
 		if (index >= ARRAYSIZE(frames_left_right))
 			index = 0;
 		s = frames + frames_left_right[index];
-		dx = 11;
-		dy = 62;
 		break;
 	case kActorUp:
 		if (render_head) {
@@ -95,8 +94,6 @@
 		if (index >= ARRAYSIZE(frames_up))
 			index = 0;
 		s = frames + frames_up[index];
-		dx = 11;
-		dy = 62;
 		break;
 	case kActorDown:
 		if (render_head) {
@@ -109,8 +106,6 @@
 		if (index >= ARRAYSIZE(frames_down))
 			index = 0;
 		s = frames + frames_down[index];
-		dx = 11;
-		dy = 62;
 		break;
 	default:
 		return Common::Rect();
@@ -120,13 +115,13 @@
 		warning("no surface, skipping");
 		return Common::Rect();
 	}
-
+	
 	Common::Rect dirty;
 	Common::Rect clip(0, 0, s->w, s->h);
 	if (head != NULL) 
 		clip.top = head->h;
 
-	int xp = position.x - dx * zoom / 256, yp = position.y - dy * zoom / 256;
+	int xp = position.x - s->w * zoom / 512 - s->x, yp = position.y - s->h * zoom / 256 - s->y;
 	if (xp < 0)
 		xp = 0;
 	if (xp + s->w > 320)
@@ -137,7 +132,7 @@
 	if (yp + clip.top + clip.height() > 200)
 		yp = 200 - clip.top - clip.height();
 	
-	dirty = s->render(surface, xp, yp + clip.top * zoom / 256, orientation == kActorLeft, clip, zoom);
+	dirty = s->render(surface, xp, yp + clip.top * zoom / 256, mirror, clip, zoom);
 
 	if (head != NULL)
 		dirty.extend(head->render(surface, xp, yp, orientation == kActorLeft, Common::Rect(), zoom));

Modified: scummvm/trunk/engines/teenagent/scene.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/scene.cpp	2010-01-02 22:40:17 UTC (rev 46905)
+++ scummvm/trunk/engines/teenagent/scene.cpp	2010-01-03 00:55:56 UTC (rev 46906)
@@ -677,7 +677,10 @@
 				uint zoom = lookupZoom(position.y);
 
 				if (!path.empty()) {
-					const int speed_x = 10 * zoom / 256, speed_y = 3 * zoom / 256;
+					int speed_x = 4 * zoom / 256, speed_y = 3 * zoom / 256;
+					if ((teenagent.currentIndex() % 5) == 0)
+						speed_x *= 4;
+					
 					const Common::Point &destination = path.front();
 					Common::Point dp(destination.x - position.x, destination.y - position.y);
 


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