[Scummvm-cvs-logs] CVS: scummvm/scumm resource_v7he.cpp,1.54,1.55

Gregory Montoir cyx at users.sourceforge.net
Tue Jan 10 13:11:12 CET 2006


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4289

Modified Files:
	resource_v7he.cpp 
Log Message:
Free the palette before re-using a 'cached cursor' slot.

Index: resource_v7he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource_v7he.cpp,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -d -r1.54 -r1.55
--- resource_v7he.cpp	10 Jan 2006 12:34:20 -0000	1.54
+++ resource_v7he.cpp	10 Jan 2006 21:10:48 -0000	1.55
@@ -49,10 +49,10 @@
 		CachedCursor *cc = &_cursorCache[i];
 		if (cc->valid) {
 			free(cc->bitmap);
-			cc->bitmap = NULL;
-			cc->valid = false;
+			free(cc->palette);
 		}
 	}
+	memset(_cursorCache, 0, sizeof(_cursorCache));
 }
 
 ResExtractor::CachedCursor *ResExtractor::findCachedCursor(int id) {
@@ -81,8 +81,8 @@
 	}
 	assert(r);
 	free(r->bitmap);
-	r->bitmap = NULL;
-	r->valid = false;
+	free(r->palette);
+	memset(r, 0, sizeof(CachedCursor));
 	return r;
 }
 
@@ -106,7 +106,7 @@
 	}
 
 	if (_vm->_system->hasFeature(OSystem::kFeatureCursorHasPalette) && cc->palette)
-			_vm->_system->setCursorPalette(cc->palette, 0, cc->palSize);
+		_vm->_system->setCursorPalette(cc->palette, 0, cc->palSize);
 
 	_vm->setCursorHotspot(cc->hotspot_x, cc->hotspot_y);
 	_vm->setCursorFromBuffer(cc->bitmap, cc->w, cc->h, cc->w);





More information about the Scummvm-git-logs mailing list