bool WitcherEngine::changeLanguage() { Aurora::Language languageText, languageVoice; if (!evaluateLanguage(false, languageText, languageVoice)) return false; if ((_languageText == languageText) && (_languageVoice == languageVoice)) return true; try { loadLanguageFiles(languageText, languageVoice); if (_game) _game->refreshLocalized(); _languageText = languageText; _languageVoice = languageVoice; } catch (...) { // Roll back loadLanguageFiles(_languageText, _languageVoice); return false; } return true; }
void WitcherEngine::loadLanguageFiles(LoadProgress &progress, Aurora::Language langText, Aurora::Language langVoice) { progress.step(Common::UString::format("Indexing language files (%s text + %s voices)", LangMan.getLanguageName(langText).c_str(), LangMan.getLanguageName(langVoice).c_str())); loadLanguageFiles(langText, langVoice); }
bool SonicEngine::changeLanguage() { Aurora::Language language; if (!evaluateLanguage(false, language)) return false; if (_language == language) return true; try { loadLanguageFiles(language); _language = language; } catch (...) { // Roll back loadLanguageFiles(_language); return false; } return true; }
void WitcherEngine::initResources(LoadProgress &progress) { progress.step("Setting base directory"); ResMan.registerDataBase(_target); progress.step("Adding extra archive directories"); indexMandatoryDirectory("system" , 0, 0, 2); indexMandatoryDirectory("system/scripts", 0, 0, 3); indexMandatoryDirectory("data" , 0, 0, 4); indexMandatoryDirectory("data/modules" , 0, -1, 5); // Contains BIFs with voices for the two premium modules indexOptionalDirectory("data/voices", 0, 0, 6); progress.step("Loading main KEY"); indexMandatoryArchive("main.key", 10); progress.step("Loading the localized base KEY"); indexMandatoryArchive("localized.key", 50); // Language files at 100-102 progress.step("Indexing extra resources"); indexOptionalDirectory("data/movies" , 0, -1, 150); indexOptionalDirectory("data/music" , 0, -1, 151); indexOptionalDirectory("data/sounds" , 0, -1, 152); indexOptionalDirectory("data/cutscenes", 0, -1, 153); indexOptionalDirectory("data/dialogues", 0, -1, 154); indexOptionalDirectory("data/fx" , 0, -1, 155); indexOptionalDirectory("data/meshes" , 0, -1, 156); indexOptionalDirectory("data/quests" , 0, -1, 157); indexOptionalDirectory("data/scripts" , 0, -1, 158); indexOptionalDirectory("data/templates", 0, -1, 159); indexOptionalDirectory("data/textures" , 0, -1, 160); progress.step("Indexing Windows-specific resources"); indexMandatoryArchive("witcher.exe", 250); progress.step("Indexing override files"); indexOptionalDirectory("data/override", 0, 0, 500); loadLanguageFiles(progress, _languageText, _languageVoice); progress.step("Registering file formats"); registerModelLoader(new WitcherModelLoader); FontMan.setFormat(Graphics::Aurora::kFontFormatTTF); }
void SonicEngine::initResources(LoadProgress &progress) { ResMan.setHasSmall(true); ResMan.setHashAlgo(Common::kHashDJB2); progress.step("Indexing the ROM file"); ResMan.registerDataBase(_target); progress.step("Indexing the main HERF file"); indexMandatoryArchive("test.herf", 10); loadLanguageFiles(progress, _language); progress.step("Registering files and formats"); declareResources(); registerModelLoader(new SonicModelLoader); FontMan.setFormat(Graphics::Aurora::kFontFormatNFTR); GfxMan.setOrthogonal(0.0f, 1000.0f); GfxMan.setCullFace(false); }
void SonicEngine::loadLanguageFiles(LoadProgress &progress, Aurora::Language language) { progress.step(Common::UString::format("Indexing language files (%s)", LangMan.getLanguageName(language).c_str())); loadLanguageFiles(language); }
void DragonAge2Engine::initResources(LoadProgress &progress) { ResMan.setRIMsAreERFs(true); ResMan.setHashAlgo(Common::kHashFNV64); progress.step("Setting base directory"); ResMan.registerDataBase(_target); progress.step("Adding extra archive directories"); indexMandatoryDirectory("packages/core/data" , 0, 0, 2); indexMandatoryDirectory("packages/core/textures/", 0, -1, 3); progress.step("Loading core resource files"); indexMandatoryArchive("packages/core/data/2da.rim" , 10); indexMandatoryArchive("packages/core/data/al_char_stage.rim" , 11); indexMandatoryArchive("packages/core/data/artfp.erf" , 12); indexMandatoryArchive("packages/core/data/artfpwin32.erf" , 13); indexMandatoryArchive("packages/core/data/chargen.gpu.rim" , 14); indexMandatoryArchive("packages/core/data/chargen.rim" , 15); indexMandatoryArchive("packages/core/data/designerresources.rim" , 16); indexMandatoryArchive("packages/core/data/designerscripts.rim" , 17); indexMandatoryArchive("packages/core/data/face.erf" , 18); indexMandatoryArchive("packages/core/data/fonts.erf" , 19); indexMandatoryArchive("packages/core/data/global-uncompressed.rim" , 20); indexMandatoryArchive("packages/core/data/global.rim" , 21); indexMandatoryArchive("packages/core/data/globalani-core.rim" , 22); indexMandatoryArchive("packages/core/data/globalchargen-core.rim" , 23); indexMandatoryArchive("packages/core/data/globalchargendds-core.gpu.rim", 24); indexMandatoryArchive("packages/core/data/globaldds-core.gpu.rim" , 25); indexMandatoryArchive("packages/core/data/globalmao-core.rim" , 26); indexMandatoryArchive("packages/core/data/globalvfx-core.rim" , 27); indexMandatoryArchive("packages/core/data/gui.erf" , 28); indexMandatoryArchive("packages/core/data/guiexport.erf" , 29); indexMandatoryArchive("packages/core/data/layouts.erf" , 30); indexMandatoryArchive("packages/core/data/lightprobedata.erf" , 31); indexMandatoryArchive("packages/core/data/maoinit.erf" , 32); indexMandatoryArchive("packages/core/data/materialdefinitions.erf" , 33); indexMandatoryArchive("packages/core/data/materialobjects.rim" , 34); indexMandatoryArchive("packages/core/data/misc.erf" , 35); indexMandatoryArchive("packages/core/data/models.erf" , 36); indexMandatoryArchive("packages/core/data/pathfindingpatches.rim" , 37); indexMandatoryArchive("packages/core/data/resmetrics.erf" , 38); indexMandatoryArchive("packages/core/data/scripts.erf" , 39); indexMandatoryArchive("packages/core/data/shaders.erf" , 40); indexMandatoryArchive("packages/core/data/subqueuefiles.erf" , 41); indexMandatoryArchive("packages/core/data/summonwardog.gpu.rim" , 42); indexMandatoryArchive("packages/core/data/summonwardog.rim" , 43); indexMandatoryArchive("packages/core/data/tints.rim" , 44); progress.step("Loading core sound resource files"); indexMandatoryDirectory("packages/core/audio/sound/" , 0, 0, 100); indexMandatoryArchive ("packages/core/audio/sound/wwisebanks_core.erf" , 101); indexMandatoryArchive ("packages/core/audio/sound/wwisestreams_core.erf" , 102); progress.step("Indexing extra core movie resources"); indexMandatoryDirectory("packages/core/data/movies" , 0, 0, 151); progress.step("Indexing extra core talktables"); indexMandatoryDirectory("packages/core/data/talktables", 0, 0, 152); progress.step("Indexing extra core cursors"); indexMandatoryDirectory("packages/core/data/cursors" , 0, 0, 153); progress.step("Loading core patches"); indexMandatoryDirectory("packages/core/patch", 0, 0, 200); indexOptionalArchive ("packages/core/patch/patch.erf" , 201); indexOptionalArchive ("packages/core/patch/patch.rimp" , 202); progress.step("Indexing extra single-player campaign resources"); indexMandatoryDirectory("modules/campaign_base/data" , 0, 0, 250); progress.step("Indexing extra single-player campaign movie resources"); indexMandatoryDirectory("modules/campaign_base/data/movies" , 0, 0, 251); progress.step("Indexing extra single-player campaign sound resources"); indexMandatoryDirectory("modules/campaign_base/audio/sound" , 0, 0, 252); progress.step("Indexing extra single-player campaign talktables"); indexMandatoryDirectory("modules/campaign_base/data/talktables", 0, 0, 253); progress.step("Loading single-player campaign global resource files"); indexMandatoryArchive("modules/campaign_base/data/global-campaign_base.rim", 300); progress.step("Loading single-player campaign patches"); indexMandatoryDirectory("modules/campaign_base/patch" , 0, 0, 400); indexOptionalArchive ("modules/campaign_base/patch/patch.erf" , 401); indexOptionalArchive ("modules/campaign_base/patch/patch.rimp" , 402); // TODO: DLC loadLanguageFiles(progress, _language); progress.step("Registering file formats"); registerModelLoader(new DragonAge2ModelLoader); }