[Scummvm-git-logs] scummvm master -> 481e18ee1d38512e9d1c730b357b230d5db22cae
dreammaster
dreammaster at scummvm.org
Sun Sep 17 22:26:06 CEST 2017
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
481e18ee1d TITANIC: Create a separate g_language global in it's own file
Commit: 481e18ee1d38512e9d1c730b357b230d5db22cae
https://github.com/scummvm/scummvm/commit/481e18ee1d38512e9d1c730b357b230d5db22cae
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-09-17T16:24:26-04:00
Commit Message:
TITANIC: Create a separate g_language global in it's own file
I was becoming concerned with more and more files having to add the
full engine definition and sub-classes thereof via titanic.h,
just so the TRANSLATE macro could call getLanguage. This way, files
just need to include the lightweight translation.h file instead
Changed paths:
engines/titanic/game/cdrom_tray.cpp
engines/titanic/game/computer_screen.cpp
engines/titanic/game/credits.cpp
engines/titanic/game/credits_button.cpp
engines/titanic/game/transport/service_elevator.cpp
engines/titanic/npcs/doorbot.cpp
engines/titanic/titanic.cpp
engines/titanic/titanic.h
engines/titanic/true_talk/doorbot_script.cpp
diff --git a/engines/titanic/game/cdrom_tray.cpp b/engines/titanic/game/cdrom_tray.cpp
index 9d0904b..0215b58 100644
--- a/engines/titanic/game/cdrom_tray.cpp
+++ b/engines/titanic/game/cdrom_tray.cpp
@@ -23,7 +23,7 @@
#include "titanic/core/room_item.h"
#include "titanic/game/cdrom_tray.h"
#include "titanic/messages/messages.h"
-#include "titanic/titanic.h"
+#include "titanic/translation.h"
namespace Titanic {
diff --git a/engines/titanic/game/computer_screen.cpp b/engines/titanic/game/computer_screen.cpp
index ea61bc5..dee469a 100644
--- a/engines/titanic/game/computer_screen.cpp
+++ b/engines/titanic/game/computer_screen.cpp
@@ -22,7 +22,7 @@
#include "titanic/game/computer_screen.h"
#include "titanic/messages/messages.h"
-#include "titanic/titanic.h"
+#include "titanic/translation.h"
namespace Titanic {
@@ -90,20 +90,20 @@ bool CComputerScreen::TimerMsg(CTimerMsg *msg) {
switch (msg->_actionVal) {
case 0:
- if (!g_vm->isGerman()) {
- loadSound("a#32.wav");
- loadSound("a#31.wav");
- loadSound("a#33.wav");
- loadSound("a#30.wav");
- loadSound("a#29.wav");
- playSound("a#25.wav");
- } else {
+ if (g_language == Common::DE_DEU) {
loadSound("a#27.wav");
loadSound("a#26.wav");
loadSound("a#28.wav");
loadSound("a#25.wav");
loadSound("a#24.wav");
playSound("a#20.wav");
+ } else {
+ loadSound("a#32.wav");
+ loadSound("a#31.wav");
+ loadSound("a#33.wav");
+ loadSound("a#30.wav");
+ loadSound("a#29.wav");
+ playSound("a#25.wav");
}
addTimer(1, 2000, 0);
break;
diff --git a/engines/titanic/game/credits.cpp b/engines/titanic/game/credits.cpp
index 9fda8cf..ddb44f1 100644
--- a/engines/titanic/game/credits.cpp
+++ b/engines/titanic/game/credits.cpp
@@ -21,7 +21,7 @@
*/
#include "titanic/game/credits.h"
-#include "titanic/titanic.h"
+#include "titanic/translation.h"
namespace Titanic {
diff --git a/engines/titanic/game/credits_button.cpp b/engines/titanic/game/credits_button.cpp
index 92815ec..2296a4e 100644
--- a/engines/titanic/game/credits_button.cpp
+++ b/engines/titanic/game/credits_button.cpp
@@ -21,7 +21,7 @@
*/
#include "titanic/game/credits_button.h"
-#include "titanic/titanic.h"
+#include "titanic/translation.h"
namespace Titanic {
diff --git a/engines/titanic/game/transport/service_elevator.cpp b/engines/titanic/game/transport/service_elevator.cpp
index 8784f0e..1e76c63 100644
--- a/engines/titanic/game/transport/service_elevator.cpp
+++ b/engines/titanic/game/transport/service_elevator.cpp
@@ -23,7 +23,7 @@
#include "titanic/game/transport/service_elevator.h"
#include "titanic/core/room_item.h"
#include "titanic/npcs/doorbot.h"
-#include "titanic/titanic.h"
+#include "titanic/translation.h"
namespace Titanic {
diff --git a/engines/titanic/npcs/doorbot.cpp b/engines/titanic/npcs/doorbot.cpp
index 83074c4..d1bf662 100644
--- a/engines/titanic/npcs/doorbot.cpp
+++ b/engines/titanic/npcs/doorbot.cpp
@@ -24,7 +24,7 @@
#include "titanic/core/room_item.h"
#include "titanic/debugger.h"
#include "titanic/pet_control/pet_control.h"
-#include "titanic/titanic.h"
+#include "titanic/translation.h"
namespace Titanic {
diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index 5af822a..e0e4a07 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -56,10 +56,12 @@
namespace Titanic {
TitanicEngine *g_vm;
+Common::Language g_language;
TitanicEngine::TitanicEngine(OSystem *syst, const TitanicGameDescription *gameDesc)
: _gameDescription(gameDesc), Engine(syst), _randomSource("Titanic") {
g_vm = this;
+ g_language = getLanguage();
_debugger = nullptr;
_events = nullptr;
_filesManager = nullptr;
diff --git a/engines/titanic/titanic.h b/engines/titanic/titanic.h
index 1708df7..5efefe4 100644
--- a/engines/titanic/titanic.h
+++ b/engines/titanic/titanic.h
@@ -63,8 +63,6 @@ namespace Titanic {
#define MAX_SAVES 99
-#define TRANSLATE(enVal, deVal) (g_vm->isGerman() ? deVal : enVal)
-
// If enabled, fixes an original bug where dispensed chickens weren't
// meant to be hot unless the Yellow fuse was left in the Fusebox.
// This is being left disabled for now, since most walkthroughs for
diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index 84c0548..ab50eca 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -24,6 +24,7 @@
#include "titanic/true_talk/doorbot_script.h"
#include "titanic/true_talk/tt_room_script.h"
#include "titanic/true_talk/true_talk_manager.h"
+#include "titanic/translation.h"
#include "titanic/titanic.h"
namespace Titanic {
@@ -546,10 +547,10 @@ ScriptChangedResult DoorbotScript::scriptChanged(const TTroomScript *roomScript,
CTrueTalkManager::setFlags(39, 0);
}
- if (id >= 220000 && id <= TRANSLATE(222418, 222430)) {
+ if (id >= 220000 && id <= (uint)TRANSLATE(222418, 222430)) {
addResponse(getDialogueId(id));
applyResponse();
- } else if (id >= 10000 && id <= TRANSLATE(11986, 11999)) {
+ } else if (id >= 10000 && id <= (uint)TRANSLATE(11986, 11999)) {
addResponse(id);
applyResponse();
}
More information about the Scummvm-git-logs
mailing list