[Scummvm-cvs-logs] SF.net SVN: scummvm:[33715] scummvm/branches/branch-0-12-0

knakos at users.sourceforge.net knakos at users.sourceforge.net
Sat Aug 9 20:10:23 CEST 2008


Revision: 33715
          http://scummvm.svn.sourceforge.net/scummvm/?rev=33715&view=rev
Author:   knakos
Date:     2008-08-09 18:10:21 +0000 (Sat, 09 Aug 2008)

Log Message:
-----------
fix MR on ce: allocate large buffer on the heap instead and of the stack, and improve the workaround (sync)

Modified Paths:
--------------
    scummvm/branches/branch-0-12-0/backends/platform/wince/missing/missing.cpp
    scummvm/branches/branch-0-12-0/engines/kyra/scene_mr.cpp

Modified: scummvm/branches/branch-0-12-0/backends/platform/wince/missing/missing.cpp
===================================================================
--- scummvm/branches/branch-0-12-0/backends/platform/wince/missing/missing.cpp	2008-08-09 18:09:24 UTC (rev 33714)
+++ scummvm/branches/branch-0-12-0/backends/platform/wince/missing/missing.cpp	2008-08-09 18:10:21 UTC (rev 33715)
@@ -171,7 +171,7 @@
 	MultiByteToWideChar(CP_ACP, 0, path, -1, fname, sizeof(fname)/sizeof(TCHAR));
 
 	WIN32_FIND_DATA ffd;
-	HANDLE h=FindFirstFile(fname, &ffd);
+	HANDLE h = FindFirstFile(fname, &ffd);
 	FindClose(h);
 
 	if (h == INVALID_HANDLE_VALUE)
@@ -179,12 +179,17 @@
 
 	if (ffd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) {
 		// WORKAROUND: WinCE (or the emulator) sometimes returns bogus direcotry
-		// hits for files that don't exist. Checking for the same fname twice
+		// hits for files that don't exist. TRIPLE checking for the same fname
 		// seems to weed out those false positives.
-		HANDLE h=FindFirstFile(fname, &ffd);
+		// Exhibited in kyra engine.
+		HANDLE h = FindFirstFile(fname, &ffd);
 		FindClose(h);
 		if (h == INVALID_HANDLE_VALUE)
 			return -1;  //Can't find file
+		h = FindFirstFile(fname, &ffd);
+		FindClose(h);
+		if (h == INVALID_HANDLE_VALUE)
+			return -1;  //Can't find file
 
 		return 0; //Always return success if target is directory and exists
 	}

Modified: scummvm/branches/branch-0-12-0/engines/kyra/scene_mr.cpp
===================================================================
--- scummvm/branches/branch-0-12-0/engines/kyra/scene_mr.cpp	2008-08-09 18:09:24 UTC (rev 33714)
+++ scummvm/branches/branch-0-12-0/engines/kyra/scene_mr.cpp	2008-08-09 18:10:21 UTC (rev 33715)
@@ -378,10 +378,11 @@
 	_screen->loadBitmap(filename, 5, 5, 0, true);
 
 	// HACK
-	uint8 data[320*200];
+	uint8 *data = new uint8[320*200];
 	_screen->copyRegionToBuffer(5, 0, 0, 320, 200, data);
 	_screen->clearPage(5);
 	_screen->copyBlockToPage(5, 0, _maskPageMinY, 320, height, data);
+	delete[] data;
 
 	musicUpdate(0);
 }


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