mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-01-11 18:41:14 +00:00
Fix loading files from CD or HD (#357)
This commit is contained in:
parent
510d6f312a
commit
922794e7ea
@ -1059,8 +1059,18 @@ MxResult IsleApp::VerifyFilesystem()
|
|||||||
MxString path(&file[1]);
|
MxString path(&file[1]);
|
||||||
path.MapPathToFilesystem();
|
path.MapPathToFilesystem();
|
||||||
|
|
||||||
if (!SDL_GetPathInfo(path.GetData(), NULL)) {
|
const char* searchPaths[] = {".", m_hdPath, m_cdPath};
|
||||||
char buffer[512];
|
char buffer[1024];
|
||||||
|
|
||||||
|
bool found = false;
|
||||||
|
for (const char* base : searchPaths) {
|
||||||
|
SDL_snprintf(buffer, sizeof(buffer), "%s%s", base, path.GetData());
|
||||||
|
found = SDL_GetPathInfo(buffer, NULL);
|
||||||
|
if (found) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found) {
|
||||||
SDL_snprintf(
|
SDL_snprintf(
|
||||||
buffer,
|
buffer,
|
||||||
sizeof(buffer),
|
sizeof(buffer),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user