From 81b2e7ca513b2650fe1fb18d65801d904c612608 Mon Sep 17 00:00:00 2001 From: "nor..67" Date: Sat, 14 Jan 2012 19:06:49 +0000 Subject: [PATCH] - add more formats to TextureAtlas git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9026 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../src/tools/jme3tools/optimize/TextureAtlas.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/engine/src/tools/jme3tools/optimize/TextureAtlas.java b/engine/src/tools/jme3tools/optimize/TextureAtlas.java index f0a7925e2..3ae249b6b 100644 --- a/engine/src/tools/jme3tools/optimize/TextureAtlas.java +++ b/engine/src/tools/jme3tools/optimize/TextureAtlas.java @@ -150,8 +150,20 @@ public class TextureAtlas { image[i + 1] = sourceData.get(j); //b image[i + 2] = sourceData.get(j + 1); //g 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 { - logger.log(Level.WARNING, "Could not draw texture {0} ", mapName); + logger.log(Level.WARNING, "Could not draw texture with format {0}", source.getFormat()); } } }