diff options
Diffstat (limited to 'src/exporter.py')
-rw-r--r-- | src/exporter.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/exporter.py b/src/exporter.py index 0ddc98a..ed377c3 100644 --- a/src/exporter.py +++ b/src/exporter.py @@ -82,6 +82,9 @@ class KPMapExporter: for i in xrange(sectorBottom - sectorTop + 1): rawSectors.append([None for j in xrange(sectorRight - sectorLeft + 1)]) + tileset = KP.tileset(layer.tileset) + optMappings = tileset.optMappings + # copy every tile index over for srcY in xrange(layerHeight): srcRow = cache[srcY] @@ -98,6 +101,8 @@ class KPMapExporter: tile = srcRow[srcX] if tile == -1: continue + tile = optMappings[tile] + if tile == -1: continue destSector = destRow[sectorX - sectorLeft] if destSector is None: @@ -398,7 +403,7 @@ class KPMapExporter: struct.pack_into('>ii', data, 8, len(tilesets), len(data)) for setname in tilesets: offsets[('tileset', setname)] = len(data) - data += self._buildGXTexObjRGB5A3(1024, 512, offsets[setname]) + data += self._buildGXTexObjRGB5A3(896, 448, offsets[setname]) for tex in textures: offsets[tex] = len(data) |