From ff48bf230ecea27d85d1d65796e70087fb0223cf Mon Sep 17 00:00:00 2001 From: Treeki Date: Sat, 22 Sep 2012 15:03:07 +0200 Subject: fix to the exporter for the new format --- src/exporter.py | 9 +++++---- 1 file 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]) -- cgit v1.2.3