From c6b6a99f2ae4f946bd07443f3364ab7ddc0ae3ae Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Mon, 8 Sep 2008 18:48:39 +0000 Subject: Fixed LoL file loading regression. svn-id: r34451 --- engines/kyra/lol.cpp | 30 ++++++++++++------------------ engines/kyra/resource.cpp | 2 +- 2 files changed, 13 insertions(+), 19 deletions(-) (limited to 'engines') diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp index b9cb7bcc0b..baa527b574 100644 --- a/engines/kyra/lol.cpp +++ b/engines/kyra/lol.cpp @@ -241,27 +241,21 @@ void LoLEngine::resetSkipFlag(bool removeEvent) { void LoLEngine::setupPrologueData(bool load) { static const char * const fileList[] = { - "xxx/general.pak", - "xxx/introvoc.pak", - "xxx/startup.pak", - "xxx/intro1.pak", - "xxx/intro2.pak", - "xxx/intro3.pak", - "xxx/intro4.pak", - "xxx/intro5.pak", - "xxx/intro6.pak", - "xxx/intro7.pak", - "xxx/intro8.pak", - "xxx/intro9.pak" + "general.pak", "introvoc.pak", "startup.pak", "intro1.pak", + "intro2.pak", "intro3.pak", "intro4.pak", "intro5.pak", + "intro6.pak", "intro7.pak", "intro8.pak", "intro9.pak" }; - char filepath[32]; - char *filename = filepath; + char filename[32]; for (uint i = 0; i < ARRAYSIZE(fileList); ++i) { - strcpy(filename, fileList[i]); - memcpy(filename, _languageExt[_lang], 3); - if (!_flags.isTalkie) - filename += 4; + filename[0] = '\0'; + + if (_flags.isTalkie) { + strcpy(filename, _languageExt[_lang]); + strcat(filename, "/"); + } + + strcat(filename, fileList[i]); if (load) { if (!_res->loadPakFile(filename)) diff --git a/engines/kyra/resource.cpp b/engines/kyra/resource.cpp index bc83111d14..531f875cc3 100644 --- a/engines/kyra/resource.cpp +++ b/engines/kyra/resource.cpp @@ -38,7 +38,7 @@ namespace Kyra { Resource::Resource(KyraEngine_v1 *vm) : _archiveCache(), _files(), _archiveFiles(new Common::SearchSet()), _protectedFiles(new Common::SearchSet()), _loaders(), _vm(vm) { initializeLoaders(); - Common::SharedPtr path(new Common::FSDirectory(ConfMan.get("path"))); + Common::SharedPtr path(new Common::FSDirectory(ConfMan.get("path"), 2)); Common::SharedPtr extrapath(new Common::FSDirectory(ConfMan.get("extrapath"))); _files.add("path", path, 4); -- cgit v1.2.3