Просмотр исходного кода

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

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9061 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
nor..67 14 лет назад
Родитель
Сommit
8a08f8d505
1 измененных файлов с 12 добавлено и 0 удалено
  1. 12 0
      engine/src/tools/jme3tools/optimize/TextureAtlas.java

+ 12 - 0
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());
                 }