[Scummvm-cvs-logs] SF.net SVN: scummvm:[49629] scummvm/trunk/engines/m4

dreammaster at users.sourceforge.net dreammaster at users.sourceforge.net
Sun Jun 13 12:50:54 CEST 2010


Revision: 49629
          http://scummvm.svn.sourceforge.net/scummvm/?rev=49629&view=rev
Author:   dreammaster
Date:     2010-06-13 10:50:54 +0000 (Sun, 13 Jun 2010)

Log Message:
-----------
Bugfixes for correct moving of the screen viewport within an animation

Modified Paths:
--------------
    scummvm/trunk/engines/m4/animation.cpp
    scummvm/trunk/engines/m4/mads_scene.cpp
    scummvm/trunk/engines/m4/mads_views.cpp
    scummvm/trunk/engines/m4/mads_views.h

Modified: scummvm/trunk/engines/m4/animation.cpp
===================================================================
--- scummvm/trunk/engines/m4/animation.cpp	2010-06-13 09:07:15 UTC (rev 49628)
+++ scummvm/trunk/engines/m4/animation.cpp	2010-06-13 10:50:54 UTC (rev 49629)
@@ -333,13 +333,15 @@
 
 	// Handle any offset adjustment for sprites as of this frame
 	if (_view->_posAdjust.x != misc.posAdjust.x) {
-		misc.posAdjust.x = _view->_posAdjust.x;
+		_view->_posAdjust.x = misc.posAdjust.x;
 		screenChanged = true;
 	}
 	if (_view->_posAdjust.y != misc.posAdjust.y) {
-		misc.posAdjust.y = _view->_posAdjust.y;
+		_view->_posAdjust.y = misc.posAdjust.y;
 		screenChanged = true;
 	}
+
+
 	if (screenChanged) {
 		// Signal the entire screen needs refreshing
 		_view->_spriteSlots.fullRefresh();

Modified: scummvm/trunk/engines/m4/mads_scene.cpp
===================================================================
--- scummvm/trunk/engines/m4/mads_scene.cpp	2010-06-13 09:07:15 UTC (rev 49628)
+++ scummvm/trunk/engines/m4/mads_scene.cpp	2010-06-13 10:50:54 UTC (rev 49629)
@@ -655,7 +655,6 @@
 	drawStyle = stream->readUint16LE();
 	width = stream->readUint16LE();
 	height = stream->readUint16LE();
-	assert((width == 320) && (height == 156));
 	
 	stream->skip(24);
 

Modified: scummvm/trunk/engines/m4/mads_views.cpp
===================================================================
--- scummvm/trunk/engines/m4/mads_views.cpp	2010-06-13 09:07:15 UTC (rev 49628)
+++ scummvm/trunk/engines/m4/mads_views.cpp	2010-06-13 10:50:54 UTC (rev 49629)
@@ -855,10 +855,15 @@
 	da1.textActive = true;
 }
 
-void MadsDirtyAreas::copy(M4Surface *dest, M4Surface *src, int yOffset) {
+void MadsDirtyAreas::copy(M4Surface *dest, M4Surface *src, int yOffset, const Common::Point &posAdjust) {
 	for (uint i = 0; i < _entries.size(); ++i) {
+		const Common::Rect &srcBounds = _entries[i].bounds;
+
+		Common::Rect bounds(srcBounds.left + posAdjust.x, srcBounds.top + posAdjust.y,
+			srcBounds.right + posAdjust.x, srcBounds.bottom + posAdjust.y);
+
 		if (_entries[i].active && _entries[i].bounds.isValidRect())
-			src->copyTo(dest, _entries[i].bounds, _entries[i].bounds.left, _entries[i].bounds.top + yOffset);
+			src->copyTo(dest, bounds, _entries[i].bounds.left, _entries[i].bounds.top + yOffset);
 	}
 }
 
@@ -1202,7 +1207,7 @@
 	_dirtyAreas.merge(1, DIRTY_AREAS_SIZE);
 	
 	// Copy dirty areas to the main display surface 
-	_dirtyAreas.copy(_view, _bgSurface, _yOffset);
+	_dirtyAreas.copy(_view, _bgSurface, _yOffset, _posAdjust);
 
 	// Handle dirty areas for foreground objects
 	_spriteSlots.setDirtyAreas();

Modified: scummvm/trunk/engines/m4/mads_views.h
===================================================================
--- scummvm/trunk/engines/m4/mads_views.h	2010-06-13 09:07:15 UTC (rev 49628)
+++ scummvm/trunk/engines/m4/mads_views.h	2010-06-13 10:50:54 UTC (rev 49629)
@@ -289,7 +289,7 @@
 	void merge(int startIndex, int count);
 	bool intersects(int idx1, int idx2);
 	void mergeAreas(int idx1, int idx2);
-	void copy(M4Surface *dest, M4Surface *src, int yOffset);
+	void copy(M4Surface *dest, M4Surface *src, int yOffset, const Common::Point &posAdjust);
 };
 
 enum SpriteAnimType {ANIMTYPE_CYCLED = 1, ANIMTYPE_REVERSIBLE = 2};


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