diff --git a/src/Engine/Engine.cpp b/src/Engine/Engine.cpp index ff3909a2be2c..e9990757e0cf 100644 --- a/src/Engine/Engine.cpp +++ b/src/Engine/Engine.cpp @@ -670,31 +670,26 @@ void FinalInitialization() { pIcons_LOD->reserveLoadedTextures(); } -bool MM7_LoadLods() { +void MM7_LoadLods() { engine->_gameResourceManager = std::make_unique(); engine->_gameResourceManager->openGameResources(); pIcons_LOD = new LodTextureCache; - if (!pIcons_LOD->open(makeDataPath("data", "icons.lod"), "icons")) { - Error(localization->GetString(LSTR_PLEASE_REINSTALL), localization->GetString(LSTR_REINSTALL_NECESSARY)); - return false; - } + pIcons_LOD->open(makeDataPath("data", "icons.lod"), "icons"); pBitmaps_LOD = new LodTextureCache; - if (!pBitmaps_LOD->open(makeDataPath("data", "bitmaps.lod"), "bitmaps")) { - Error(localization->GetString(LSTR_PLEASE_REINSTALL), localization->GetString(LSTR_REINSTALL_NECESSARY)); - return false; - } + pBitmaps_LOD->open(makeDataPath("data", "bitmaps.lod"), "bitmaps"); pSprites_LOD = new LodSpriteCache; - if (!pSprites_LOD->open(makeDataPath("data", "sprites.lod"), "sprites08")) { - Error(localization->GetString(LSTR_PLEASE_REINSTALL), localization->GetString(LSTR_REINSTALL_NECESSARY)); - return false; - } + pSprites_LOD->open(makeDataPath("data", "sprites.lod"), "sprites08"); - pPaletteManager->load(pBitmaps_LOD); + // TODO(captainurist): + // on error in `open` we had this: + // Error(localization->GetString(LSTR_PLEASE_REINSTALL), localization->GetString(LSTR_REINSTALL_NECESSARY)); + // however, at this point localization isn't initialized yet, so this was a guaranteed crash. + // Implement proper user-facing error reporting! - return true; + pPaletteManager->load(pBitmaps_LOD); } //----- (004651F4) -------------------------------------------------------- diff --git a/src/Engine/LodTextureCache.cpp b/src/Engine/LodTextureCache.cpp index 5a54178df33d..7ab37bae2867 100644 --- a/src/Engine/LodTextureCache.cpp +++ b/src/Engine/LodTextureCache.cpp @@ -23,9 +23,8 @@ LodTextureCache::~LodTextureCache() { } } -bool LodTextureCache::open(const std::string &pFilename, const std::string &pFolderName) { +void LodTextureCache::open(const std::string &pFilename, const std::string &pFolderName) { _reader.open(pFilename); - return true; } void LodTextureCache::reserveLoadedTextures() { diff --git a/src/Engine/LodTextureCache.h b/src/Engine/LodTextureCache.h index 6308a715f0db..7aa8acd4de7e 100644 --- a/src/Engine/LodTextureCache.h +++ b/src/Engine/LodTextureCache.h @@ -17,7 +17,7 @@ class LodTextureCache { LodTextureCache(); ~LodTextureCache(); - bool open(const std::string &pFilename, const std::string &pFolderName); + void open(const std::string &pFilename, const std::string &pFolderName); void reserveLoadedTextures(); void releaseUnreserved();