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

dreammaster at users.sourceforge.net dreammaster at users.sourceforge.net
Mon Jun 7 12:17:45 CEST 2010


Revision: 49480
          http://scummvm.svn.sourceforge.net/scummvm/?rev=49480&view=rev
Author:   dreammaster
Date:     2010-06-07 10:17:44 +0000 (Mon, 07 Jun 2010)

Log Message:
-----------
Added extra positioning and dummy depths surface so that the introduction cutscene now starts up

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

Modified: scummvm/trunk/engines/m4/mads_anim.cpp
===================================================================
--- scummvm/trunk/engines/m4/mads_anim.cpp	2010-06-07 09:35:59 UTC (rev 49479)
+++ scummvm/trunk/engines/m4/mads_anim.cpp	2010-06-07 10:17:44 UTC (rev 49480)
@@ -446,6 +446,7 @@
 
 	MadsView::_bgSurface = &_backgroundSurface;
 	MadsView::_depthSurface = &_codeSurface;
+	MadsView::_yOffset = MADS_Y_OFFSET;
 
 	_screenType = VIEWID_ANIMVIEW;
 	_screenFlags.layer = LAYER_BACKGROUND;
@@ -512,14 +513,6 @@
 	if (!_script)
 		return;
 
-	// Only update state if wait period has expired
-	if (_previousUpdate > 0) {
-		if (g_system->getMillis() - _previousUpdate < 100)
-			return;
-
-		_previousUpdate = g_system->getMillis();
-	}
-
 	if (!_activeAnimation) {
 		readNextCommand();
 		assert(_activeAnimation);
@@ -579,7 +572,7 @@
 
 	_backgroundSurface.loadBackground(_activeAnimation->roomNumber());
 	_codeSurface.setSize(_backgroundSurface.width(), _backgroundSurface.height());
-	_codeSurface.clear();
+	_codeSurface.fillRect(_codeSurface.bounds(), 0xff);
 
 	_spriteSlots.fullRefresh();
 /*

Modified: scummvm/trunk/engines/m4/mads_views.cpp
===================================================================
--- scummvm/trunk/engines/m4/mads_views.cpp	2010-06-07 09:35:59 UTC (rev 49479)
+++ scummvm/trunk/engines/m4/mads_views.cpp	2010-06-07 10:17:44 UTC (rev 49480)
@@ -170,7 +170,7 @@
 		_owner._dirtyAreas[i].active = false;
 }
 
-void MadsSpriteSlots::drawForeground(View *view) {
+void MadsSpriteSlots::drawForeground(View *view, int yOffset) {
 	DepthList depthList;
 
 	// Get a list of sprite object depths for active objects
@@ -196,7 +196,7 @@
 			// Minimalised drawing
 			assert(slot.spriteListIndex < (int)_sprites.size());
 			M4Sprite *spr = spriteSet.getFrame((slot.frameNumber & 0x7fff) - 1);
-			spr->copyTo(view, slot.xp, slot.yp, slot.depth, _owner._depthSurface, slot.scale, 0);
+			spr->copyTo(view, slot.xp, slot.yp + yOffset, slot.depth, _owner._depthSurface, slot.scale, 0);
 		} else {
 			int xp, yp;
 			M4Sprite *spr = spriteSet.getFrame(slot.frameNumber - 1);
@@ -211,10 +211,10 @@
 
 			if (slot.depth > 1) {
 				// Draw the frame with depth processing
-				spr->copyTo(view, xp, yp, slot.depth, _owner._depthSurface, 100, 0);
+				spr->copyTo(view, xp, yp + yOffset, slot.depth, _owner._depthSurface, 100, 0);
 			} else {
 				// No depth, so simply draw the image
-				spr->copyTo(view, xp, yp, 0);
+				spr->copyTo(view, xp, yp + yOffset, 0);
 			}
 		}
 	}
@@ -326,12 +326,12 @@
 	}
 }
 
-void MadsTextDisplay::draw(View *view) {
+void MadsTextDisplay::draw(View *view, int yOffset) {
 	for (uint idx = 0; idx < _entries.size(); ++idx) {
 		if (_entries[idx].active && (_entries[idx].expire >= 0)) {
 			_entries[idx].font->setColours(_entries[idx].colour1, _entries[idx].colour2, 0);
 			_entries[idx].font->writeString(view, _entries[idx].msg, 
-				_entries[idx].bounds.left, _entries[idx].bounds.top, _entries[idx].bounds.width(),
+				_entries[idx].bounds.left, _entries[idx].bounds.top + yOffset, _entries[idx].bounds.width(),
 				_entries[idx].spacing);
 		}
 	}
@@ -855,10 +855,10 @@
 	da1.textActive = true;
 }
 
-void MadsDirtyAreas::copy(M4Surface *dest, M4Surface *src) {
+void MadsDirtyAreas::copy(M4Surface *dest, M4Surface *src, int yOffset) {
 	for (uint i = 0; i < _entries.size(); ++i) {
 		if (_entries[i].active && _entries[i].bounds.isValidRect())
-			src->copyTo(dest, _entries[i].bounds, _entries[i].bounds.left, _entries[i].bounds.top);
+			src->copyTo(dest, _entries[i].bounds, _entries[i].bounds.left, _entries[i].bounds.top + yOffset);
 	}
 }
 
@@ -1180,7 +1180,8 @@
 	_abortTimers2 = 0;
 	_abortTimersMode = ABORTMODE_0;
 	_abortTimersMode2 = ABORTMODE_0;
-	
+
+	_yOffset = 0;
 	_depthSurface = NULL;
 	_bgSurface = NULL;
 	_sceneAnimation = new MadsAnimation(_vm, this);
@@ -1201,7 +1202,7 @@
 	_dirtyAreas.merge(1, DIRTY_AREAS_SIZE);
 	
 	// Copy dirty areas to the main display surface 
-	_dirtyAreas.copy(_view, _bgSurface);
+	_dirtyAreas.copy(_view, _bgSurface, _yOffset);
 
 	// Handle dirty areas for foreground objects
 	_spriteSlots.setDirtyAreas();
@@ -1209,10 +1210,10 @@
 	_dirtyAreas.merge(1, DIRTY_AREAS_SIZE);
 
 	// Draw foreground sprites
-	_spriteSlots.drawForeground(_view);
+	_spriteSlots.drawForeground(_view, _yOffset);
 
 	// Draw text elements onto the view
-	_textDisplay.draw(_view);
+	_textDisplay.draw(_view, _yOffset);
 
 	// Remove any sprite slots that are no longer needed
 	_spriteSlots.cleanUp();

Modified: scummvm/trunk/engines/m4/mads_views.h
===================================================================
--- scummvm/trunk/engines/m4/mads_views.h	2010-06-07 09:35:59 UTC (rev 49479)
+++ scummvm/trunk/engines/m4/mads_views.h	2010-06-07 10:17:44 UTC (rev 49480)
@@ -98,7 +98,7 @@
 	void deleteTimer(int seqIndex);
 
 	void drawBackground();
-	void drawForeground(View *view);
+	void drawForeground(View *view, int yOffset);
 	void setDirtyAreas();
 	void fullRefresh();
 	void cleanUp();
@@ -139,7 +139,7 @@
 
 	int add(int xp, int yp, uint fontColour, int charSpacing, const char *msg, Font *font);
 	void clear();
-	void draw(View *view);
+	void draw(View *view, int yOffset);
 	void setDirtyAreas();
 	void setDirtyAreas2();
 	void cleanUp();
@@ -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);
+	void copy(M4Surface *dest, M4Surface *src, int yOffset);
 };
 
 enum SpriteAnimType {ANIMTYPE_CYCLED = 1, ANIMTYPE_REVERSIBLE = 2};
@@ -398,6 +398,7 @@
 
 	M4Surface *_depthSurface;
 	M4Surface *_bgSurface;
+	int _yOffset;
 public:
 	MadsView(View *view);
 	~MadsView();


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