use of io.xol.chunkstories.api.util.Configuration.Option in project chunkstories by Hugobros3.
the class GLSLPreprocessor method defineConfiguration.
private static void defineConfiguration(StringBuilder shaderSource) {
for (Option option : Client.getInstance().getConfiguration().allOptions()) {
String fullname = option.getName();
if (fullname.startsWith("client.rendering")) {
String abridgedName = fullname.substring("client.rendering.".length());
abridgedName = abridgedName.replace(".", "_");
if (option instanceof OptionBoolean) {
if (option.getValue().equals("true"))
shaderSource.append("#define " + abridgedName + " " + option.getValue().toString() + "\n");
// shaderSource.append("#define " + abridgedName + " " + (option.getValue().equals("true") ? 1 : 0) + "\n");
} else
shaderSource.append("#define " + abridgedName + " " + option.getValue().toString() + "\n");
// System.out.println("#define " + abridgedName + " " + option.getValue().toString());
}
}
}
Aggregations