[Scummvm-cvs-logs] SF.net SVN: scummvm:[40522] scummvm/trunk/engines/cruise

dreammaster at users.sourceforge.net dreammaster at users.sourceforge.net
Wed May 13 14:31:30 CEST 2009


Revision: 40522
          http://scummvm.svn.sourceforge.net/scummvm/?rev=40522&view=rev
Author:   dreammaster
Date:     2009-05-13 12:31:30 +0000 (Wed, 13 May 2009)

Log Message:
-----------
Reintroduced language string lists as a fallback for DELPHINE.LNG, since not all versions have this file

Modified Paths:
--------------
    scummvm/trunk/engines/cruise/cruise.cpp
    scummvm/trunk/engines/cruise/staticres.cpp
    scummvm/trunk/engines/cruise/staticres.h

Modified: scummvm/trunk/engines/cruise/cruise.cpp
===================================================================
--- scummvm/trunk/engines/cruise/cruise.cpp	2009-05-13 11:59:49 UTC (rev 40521)
+++ scummvm/trunk/engines/cruise/cruise.cpp	2009-05-13 12:31:30 UTC (rev 40522)
@@ -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 @@
 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;
 }
 

Modified: scummvm/trunk/engines/cruise/staticres.cpp
===================================================================
--- scummvm/trunk/engines/cruise/staticres.cpp	2009-05-13 11:59:49 UTC (rev 40521)
+++ scummvm/trunk/engines/cruise/staticres.cpp	2009-05-13 12:31:30 UTC (rev 40522)
@@ -208,4 +208,13 @@
 	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

Modified: scummvm/trunk/engines/cruise/staticres.h
===================================================================
--- scummvm/trunk/engines/cruise/staticres.h	2009-05-13 11:59:49 UTC (rev 40521)
+++ scummvm/trunk/engines/cruise/staticres.h	2009-05-13 12:31:30 UTC (rev 40522)
@@ -49,6 +49,10 @@
 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


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list