diff options
author | Colin Noga <Tempus@chronometry.ca> | 2012-02-17 03:27:27 -0600 |
---|---|---|
committer | Colin Noga <Tempus@chronometry.ca> | 2012-02-17 03:27:27 -0600 |
commit | 41d8073ac1b00409827968308689c6844bdf7ab8 (patch) | |
tree | b8a2d650d64c1090f31f09ddda314ea7bc15a404 /src | |
parent | d686ee1250bf148e600830642ed44f7d85357dd3 (diff) | |
download | koopatlas-41d8073ac1b00409827968308689c6844bdf7ab8.tar.gz koopatlas-41d8073ac1b00409827968308689c6844bdf7ab8.zip |
Fixed tileset shit
Diffstat (limited to '')
-rw-r--r-- | src/tileset.py | 16 |
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) |