Fix loading files from CD or HD

This commit is contained in:
Anders Jenbo 2025-06-21 07:55:15 +02:00
parent 54b56c6b13
commit 4a8f77038d

View File

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