diff options
author | Willem Jan Palenstijn | 2006-05-25 22:39:44 +0000 |
---|---|---|
committer | Willem Jan Palenstijn | 2006-05-25 22:39:44 +0000 |
commit | d56c65bf4a47007dc874b70eb04be9ed7de27b01 (patch) | |
tree | e628bf897962b6b1d3c7473869005f0a937abb1e /engines/agi | |
parent | d05138fd9cc694799dcbb8f2b91420576df2238a (diff) | |
download | scummvm-rg350-d56c65bf4a47007dc874b70eb04be9ed7de27b01.tar.gz scummvm-rg350-d56c65bf4a47007dc874b70eb04be9ed7de27b01.tar.bz2 scummvm-rg350-d56c65bf4a47007dc874b70eb04be9ed7de27b01.zip |
add and use is_ego_view() function
svn-id: r22638
Diffstat (limited to 'engines/agi')
-rw-r--r-- | engines/agi/checks.cpp | 2 | ||||
-rw-r--r-- | engines/agi/motion.cpp | 8 | ||||
-rw-r--r-- | engines/agi/view.cpp | 5 | ||||
-rw-r--r-- | engines/agi/view.h | 2 |
4 files changed, 12 insertions, 5 deletions
diff --git a/engines/agi/checks.cpp b/engines/agi/checks.cpp index 189d1395a5..93f40c07be 100644 --- a/engines/agi/checks.cpp +++ b/engines/agi/checks.cpp @@ -242,7 +242,7 @@ void update_position() { } 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; diff --git a/engines/agi/motion.cpp b/engines/agi/motion.cpp index 61d14dc1a3..79504bbdc5 100644 --- a/engines/agi/motion.cpp +++ b/engines/agi/motion.cpp @@ -59,7 +59,7 @@ static void changepos(struct vt_entry *v) { } 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 @@ static void motion_wander(struct vt_entry *v) { 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 @@ static void motion_moveobj(struct vt_entry *v) { 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 @@ void in_destination(struct vt_entry *v) { setflag(v->parm4, true); } v->motion = MOTION_NORMAL; - if (v == game.view_table) + if (is_ego_view(v)) game.player_control = true; } diff --git a/engines/agi/view.cpp b/engines/agi/view.cpp index 536cf3a47f..21aa34f73a 100644 --- a/engines/agi/view.cpp +++ b/engines/agi/view.cpp @@ -375,4 +375,9 @@ void update_viewtable() { } } +bool is_ego_view(const vt_entry* v) +{ + return v == game.view_table; +} + } // End of namespace Agi diff --git a/engines/agi/view.h b/engines/agi/view.h index 414d6de01b..1a6232a539 100644 --- a/engines/agi/view.h +++ b/engines/agi/view.h @@ -137,6 +137,8 @@ int decode_view(int); 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 */ |