aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKostas Nakos2008-08-09 18:09:24 +0000
committerKostas Nakos2008-08-09 18:09:24 +0000
commit355f100793c8c8946b5fc418f00b2744cd4b2089 (patch)
tree61cd39600d9295b8d2f1aa71615d5138c676abc0
parente02f94d3922b39bdc8d0333c2e9fd602aeb40ef6 (diff)
downloadscummvm-rg350-355f100793c8c8946b5fc418f00b2744cd4b2089.tar.gz
scummvm-rg350-355f100793c8c8946b5fc418f00b2744cd4b2089.tar.bz2
scummvm-rg350-355f100793c8c8946b5fc418f00b2744cd4b2089.zip
fix MR on ce: allocate large buffer on the heap instead and of the stack, and improve the workaround
svn-id: r33714
-rw-r--r--backends/platform/wince/missing/missing.cpp11
-rw-r--r--engines/kyra/scene_mr.cpp3
2 files changed, 10 insertions, 4 deletions
diff --git a/backends/platform/wince/missing/missing.cpp b/backends/platform/wince/missing/missing.cpp
index c760b1f7df..f03f00bb9a 100644
--- a/backends/platform/wince/missing/missing.cpp
+++ b/backends/platform/wince/missing/missing.cpp
@@ -171,7 +171,7 @@ int _access(const char *path, int mode) {
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,9 +179,14 @@ int _access(const char *path, int mode) {
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
diff --git a/engines/kyra/scene_mr.cpp b/engines/kyra/scene_mr.cpp
index e4a3a5c54e..53c0cb5380 100644
--- a/engines/kyra/scene_mr.cpp
+++ b/engines/kyra/scene_mr.cpp
@@ -378,10 +378,11 @@ void KyraEngine_MR::loadSceneMsc() {
_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);
}