diff options
author | Thierry Crozat | 2013-08-19 21:11:23 +0100 |
---|---|---|
committer | Thierry Crozat | 2013-08-19 21:11:23 +0100 |
commit | efbf1ff5f999786675fdf28b53970af0eacfa759 (patch) | |
tree | 1ecb0b96fef0a9e00ced497af1e015dd25a37513 /devtools | |
parent | 9eaf978e334861fa7da2f9304633cef5202d6745 (diff) | |
download | scummvm-rg350-efbf1ff5f999786675fdf28b53970af0eacfa759.tar.gz scummvm-rg350-efbf1ff5f999786675fdf28b53970af0eacfa759.tar.bz2 scummvm-rg350-efbf1ff5f999786675fdf28b53970af0eacfa759.zip |
MORTEVIELLE: Store German menu data in data file and clean menu code
This opens the door to a better translation of the menu to German. Also
the code will now always try to read the menu data from the mort.data file
and only if this fails it will use the game data. And remove some dead code
that was to support the corrupted menu.mor file.
Diffstat (limited to 'devtools')
-rw-r--r-- | devtools/create_mortdat/create_mortdat.cpp | 14 | ||||
-rw-r--r-- | devtools/create_mortdat/create_mortdat.h | 2 | ||||
-rw-r--r-- | devtools/create_mortdat/menudata.h | 52 |
3 files changed, 63 insertions, 5 deletions
diff --git a/devtools/create_mortdat/create_mortdat.cpp b/devtools/create_mortdat/create_mortdat.cpp index 00b9b1ce4a..5a491eea2f 100644 --- a/devtools/create_mortdat/create_mortdat.cpp +++ b/devtools/create_mortdat/create_mortdat.cpp @@ -204,16 +204,19 @@ void writeGameStrings() { /** * Write out the data for the English menu */ -void writeMenuBlock() { +void writeMenuData(const char *menuData, int languageId) { // Write out a section header to the output file and the menu data const char menuHeader[4] = { 'M', 'E', 'N', 'U' }; outputFile.write(menuHeader, 4); // Section Id - outputFile.writeWord(strlen(menuDataEn) / 8); // Section size + int size = strlen(menuData) / 8 + 1; // Language code + Menu data size + outputFile.writeWord(size); + + outputFile.writeByte(languageId); // Write each 8-characters block as a byte (one bit per character) // ' ' -> 0, anything else -> 1 byte value; int valueCpt = 0; - const char* str = menuDataEn; + const char* str = menuData; while (*str != 0) { if (*(str++) != ' ') value |= (1 << (7 - valueCpt)); @@ -226,6 +229,11 @@ void writeMenuBlock() { } } +void writeMenuBlock() { + writeMenuData(menuDataEn, 1); + writeMenuData(menuDataDe, 2); +} + void writeVerbNums(const int *verbs, int languageId) { // Write out a section header to the output file const char menuHeader[4] = { 'V', 'E', 'R', 'B' }; diff --git a/devtools/create_mortdat/create_mortdat.h b/devtools/create_mortdat/create_mortdat.h index 1ebbbe37e0..e5007ae653 100644 --- a/devtools/create_mortdat/create_mortdat.h +++ b/devtools/create_mortdat/create_mortdat.h @@ -24,7 +24,7 @@ */ #define VERSION_MAJOR 1 -#define VERSION_MINOR 1 +#define VERSION_MINOR 2 enum AccessMode { kFileReadMode = 1, diff --git a/devtools/create_mortdat/menudata.h b/devtools/create_mortdat/menudata.h index ccdd13d7f2..f3ca81cf1f 100644 --- a/devtools/create_mortdat/menudata.h +++ b/devtools/create_mortdat/menudata.h @@ -76,7 +76,57 @@ const char *menuDataEn = "@@@ @@@ @@@ @@@ " " "; -const int verbsFr[26] = { 0x301, 0x302, 0x303, 0x304, 0x305, 0x306, 0x307, 0x308, +const char *menuDataDe = + " @@@ " + " @ " + " @ @ @@ @@@ @@@ " + " @ @ @ @ @ " + " @ @ @ @ @ " + " @ @ @ @ @ " + "@@@ @@@ @@ @@ " + " " + " @@@@@ " + " @ @ " + " @ @ @@@ @ @@@ " + " @ @ @ @ @ @ " + " @ @ @@@@ @ @ " + " @ @ @ @@@@ " + "@@@@@ @@@ @ " + " @@@ " + " @ @@ @ " + " @@@ @ @ " + " @ @ @ @@ @@@@ " + " @ @ @ @ @ " + " @@@@@ @@@ @ " + " @ @ @ @ @ " + "@@@ @@@ @@@ @@ @@ " + " " + " @@@@@ @@@ @@@" + " @ @ @ @ @" + " @ @@@ @ @ " + " @@@@ @ @ @ @@@ " + " @ @@@@@ @ @ " + " @ @ @ @ @ " + "@@@@@@ @@@ @@@ @@@ " + " " + " @@@@@ @ " + " @ @ " + " @ @ @@ @@@@ " + " @ @ @ @ " + " @ @ @ @@@ " + " @ @ @ @ " + "@@@@@ @@@ @@@@@ " + " " + " @@@@@@@ @ " + " @ @ " + " @ @ @@ @@@@ " + " @@@@ @ @ @ " + " @ @ @ @ " + " @ @ @ @ " + "@@@ @@@ @@@ " + " "; + +const int verbsFr[26] = { 0x301, 0x302, 0x303, 0x304, 0x305, 0x306, 0x307, 0x308, 0x309, 0x30a, 0x30b, 0x30c, 0x30d, 0x30e, 0x30f, 0x310, 0x311, 0x312, 0x313, 0x314, 0x315, 0x401, 0x402, 0x403, 0x404, 0x405 }; |