parent
97fe9cc49c
commit
fb99ca90b1
@ -37,6 +37,7 @@ import com.jme3.math.*;
|
|||||||
import com.jme3.shader.VarType;
|
import com.jme3.shader.VarType;
|
||||||
import com.jme3.texture.Texture;
|
import com.jme3.texture.Texture;
|
||||||
import com.jme3.texture.Texture.WrapMode;
|
import com.jme3.texture.Texture.WrapMode;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -301,20 +302,21 @@ When arrays can be inserted in J3M files
|
|||||||
OutputCapsule oc = ex.getCapsule(this);
|
OutputCapsule oc = ex.getCapsule(this);
|
||||||
oc.write(type, "varType", null);
|
oc.write(type, "varType", null);
|
||||||
oc.write(name, "name", null);
|
oc.write(name, "name", null);
|
||||||
|
|
||||||
|
if (value == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (value instanceof Savable) {
|
if (value instanceof Savable) {
|
||||||
Savable s = (Savable) value;
|
oc.write((Savable) value, "value_savable", null);
|
||||||
oc.write(s, "value_savable", null);
|
|
||||||
} else if (value instanceof Float) {
|
} else if (value instanceof Float) {
|
||||||
Float f = (Float) value;
|
oc.write((Float) value, "value_float", 0f);
|
||||||
oc.write(f.floatValue(), "value_float", 0f);
|
|
||||||
} else if (value instanceof Integer) {
|
} else if (value instanceof Integer) {
|
||||||
Integer i = (Integer) value;
|
oc.write((Integer) value, "value_int", 0);
|
||||||
oc.write(i.intValue(), "value_int", 0);
|
|
||||||
} else if (value instanceof Boolean) {
|
} else if (value instanceof Boolean) {
|
||||||
Boolean b = (Boolean) value;
|
oc.write((Boolean) value, "value_bool", false);
|
||||||
oc.write(b.booleanValue(), "value_bool", false);
|
|
||||||
} else if (value.getClass().isArray() && value instanceof Savable[]) {
|
} else if (value.getClass().isArray() && value instanceof Savable[]) {
|
||||||
oc.write((Savable[])value, "value_savable_array", null);
|
oc.write((Savable[]) value, "value_savable_array", null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user