- 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
This commit is contained in:
parent
c4b1205fda
commit
29b9a64e12
@ -137,7 +137,7 @@ public class TextureAtlas {
|
|||||||
rootMapName = mapName;
|
rootMapName = mapName;
|
||||||
}
|
}
|
||||||
if (sourceTextureName == null && !rootMapName.equals(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);
|
TextureAtlasTile location = locationMap.get(name);
|
||||||
if (location != null) {
|
if (location != null) {
|
||||||
@ -152,7 +152,9 @@ public class TextureAtlas {
|
|||||||
} else {
|
} else {
|
||||||
location = locationMap.get(sourceTextureName);
|
location = locationMap.get(sourceTextureName);
|
||||||
if (location == null) {
|
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);
|
locationMap.put(name, location);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user