diff options
Diffstat (limited to 'backends/platform')
-rw-r--r-- | backends/platform/wince/CEActionsPocket.cpp | 2 | ||||
-rw-r--r-- | backends/platform/wince/CEActionsSmartphone.cpp | 2 | ||||
-rw-r--r-- | backends/platform/wince/missing/missing.cpp | 11 |
3 files changed, 10 insertions, 5 deletions
diff --git a/backends/platform/wince/CEActionsPocket.cpp b/backends/platform/wince/CEActionsPocket.cpp index 45310dba88..932599004d 100644 --- a/backends/platform/wince/CEActionsPocket.cpp +++ b/backends/platform/wince/CEActionsPocket.cpp @@ -121,7 +121,7 @@ void CEActionsPocket::initInstanceGame() { bool is_comi = (strncmp(gameid.c_str(), "comi", 4) == 0); bool is_gob = (strncmp(gameid.c_str(), "gob", 3) == 0); bool is_saga = (gameid == "saga"); - bool is_kyra = (gameid == "kyra1"); + bool is_kyra = (strncmp(gameid.c_str(), "kyra",4) == 0); bool is_samnmax = (gameid == "samnmax"); bool is_cine = (gameid == "cine"); bool is_touche = (gameid == "touche"); diff --git a/backends/platform/wince/CEActionsSmartphone.cpp b/backends/platform/wince/CEActionsSmartphone.cpp index 97d780d534..6877c343e3 100644 --- a/backends/platform/wince/CEActionsSmartphone.cpp +++ b/backends/platform/wince/CEActionsSmartphone.cpp @@ -111,7 +111,7 @@ void CEActionsSmartphone::initInstanceGame() { bool is_comi = (strncmp(gameid.c_str(), "comi", 4) == 0); bool is_gob = (strncmp(gameid.c_str(), "gob", 3) == 0); bool is_saga = (gameid == "saga"); - bool is_kyra = (gameid == "kyra1"); + bool is_kyra = (strncmp(gameid.c_str(), "kyra",4) == 0); bool is_samnmax = (gameid == "samnmax"); bool is_cine = (gameid == "cine"); bool is_touche = (gameid == "touche"); 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 |