diff options
author | Paul Gilbert | 2016-06-08 19:15:15 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-07-15 19:21:03 -0400 |
commit | 041ce7f4efd80af0c8cea3b58d87741ee1206a6e (patch) | |
tree | c3d51b0160ce06b8b8853f261188aa277c84ec15 | |
parent | 074dbb8c1a2bfd9ad377ec6f57280d62dfe83803 (diff) | |
download | scummvm-rg350-041ce7f4efd80af0c8cea3b58d87741ee1206a6e.tar.gz scummvm-rg350-041ce7f4efd80af0c8cea3b58d87741ee1206a6e.tar.bz2 scummvm-rg350-041ce7f4efd80af0c8cea3b58d87741ee1206a6e.zip |
DEVTOOLS: Add NPC Id mapping tables to create_titanic
-rw-r--r-- | devtools/create_titanic/create_titanic_dat.cpp | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/devtools/create_titanic/create_titanic_dat.cpp b/devtools/create_titanic/create_titanic_dat.cpp index ad52a5dba5..b90777c243 100644 --- a/devtools/create_titanic/create_titanic_dat.cpp +++ b/devtools/create_titanic/create_titanic_dat.cpp @@ -51,7 +51,7 @@ */ #define VERSION_NUMBER 1 -#define HEADER_SIZE 0x500 +#define HEADER_SIZE 0x580 Common::File inputFile, outputFile; Common::PEResources res; @@ -59,6 +59,8 @@ uint headerOffset = 6; uint dataOffset = HEADER_SIZE; #define SEGMENT_OFFSET 0x401C00 +const int FILE_DIFF = 0x401C00; + static const char *const ITEM_NAMES[46] = { "LeftArmWith", "LeftArmWithout", "RightArmWith", "RightArmWithout", "BridgeRed", "BridgeYellow", "BridgeBlue", "BridgeGreen", "Parrot", "CentralCore", "BrainGreen", @@ -311,7 +313,6 @@ void writeNumbers() { } void writeString(uint offset) { - const int FILE_DIFF = 0x401C00; inputFile.seek(offset - FILE_DIFF); char c; do { @@ -321,7 +322,6 @@ void writeString(uint offset) { } void writeResponseTree() { - const int FILE_DIFF = 0x401C00; outputFile.seek(dataOffset); inputFile.seek(0x619500 - FILE_DIFF); @@ -358,7 +358,6 @@ void writeResponseTree() { void writeSentenceEntries(const char *name, uint tableOffset) { - const int FILE_DIFF = 0x401C00; outputFile.seek(dataOffset); uint v1, v2, v4, v9, v11, v12, v13; @@ -405,6 +404,23 @@ void writeSentenceEntries(const char *name, uint tableOffset) { dataOffset += size; } +void writeSentenceMappings(const char *name, uint offset, int numValues) { + inputFile.seek(offset - FILE_DIFF); + outputFile.seek(dataOffset); + + uint id; + while ((id = inputFile.readLong()) != 0) { + outputFile.writeLong(id); + + for (int ctr = 0; ctr < numValues; ++ctr) + outputFile.writeLong(inputFile.readLong()); + } + + uint size = outputFile.size() - dataOffset; + writeEntryHeader(name, dataOffset, size); + dataOffset += size; +} + void writeHeader() { // Write out magic string const char *MAGIC_STR = "SVTN"; @@ -458,6 +474,14 @@ void writeData() { writeSentenceEntries("Sentences/MaitreD", 0x60CFD8); writeSentenceEntries("Sentences/Parrot", 0x615858); writeSentenceEntries("Sentences/SuccUBus", 0x616698); + writeSentenceMappings("Sentences/Barbot", 0x5B28A0, 8); + writeSentenceMappings("Sentences/Bellbot", 0x5CD830, 1); + writeSentenceMappings("Sentences/Deskbot", 0x5E2BB8, 4); + writeSentenceMappings("Sentences/Doorbot", 0x5F7950, 4); + writeSentenceMappings("Sentences/Liftbot", 0x608660, 4); + writeSentenceMappings("Sentences/MaitreD", 0x6125C8, 1); + writeSentenceMappings("Sentences/Parrot", 0x615B68, 1); + writeSentenceMappings("Sentences/SuccUBus", 0x6189F0, 1); writeResponseTree(); writeNumbers(); |