* Made all placeholder assets loaded have correct asset keys (based on the key that was used to load them)
* Also made the placeholder texture use repeat mode if the original was supposed to use it git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10207 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
@@ -159,6 +159,10 @@ public class J3MLoader implements AssetLoader {
|
||||
}
|
||||
}else{
|
||||
tex = new Texture2D(PlaceholderAssets.getPlaceholderImage());
|
||||
if (repeat){
|
||||
tex.setWrap(WrapMode.Repeat);
|
||||
}
|
||||
tex.setKey(texKey);
|
||||
}
|
||||
return tex;
|
||||
}else{
|
||||
|
||||
@@ -183,6 +183,8 @@ public class MTLLoader implements AssetLoader {
|
||||
} catch (AssetNotFoundException ex){
|
||||
logger.log(Level.WARNING, "Cannot locate {0} for material {1}", new Object[]{texKey, key});
|
||||
texture = new Texture2D(PlaceholderAssets.getPlaceholderImage());
|
||||
texture.setWrap(WrapMode.Repeat);
|
||||
texture.setKey(key);
|
||||
}
|
||||
return texture;
|
||||
}
|
||||
|
||||
@@ -233,6 +233,7 @@ public class MeshLoader extends DefaultHandler implements AssetLoader {
|
||||
if (mat == null) {
|
||||
logger.log(Level.WARNING, "Cannot locate {0} for model {1}", new Object[]{matName, key});
|
||||
mat = PlaceholderAssets.getPlaceholderMaterial(assetManager);
|
||||
mat.setKey(key);
|
||||
}
|
||||
|
||||
if (mat.isTransparent()) {
|
||||
|
||||
@@ -305,7 +305,9 @@ public class SceneLoader extends DefaultHandler implements AssetLoader {
|
||||
if (ex.getMessage().equals(meshFile)) {
|
||||
logger.log(Level.WARNING, "Cannot locate {0} for scene {1}", new Object[]{meshKey, key});
|
||||
// Attach placeholder asset.
|
||||
entityNode.attachChild(PlaceholderAssets.getPlaceholderModel(assetManager));
|
||||
Spatial model = PlaceholderAssets.getPlaceholderModel(assetManager);
|
||||
model.setKey(key);
|
||||
entityNode.attachChild(model);
|
||||
} else {
|
||||
throw ex;
|
||||
}
|
||||
|
||||
@@ -83,6 +83,8 @@ public class MaterialExtensionLoader {
|
||||
} catch (AssetNotFoundException ex){
|
||||
logger.log(Level.WARNING, "Cannot locate {0} for material {1}", new Object[]{texKey, key});
|
||||
tex = new Texture2D( PlaceholderAssets.getPlaceholderImage() );
|
||||
tex.setWrap(WrapMode.Repeat);
|
||||
tex.setKey(texKey);
|
||||
}
|
||||
|
||||
material.setTexture(jmeParamName, tex);
|
||||
|
||||
Reference in New Issue
Block a user