aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2009-09-17 12:43:10 +0000
committerJohannes Schickel2009-09-17 12:43:10 +0000
commitcd394fce761ee9580e4df9ffc761826e688cda4f (patch)
treea481e036df597ceae355b61c544afca81b6165ce
parentf5f209797d4ed85917bdb243405c5b7797751c9b (diff)
downloadscummvm-rg350-cd394fce761ee9580e4df9ffc761826e688cda4f.tar.gz
scummvm-rg350-cd394fce761ee9580e4df9ffc761826e688cda4f.tar.bz2
scummvm-rg350-cd394fce761ee9580e4df9ffc761826e688cda4f.zip
Handle platform specific extraction via platform settings instead of special id where possible.
svn-id: r44149
-rw-r--r--tools/create_kyradat/extract.cpp19
1 files changed, 6 insertions, 13 deletions
diff --git a/tools/create_kyradat/extract.cpp b/tools/create_kyradat/extract.cpp
index 7c2c72c900..cbcb72b455 100644
--- a/tools/create_kyradat/extract.cpp
+++ b/tools/create_kyradat/extract.cpp
@@ -163,17 +163,14 @@ bool extractRaw(PAKFile &out, const Game *g, const byte *data, const uint32 size
bool extractStrings(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int id, int lang) {
int fmtPatch = 0;
- if (g->special == kFMTownsVersionE || g->special == kFMTownsVersionJ) {
- // FM Towns files that need addional patches
+ // FM Towns files that need addional patches
+ if (g->platform == kPlatformFMTowns) {
if (id == kTakenStrings || id == kNoDropStrings || id == kPoisonGoneString ||
id == kThePoisonStrings || id == kFluteStrings || id == kWispJewelStrings)
fmtPatch = 1;
else if (id == kIntroStrings)
fmtPatch = 2;
- }
-
- if (g->special == k2TownsFile1E || g->special == k2TownsFile1J) {
- if (id == k2SeqplayStrings)
+ else if (id == k2SeqplayStrings)
fmtPatch = 3;
}
@@ -197,9 +194,7 @@ bool extractStrings(PAKFile &out, const Game *g, const byte *data, const uint32
++entries;
}
- if (g->special == kFMTownsVersionE || g->special == kFMTownsVersionJ ||
- g->special == k2TownsFile1E || g->special == k2TownsFile1J ||
- g->special == k2TownsFile2E || g->special == k2TownsFile2J) {
+ if (g->platform == kPlatformFMTowns) {
// prevents creation of empty entries (which we have mostly between all strings in the FM-TOWNS version)
while (!data[++i]) {
if (i == size)
@@ -254,9 +249,7 @@ bool extractStrings(PAKFile &out, const Game *g, const byte *data, const uint32
const uint8 *input = (const uint8*) data;
WRITE_BE_UINT32(output, entries); output += 4;
- if (g->special == kFMTownsVersionE || g->special == kFMTownsVersionJ ||
- g->special == k2TownsFile1E || g->special == k2TownsFile1J ||
- g->special == k2TownsFile2E || g->special == k2TownsFile2J) {
+ if (g->platform == kPlatformFMTowns) {
const byte *c = data + size;
do {
if (fmtPatch == 2 && input - data == 0x3C0 && input[0x10] == 0x32) {
@@ -359,7 +352,7 @@ bool extractStrings10(PAKFile &out, const Game *g, const byte *data, const uint3
bool extractRooms(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int id, int lang) {
// different entry size for the FM-TOWNS version
- const int roomEntrySize = (g->special == kFMTownsVersionE || g->special == kFMTownsVersionJ) ? (0x69) : ((g->platform == kPlatformAmiga) ? 0x52 : 0x51);
+ const int roomEntrySize = (g->platform == kPlatformFMTowns) ? (0x69) : ((g->platform == kPlatformAmiga) ? 0x52 : 0x51);
const int countRooms = size / roomEntrySize;
uint8 *buffer = new uint8[countRooms * 9 + 4];