for (VariableMapping map : shaderNode.getInputMapping()) { if ((map.getLeftVariable().getName()).equals(param)) { if (map.getCondition() != null) { l = l.replaceAll(param, map.getCondition()); match = true;
if (mapping.getCondition() != null) { out.write(" : "); out.write(formatCondition(mapping.getCondition(), matParams));
final String rightExpression = mapping.getRightExpression(); startCondition(mapping.getCondition(), source); appendIndent(source); if (!leftVariable.isShaderOutput() && declare) { endCondition(mapping.getCondition(), source);
private void assertEqualsVariableMapping(VariableMapping im1, VariableMapping im2) { assertEquals(im1.getCondition(), im2.getCondition()); assertEquals(im1.getLeftSwizzling(), im2.getLeftSwizzling()); assertEquals(im1.getRightSwizzling(), im2.getRightSwizzling()); assertEqualsVariables(im1.getRightVariable(), im2.getRightVariable()); assertEqualsVariables(im1.getLeftVariable(), im2.getLeftVariable()); }
for (VariableMapping map : shaderNode.getInputMapping()) { if ((map.getLeftVariable().getName()).equals(param)) { if (map.getCondition() != null) { l = l.replaceAll(param, map.getCondition()); match = true;
private void writeVariableMapping(OutputStreamWriter out, ShaderNode shaderNode, VariableMapping mapping, Collection<MatParam> matParams) throws IOException { out.write(" "); if(!mapping.getLeftVariable().getNameSpace().equals(shaderNode.getName())) { out.write(mapping.getLeftVariable().getNameSpace()); out.write("."); } out.write(mapping.getLeftVariable().getName()); if(!mapping.getLeftSwizzling().equals("")){ out.write("."); out.write(mapping.getLeftSwizzling()); } out.write(" = "); if(!mapping.getRightVariable().getNameSpace().equals(shaderNode.getName())) { out.write(mapping.getRightVariable().getNameSpace()); out.write("."); } out.write(mapping.getRightVariable().getName().replaceFirst("g_","").replaceFirst("m_","")); if(!mapping.getRightSwizzling().equals("")){ out.write("."); out.write(mapping.getRightSwizzling()); } if (mapping.getCondition() != null){ out.write(" : "); out.write(formatCondition(mapping.getCondition(),matParams)); } out.write("\n"); }
startCondition(mapping.getCondition(), source); appendIndent(source); if (!mapping.getLeftVariable().isShaderOutput()) { endCondition(mapping.getCondition(), source);