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

dreammaster at users.sourceforge.net dreammaster at users.sourceforge.net
Mon Jun 28 13:40:39 CEST 2010


Revision: 50432
          http://scummvm.svn.sourceforge.net/scummvm/?rev=50432&view=rev
Author:   dreammaster
Date:     2010-06-28 11:40:39 +0000 (Mon, 28 Jun 2010)

Log Message:
-----------
Bugfix to properly erase text messages when they expire

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

Modified: scummvm/trunk/engines/m4/mads_views.cpp
===================================================================
--- scummvm/trunk/engines/m4/mads_views.cpp	2010-06-28 11:23:16 UTC (rev 50431)
+++ scummvm/trunk/engines/m4/mads_views.cpp	2010-06-28 11:40:39 UTC (rev 50432)
@@ -313,7 +313,7 @@
 void MadsTextDisplay::setDirtyAreas() {
 	// Determine dirty areas for active text areas
 	for (uint idx = 0, dirtyIdx = DIRTY_AREAS_TEXT_DISPLAY_IDX; dirtyIdx < DIRTY_AREAS_SIZE; ++idx, ++dirtyIdx) {
-		if ((_entries[idx].expire < 0) || !_entries[idx].active)
+		if ((_entries[idx].expire >= 0) || !_entries[idx].active)
 			_owner._dirtyAreas[dirtyIdx].active = false;
 		else {
 			_owner._dirtyAreas[dirtyIdx].textActive = true;
@@ -341,14 +341,6 @@
 				_entries[idx].spacing);
 		}
 	}
-
-	// Clear up any now text display entries that are to be expired
-	for (uint idx = 0; idx < _entries.size(); ++idx) {
-		if (_entries[idx].expire < 0) {
-			_entries[idx].active = false;
-			_entries[idx].expire = 0;
-		}
-	}
 }
 
 /**
@@ -827,6 +819,7 @@
  * @param count			Number of entries to process
  */
 void MadsDirtyAreas::merge(int startIndex, int count) {
+return;//***DEBUG***
 	if (startIndex >= count)
 		return;
 
@@ -878,6 +871,11 @@
 	}
 }
 
+void MadsDirtyAreas::clear() {
+	for (uint i = 0; i < _entries.size(); ++i)
+		_entries[i].active = false;
+}
+
 /*--------------------------------------------------------------------------*/
 
 MadsSequenceList::MadsSequenceList(MadsView &owner): _owner(owner) {
@@ -1209,6 +1207,7 @@
 
 void MadsView::refresh() {
 	// Draw any sprites
+	_dirtyAreas.clear();
 	_spriteSlots.drawBackground(_yOffset);
 
 	// Process dirty areas

Modified: scummvm/trunk/engines/m4/mads_views.h
===================================================================
--- scummvm/trunk/engines/m4/mads_views.h	2010-06-28 11:23:16 UTC (rev 50431)
+++ scummvm/trunk/engines/m4/mads_views.h	2010-06-28 11:40:39 UTC (rev 50432)
@@ -294,6 +294,7 @@
 	bool intersects(int idx1, int idx2);
 	void mergeAreas(int idx1, int idx2);
 	void copy(M4Surface *dest, M4Surface *src, int yOffset, const Common::Point &posAdjust);
+	void clear();
 };
 
 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