// <DEFINENAME> [ ":" <PARAMNAME> ] private void readDefine(String statement) throws IOException { String[] split = statement.split(":"); if (split.length == 1) { String defineName = split[0].trim(); presetDefines.add(defineName); } else if (split.length == 2) { String defineName = split[0].trim(); String paramName = split[1].trim(); MatParam param = materialDef.getMaterialParam(paramName); if (param == null) { logger.log( Level.WARNING, "In technique ''{0}'':\n" + "Define ''{1}'' mapped to non-existent" + " material parameter ''{2}'', ignoring.", new Object[] {technique.getName(), defineName, paramName}); return; } VarType paramType = param.getVarType(); technique.addShaderParamDefine(paramName, paramType, defineName); } else { throw new IOException("Define syntax incorrect"); } }
private void readShaderDefinition( Shader.ShaderType shaderType, String name, String... languages) { shaderNames.put(shaderType, name); if (langSize != 0 && langSize != languages.length) { throw new AssetLoadException( "Technique " + technique.getName() + " must have the same number of languages for each shader type."); } langSize = languages.length; for (int i = 0; i < languages.length; i++) { if (i >= shaderLanguages.size()) { shaderLanguages.add(new EnumMap<Shader.ShaderType, String>(Shader.ShaderType.class)); } shaderLanguages.get(i).put(shaderType, languages[i]); } }