diff options
author | Vladimir Menshakov | 2009-09-08 19:24:20 +0000 |
---|---|---|
committer | Vladimir Menshakov | 2009-09-08 19:24:20 +0000 |
commit | a466f1dcfdbb7d6a5afab39d6016b01312ff25d1 (patch) | |
tree | ac2d7950eb47a136fcee1782be6cc46efc6abc03 | |
parent | 908e6b857df87ae9dc580487cfdffaacf19eb9f3 (diff) | |
download | scummvm-rg350-a466f1dcfdbb7d6a5afab39d6016b01312ff25d1.tar.gz scummvm-rg350-a466f1dcfdbb7d6a5afab39d6016b01312ff25d1.tar.bz2 scummvm-rg350-a466f1dcfdbb7d6a5afab39d6016b01312ff25d1.zip |
added actor-walkbox position correction
svn-id: r44013
-rw-r--r-- | engines/teenagent/objects.cpp | 3 | ||||
-rw-r--r-- | engines/teenagent/objects.h | 2 | ||||
-rw-r--r-- | engines/teenagent/scene.cpp | 21 |
3 files changed, 22 insertions, 4 deletions
diff --git a/engines/teenagent/objects.cpp b/engines/teenagent/objects.cpp index c6b64c8b9e..fd97b15891 100644 --- a/engines/teenagent/objects.cpp +++ b/engines/teenagent/objects.cpp @@ -35,7 +35,8 @@ void Rect::render(Graphics::Surface *surface, uint8 color) const { } 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); } diff --git a/engines/teenagent/objects.h b/engines/teenagent/objects.h index 3aceaaf9e6..157d592064 100644 --- a/engines/teenagent/objects.h +++ b/engines/teenagent/objects.h @@ -92,7 +92,7 @@ struct UseObject { struct Walkbox { byte unk00; - byte unk01; + byte orientation; Rect rect; byte unk0a; byte unk0b; diff --git a/engines/teenagent/scene.cpp b/engines/teenagent/scene.cpp index eab6d62e6e..c9ebdcaf35 100644 --- a/engines/teenagent/scene.cpp +++ b/engines/teenagent/scene.cpp @@ -52,9 +52,26 @@ void Scene::moveTo(const Common::Point & _point, byte orient, bool validate) { 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; + } } } } |