summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2012-09-22 15:03:07 +0200
committerTreeki <treeki@gmail.com>2012-09-22 15:03:07 +0200
commitff48bf230ecea27d85d1d65796e70087fb0223cf (patch)
treeb62082586b75f84ed633e59fa8ab0f887da30ec0
parent077a8de3a18e051f818d04ef6621842901cd1614 (diff)
downloadkoopatlas-ff48bf230ecea27d85d1d65796e70087fb0223cf.tar.gz
koopatlas-ff48bf230ecea27d85d1d65796e70087fb0223cf.zip
fix to the exporter for the new format
-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])