From 6e8595b814123cff18485998b50fe86430672348 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Wed, 18 Nov 2009 08:15:16 +0000 Subject: use actual actor position for overlay positioning to avoid z-order glitches. svn-id: r45969 --- engines/teenagent/callbacks.cpp | 3 +++ engines/teenagent/scene.cpp | 4 ++-- engines/teenagent/surface.cpp | 2 +- engines/teenagent/surface_list.cpp | 2 +- engines/teenagent/surface_list.h | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) (limited to 'engines/teenagent') diff --git a/engines/teenagent/callbacks.cpp b/engines/teenagent/callbacks.cpp index 55048e09e9..a3066df71a 100644 --- a/engines/teenagent/callbacks.cpp +++ b/engines/teenagent/callbacks.cpp @@ -356,6 +356,9 @@ bool TeenAgentEngine::processCallback(uint16 addr) { playAnimation(820, 1); setOns(3, 0x59); //some moving animation is missing here + moveTo(scene->getPosition().x, scene->getPosition().y + 1, 3); + //wait + moveTo(scene->getPosition().x, scene->getPosition().y - 1, 2); displayMessage(0x551f); enableObject(4); SET_FLAG(0xdbdc, 1); diff --git a/engines/teenagent/scene.cpp b/engines/teenagent/scene.cpp index 4e2a9463e6..31f529e75a 100644 --- a/engines/teenagent/scene.cpp +++ b/engines/teenagent/scene.cpp @@ -651,7 +651,7 @@ bool Scene::render(OSystem *system) { if (debug_features.feature[DebugFeatures::kShowOn]) { if (_id != 16 || getOns(16)[0] != 0) { - on.render(surface, actor_animation_position.bottom, false); //do not render boat on isle. I double checked all callbacks, there's no code switching off the boat :( + on.render(surface, position.y, false); //do not render boat on isle. I double checked all callbacks, there's no code switching off the boat :( } } @@ -720,7 +720,7 @@ bool Scene::render(OSystem *system) { //render on if (debug_features.feature[DebugFeatures::kShowOn]) { if (_id != 16 || getOns(16)[0] != 0) { - on.render(surface, actor_animation_position.bottom, true); //do not render boat on isle. I double checked all callbacks, there's no code switching off the boat :( + on.render(surface, position.y, true); //do not render boat on isle. I double checked all callbacks, there's no code switching off the boat :( } } diff --git a/engines/teenagent/surface.cpp b/engines/teenagent/surface.cpp index a811f2731a..1bc9cad332 100644 --- a/engines/teenagent/surface.cpp +++ b/engines/teenagent/surface.cpp @@ -51,7 +51,7 @@ void Surface::load(Common::SeekableReadStream *stream, Type type) { if (stream->eos() || w_ == 0) return; - if (w_ * h_ > stream->size()) {//rough but working + if (w_ * h_ > stream->size()) { debug(0, "invalid surface %ux%u -> %u,%u", w_, h_, x, y); return; } diff --git a/engines/teenagent/surface_list.cpp b/engines/teenagent/surface_list.cpp index 2c34b3b3fc..57cc5677d6 100644 --- a/engines/teenagent/surface_list.cpp +++ b/engines/teenagent/surface_list.cpp @@ -67,7 +67,7 @@ Common::Rect SurfaceList::render(Graphics::Surface *surface, int horizon, bool s for(uint i = 0; i < surfaces_n; ++i) { const Surface &s = surfaces[i]; if (second_pass) { - debug(0, "%d %d", s.y + s.h, horizon); + //debug(0, "%d %d", s.y + s.h, horizon); if (s.y + s.h > horizon) dirty.extend(s.render(surface)); } else { diff --git a/engines/teenagent/surface_list.h b/engines/teenagent/surface_list.h index 089c3d3cab..08d8d074a6 100644 --- a/engines/teenagent/surface_list.h +++ b/engines/teenagent/surface_list.h @@ -37,7 +37,7 @@ public: SurfaceList(); void load(Common::SeekableReadStream *stream, Type type, int sub_hack = 0); void free(); - Common::Rect render(Graphics::Surface *surface, int horizont, bool second_pass) const; + Common::Rect render(Graphics::Surface *surface, int horizon, bool second_pass) const; protected: Surface * surfaces; -- cgit v1.2.3