This commit is contained in:
Christian Semmler 2025-05-21 16:09:56 -07:00
parent 622d41abcd
commit 49638b1d1c
2 changed files with 12 additions and 8 deletions

View File

@ -29,6 +29,7 @@
#include "viewmanager/viewmanager.h" #include "viewmanager/viewmanager.h"
#include <SDL3/SDL_filesystem.h> #include <SDL3/SDL_filesystem.h>
#include <SDL3/SDL_messagebox.h>
#include <SDL3/SDL_stdinc.h> #include <SDL3/SDL_stdinc.h>
#include <stdio.h> #include <stdio.h>
#include <vec.h> #include <vec.h>
@ -640,6 +641,8 @@ MxResult LegoAnimationManager::LoadWorldInfo(LegoOmni::World p_worldId)
} }
strcat(path, filename); strcat(path, filename);
MxString::MapPathToFilesystem(path);
SDL_PathInfo pathInfo; SDL_PathInfo pathInfo;
if (!SDL_GetPathInfo(path, &pathInfo) || pathInfo.type != SDL_PATHTYPE_FILE) { if (!SDL_GetPathInfo(path, &pathInfo) || pathInfo.type != SDL_PATHTYPE_FILE) {
@ -650,8 +653,17 @@ MxResult LegoAnimationManager::LoadWorldInfo(LegoOmni::World p_worldId)
} }
strcat(path, filename); strcat(path, filename);
MxString::MapPathToFilesystem(path);
if (!SDL_GetPathInfo(path, &pathInfo) || pathInfo.type != SDL_PATHTYPE_FILE) { if (!SDL_GetPathInfo(path, &pathInfo) || pathInfo.type != SDL_PATHTYPE_FILE) {
char buffer[256];
SDL_snprintf(
buffer,
sizeof(buffer),
"\"LEGO® Island\" failed to load %s.\nPlease make sure this file is available on HD/CD.",
filename
);
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "LEGO® Island Error", buffer, NULL);
goto done; goto done;
} }
} }

View File

@ -128,14 +128,6 @@ LegoResult LegoFile::Open(const char* p_name, LegoU32 p_mode)
path.MapPathToFilesystem(); path.MapPathToFilesystem();
if (!(m_file = SDL_IOFromFile(path.GetData(), mode))) { if (!(m_file = SDL_IOFromFile(path.GetData(), mode))) {
char buffer[256];
SDL_snprintf(
buffer,
sizeof(buffer),
"\"LEGO® Island\" failed to load %s.\nPlease make sure this file is available on HD/CD.",
path.GetData()
);
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "LEGO® Island Error", buffer, NULL);
return FAILURE; return FAILURE;
} }
return SUCCESS; return SUCCESS;