From 8a08f8d50589c25131689f7ad353360a463b585b Mon Sep 17 00:00:00 2001 From: "nor..67" Date: Sun, 15 Jan 2012 19:02:17 +0000 Subject: [PATCH] - add grayscale (Luminance8/Luminance8Alpha8) texture support to TextureAtlas git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9061 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../src/tools/jme3tools/optimize/TextureAtlas.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/engine/src/tools/jme3tools/optimize/TextureAtlas.java b/engine/src/tools/jme3tools/optimize/TextureAtlas.java index 9eba8cdb8..35ca819b7 100644 --- a/engine/src/tools/jme3tools/optimize/TextureAtlas.java +++ b/engine/src/tools/jme3tools/optimize/TextureAtlas.java @@ -301,6 +301,18 @@ public class TextureAtlas { image[i + 1] = sourceData.get(j + 2); //b image[i + 2] = sourceData.get(j + 1); //g image[i + 3] = sourceData.get(j); //r + } else if (source.getFormat() == Format.Luminance8) { + int j = (xPos + yPos * width) * 1; + image[i] = 1; //a + image[i + 1] = sourceData.get(j); //b + image[i + 2] = sourceData.get(j); //g + image[i + 3] = sourceData.get(j); //r + } else if (source.getFormat() == Format.Luminance8Alpha8) { + int j = (xPos + yPos * width) * 2; + image[i] = sourceData.get(j + 1); //a + image[i + 1] = sourceData.get(j); //b + image[i + 2] = sourceData.get(j); //g + image[i + 3] = sourceData.get(j); //r } else { throw new UnsupportedOperationException("Cannot draw textures with format " + source.getFormat()); }