diff options
author | Treeki <treeki@gmail.com> | 2012-02-18 17:17:51 +0100 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2012-02-18 17:17:51 +0100 |
commit | f5c41235018fbc793199c0e7c34b52b04fde6828 (patch) | |
tree | e2e25d1ccc2b45234d8a53390edefd1fd9a24abe | |
parent | c97c497d3ed019b26e66d20436b5d4ea1dfc4cd7 (diff) | |
download | koopatlas-f5c41235018fbc793199c0e7c34b52b04fde6828.tar.gz koopatlas-f5c41235018fbc793199c0e7c34b52b04fde6828.zip |
exporter fixes
Diffstat (limited to '')
-rw-r--r-- | src/exporter.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/exporter.py b/src/exporter.py index 0c24d50..27e775a 100644 --- a/src/exporter.py +++ b/src/exporter.py @@ -22,8 +22,8 @@ def RGB5A3Encode(tex): sspack = shortstruct.pack_into offset = 0 - for ytile in xrange(0, padW, 4): - for xtile in xrange(0, padH, 4): + for ytile in xrange(0, padH, 4): + for xtile in xrange(0, padW, 4): for ypixel in xrange(ytile, ytile + 4): for xpixel in xrange(xtile, xtile + 4): @@ -89,7 +89,7 @@ class KPMapExporter: sectorY = worldY / 16 destY = worldY % 16 - destRow = rawSectors[sectorY] + destRow = rawSectors[sectorY - sectorTop] for srcX in xrange(layerWidth): worldX = srcX + layerX @@ -99,10 +99,10 @@ class KPMapExporter: tile = srcRow[srcX] if tile == -1: continue - destSector = destRow[sectorX] + destSector = destRow[sectorX - sectorLeft] if destSector is None: destSector = [[-1 for j in xrange(16)] for i in xrange(16)] - destRow[sectorX] = destSector + destRow[sectorX - sectorLeft] = destSector destSector[destY][destX] = tile @@ -396,7 +396,7 @@ class KPMapExporter: imageData = [] - struct.pack_into('>ii', data, 8, len(textures), len(data)) + 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]) |