* Put comment markers around imported library contents when loading shader

This commit is contained in:
shadowislord 2014-06-05 23:16:10 -04:00
parent ad7fdb6fab
commit be3a6c03b2

View File

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