* Put comment markers around imported library contents when loading shader

experimental
shadowislord 11 years ago
parent ad7fdb6fab
commit be3a6c03b2
  1. 6
      jme3-core/src/plugins/java/com/jme3/shader/plugins/GLSLLoader.java

@ -84,6 +84,9 @@ public class GLSLLoader implements AssetLoader {
try { try {
bufReader = new BufferedReader(reader); bufReader = new BufferedReader(reader);
String ln; String ln;
if (!nodeName.equals("[main]")) {
sb.append("// -- begin import ").append(nodeName).append(" --\n");
}
while ((ln = bufReader.readLine()) != null) { while ((ln = bufReader.readLine()) != null) {
if (ln.trim().startsWith("#import ")) { if (ln.trim().startsWith("#import ")) {
ln = ln.trim().substring(8).trim(); ln = ln.trim().substring(8).trim();
@ -109,6 +112,9 @@ public class GLSLLoader implements AssetLoader {
sb.append(ln).append('\n'); sb.append(ln).append('\n');
} }
} }
if (!nodeName.equals("[main]")) {
sb.append("// -- end import ").append(nodeName).append(" --\n");
}
} catch (IOException ex) { } catch (IOException ex) {
if (bufReader != null) { if (bufReader != null) {
try { try {

Loading…
Cancel
Save