aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Hesse2007-04-28 21:16:13 +0000
committerSven Hesse2007-04-28 21:16:13 +0000
commit339c39f8b7dcc2d245ba936f332592490f0bac3d (patch)
tree9cf68f9a72564a6f727c9512e1f1a3f55edbfc8e
parent4487f5be6a1ac1aad90bae969f74e76dd96b66b6 (diff)
downloadscummvm-rg350-339c39f8b7dcc2d245ba936f332592490f0bac3d.tar.gz
scummvm-rg350-339c39f8b7dcc2d245ba936f332592490f0bac3d.tar.bz2
scummvm-rg350-339c39f8b7dcc2d245ba936f332592490f0bac3d.zip
Possible fix for bug #1709124 ("GOB3: (dos/russian) just dont run")
svn-id: r26665
-rw-r--r--engines/gob/dataio.cpp8
-rw-r--r--engines/gob/util.cpp5
-rw-r--r--engines/gob/util.h1
3 files changed, 14 insertions, 0 deletions
diff --git a/engines/gob/dataio.cpp b/engines/gob/dataio.cpp
index 3d4610d961..63c25b4659 100644
--- a/engines/gob/dataio.cpp
+++ b/engines/gob/dataio.cpp
@@ -27,6 +27,7 @@
#include "gob/gob.h"
#include "gob/dataio.h"
#include "gob/global.h"
+#include "gob/util.h"
namespace Gob {
@@ -305,6 +306,13 @@ void DataIO::openDataFile(const char *src, bool itk) {
dataDesc[i].size = file_getHandle(_dataFileHandles[file])->readUint32LE();
dataDesc[i].offset = file_getHandle(_dataFileHandles[file])->readUint32LE();
dataDesc[i].packed = file_getHandle(_dataFileHandles[file])->readByte();
+
+ // Replacing cyrillic characters
+ Util::replaceChar(dataDesc[i].chunkName, (char) 0x85, 'E');
+ Util::replaceChar(dataDesc[i].chunkName, (char) 0x8A, 'K');
+ Util::replaceChar(dataDesc[i].chunkName, (char) 0x8E, 'O');
+ Util::replaceChar(dataDesc[i].chunkName, (char) 0x91, 'C');
+ Util::replaceChar(dataDesc[i].chunkName, (char) 0x92, 'T');
}
for (int i = 0; i < _numDataChunks[file]; i++)
diff --git a/engines/gob/util.cpp b/engines/gob/util.cpp
index 4970aee2e9..ad10381dac 100644
--- a/engines/gob/util.cpp
+++ b/engines/gob/util.cpp
@@ -393,6 +393,11 @@ void Util::cutFromStr(char *str, int16 from, int16 cutlen) {
} while (str[i] != 0);
}
+void Util::replaceChar(char *str, char c1, char c2) {
+ while ((str = strchr(str, c1)))
+ *str = c2;
+}
+
static const char trStr1[] =
" ' + - :0123456789: <=> abcdefghijklmnopqrstuvwxyz "
"abcdefghijklmnopqrstuvwxyz ";
diff --git a/engines/gob/util.h b/engines/gob/util.h
index e6145fcde7..3adc26385a 100644
--- a/engines/gob/util.h
+++ b/engines/gob/util.h
@@ -77,6 +77,7 @@ public:
static void insertStr(const char *str1, char *str2, int16 pos);
static void cutFromStr(char *str, int16 from, int16 cutlen);
static void prepareStr(char *str);
+ static void replaceChar(char *str, char c1, char c2);
static void listInsertFront(List *list, void *data);
static void listInsertBack(List *list, void *data);