[Scummvm-cvs-logs] SF.net SVN: scummvm: [21948] scummvm/trunk/engines/simon/cursor.cpp

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Sun Apr 16 10:54:02 CEST 2006


Revision: 21948
Author:   eriktorbjorn
Date:     2006-04-16 10:53:37 -0700 (Sun, 16 Apr 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21948&view=rev

Log Message:
-----------
The backend is responsible for making its own copy of the mouse cursor, so FF
can use the original data, instead of leaking memory every time the
drawMousePointer() function is called (several times per second).

Modified Paths:
--------------
    scummvm/trunk/engines/simon/cursor.cpp
Modified: scummvm/trunk/engines/simon/cursor.cpp
===================================================================
--- scummvm/trunk/engines/simon/cursor.cpp	2006-04-16 16:56:11 UTC (rev 21947)
+++ scummvm/trunk/engines/simon/cursor.cpp	2006-04-16 17:53:37 UTC (rev 21948)
@@ -227,7 +227,7 @@
 	//debug(0, "Mouse %d Anim %d Max %d", _mouseCursor, _mouseAnim, _mouseAnimMax);
 
 	if (getGameType() == GType_FF) {
-		byte *src, *dst;
+		byte *src;
 		VgaPointersEntry *vpe = &_vgaBufferPointers[7];
 		uint cursor, image, width, height;
 
@@ -241,7 +241,7 @@
 		if (_animatePointer == 0 && getBitFlag(99)) {
 			cursor = 6;
 			_mouseAnim = 1;
-		} else 	if (getBitFlag(72)) {
+		} else if (getBitFlag(72)) {
 			cursor += 7;
 		}
 
@@ -252,9 +252,7 @@
 		height = READ_LE_UINT16(src + 4) & 0x7FFF;
 		src = vpe->vgaFile2 + readUint32Wrapper(src);
 
-		dst = (byte *)malloc(width * height);
-		memcpy(dst, src, width * height);
-		_system->setMouseCursor(dst, width, height, width / 2, height / 2, 0);
+		_system->setMouseCursor(src, width, height, width / 2, height / 2, 0);
 	} else if (getGameType() == GType_SIMON2) {
 		_system->setMouseCursor(_simon2_cursors[_mouseCursor], 16, 16, 7, 7);
 	} else {


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