Search in sources :

Example 1 with Option

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());
        }
    }
}
Also used : Option(io.xol.chunkstories.api.util.Configuration.Option) OptionBoolean(io.xol.chunkstories.api.util.Configuration.OptionBoolean)

Aggregations

Option (io.xol.chunkstories.api.util.Configuration.Option)1 OptionBoolean (io.xol.chunkstories.api.util.Configuration.OptionBoolean)1