- add grayscale (Luminance8/Luminance8Alpha8) texture support to TextureAtlas

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9061 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 13 years ago
parent 2511d6960e
commit 8a08f8d505
  1. 12
      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());
}

Loading…
Cancel
Save