summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorColin Noga <Tempus@chronometry.ca>2012-02-17 03:27:27 -0600
committerColin Noga <Tempus@chronometry.ca>2012-02-17 03:27:27 -0600
commit41d8073ac1b00409827968308689c6844bdf7ab8 (patch)
treeb8a2d650d64c1090f31f09ddda314ea7bc15a404 /src
parentd686ee1250bf148e600830642ed44f7d85357dd3 (diff)
downloadkoopatlas-41d8073ac1b00409827968308689c6844bdf7ab8.tar.gz
koopatlas-41d8073ac1b00409827968308689c6844bdf7ab8.zip
Fixed tileset shit
Diffstat (limited to 'src')
-rw-r--r--src/tileset.py16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/tileset.py b/src/tileset.py
index a68f733..244cf8e 100644
--- a/src/tileset.py
+++ b/src/tileset.py
@@ -440,18 +440,10 @@ class KPTileset(object):
newpixel = struct.unpack_from('>H', tex, i)[0]
# newpixel = (int(tex[i]) << 8) | int(tex[i+1])
-
- if(newpixel >= 0x8000): # Check if it's RGB555
- red = ((newpixel >> 10) & 0x1F) * 255 / 0x1F
- green = ((newpixel >> 5) & 0x1F) * 255 / 0x1F
- blue = (newpixel & 0x1F) * 255 / 0x1F
- alpha = 0xFF
-
- else: # If not, it's RGB4A3
- alpha = ((newpixel & 0x7000) >> 12) * 255 / 0x7
- blue = ((newpixel & 0xF00) >> 8) * 255 / 0xF
- green = ((newpixel & 0xF0) >> 4) * 255 / 0xF
- red = (newpixel & 0xF) * 255 / 0xF
+ alpha = ((newpixel & 0x7000) >> 12) * 255 / 0x7
+ red = ((newpixel & 0xF00) >> 8) * 255 / 0xF
+ green = ((newpixel & 0xF0) >> 4) * 255 / 0xF
+ blue = (newpixel & 0xF) * 255 / 0xF
argb = (blue) | (green << 8) | (red << 16) | (alpha << 24)
dest.setPixel(xpixel, ypixel, argb)