From efafd2246874464c59d27d444ee6b21e91cde3d7 Mon Sep 17 00:00:00 2001 From: Treeki Date: Mon, 23 Jul 2012 02:52:35 +0200 Subject: added EXTRA pointers --- src/exporter.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/exporter.py b/src/exporter.py index e6ba38a..2396633 100644 --- a/src/exporter.py +++ b/src/exporter.py @@ -343,21 +343,25 @@ class KPMapExporter: if node.isStop(): if node.level: level1, level2 = node.level - data += struct.pack('>ibbibb', 2, level1, level2, 0, 0, 0) + # i i b b b b: node type, Extra pointer, world, level, padding (hasSecret?), padding + data += struct.pack('>iibbbb', 2, 0, level1, level2, 0, 0) elif node.mapChange: - data += u32.pack(3) + data += u32.pack(3) # node type destMap = node.mapChange - requiredFixUps.append((len(data), destMap)) + requiredFixUps.append((len(data)+4, destMap)) stringsToAdd.add(destMap) - data += struct.pack('>ibbbb', 0, node.mapID, node.foreignID, node.transition, 0) + # i i b b b b: Extra pointer, dest map, map ID, foreign ID, transition, padding + data += struct.pack('>iibbbb', 0, 0, node.mapID, node.foreignID, node.transition, 0) else: - data += u32.pack(1) + data += u32.pack(1) # node type + data += u32.pack(0) # Extra pointer else: - data += u32.pack(0) + data += u32.pack(0) # node type + data += u32.pack(0) # Extra pointer for path in layer.paths: offsets[path] = len(data) -- cgit v1.2.3