diff options
author | Vladimir Menshakov | 2011-06-25 18:20:19 +0400 |
---|---|---|
committer | Vladimir Menshakov | 2011-06-25 18:21:37 +0400 |
commit | 545e482b5ad5cd440070904dc4446f1569d2b066 (patch) | |
tree | 6c0857079ccfe99c3923e5b70538a41f866ea5d5 | |
parent | 375298f69a69e478447feab360fa9296b53e2698 (diff) | |
download | scummvm-rg350-545e482b5ad5cd440070904dc4446f1569d2b066.tar.gz scummvm-rg350-545e482b5ad5cd440070904dc4446f1569d2b066.tar.bz2 scummvm-rg350-545e482b5ad5cd440070904dc4446f1569d2b066.zip |
DREAMWEB: Reimplemented modifychar and language switching
-rw-r--r-- | engines/dreamweb/detection.cpp | 10 | ||||
-rw-r--r-- | engines/dreamweb/dreamweb.cpp | 55 | ||||
-rw-r--r-- | engines/dreamweb/dreamweb.h | 8 | ||||
-rw-r--r-- | engines/dreamweb/stubs.cpp | 9 |
4 files changed, 70 insertions, 12 deletions
diff --git a/engines/dreamweb/detection.cpp b/engines/dreamweb/detection.cpp index 47e25ded33..d32be6a2b7 100644 --- a/engines/dreamweb/detection.cpp +++ b/engines/dreamweb/detection.cpp @@ -30,16 +30,6 @@ #include "dreamweb/dreamweb.h" -#include "engines/advancedDetector.h" - -namespace DreamWeb { - -struct DreamWebGameDescription { - ADGameDescription desc; -}; - -} // End of namespace DreamWeb - static const PlainGameDescriptor dreamWebGames[] = { { "dreamweb", "DreamWeb" }, { 0, 0 } diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp index e8152e9963..74fcf33407 100644 --- a/engines/dreamweb/dreamweb.cpp +++ b/engines/dreamweb/dreamweb.cpp @@ -65,6 +65,8 @@ DreamWebEngine::DreamWebEngine(OSystem *syst, const DreamWebGameDescription *gam _oldMouseState = 0; _channel0 = 0; _channel1 = 0; + + _language = gameDesc->desc.language; } DreamWebEngine::~DreamWebEngine() { @@ -569,7 +571,58 @@ void DreamWebEngine::loadSounds(uint bank, const Common::String &filename) { } uint8 DreamWebEngine::modifyChar(uint8 c) const { - return c; + if (c < 128) + return c; + + switch(_language) { + case Common::DE_DEU: + switch(c) + { + case 129: + return 'Z' + 3; + case 132: + return 'Z' + 1; + case 142: + return 'Z' + 4; + case 154: + return 'Z' + 6; + case 255: + return 'A' - 1; + case 153: + return 'Z' + 5; + case 148: + return 'Z' + 2; + default: + return c; + } + case Common::ES_ESP: + switch(c) { + case 160: + return 'Z' + 1; + case 130: + return 'Z' + 2; + case 161: + return 'Z' + 3; + case 162: + return 'Z' + 4; + case 163: + return 'Z' + 5; + case 164: + return 'Z' + 6; + case 165: + return ',' - 1; + case 168: + return 'A' - 1; + case 173: + return 'A' - 4; + case 129: + return 'A' - 5; + default: + return c; + } + default: + return c; + } } } // End of namespace DreamWeb diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h index b1a68dbc20..7323cfe836 100644 --- a/engines/dreamweb/dreamweb.h +++ b/engines/dreamweb/dreamweb.h @@ -37,7 +37,9 @@ #include "audio/audiostream.h" #include "audio/mixer.h" +#include "engines/advancedDetector.h" #include "engines/engine.h" + #include "dreamweb/dreamgen.h" #include "dreamweb/console.h" @@ -49,7 +51,9 @@ enum { kDebugSaveLoad = (1 << 1) }; -struct DreamWebGameDescription; +struct DreamWebGameDescription { + ADGameDescription desc; +}; class DreamWebEngine : public Engine { private: @@ -107,6 +111,7 @@ public: void enableSavingOrLoading(bool enable = true) { _enableSavingOrLoading = enable; } + Common::Language getLanguage() const { return _language; } uint8 modifyChar(uint8 c) const; private: @@ -127,6 +132,7 @@ private: uint _oldMouseState; int _loadSavefile; bool _enableSavingOrLoading; + Common::Language _language; struct Sample { uint offset; diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index 55e5fba2ac..43be0917e6 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -239,6 +239,15 @@ void DreamGenContext::removeemm() { } void DreamGenContext::setupemm() { + //good place for early initialization + switch(engine->getLanguage()) { + case Common::EN_ANY: + case Common::EN_GRB: + case Common::EN_USA: + return; + default: + data.byte(kForeignrelease) = 1; + } } void DreamGenContext::pitinterupt() { |