- add size warning to TextureAtlas

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9051 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 13 years ago
parent 1d742f1d07
commit d83815847a
  1. 8
      engine/src/tools/jme3tools/optimize/TextureAtlas.java

@ -53,6 +53,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
@ -60,6 +62,7 @@ import java.util.TreeMap;
*/
public class TextureAtlas {
private static final Logger logger = Logger.getLogger(TextureAtlas.class.getName());
private Map<String, byte[]> images;
private int atlasWidth, atlasHeight;
private Format format = Format.ABGR8;
@ -348,7 +351,10 @@ public class TextureAtlas {
GeometryBatchFactory.gatherGeoms(root, geometries);
TextureAtlas atlas = new TextureAtlas(atlasSize, atlasSize);
for (Geometry geometry : geometries) {
atlas.addGeometry(geometry);
if(!atlas.addGeometry(geometry)){
logger.log(Level.WARNING, "Texture atlas size too small, cannot add all textures");
return null;
}
}
return atlas;
}

Loading…
Cancel
Save