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

megath at users.sourceforge.net megath at users.sourceforge.net
Fri Jan 1 15:38:46 CET 2010


Revision: 46830
          http://scummvm.svn.sourceforge.net/scummvm/?rev=46830&view=rev
Author:   megath
Date:     2010-01-01 14:38:46 +0000 (Fri, 01 Jan 2010)

Log Message:
-----------
aligned zoomed picture to the top and fixed actor head animation in zoomed state

Modified Paths:
--------------
    scummvm/trunk/engines/teenagent/actor.cpp
    scummvm/trunk/engines/teenagent/surface.cpp

Modified: scummvm/trunk/engines/teenagent/actor.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/actor.cpp	2010-01-01 14:33:20 UTC (rev 46829)
+++ scummvm/trunk/engines/teenagent/actor.cpp	2010-01-01 14:38:46 UTC (rev 46830)
@@ -126,7 +126,7 @@
 	if (head != NULL) 
 		clip.top = head->h;
 
-	int xp = position.x - dx, yp = position.y - dy;
+	int xp = position.x - dx * zoom / 256, yp = position.y - dy * zoom / 256;
 	if (xp < 0)
 		xp = 0;
 	if (xp + s->w > 320)
@@ -137,7 +137,7 @@
 	if (yp + clip.top + clip.height() > 200)
 		yp = 200 - clip.top - clip.height();
 	
-	dirty = s->render(surface, xp, yp + clip.top, orientation == kActorLeft, clip, zoom);
+	dirty = s->render(surface, xp, yp + clip.top * zoom / 256, orientation == kActorLeft, clip, zoom);
 
 	if (head != NULL)
 		dirty.extend(head->render(surface, xp, yp, orientation == kActorLeft, Common::Rect(), zoom));

Modified: scummvm/trunk/engines/teenagent/surface.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/surface.cpp	2010-01-01 14:33:20 UTC (rev 46829)
+++ scummvm/trunk/engines/teenagent/surface.cpp	2010-01-01 14:38:46 UTC (rev 46830)
@@ -86,10 +86,12 @@
 			dst += surface->pitch;
 			src += pitch;
 		}
+		src_rect.translate(x + dx, y + dy);
+		return src_rect;
 	} else {
 		Common::Rect dst_rect(src_rect);
 		dst_rect.right = (dst_rect.width() * zoom / 256) + dst_rect.left;
-		dst_rect.top = dst_rect.bottom - (dst_rect.height() * zoom / 256);
+		dst_rect.bottom = dst_rect.top + (dst_rect.height() * zoom / 256);
 
 		assert(x + dx + dst_rect.width() <= surface->w);
 		assert(y + dy + dst_rect.height() <= surface->h);
@@ -105,8 +107,9 @@
 			}
 			dst += surface->pitch;
 		}
+		dst_rect.translate(x + dx, y + dy);
+		return dst_rect;
 	}
-	return Common::Rect(x + dx, y + dy, x + src_rect.width() + dx, y + src_rect.height() + dy);
 }
 
 } // End of namespace TeenAgent


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