aboutsummaryrefslogtreecommitdiff
path: root/tools/create_kyradat
diff options
context:
space:
mode:
authorFlorian Kagerer2009-02-21 17:24:50 +0000
committerFlorian Kagerer2009-02-21 17:24:50 +0000
commit8a95f02abfabb04972a6c85fbc655e53ae7a54f6 (patch)
tree66acc3d8e8b616b7f329888c8a529f922bfb370c /tools/create_kyradat
parent51bb24626a422664684e1d70484944b7c9809557 (diff)
downloadscummvm-rg350-8a95f02abfabb04972a6c85fbc655e53ae7a54f6.tar.gz
scummvm-rg350-8a95f02abfabb04972a6c85fbc655e53ae7a54f6.tar.bz2
scummvm-rg350-8a95f02abfabb04972a6c85fbc655e53ae7a54f6.zip
LOL: some work on inventory/item handling
svn-id: r38711
Diffstat (limited to 'tools/create_kyradat')
-rw-r--r--tools/create_kyradat/create_kyradat.cpp27
-rw-r--r--tools/create_kyradat/create_kyradat.h11
-rw-r--r--tools/create_kyradat/lol_cd.h12
-rw-r--r--tools/create_kyradat/misc.h10
4 files changed, 58 insertions, 2 deletions
diff --git a/tools/create_kyradat/create_kyradat.cpp b/tools/create_kyradat/create_kyradat.cpp
index 3b1b43a2b1..4ec75d653c 100644
--- a/tools/create_kyradat/create_kyradat.cpp
+++ b/tools/create_kyradat/create_kyradat.cpp
@@ -31,7 +31,7 @@
#include "md5.h"
enum {
- kKyraDatVersion = 38,
+ kKyraDatVersion = 39,
kIndexSize = 12
};
@@ -74,6 +74,7 @@ bool extractPaddedStrings(PAKFile &out, const Game *g, const byte *data, const u
bool extractRaw16to8(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch = 0);
bool extractMrShapeAnimData(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch = 0);
bool extractRaw16(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch = 0);
+bool extractRaw32(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch = 0);
bool extractLolButtonDefs(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch = 0);
int extractHofSeqData_checkString(const void *ptr, uint8 checkSize);
@@ -100,6 +101,7 @@ const ExtractType extractTypeTable[] = {
{ k3TypeShpData, extractMrShapeAnimData, createFilename },
{ lolTypeRaw16, extractRaw16, createFilename },
+ { lolTypeRaw32, extractRaw32, createFilename },
{ lolTypeButtonDef, extractLolButtonDefs, createFilename },
{ -1, 0, 0}
@@ -274,6 +276,15 @@ const ExtractFilename extractFilenames[] = {
//{ lolADLSfxIndex, kTypeRawData, "SFX_ADL.MAP" },
{ lolSpellProperties, kTypeRawData, "SPELLS.DEF" },
{ lolGameShapeMap, kTypeRawData, "GAMESHP.MAP" },
+ { lolCharInvIndex, k3TypeRaw16to8, "CHARINV.MAP" },
+ { lolCharInvDefs, kTypeRawData, "CHARINV.DEF" },
+ { lolCharDefsMan, lolTypeRaw16, "CHMAN.DEF" },
+ { lolCharDefsWoman, lolTypeRaw16, "CHWOMAN.DEF" },
+ { lolCharDefsKieran, lolTypeRaw16, "CHKIERAN.DEF" },
+ //{ lolCharDefsUnk, lolTypeRaw16, "CHUNK.DEF" },
+ { lolCharDefsAkshel, lolTypeRaw16, "CHAKSHEL.DEF" },
+ { lolExpRequirements, lolTypeRaw32, "EXPERIENCE.DEF" },
+ { lolInventoryDesc, lolTypeRaw16, "INVDESC.DEF" },
{ lolLevelShpList, kTypeStringList, "SHPFILES.TXT" },
{ lolLevelDatList, kTypeStringList, "DATFILES.TXT" },
{ lolCompassDefs, k3TypeRaw16to8, "COMPASS.DEF" },
@@ -1083,6 +1094,20 @@ bool extractRaw16(PAKFile &out, const Game *g, const byte *data, const uint32 si
return out.addFile(filename, buffer, size);
}
+bool extractRaw32(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch) {
+ uint8 *buffer = new uint8[size];
+ const uint8 *src = data;
+ uint8 *dst = buffer;
+
+ for (uint32 i = 0; i < (size >> 2); i++) {
+ WRITE_BE_UINT32(dst, READ_LE_UINT32(src));
+ src += 4;
+ dst += 4;
+ }
+
+ return out.addFile(filename, buffer, size);
+}
+
bool extractLolButtonDefs(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch) {
int num = size / 22;
uint8 *buffer = new uint8[size];
diff --git a/tools/create_kyradat/create_kyradat.h b/tools/create_kyradat/create_kyradat.h
index 5be72e363f..ecd7bdd81e 100644
--- a/tools/create_kyradat/create_kyradat.h
+++ b/tools/create_kyradat/create_kyradat.h
@@ -185,6 +185,16 @@ enum kExtractID {
//lolADLSfxIndex,
lolSpellProperties,
lolGameShapeMap,
+ lolCharInvIndex,
+ lolCharInvDefs,
+ lolCharDefsMan,
+ lolCharDefsWoman,
+ lolCharDefsKieran,
+ //lolCharDefsUnk,
+ lolCharDefsAkshel,
+ lolExpRequirements,
+ lolInventoryDesc,
+
lolLevelShpList,
lolLevelDatList,
lolCompassDefs,
@@ -322,6 +332,7 @@ enum kExtractType {
k3TypeShpData,
lolTypeRaw16,
+ lolTypeRaw32,
lolTypeButtonDef
};
diff --git a/tools/create_kyradat/lol_cd.h b/tools/create_kyradat/lol_cd.h
index 3bab171b9f..66f49d887d 100644
--- a/tools/create_kyradat/lol_cd.h
+++ b/tools/create_kyradat/lol_cd.h
@@ -7,7 +7,17 @@ const ExtractEntry lolCDFile2[] = {
{ lolMT32SfxIndex, 0x0002B110, 0x0002B20A },
//{ lolADLSfxIndex, 0x0002B210, 0x0002B30A },
{ lolSpellProperties, 0x0002B5D0, 0x0002B6E8 },
- { lolGameShapeMap, 0x0002B35D, 0x0002B52C },
+ { lolGameShapeMap, 0x0002B35C, 0x0002B470 },
+ { lolCharInvIndex, 0x0002B470, 0x0002B47A },
+ { lolCharInvDefs, 0x0002B47A, 0x0002B4D2 },
+ { lolCharDefsMan, 0x0002B4D2, 0x0002B4E4 },
+ { lolCharDefsWoman, 0x0002B4E4, 0x0002B4F6 },
+ { lolCharDefsKieran, 0x0002B4F6, 0x0002B508 },
+ //{ lolCharDefsUnk, 0x0002B508, 0x0002B51A },
+ { lolCharDefsAkshel, 0x0002B51A, 0x0002B52C },
+ { lolExpRequirements, 0x0002B830, 0x0002B85C },
+ { lolInventoryDesc, 0x00032706, 0x0003271C },
+
{ lolLevelShpList, 0x00032826, 0x000328A5 },
{ lolLevelDatList, 0x000328A5, 0x000329A4 },
{ lolCompassDefs, 0x000286C4, 0x000287C4 },
diff --git a/tools/create_kyradat/misc.h b/tools/create_kyradat/misc.h
index d565c7504a..2b865b34a4 100644
--- a/tools/create_kyradat/misc.h
+++ b/tools/create_kyradat/misc.h
@@ -491,6 +491,16 @@ const int lolCDFile2Need[] = {
//lolADLSfxIndex,
lolSpellProperties,
lolGameShapeMap,
+ lolCharInvIndex,
+ lolCharInvDefs,
+ lolCharDefsMan,
+ lolCharDefsWoman,
+ lolCharDefsKieran,
+ //lolCharDefsUnk,
+ lolCharDefsAkshel,
+ lolExpRequirements,
+ lolInventoryDesc,
+
lolLevelShpList,
lolLevelDatList,
lolCompassDefs,