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:
@@ -116,10 +116,6 @@ public class ModelMesh extends TriMesh
|
|||||||
_textureByteBuffer = textures;
|
_textureByteBuffer = textures;
|
||||||
_indexByteBuffer = indices;
|
_indexByteBuffer = indices;
|
||||||
|
|
||||||
// initialize the model if we're displaying
|
|
||||||
if (DisplaySystem.getDisplaySystem() == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (_boundingType == BOX_BOUND) {
|
if (_boundingType == BOX_BOUND) {
|
||||||
setModelBound(new BoundingBox());
|
setModelBound(new BoundingBox());
|
||||||
} else { // _boundingType == SPHERE_BOUND
|
} else { // _boundingType == SPHERE_BOUND
|
||||||
@@ -127,6 +123,10 @@ public class ModelMesh extends TriMesh
|
|||||||
}
|
}
|
||||||
updateModelBound();
|
updateModelBound();
|
||||||
|
|
||||||
|
// initialize the model if we're displaying
|
||||||
|
if (DisplaySystem.getDisplaySystem() == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (_backCull == null) {
|
if (_backCull == null) {
|
||||||
initSharedStates();
|
initSharedStates();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import java.io.ObjectOutputStream;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import org.apache.tools.ant.BuildException;
|
import org.apache.tools.ant.BuildException;
|
||||||
import org.apache.tools.ant.DirectoryScanner;
|
import org.apache.tools.ant.DirectoryScanner;
|
||||||
@@ -37,6 +38,7 @@ import org.apache.tools.ant.Task;
|
|||||||
import org.apache.tools.ant.types.FileSet;
|
import org.apache.tools.ant.types.FileSet;
|
||||||
|
|
||||||
import com.jme.scene.Spatial;
|
import com.jme.scene.Spatial;
|
||||||
|
import com.jme.util.LoggingSystem;
|
||||||
|
|
||||||
import com.samskivert.util.PropertiesUtil;
|
import com.samskivert.util.PropertiesUtil;
|
||||||
import com.samskivert.util.StringUtil;
|
import com.samskivert.util.StringUtil;
|
||||||
@@ -123,6 +125,8 @@ public class CompileModelTask extends Task
|
|||||||
public void execute ()
|
public void execute ()
|
||||||
throws BuildException
|
throws BuildException
|
||||||
{
|
{
|
||||||
|
LoggingSystem.getLoggingSystem().setLevel(Level.WARNING);
|
||||||
|
|
||||||
for (int ii = 0, nn = _filesets.size(); ii < nn; ii++) {
|
for (int ii = 0, nn = _filesets.size(); ii < nn; ii++) {
|
||||||
FileSet fs = _filesets.get(ii);
|
FileSet fs = _filesets.get(ii);
|
||||||
DirectoryScanner ds = fs.getDirectoryScanner(getProject());
|
DirectoryScanner ds = fs.getDirectoryScanner(getProject());
|
||||||
|
|||||||
@@ -452,12 +452,12 @@ public class ModelViewer extends JmeCanvasApp
|
|||||||
}
|
}
|
||||||
Texture tex = TextureManager.loadTexture(file.toString(),
|
Texture tex = TextureManager.loadTexture(file.toString(),
|
||||||
Texture.MM_LINEAR_LINEAR, Texture.FM_LINEAR);
|
Texture.MM_LINEAR_LINEAR, Texture.FM_LINEAR);
|
||||||
tex.setWrap(Texture.WM_WRAP_S_WRAP_T);
|
|
||||||
if (tex == null) {
|
if (tex == null) {
|
||||||
Log.warning("Couldn't find texture [path=" + file +
|
Log.warning("Couldn't find texture [path=" + file +
|
||||||
"].");
|
"].");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
tex.setWrap(Texture.WM_WRAP_S_WRAP_T);
|
||||||
tstate = _ctx.getRenderer().createTextureState();
|
tstate = _ctx.getRenderer().createTextureState();
|
||||||
tstate.setTexture(tex);
|
tstate.setTexture(tex);
|
||||||
_tstates.put(name, tstate);
|
_tstates.put(name, tstate);
|
||||||
|
|||||||
Reference in New Issue
Block a user