Fixes for cases where there's no texture, DisplaySystem.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4066 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Andrzej Kapolka
2006-04-26 22:38:46 +00:00
parent e1c9d4bc53
commit e20ec412f1
3 changed files with 9 additions and 5 deletions
@@ -116,10 +116,6 @@ public class ModelMesh extends TriMesh
_textureByteBuffer = textures;
_indexByteBuffer = indices;
// initialize the model if we're displaying
if (DisplaySystem.getDisplaySystem() == null) {
return;
}
if (_boundingType == BOX_BOUND) {
setModelBound(new BoundingBox());
} else { // _boundingType == SPHERE_BOUND
@@ -127,6 +123,10 @@ public class ModelMesh extends TriMesh
}
updateModelBound();
// initialize the model if we're displaying
if (DisplaySystem.getDisplaySystem() == null) {
return;
}
if (_backCull == null) {
initSharedStates();
}
@@ -30,6 +30,7 @@ import java.io.ObjectOutputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Properties;
import java.util.logging.Level;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.DirectoryScanner;
@@ -37,6 +38,7 @@ import org.apache.tools.ant.Task;
import org.apache.tools.ant.types.FileSet;
import com.jme.scene.Spatial;
import com.jme.util.LoggingSystem;
import com.samskivert.util.PropertiesUtil;
import com.samskivert.util.StringUtil;
@@ -123,6 +125,8 @@ public class CompileModelTask extends Task
public void execute ()
throws BuildException
{
LoggingSystem.getLoggingSystem().setLevel(Level.WARNING);
for (int ii = 0, nn = _filesets.size(); ii < nn; ii++) {
FileSet fs = _filesets.get(ii);
DirectoryScanner ds = fs.getDirectoryScanner(getProject());
@@ -452,12 +452,12 @@ public class ModelViewer extends JmeCanvasApp
}
Texture tex = TextureManager.loadTexture(file.toString(),
Texture.MM_LINEAR_LINEAR, Texture.FM_LINEAR);
tex.setWrap(Texture.WM_WRAP_S_WRAP_T);
if (tex == null) {
Log.warning("Couldn't find texture [path=" + file +
"].");
return null;
}
tex.setWrap(Texture.WM_WRAP_S_WRAP_T);
tstate = _ctx.getRenderer().createTextureState();
tstate.setTexture(tex);
_tstates.put(name, tstate);