diff options
author | Vladimir Menshakov | 2009-12-12 13:05:55 +0000 |
---|---|---|
committer | Vladimir Menshakov | 2009-12-12 13:05:55 +0000 |
commit | 100805144ab212b958159a733f35a0754db8b16a (patch) | |
tree | 2ae9ed503f5f6cb1cf08e6e9cbccb79db5be958c | |
parent | d45385f98ed5453f25cefa19d687bd85ffc82324 (diff) | |
download | scummvm-rg350-100805144ab212b958159a733f35a0754db8b16a.tar.gz scummvm-rg350-100805144ab212b958159a733f35a0754db8b16a.tar.bz2 scummvm-rg350-100805144ab212b958159a733f35a0754db8b16a.zip |
render 'on' surfaces only on mark (fixed many z-order issues)
svn-id: r46341
-rw-r--r-- | engines/teenagent/scene.cpp | 10 | ||||
-rw-r--r-- | engines/teenagent/surface_list.cpp | 25 | ||||
-rw-r--r-- | engines/teenagent/surface_list.h | 2 |
3 files changed, 12 insertions, 25 deletions
diff --git a/engines/teenagent/scene.cpp b/engines/teenagent/scene.cpp index dfe74fc0e8..0ade44f431 100644 --- a/engines/teenagent/scene.cpp +++ b/engines/teenagent/scene.cpp @@ -595,12 +595,6 @@ bool Scene::render(OSystem *system) { } } - if (debug_features.feature[DebugFeatures::kShowOn]) { - if (_id != 16 || getOns(16)[0] != 0) { - 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 :( - } - } - { Surface *mark = actor_animation.currentFrame(); if (mark != NULL) { @@ -657,9 +651,7 @@ bool Scene::render(OSystem *system) { //render on if (debug_features.feature[DebugFeatures::kShowOn]) { - if (_id != 16 || getOns(16)[0] != 0) { - 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 :( - } + on.render(surface, actor_animation_position); } if (!message.empty()) { diff --git a/engines/teenagent/surface_list.cpp b/engines/teenagent/surface_list.cpp index 57cc5677d6..cd0b559793 100644 --- a/engines/teenagent/surface_list.cpp +++ b/engines/teenagent/surface_list.cpp @@ -24,6 +24,7 @@ #include "teenagent/surface.h" #include "teenagent/surface_list.h" +#include "objects.h" namespace TeenAgent { @@ -44,16 +45,13 @@ void SurfaceList::load(Common::SeekableReadStream *stream, Type type, int sub_ha surfaces = new Surface[surfaces_n]; - byte i; - for (i = 0; i < surfaces_n; ++i) { + for (byte i = 0; i < surfaces_n; ++i) { uint offset = stream->readUint16LE(); uint pos = stream->pos(); stream->seek(offset); surfaces[i].load(stream, Surface::kTypeOns); stream->seek(pos); } - //for(; i < fn; ++i) - // debug(0, "*hack* skipping flag %04x", stream->readUint16LE()); } void SurfaceList::free() { @@ -62,20 +60,17 @@ void SurfaceList::free() { surfaces_n = 0; } -Common::Rect SurfaceList::render(Graphics::Surface *surface, int horizon, bool second_pass) const { - Common::Rect dirty; +void SurfaceList::render(Graphics::Surface *surface, const Common::Rect & clip) const { 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); - if (s.y + s.h > horizon) - dirty.extend(s.render(surface)); - } else { - if (s.y + s.h <= horizon) - dirty.extend(s.render(surface)); - } + Common::Rect r(s.x, s.y, s.x + s.w, s.y + s.h); + if (r.bottom < clip.bottom || !clip.intersects(r)) + continue; + + r.clip(clip); + r.translate(-s.x, -s.y); + s.render(surface, r.left, r.top, false, r); } - return dirty; } } diff --git a/engines/teenagent/surface_list.h b/engines/teenagent/surface_list.h index 08d8d074a6..1f6ca0c510 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 horizon, bool second_pass) const; + void render(Graphics::Surface *surface, const Common::Rect & clip) const; protected: Surface * surfaces; |