aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorSven Hesse2012-06-30 01:23:21 +0200
committerSven Hesse2012-07-30 01:44:43 +0200
commit139b03c4bcafea260e79e3e83db897c71db41907 (patch)
treef5656ed4b6ef5216ab360b05f94247b77e7ecfb3 /engines
parent4b3aa88c8aaaec4f13435c46a7a3cf4ef00a08df (diff)
downloadscummvm-rg350-139b03c4bcafea260e79e3e83db897c71db41907.tar.gz
scummvm-rg350-139b03c4bcafea260e79e3e83db897c71db41907.tar.bz2
scummvm-rg350-139b03c4bcafea260e79e3e83db897c71db41907.zip
GOB: Add a PreGob method to get a localized file name
Diffstat (limited to 'engines')
-rw-r--r--engines/gob/pregob/pregob.cpp9
-rw-r--r--engines/gob/pregob/pregob.h3
2 files changed, 12 insertions, 0 deletions
diff --git a/engines/gob/pregob/pregob.cpp b/engines/gob/pregob/pregob.cpp
index 98b1a2e6b8..582ebc6677 100644
--- a/engines/gob/pregob/pregob.cpp
+++ b/engines/gob/pregob/pregob.cpp
@@ -34,6 +34,8 @@
#include "gob/pregob/pregob.h"
+static char kLanguageSuffix[5] = { 't', 'g', 'a', 'e', 'i' };
+
namespace Gob {
PreGob::PreGob(GobEngine *vm) : _vm(vm), _fadedOut(false) {
@@ -203,6 +205,13 @@ void PreGob::redrawAnim(ANIObject &ani) {
drawAnim(ani);
}
+Common::String PreGob::getLocFile(const Common::String &file) const {
+ if (_vm->_global->_language >= ARRAYSIZE(kLanguageSuffix))
+ return file;
+
+ return file + kLanguageSuffix[_vm->_global->_language];
+}
+
TXTFile *PreGob::loadTXT(const Common::String &txtFile, TXTFile::Format format) const {
Common::SeekableReadStream *txtStream = _vm->_dataIO->getFile(txtFile);
if (!txtStream)
diff --git a/engines/gob/pregob/pregob.h b/engines/gob/pregob/pregob.h
index d087bb0d0c..902a7c437d 100644
--- a/engines/gob/pregob/pregob.h
+++ b/engines/gob/pregob/pregob.h
@@ -23,6 +23,8 @@
#ifndef GOB_PREGOB_PREGOB_H
#define GOB_PREGOB_PREGOB_H
+#include "common/str.h"
+
#include "gob/util.h"
#include "gob/pregob/txtfile.h"
@@ -79,6 +81,7 @@ protected:
void drawAnim(ANIObject &ani);
void redrawAnim(ANIObject &ani);
+ Common::String getLocFile(const Common::String &file) const;
TXTFile *loadTXT(const Common::String &txtFile, TXTFile::Format format) const;