[Scummvm-cvs-logs] SF.net SVN: scummvm: [22638] scummvm/trunk/engines/agi

wjpalenstijn at users.sourceforge.net wjpalenstijn at users.sourceforge.net
Thu May 25 15:40:06 CEST 2006


Revision: 22638
Author:   wjpalenstijn
Date:     2006-05-25 15:39:44 -0700 (Thu, 25 May 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=22638&view=rev

Log Message:
-----------
add and use is_ego_view() function

Modified Paths:
--------------
    scummvm/trunk/engines/agi/checks.cpp
    scummvm/trunk/engines/agi/motion.cpp
    scummvm/trunk/engines/agi/view.cpp
    scummvm/trunk/engines/agi/view.h
Modified: scummvm/trunk/engines/agi/checks.cpp
===================================================================
--- scummvm/trunk/engines/agi/checks.cpp	2006-05-25 21:16:49 UTC (rev 22637)
+++ scummvm/trunk/engines/agi/checks.cpp	2006-05-25 22:39:44 UTC (rev 22638)
@@ -242,7 +242,7 @@
 		}
 
 		if (border != 0) {
-			if (v == game.view_table) {
+			if (is_ego_view(v)) {
 				game.vars[V_border_touch_ego] = border;
 			} else {
 				game.vars[V_border_code] = v->entry;

Modified: scummvm/trunk/engines/agi/motion.cpp
===================================================================
--- scummvm/trunk/engines/agi/motion.cpp	2006-05-25 21:16:49 UTC (rev 22637)
+++ scummvm/trunk/engines/agi/motion.cpp	2006-05-25 22:39:44 UTC (rev 22638)
@@ -59,7 +59,7 @@
 	} else {
 		v->flags |= MOTION;
 		v->direction = 0;
-		if /*_is_ego_view*/ (v)
+		if (is_ego_view(v))
 			game.vars[V_ego_dir] = 0;
 	}
 }
@@ -72,7 +72,7 @@
 
 	v->direction = rnd->getRandomNumber(8);
 
-	if /*_is_ego_view */ (v) {
+	if (is_ego_view(v)) {
 		game.vars[V_ego_dir] = v->direction;
 		while (v->parm1 < 6) {
 			v->parm1 = rnd->getRandomNumber(50);	/* huh? */
@@ -146,7 +146,7 @@
 	v->direction = get_direction(v->x_pos, v->y_pos, v->parm1, v->parm2, v->step_size);
 
 	/* Update V6 if ego */
-	if (v == game.view_table)
+	if (is_ego_view(v))
 		game.vars[V_ego_dir] = v->direction;
 
 	if (v->direction == 0)
@@ -200,7 +200,7 @@
 		setflag(v->parm4, true);
 	}
 	v->motion = MOTION_NORMAL;
-	if (v == game.view_table)
+	if (is_ego_view(v))
 		game.player_control = true;
 }
 

Modified: scummvm/trunk/engines/agi/view.cpp
===================================================================
--- scummvm/trunk/engines/agi/view.cpp	2006-05-25 21:16:49 UTC (rev 22637)
+++ scummvm/trunk/engines/agi/view.cpp	2006-05-25 22:39:44 UTC (rev 22638)
@@ -375,4 +375,9 @@
 	}
 }
 
+bool is_ego_view(const vt_entry* v)
+{
+	return v == game.view_table;
+}
+
 }                             // End of namespace Agi

Modified: scummvm/trunk/engines/agi/view.h
===================================================================
--- scummvm/trunk/engines/agi/view.h	2006-05-25 21:16:49 UTC (rev 22637)
+++ scummvm/trunk/engines/agi/view.h	2006-05-25 22:39:44 UTC (rev 22638)
@@ -137,6 +137,8 @@
 void add_to_pic(int, int, int, int, int, int, int);
 void draw_obj(int);
 
+bool is_ego_view(const vt_entry *v);
+
 }                             // End of namespace Agi
 
 #endif				/* AGI_VIEW_H */


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