[Scummvm-cvs-logs] SF.net SVN: scummvm:[47019] scummvm/trunk/engines/lure
dreammaster at users.sourceforge.net
dreammaster at users.sourceforge.net
Tue Jan 5 09:24:27 CET 2010
Revision: 47019
http://scummvm.svn.sourceforge.net/scummvm/?rev=47019&view=rev
Author: dreammaster
Date: 2010-01-05 08:24:27 +0000 (Tue, 05 Jan 2010)
Log Message:
-----------
Added a new LureLanguage enumeration of supported languages, and changed game code to use it
Modified Paths:
--------------
scummvm/trunk/engines/lure/detection.cpp
scummvm/trunk/engines/lure/disk.cpp
scummvm/trunk/engines/lure/lure.cpp
scummvm/trunk/engines/lure/lure.h
Modified: scummvm/trunk/engines/lure/detection.cpp
===================================================================
--- scummvm/trunk/engines/lure/detection.cpp 2010-01-05 05:25:18 UTC (rev 47018)
+++ scummvm/trunk/engines/lure/detection.cpp 2010-01-05 08:24:27 UTC (rev 47019)
@@ -43,6 +43,19 @@
Common::Language LureEngine::getLanguage() const { return _gameDescription->desc.language; }
Common::Platform LureEngine::getPlatform() const { return _gameDescription->desc.platform; }
+LureLanguage LureEngine::getLureLanguage() const {
+ switch (_gameDescription->desc.language) {
+ case IT_ITA: return LANG_IT_ITA;
+ case FR_FRA: return LANG_FR_FRA;
+ case DE_DEU: return LANG_DE_DEU;
+ case ES_ESP: return LANG_ES_ESP;
+ case EN_ANY: return LANG_EN_ANY;
+ case UNK_LANG: return LANG_UNKNOWN;
+ default:
+ error("Unknown game language");
+ }
+}
+
} // End of namespace Lure
static const PlainGameDescriptor lureGames[] = {
Modified: scummvm/trunk/engines/lure/disk.cpp
===================================================================
--- scummvm/trunk/engines/lure/disk.cpp 2010-01-05 05:25:18 UTC (rev 47018)
+++ scummvm/trunk/engines/lure/disk.cpp 2010-01-05 08:24:27 UTC (rev 47019)
@@ -115,7 +115,7 @@
error("The file %s is not a valid Lure support file", sFilename);
// Scan for the correct language block
- Common::Language language = LureEngine::getReference().getLanguage();
+ LureLanguage language = LureEngine::getReference().getLureLanguage();
bool foundFlag = false;
while (!foundFlag) {
@@ -123,7 +123,7 @@
if ((byte)buffer[0] == 0xff)
error("Could not find language data in support file");
- if ((language == (Common::Language)buffer[0]) || (language == UNK_LANG)) {
+ if ((language == (LureLanguage)buffer[0]) || (language == LANG_UNKNOWN)) {
foundFlag = true;
_dataOffset = READ_LE_UINT32(&buffer[1]);
_fileHandle->seek(_dataOffset);
Modified: scummvm/trunk/engines/lure/lure.cpp
===================================================================
--- scummvm/trunk/engines/lure/lure.cpp 2010-01-05 05:25:18 UTC (rev 47018)
+++ scummvm/trunk/engines/lure/lure.cpp 2010-01-05 08:24:27 UTC (rev 47019)
@@ -186,7 +186,7 @@
return false;
f->write("lure", 5);
- f->writeByte(getLanguage());
+ f->writeByte(getLureLanguage());
f->writeByte(LURE_SAVEGAME_MINOR);
f->writeString(caption);
f->writeByte(0); // End of string terminator
@@ -221,7 +221,7 @@
// Check language version
uint8 language = f->readByte();
_saveVersion = f->readByte();
- if ((language != getLanguage()) || (_saveVersion < LURE_MIN_SAVEGAME_MINOR)) {
+ if ((language != getLureLanguage()) || (_saveVersion < LURE_MIN_SAVEGAME_MINOR)) {
warning("loadGame: Failed to load slot %d - incorrect version", slotNumber);
delete f;
return false;
@@ -274,7 +274,7 @@
// Check language version
uint8 language = f->readByte();
uint8 version = f->readByte();
- if ((language == getLanguage()) && (version >= LURE_MIN_SAVEGAME_MINOR)) {
+ if ((language == getLureLanguage()) && (version >= LURE_MIN_SAVEGAME_MINOR)) {
// Read in the savegame title
char saveName[MAX_DESC_SIZE];
char *p = saveName;
Modified: scummvm/trunk/engines/lure/lure.h
===================================================================
--- scummvm/trunk/engines/lure/lure.h 2010-01-05 05:25:18 UTC (rev 47018)
+++ scummvm/trunk/engines/lure/lure.h 2010-01-05 08:24:27 UTC (rev 47019)
@@ -54,6 +54,15 @@
#define RandomNumberGen LureEngine::getReference().rnd()
+enum LureLanguage {
+ LANG_IT_ITA = 10,
+ LANG_FR_FRA = 6,
+ LANG_DE_DEU = 7,
+ LANG_ES_ESP = 17,
+ LANG_EN_ANY = 3,
+ LANG_UNKNOWN = -1
+};
+
struct LureGameDescription;
class LureEngine : public Engine {
@@ -107,6 +116,7 @@
void GUIError(const char *msg, ...) GCC_PRINTF(2, 3);
uint32 getFeatures() const;
+ LureLanguage getLureLanguage() const;
Common::Language getLanguage() const;
Common::Platform getPlatform() const;
virtual GUI::Debugger *getDebugger();
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