summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/exporter.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/exporter.py b/src/exporter.py
index aad9559..ad352d3 100644
--- a/src/exporter.py
+++ b/src/exporter.py
@@ -194,9 +194,10 @@ class KPMapExporter:
# now that we've got that, we can pack the first part of the file
version = 1
headerSize = 0x24
- data = bytearray(struct.pack('>4sIIIIII', 'KP_m', version, len(self.layers), 20 + len(sectorData), 0, 0, 0, headerSize, 0))
- requiredFixUps.append((24, 'UnlockBytecode'))
- requiredFixUps.append((32, self.map.bgName))
+ tsInfoOffsetInHeader = 0x10
+ data = bytearray(struct.pack('>4sIIIIIIII', 'KP_m', version, len(self.layers), headerSize + len(sectorData), 0, 0, 0, headerSize, 0))
+ requiredFixUps.append((0x18, 'UnlockBytecode'))
+ requiredFixUps.append((0x20, self.map.bgName))
stringsToAdd.add(self.map.bgName)
# list of layer pointers goes here.. or will, later
@@ -425,7 +426,7 @@ class KPMapExporter:
imageData = []
- struct.pack_into('>ii', data, 8, len(tilesets), len(data))
+ struct.pack_into('>ii', data, tsInfoOffsetInHeader, len(tilesets), len(data))
for setname in tilesets:
offsets[('tileset', setname)] = len(data)
data += self._buildGXTexObjRGB5A3(896, 448, offsets[setname])