fix MR on ce: allocate large buffer on the heap instead and of the stack, and improve the workaround

svn-id: r33714
This commit is contained in:
Kostas Nakos 2008-08-09 18:09:24 +00:00
parent e02f94d392
commit 355f100793
2 changed files with 10 additions and 4 deletions

View File

@ -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

View File

@ -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);
}