aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/support
diff options
context:
space:
mode:
authorPaul Gilbert2016-09-11 14:16:11 -0400
committerPaul Gilbert2016-09-11 14:16:11 -0400
commitdd1a2b65e9a79b4d643c5b8fe3a8a35dd03c80c0 (patch)
treef1608efae67f5475ddf4fe456fdd7a9df1aed3d9 /engines/titanic/support
parentf207bc86cb29c6b941aeb3da0444d56e7d4d408d (diff)
downloadscummvm-rg350-dd1a2b65e9a79b4d643c5b8fe3a8a35dd03c80c0.tar.gz
scummvm-rg350-dd1a2b65e9a79b4d643c5b8fe3a8a35dd03c80c0.tar.bz2
scummvm-rg350-dd1a2b65e9a79b4d643c5b8fe3a8a35dd03c80c0.zip
TITANIC: Extra loading logic and translation code for German version
Diffstat (limited to 'engines/titanic/support')
-rw-r--r--engines/titanic/support/files_manager.cpp11
-rw-r--r--engines/titanic/support/files_manager.h4
2 files changed, 12 insertions, 3 deletions
diff --git a/engines/titanic/support/files_manager.cpp b/engines/titanic/support/files_manager.cpp
index ee3a3e1cde..836d35b717 100644
--- a/engines/titanic/support/files_manager.cpp
+++ b/engines/titanic/support/files_manager.cpp
@@ -24,11 +24,12 @@
#include "common/memstream.h"
#include "titanic/support/files_manager.h"
#include "titanic/game_manager.h"
+#include "titanic/titanic.h"
namespace Titanic {
-CFilesManager::CFilesManager() : _gameManager(nullptr), _assetsPath("Assets"),
- _drive(-1) {
+CFilesManager::CFilesManager(TitanicEngine *vm) : _vm(vm), _gameManager(nullptr),
+ _assetsPath("Assets"), _drive(-1) {
loadResourceIndex();
}
@@ -122,6 +123,12 @@ void CFilesManager::preload(const CString &name) {
Common::SeekableReadStream *CFilesManager::getResource(const CString &str) {
ResourceEntry resEntry = _resources[str];
+
+ // If we're running the German version, check for the existance of
+ // a German specific version of the given resource
+ if (_vm->getLanguage() == Common::DE_DEU && _resources.contains(str + "/DE"))
+ resEntry = _resources[str + "/DE"];
+
_datFile.seek(resEntry._offset);
return (resEntry._size > 0) ? _datFile.readStream(resEntry._size) :
diff --git a/engines/titanic/support/files_manager.h b/engines/titanic/support/files_manager.h
index 6f56327968..a980ef1b25 100644
--- a/engines/titanic/support/files_manager.h
+++ b/engines/titanic/support/files_manager.h
@@ -29,6 +29,7 @@
namespace Titanic {
+class TitanicEngine;
class CGameManager;
class CFilesManagerList : public List<ListItem> {
@@ -44,6 +45,7 @@ class CFilesManager {
};
typedef Common::HashMap<Common::String, ResourceEntry> ResourceHash;
private:
+ TitanicEngine *_vm;
CGameManager *_gameManager;
Common::File _datFile;
ResourceHash _resources;
@@ -53,7 +55,7 @@ private:
private:
void loadResourceIndex();
public:
- CFilesManager();
+ CFilesManager(TitanicEngine *vm);
~CFilesManager();
/**