From 3327051521aff341acccdd1328ed787a3b16eab5 Mon Sep 17 00:00:00 2001 From: Ochi Wolfe Date: Mon, 26 Aug 2013 12:19:04 +0200 Subject: [PATCH] Now saving RGBA TGAs instead of Grayscale+Alpha because the Windows version of SL doesn't like those. --- TextureCreator/lib/TGAWriter.py | 2 +- TextureCreator/lib/TexturePainter.py | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/TextureCreator/lib/TGAWriter.py b/TextureCreator/lib/TGAWriter.py index 8efae4e..4ca7e4e 100644 --- a/TextureCreator/lib/TGAWriter.py +++ b/TextureCreator/lib/TGAWriter.py @@ -15,7 +15,7 @@ def writeTGA(width, height, bitsPerColor, bitsPerPixel, data, path): header = struct.pack(FORMAT, 0, # Offset 0, # ColorType - 3, # ImageType + 2, # ImageType 0, # PaletteStart 0, # PaletteLen bitsPerColor, # PalBits diff --git a/TextureCreator/lib/TexturePainter.py b/TextureCreator/lib/TexturePainter.py index 3b50634..c3cc09c 100644 --- a/TextureCreator/lib/TexturePainter.py +++ b/TextureCreator/lib/TexturePainter.py @@ -191,15 +191,14 @@ class TexturePainter: arr = bytearray(buf) - del arr[0::4] - del arr[0::3] - if not self.debugGrid: - arr[0::2] = itertools.repeat(255, self.gridConfig.imageSize[0] * self.gridConfig.imageSize[1]) + arr[0::4] = itertools.repeat(255, self.gridConfig.imageSize[0] * self.gridConfig.imageSize[1]) + arr[1::4] = itertools.repeat(255, self.gridConfig.imageSize[0] * self.gridConfig.imageSize[1]) + arr[2::4] = itertools.repeat(255, self.gridConfig.imageSize[0] * self.gridConfig.imageSize[1]) targetPath = os.path.join(OUTPUT_DIR, self.outputName + ".tga") - TGAWriter.writeTGA(self.gridConfig.imageSize[0], self.gridConfig.imageSize[1], 8, 16, arr, targetPath) + TGAWriter.writeTGA(self.gridConfig.imageSize[0], self.gridConfig.imageSize[1], 8, 32, arr, targetPath) def init(self, args): imageSizeX = int(math.floor(args[2] * args[0]))