the ShaderNodesLoader is now properly reset when loading several technique def using nodes
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10859 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
0759c74764
commit
b14f33936f
@ -431,6 +431,7 @@ public class J3MLoader implements AssetLoader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void readTechnique(Statement techStat) throws IOException{
|
private void readTechnique(Statement techStat) throws IOException{
|
||||||
|
isUseNodes = false;
|
||||||
String[] split = techStat.getLine().split(whitespacePattern);
|
String[] split = techStat.getLine().split(whitespacePattern);
|
||||||
if (split.length == 1) {
|
if (split.length == 1) {
|
||||||
technique = new TechniqueDef(null);
|
technique = new TechniqueDef(null);
|
||||||
@ -469,7 +470,6 @@ public class J3MLoader implements AssetLoader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void loadFromRoot(List<Statement> roots) throws IOException{
|
private void loadFromRoot(List<Statement> roots) throws IOException{
|
||||||
isUseNodes = false;
|
|
||||||
if (roots.size() == 2){
|
if (roots.size() == 2){
|
||||||
Statement exception = roots.get(0);
|
Statement exception = roots.get(0);
|
||||||
String line = exception.getLine();
|
String line = exception.getLine();
|
||||||
@ -586,7 +586,11 @@ public class J3MLoader implements AssetLoader {
|
|||||||
if (!isUseNodes) {
|
if (!isUseNodes) {
|
||||||
isUseNodes = fragName == null && vertName == null;
|
isUseNodes = fragName == null && vertName == null;
|
||||||
if (isUseNodes) {
|
if (isUseNodes) {
|
||||||
nodesLoaderDelegate = new ShaderNodeLoaderDelegate();
|
if(nodesLoaderDelegate == null){
|
||||||
|
nodesLoaderDelegate = new ShaderNodeLoaderDelegate();
|
||||||
|
}else{
|
||||||
|
nodesLoaderDelegate.clear();
|
||||||
|
}
|
||||||
nodesLoaderDelegate.setTechniqueDef(technique);
|
nodesLoaderDelegate.setTechniqueDef(technique);
|
||||||
nodesLoaderDelegate.setMaterialDef(materialDef);
|
nodesLoaderDelegate.setMaterialDef(materialDef);
|
||||||
nodesLoaderDelegate.setAssetManager(assetManager);
|
nodesLoaderDelegate.setAssetManager(assetManager);
|
||||||
|
@ -1077,4 +1077,22 @@ public class ShaderNodeLoaderDelegate {
|
|||||||
declaredVariable.makeCondition();
|
declaredVariable.makeCondition();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void clear() {
|
||||||
|
nodeDefinitions.clear();
|
||||||
|
nodes.clear();
|
||||||
|
shaderNodeDefinition = null;
|
||||||
|
shaderNode = null;
|
||||||
|
techniqueDef = null;
|
||||||
|
attributes.clear();
|
||||||
|
vertexDeclaredUniforms.clear();
|
||||||
|
fragmentDeclaredUniforms.clear();
|
||||||
|
varyings.clear();
|
||||||
|
materialDef = null;
|
||||||
|
shaderLanguage = "";
|
||||||
|
shaderName = "";
|
||||||
|
varNames = "";
|
||||||
|
assetManager = null;
|
||||||
|
nulledConditions.clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user