aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2009-05-13 12:31:30 +0000
committerPaul Gilbert2009-05-13 12:31:30 +0000
commita6cf2bf2b1ce16411e5b52cad4faf1f9505bc8e3 (patch)
treec855b96da37a538142987db323a13da714965604
parentd116a94e2b3aaed238aa370c11bc21d455b8b5a9 (diff)
downloadscummvm-rg350-a6cf2bf2b1ce16411e5b52cad4faf1f9505bc8e3.tar.gz
scummvm-rg350-a6cf2bf2b1ce16411e5b52cad4faf1f9505bc8e3.tar.bz2
scummvm-rg350-a6cf2bf2b1ce16411e5b52cad4faf1f9505bc8e3.zip
Reintroduced language string lists as a fallback for DELPHINE.LNG, since not all versions have this file
svn-id: r40522
-rw-r--r--engines/cruise/cruise.cpp50
-rw-r--r--engines/cruise/staticres.cpp9
-rw-r--r--engines/cruise/staticres.h4
3 files changed, 48 insertions, 15 deletions
diff --git a/engines/cruise/cruise.cpp b/engines/cruise/cruise.cpp
index b7fd0def8b..1edd48dbed 100644
--- a/engines/cruise/cruise.cpp
+++ b/engines/cruise/cruise.cpp
@@ -37,6 +37,7 @@
#include "cruise/cruise.h"
#include "cruise/font.h"
#include "cruise/gfxModule.h"
+#include "cruise/staticres.h"
namespace Cruise {
@@ -138,27 +139,46 @@ void CruiseEngine::initialize() {
bool CruiseEngine::loadLanguageStrings() {
Common::File f;
- if (!f.open("DELPHINE.LNG"))
- return false;
+ // Give preference to a language file
+ if (f.open("DELPHINE.LNG")) {
+ char *data = (char *)malloc(f.size());
+ f.read(data, f.size());
+ char *ptr = data;
- char *data = (char *)malloc(f.size());
- f.read(data, f.size());
- char *ptr = data;
+ for (int i = 0; i < MAX_LANGUAGE_STRINGS; ++i) {
+ // Get the start of the next string
+ while (*ptr != '"') ++ptr;
+ const char *v = ++ptr;
- for (int i = 0; i < MAX_LANGUAGE_STRINGS; ++i) {
- // Get the start of the next string
- while (*ptr != '"') ++ptr;
- const char *v = ++ptr;
+ // Find the end of the string, and replace the end '"' with a NULL
+ while (*ptr != '"') ++ptr;
+ *ptr++ = '\0';
- // Find the end of the string, and replace the end '"' with a NULL
- while (*ptr != '"') ++ptr;
- *ptr++ = '\0';
+ // Add the string to the list
+ _langStrings.push_back(v);
+ }
- // Add the string to the list
- _langStrings.push_back(v);
+ f.close();
+
+ } else {
+ // Try and use one of the pre-defined language lists
+ const char **p = NULL;
+ switch (getLanguage()) {
+ case Common::EN_ANY:
+ p = englishLanguageStrings;
+ break;
+ case Common::FR_FRA:
+ p = frenchLanguageStrings;
+ break;
+ default:
+ return false;
+ }
+
+ // Load in the located language set
+ for (int i = 0; i < 13; ++i, ++p)
+ _langStrings.push_back(*p);
}
- f.close();
return true;
}
diff --git a/engines/cruise/staticres.cpp b/engines/cruise/staticres.cpp
index 9224214ba4..e2633a5d36 100644
--- a/engines/cruise/staticres.cpp
+++ b/engines/cruise/staticres.cpp
@@ -208,4 +208,13 @@ const byte mouseCursorMagnifyingGlass[] = {
0xfe, 0xc0, 0xfc, 0x00, 0xf8, 0x00, 0x00, 0x00
};
+const char *englishLanguageStrings[13] = {
+ "Pause", NULL, NULL, NULL, NULL, "Inventory", "Speak about...", "Player Menu", NULL,
+ "Save", "Load", "Start Again", "Quit"
+};
+const char *frenchLanguageStrings[13] = {
+ "", NULL, NULL, NULL, NULL, "Inventaire", "Parler de...", "Menu Joueur", NULL,
+ "Sauvegarde", "Chargement", "Recommencer le jeu", "Quitter"
+};
+
} // End of namespace Cruise
diff --git a/engines/cruise/staticres.h b/engines/cruise/staticres.h
index 924d1c6123..e53215acee 100644
--- a/engines/cruise/staticres.h
+++ b/engines/cruise/staticres.h
@@ -49,6 +49,10 @@ extern const byte mouseCursorWalk[];
extern const byte mouseCursorExit[];
extern const byte mouseCursorMagnifyingGlass[];
+// Language strings
+extern const char *englishLanguageStrings[13];
+extern const char *frenchLanguageStrings[13];
+
} // End of namespace Cruise
#endif