diff options
author | Paul Gilbert | 2016-11-11 11:14:49 -0500 |
---|---|---|
committer | Paul Gilbert | 2016-11-11 11:14:49 -0500 |
commit | c3218287bf9b38470648db701ff81e25fb20bf7a (patch) | |
tree | f2c12462668e39e3e8ad77caf33488ce56e15acf | |
parent | 5474a9b7c1f34f1b8ef059ceeeb20178c65bc47c (diff) | |
download | scummvm-rg350-c3218287bf9b38470648db701ff81e25fb20bf7a.tar.gz scummvm-rg350-c3218287bf9b38470648db701ff81e25fb20bf7a.tar.bz2 scummvm-rg350-c3218287bf9b38470648db701ff81e25fb20bf7a.zip |
DEVTOOLS: Fix writing out strings in titanic.dat
-rw-r--r-- | devtools/create_titanic/create_titanic_dat.cpp | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/devtools/create_titanic/create_titanic_dat.cpp b/devtools/create_titanic/create_titanic_dat.cpp index fc9222467f..493cbad983 100644 --- a/devtools/create_titanic/create_titanic_dat.cpp +++ b/devtools/create_titanic/create_titanic_dat.cpp @@ -779,12 +779,16 @@ void writeNumbers() { } void writeString(uint offset) { - inputFile.seek(offset - FILE_DIFF[_version]); - char c; - do { - c = inputFile.readByte(); - outputFile.writeByte(c); - } while (c); + if (offset == 0) { + outputFile.writeByte(0); + } else { + inputFile.seek(offset - FILE_DIFF[_version]); + char c; + do { + c = inputFile.readByte(); + outputFile.writeByte(c); + } while (c); + } } void writeResponseTree() { @@ -818,7 +822,7 @@ void writeResponseTree() { void writeSentenceEntries(const char *name, uint tableOffset) { outputFile.seek(dataOffset); - uint v1, v2, v9, v11, v12, v13; + uint v1, category, v4, v9, v11, v12, v13; uint offset3, offset5, offset6, offset7, offset8, offset10; for (uint idx = 0; ; ++idx) { @@ -829,9 +833,9 @@ void writeSentenceEntries(const char *name, uint tableOffset) { break; // Read data fields - v2 = inputFile.readLong(); + category = inputFile.readLong(); offset3 = inputFile.readLong(); - /* v4 = */inputFile.readLong(); + v4 = inputFile.readLong(); offset5 = inputFile.readLong(); offset6 = inputFile.readLong(); offset7 = inputFile.readLong(); @@ -843,9 +847,9 @@ void writeSentenceEntries(const char *name, uint tableOffset) { v13 = inputFile.readLong(); outputFile.writeLong(v1); - outputFile.writeLong(v2); + outputFile.writeLong(category); writeString(offset3); - outputFile.writeLong(v1); + outputFile.writeLong(v4); writeString(offset5); writeString(offset6); writeString(offset7); |