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

megath at users.sourceforge.net megath at users.sourceforge.net
Tue Sep 8 21:24:20 CEST 2009


Revision: 44013
          http://scummvm.svn.sourceforge.net/scummvm/?rev=44013&view=rev
Author:   megath
Date:     2009-09-08 19:24:20 +0000 (Tue, 08 Sep 2009)

Log Message:
-----------
added actor-walkbox position correction

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

Modified: scummvm/trunk/engines/teenagent/objects.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/objects.cpp	2009-09-08 14:26:14 UTC (rev 44012)
+++ scummvm/trunk/engines/teenagent/objects.cpp	2009-09-08 19:24:20 UTC (rev 44013)
@@ -35,7 +35,8 @@
 }
 
 void Walkbox::dump() {
-	debug(0, "walkbox %02x %02x [%d, %d, %d, %d] %02x %02x %02x %02x  ", unk00, unk01, 
+	debug(0, "walkbox %02x %02x [%d, %d, %d, %d] %02x %02x %02x %02x  ", 
+		unk00, orientation, 
 		rect.left, rect.right, rect.top, rect.bottom, 
 		unk0a, unk0b, unk0c, unk0d);
 }

Modified: scummvm/trunk/engines/teenagent/objects.h
===================================================================
--- scummvm/trunk/engines/teenagent/objects.h	2009-09-08 14:26:14 UTC (rev 44012)
+++ scummvm/trunk/engines/teenagent/objects.h	2009-09-08 19:24:20 UTC (rev 44013)
@@ -92,7 +92,7 @@
 
 struct Walkbox {
 	byte unk00;
-	byte unk01;
+	byte orientation;
 	Rect rect;
 	byte unk0a;
 	byte unk0b;

Modified: scummvm/trunk/engines/teenagent/scene.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/scene.cpp	2009-09-08 14:26:14 UTC (rev 44012)
+++ scummvm/trunk/engines/teenagent/scene.cpp	2009-09-08 19:24:20 UTC (rev 44013)
@@ -52,9 +52,26 @@
 	debug(0, "moveTo(%d, %d, %u)", point.x, point.y, orient);
 	if (validate) {
 		for (byte i = 0; i < walkboxes; ++i) {
-			if (walkbox[i]->rect.in(point)) {
+			Walkbox * w = walkbox[i];
+			if (w->rect.in(point)) {
 				debug(0, "bumped into walkbox %u", i);
-				return;
+				byte o = w->orientation;
+				switch(o) {
+				case 1:
+					point.y = w->rect.top - 1;
+					break;
+				case 2: 
+					point.x = w->rect.right + 1;
+					break;
+				case 3:
+					point.y = w->rect.bottom + 1;
+					break;
+				case 4:
+					point.x = w->rect.left - 1;
+					break;
+				default:
+					return;
+				}
 			}
 		}
 	}


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