Update shader preprocessing to strip version correctly

Previously the whole line was removed, now only the end of the line is
removed to handle the case when version is in a comment
This commit is contained in:
Jakub Valtar
2017-07-21 11:41:53 +02:00
parent 9ccf77ae7c
commit 4bb1d9e373

View File

@@ -1989,8 +1989,9 @@ public abstract class PGL {
String[] src = new String[src0.length+offset];
for (int i = 0; i < src0.length; i++) {
String line = src0[i];
if (line.contains("#version")) {
line = "";
int versionIndex = line.indexOf("#version");
if (versionIndex >= 0) {
line = line.substring(0, versionIndex);
}
for (int j = 0; j < search.length; j++) {
line = search[j].matcher(line).replaceAll(replace[j]);