[Scummvm-git-logs] scummvm master -> dd1a2b65e9a79b4d643c5b8fe3a8a35dd03c80c0
dreammaster
dreammaster at scummvm.org
Sun Sep 11 20:16:22 CEST 2016
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
f207bc86cb DEVTOOLS: Write out German strings in create_titanic
dd1a2b65e9 TITANIC: Extra loading logic and translation code for German version
Commit: f207bc86cb29c6b941aeb3da0444d56e7d4d408d
https://github.com/scummvm/scummvm/commit/f207bc86cb29c6b941aeb3da0444d56e7d4d408d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-09-11T14:15:02-04:00
Commit Message:
DEVTOOLS: Write out German strings in create_titanic
Changed paths:
devtools/create_titanic/create_titanic_dat.cpp
diff --git a/devtools/create_titanic/create_titanic_dat.cpp b/devtools/create_titanic/create_titanic_dat.cpp
index c32b3c9..8f26c1b 100644
--- a/devtools/create_titanic/create_titanic_dat.cpp
+++ b/devtools/create_titanic/create_titanic_dat.cpp
@@ -480,9 +480,11 @@ static const char *const STRINGS_EN[] = {
};
static const char *const STRINGS_DE[] = {
+ // TODO: Translate these to their German versions
"",
- "You are standing outside the Pellerator.",
- "I'm sorry, you cannot enter this pellerator at present as a bot is in the way.",
+ "Sie befinden sich vor dem Pellerator.",
+ "Wir bedauern, Zutritt zu diesem Pellerator ist nicht m\0xF6"
+ "glich, da die T\0xFC" "r zugefroren ist.",
"The Succ-U-Bus is in Standby, or \"Off\" mode at present.",
"There is currently nothing to deliver.",
"There is currently nothing in the tray to send.",
@@ -601,7 +603,6 @@ static const char *const STRINGS_DE[] = {
"Und sagen Sie hinterher blo\0xFC nicht, niemand hStte Sie gewarnt.",
"Pin\0xAA" "z-pin\0xAA" "z stot \0xAF" "r\0xB0 jibbli",
"Dr\0xFC" "cken Sie den Knopf um die Bombe zu entschSrfen."
-
};
void NORETURN_PRE error(const char *s, ...) {
@@ -1059,6 +1060,7 @@ void writeData() {
writeStringArray("TEXT/ITEM_IDS", ITEM_IDS, 40);
writeStringArray("TEXT/ROOM_NAMES", ROOM_NAMES, 34);
writeStringArray("TEXT/STRINGS", STRINGS_EN, 58);
+ writeStringArray("TEXT/STRINGS/DE", STRINGS_DE, 104);
const int TEXT_PHRASES[3] = { 0x61D3C8, 0x618340, 0x61B1E0 };
const int TEXT_REPLACEMENTS1[3] = { 0x61D9B0, 0x61C788, 0x61B7C8 };
const int TEXT_REPLACEMENTS2[3] = { 0x61DD20, 0x61CAF8, 0x61BB38 };
Commit: dd1a2b65e9a79b4d643c5b8fe3a8a35dd03c80c0
https://github.com/scummvm/scummvm/commit/dd1a2b65e9a79b4d643c5b8fe3a8a35dd03c80c0
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-09-11T14:16:11-04:00
Commit Message:
TITANIC: Extra loading logic and translation code for German version
Changed paths:
engines/titanic/core/saveable_object.cpp
engines/titanic/game/arboretum_gate.cpp
engines/titanic/game/arboretum_gate.h
engines/titanic/game/code_wheel.cpp
engines/titanic/game/code_wheel.h
engines/titanic/pet_control/pet_show_translation.cpp
engines/titanic/pet_control/pet_show_translation.h
engines/titanic/support/files_manager.cpp
engines/titanic/support/files_manager.h
engines/titanic/titanic.cpp
diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index f84ca23..630404a 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -740,7 +740,7 @@ DEFFN(CPetModePanel);
DEFFN(CPetPannel1);
DEFFN(CPetPannel2);
DEFFN(CPetPannel3);
-DEFFN(CPetShowTranslation);
+DEFFN(CPETShowTranslation);
DEFFN(CSendToSucc);
DEFFN(CSGTSelector);
DEFFN(CSliderButton);
@@ -1331,7 +1331,7 @@ void CSaveableObject::initClassList() {
ADDFN(CPetPannel1, CPetGraphic);
ADDFN(CPetPannel2, CPetGraphic);
ADDFN(CPetPannel3, CPetGraphic);
- ADDFN(CPetShowTranslation, CGameObject);
+ ADDFN(CPETShowTranslation, CGameObject);
ADDFN(CSendToSucc, CToggleSwitch);
ADDFN(CSGTSelector, CPetGraphic);
ADDFN(CSliderButton, CSTButton);
diff --git a/engines/titanic/game/arboretum_gate.cpp b/engines/titanic/game/arboretum_gate.cpp
index 1435e3e..1f684fd 100644
--- a/engines/titanic/game/arboretum_gate.cpp
+++ b/engines/titanic/game/arboretum_gate.cpp
@@ -21,6 +21,7 @@
*/
#include "titanic/game/arboretum_gate.h"
+#include "titanic/titanic.h"
namespace Titanic {
@@ -68,6 +69,14 @@ CArboretumGate::CArboretumGate() : CBackground() {
_endFrameWinterOn1 = 364;
_startFrameWinterOn2 = 365;
_endFrameWinterOn2 = 424;
+
+ // German specific fields
+ _field160 = _field164 = _field168 = _field16C = 0;
+ _field170 = _field174 = _field178 = _field17C = 0;
+ _field180 = _field184 = _field188 = _field18C = 0;
+ _field190 = _field194 = _field198 = _field19C = 0;
+ _field1A0 = _field1A4 = _field1A8 = _field1AC = 0;
+ _field1B0 = _field1B4 = _field1B8 = _field1BC = 0;
}
void CArboretumGate::save(SimpleFile *file, int indent) {
@@ -104,6 +113,33 @@ void CArboretumGate::save(SimpleFile *file, int indent) {
file->writeNumberLine(_endFrameWinterOn2, indent);
file->writeQuotedLine(_viewName2, indent);
+ if (g_vm->getLanguage() == Common::DE_DEU) {
+ file->writeNumberLine(_field160, indent);
+ file->writeNumberLine(_field164, indent);
+ file->writeNumberLine(_field168, indent);
+ file->writeNumberLine(_field16C, indent);
+ file->writeNumberLine(_field170, indent);
+ file->writeNumberLine(_field174, indent);
+ file->writeNumberLine(_field178, indent);
+ file->writeNumberLine(_field17C, indent);
+ file->writeNumberLine(_field180, indent);
+ file->writeNumberLine(_field184, indent);
+ file->writeNumberLine(_field188, indent);
+ file->writeNumberLine(_field18C, indent);
+ file->writeNumberLine(_field190, indent);
+ file->writeNumberLine(_field194, indent);
+ file->writeNumberLine(_field198, indent);
+ file->writeNumberLine(_field19C, indent);
+ file->writeNumberLine(_field1A0, indent);
+ file->writeNumberLine(_field1A4, indent);
+ file->writeNumberLine(_field1A8, indent);
+ file->writeNumberLine(_field1AC, indent);
+ file->writeNumberLine(_field1B0, indent);
+ file->writeNumberLine(_field1B4, indent);
+ file->writeNumberLine(_field1B8, indent);
+ file->writeNumberLine(_field1BC, indent);
+ }
+
CBackground::save(file, indent);
}
@@ -141,6 +177,33 @@ void CArboretumGate::load(SimpleFile *file) {
_endFrameWinterOn2 = file->readNumber();
_viewName2 = file->readString();
+ if (g_vm->getLanguage() == Common::DE_DEU) {
+ _field160 = file->readNumber();
+ _field164 = file->readNumber();
+ _field168 = file->readNumber();
+ _field16C = file->readNumber();
+ _field170 = file->readNumber();
+ _field174 = file->readNumber();
+ _field178 = file->readNumber();
+ _field17C = file->readNumber();
+ _field180 = file->readNumber();
+ _field184 = file->readNumber();
+ _field188 = file->readNumber();
+ _field18C = file->readNumber();
+ _field190 = file->readNumber();
+ _field194 = file->readNumber();
+ _field198 = file->readNumber();
+ _field19C = file->readNumber();
+ _field1A0 = file->readNumber();
+ _field1A4 = file->readNumber();
+ _field1A8 = file->readNumber();
+ _field1AC = file->readNumber();
+ _field1B0 = file->readNumber();
+ _field1B4 = file->readNumber();
+ _field1B8 = file->readNumber();
+ _field1BC = file->readNumber();
+ }
+
CBackground::load(file);
}
diff --git a/engines/titanic/game/arboretum_gate.h b/engines/titanic/game/arboretum_gate.h
index b1c06cf..efb4e81 100644
--- a/engines/titanic/game/arboretum_gate.h
+++ b/engines/titanic/game/arboretum_gate.h
@@ -72,6 +72,31 @@ private:
int _startFrameWinterOn2;
int _endFrameWinterOn2;
CString _viewName2;
+ // German specific fields
+ int _field160;
+ int _field164;
+ int _field168;
+ int _field16C;
+ int _field170;
+ int _field174;
+ int _field178;
+ int _field17C;
+ int _field180;
+ int _field184;
+ int _field188;
+ int _field18C;
+ int _field190;
+ int _field194;
+ int _field198;
+ int _field19C;
+ int _field1A0;
+ int _field1A4;
+ int _field1A8;
+ int _field1AC;
+ int _field1B0;
+ int _field1B4;
+ int _field1B8;
+ int _field1BC;
public:
CLASSDEF;
CArboretumGate();
diff --git a/engines/titanic/game/code_wheel.cpp b/engines/titanic/game/code_wheel.cpp
index 94ee254..cd492ec 100644
--- a/engines/titanic/game/code_wheel.cpp
+++ b/engines/titanic/game/code_wheel.cpp
@@ -21,6 +21,7 @@
*/
#include "titanic/game/code_wheel.h"
+#include "titanic/titanic.h"
namespace Titanic {
@@ -31,7 +32,8 @@ BEGIN_MESSAGE_MAP(CodeWheel, CBomb)
ON_MESSAGE(MovieEndMsg)
END_MESSAGE_MAP()
-CodeWheel::CodeWheel() : CBomb(), _field108(0), _state(4), _field110(0) {
+CodeWheel::CodeWheel() : CBomb(), _field108(0), _state(4),
+ _field110(0), _field114(0), _field118(0) {
}
void CodeWheel::save(SimpleFile *file, int indent) {
@@ -39,6 +41,10 @@ void CodeWheel::save(SimpleFile *file, int indent) {
file->writeNumberLine(_field108, indent);
file->writeNumberLine(_state, indent);
file->writeNumberLine(_field110, indent);
+ if (g_vm->getLanguage() == Common::DE_DEU) {
+ file->writeNumberLine(_field114, indent);
+ file->writeNumberLine(_field118, indent);
+ }
CBomb::save(file, indent);
}
@@ -48,6 +54,10 @@ void CodeWheel::load(SimpleFile *file) {
_field108 = file->readNumber();
_state = file->readNumber();
_field110 = file->readNumber();
+ if (g_vm->getLanguage() == Common::DE_DEU) {
+ _field114 = file->readNumber();
+ _field118 = file->readNumber();
+ }
CBomb::load(file);
}
diff --git a/engines/titanic/game/code_wheel.h b/engines/titanic/game/code_wheel.h
index e38a45b..de246f5 100644
--- a/engines/titanic/game/code_wheel.h
+++ b/engines/titanic/game/code_wheel.h
@@ -37,6 +37,9 @@ private:
int _field108;
int _state;
int _field110;
+ // German specific fields
+ int _field114;
+ int _field118;
public:
CLASSDEF;
CodeWheel();
diff --git a/engines/titanic/pet_control/pet_show_translation.cpp b/engines/titanic/pet_control/pet_show_translation.cpp
index 2a3b024..cf52916 100644
--- a/engines/titanic/pet_control/pet_show_translation.cpp
+++ b/engines/titanic/pet_control/pet_show_translation.cpp
@@ -25,7 +25,7 @@
namespace Titanic {
-BEGIN_MESSAGE_MAP(CPetShowTranslation, CGameObject)
+BEGIN_MESSAGE_MAP(CPETShowTranslation, CGameObject)
ON_MESSAGE(EnterViewMsg)
ON_MESSAGE(LeaveViewMsg)
ON_MESSAGE(ChangeSeasonMsg)
@@ -33,17 +33,17 @@ BEGIN_MESSAGE_MAP(CPetShowTranslation, CGameObject)
END_MESSAGE_MAP()
-void CPetShowTranslation::save(SimpleFile *file, int indent) {
+void CPETShowTranslation::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
CGameObject::save(file, indent);
}
-void CPetShowTranslation::load(SimpleFile *file) {
+void CPETShowTranslation::load(SimpleFile *file) {
file->readNumber();
CGameObject::load(file);
}
-bool CPetShowTranslation::EnterViewMsg(CEnterViewMsg *msg) {
+bool CPETShowTranslation::EnterViewMsg(CEnterViewMsg *msg) {
CPetControl *pet = getPetControl();
if (!pet)
return true;
@@ -113,15 +113,69 @@ bool CPetShowTranslation::EnterViewMsg(CEnterViewMsg *msg) {
return true;
}
-bool CPetShowTranslation::LeaveViewMsg(CLeaveViewMsg *msg) {
+bool CPETShowTranslation::LeaveViewMsg(CLeaveViewMsg *msg) {
+ CPetControl *pet = getPetControl();
+ if (pet)
+ pet->clearTranslation();
+
return true;
}
-bool CPetShowTranslation::ChangeSeasonMsg(CChangeSeasonMsg *msg) {
+bool CPETShowTranslation::ChangeSeasonMsg(CChangeSeasonMsg *msg) {
+ CPetControl *pet = getPetControl();
+ if (pet) {
+ pet->clearTranslation();
+
+ CString viewName = getFullViewName();
+ if (viewName == "Arboretum.Node 2.N" || viewName == "FrozenArboretum.Node 2.N") {
+ if (msg->_season == "Summer")
+ pet->addTranslation(DE_SUMMER_ARBORETUM, DE_SUMMER);
+ else if (msg->_season == "Autumn")
+ pet->addTranslation(DE_AUTUMN_ARBORETUM, DE_AUTUMN);
+ else if (msg->_season == "Winter")
+ pet->addTranslation(DE_WINTER_ARBORETUM, DE_WINTER);
+ else if (msg->_season == "Spring")
+ pet->addTranslation(DE_SPRING_ARBORETUM, DE_SPRING);
+
+ pet->addTranslation(DE_ARBORETUM_MSG1, DE_ARBORETUM_MSG2);
+ }
+ }
+
return true;
}
-bool CPetShowTranslation::ArboretumGateMsg(CArboretumGateMsg *msg) {
+bool CPETShowTranslation::ArboretumGateMsg(CArboretumGateMsg *msg) {
+ CPetControl *pet = getPetControl();
+ if (pet) {
+ pet->clearTranslation();
+
+ CString viewName = getFullViewName();
+ if (viewName == "Arboretum.Node 2.N" || viewName == "FrozenArboretum.Node 2.N") {
+ switch (stateGetSeason()) {
+ case SEASON_SUMMER:
+ pet->addTranslation(DE_SUMMER_ARBORETUM, DE_SUMMER);
+ break;
+
+ case SEASON_AUTUMN:
+ pet->addTranslation(DE_AUTUMN_ARBORETUM, DE_AUTUMN);
+ break;
+
+ case SEASON_WINTER:
+ pet->addTranslation(DE_WINTER_ARBORETUM, DE_WINTER);
+ break;
+
+ case SEASON_SPRING:
+ pet->addTranslation(DE_SPRING_ARBORETUM, DE_SPRING);
+ break;
+
+ default:
+ break;
+ }
+
+ pet->addTranslation(DE_ARBORETUM_MSG1, DE_ARBORETUM_MSG2);
+ }
+ }
+
return true;
}
diff --git a/engines/titanic/pet_control/pet_show_translation.h b/engines/titanic/pet_control/pet_show_translation.h
index cef9708..a0feae8 100644
--- a/engines/titanic/pet_control/pet_show_translation.h
+++ b/engines/titanic/pet_control/pet_show_translation.h
@@ -31,7 +31,7 @@ namespace Titanic {
* Used by the German version to show contextual translation of
* English background text throughout the game
*/
-class CPetShowTranslation: public CGameObject {
+class CPETShowTranslation: public CGameObject {
DECLARE_MESSAGE_MAP;
bool EnterViewMsg(CEnterViewMsg *msg);
bool LeaveViewMsg(CLeaveViewMsg *msg);
@@ -39,7 +39,7 @@ class CPetShowTranslation: public CGameObject {
bool ArboretumGateMsg(CArboretumGateMsg *msg);
public:
CLASSDEF;
- CPetShowTranslation() : CGameObject() {}
+ CPETShowTranslation() : CGameObject() {}
/**
* Save the data for the class to file
diff --git a/engines/titanic/support/files_manager.cpp b/engines/titanic/support/files_manager.cpp
index ee3a3e1..836d35b 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 6f56327..a980ef1 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();
/**
diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index 3a721b6..375908a 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -85,7 +85,7 @@ void TitanicEngine::initialize() {
DebugMan.addDebugChannel(kDebugSound, "sound", "Sound and Music handling");
_debugger = new Debugger(this);
- _filesManager = new CFilesManager();
+ _filesManager = new CFilesManager(this);
CSaveableObject::initClassList();
CEnterExitFirstClassState::init();
More information about the Scummvm-git-logs
mailing list