From 29b9a64e1271017cfb57e60168f3136f396ccac2 Mon Sep 17 00:00:00 2001 From: "nor..67" Date: Sun, 15 Jan 2012 01:50:15 +0000 Subject: [PATCH] - add size check for normal etc. maps, have to fit to main texture size git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9040 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- engine/src/tools/jme3tools/optimize/TextureAtlas.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/engine/src/tools/jme3tools/optimize/TextureAtlas.java b/engine/src/tools/jme3tools/optimize/TextureAtlas.java index 31c32efa1..668d34918 100644 --- a/engine/src/tools/jme3tools/optimize/TextureAtlas.java +++ b/engine/src/tools/jme3tools/optimize/TextureAtlas.java @@ -137,7 +137,7 @@ public class TextureAtlas { rootMapName = mapName; } if (sourceTextureName == null && !rootMapName.equals(mapName)) { - throw new IllegalStateException("Cannot add texture to new map without source texture"); + throw new IllegalStateException("Cannot add texture " + name + " to new map without source texture."); } TextureAtlasTile location = locationMap.get(name); if (location != null) { @@ -152,7 +152,9 @@ public class TextureAtlas { } else { location = locationMap.get(sourceTextureName); if (location == null) { - throw new IllegalStateException("Cannot find location for source texture"); + throw new IllegalStateException("Cannot find source texture for " + name + "."); + } else if (location.width != image.getWidth() || location.height != image.getHeight()) { + throw new IllegalStateException("Secondary texture " + name + " does not fit main texture size."); } } locationMap.put(name, location);