- add more formats to TextureAtlas

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9026 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
nor..67 2012-01-14 19:06:49 +00:00
parent fddcbf6d6c
commit 81b2e7ca51

View File

@ -150,8 +150,20 @@ public class TextureAtlas {
image[i + 1] = sourceData.get(j); //b image[i + 1] = sourceData.get(j); //b
image[i + 2] = sourceData.get(j + 1); //g image[i + 2] = sourceData.get(j + 1); //g
image[i + 3] = sourceData.get(j + 2); //r image[i + 3] = sourceData.get(j + 2); //r
} else if (source.getFormat() == Format.RGB8) {
int j = (xPos + yPos * width) * 3;
image[i] = 0; //b
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.RGBA8) {
int j = (xPos + yPos * width) * 4;
image[i] = sourceData.get(j + 3); //a
image[i + 1] = sourceData.get(j + 2); //b
image[i + 2] = sourceData.get(j + 1); //g
image[i + 3] = sourceData.get(j); //r
} else { } else {
logger.log(Level.WARNING, "Could not draw texture {0} ", mapName); logger.log(Level.WARNING, "Could not draw texture with format {0}", source.getFormat());
} }
} }
} }