[Scummvm-cvs-logs] SF.net SVN: scummvm:[46341] scummvm/trunk/engines/teenagent

megath at users.sourceforge.net megath at users.sourceforge.net
Sat Dec 12 14:06:13 CET 2009


Revision: 46341
          http://scummvm.svn.sourceforge.net/scummvm/?rev=46341&view=rev
Author:   megath
Date:     2009-12-12 13:05:55 +0000 (Sat, 12 Dec 2009)

Log Message:
-----------
render 'on' surfaces only on mark (fixed many z-order issues)

Modified Paths:
--------------
    scummvm/trunk/engines/teenagent/scene.cpp
    scummvm/trunk/engines/teenagent/surface_list.cpp
    scummvm/trunk/engines/teenagent/surface_list.h

Modified: scummvm/trunk/engines/teenagent/scene.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/scene.cpp	2009-12-12 13:00:44 UTC (rev 46340)
+++ scummvm/trunk/engines/teenagent/scene.cpp	2009-12-12 13:05:55 UTC (rev 46341)
@@ -595,12 +595,6 @@
 			}
 		}
 
-		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 @@
 
 		//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()) {

Modified: scummvm/trunk/engines/teenagent/surface_list.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/surface_list.cpp	2009-12-12 13:00:44 UTC (rev 46340)
+++ scummvm/trunk/engines/teenagent/surface_list.cpp	2009-12-12 13:05:55 UTC (rev 46341)
@@ -24,6 +24,7 @@
 
 #include "teenagent/surface.h"
 #include "teenagent/surface_list.h"
+#include "objects.h"
 
 namespace TeenAgent {
 
@@ -44,16 +45,13 @@
 	
 	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 @@
 	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;
 }
 
 }

Modified: scummvm/trunk/engines/teenagent/surface_list.h
===================================================================
--- scummvm/trunk/engines/teenagent/surface_list.h	2009-12-12 13:00:44 UTC (rev 46340)
+++ scummvm/trunk/engines/teenagent/surface_list.h	2009-12-12 13:05:55 UTC (rev 46341)
@@ -37,7 +37,7 @@
 	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;


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