mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
check point and line attributes at the end, so that defines can override
autodetection
This commit is contained in:
@@ -1020,19 +1020,8 @@ public class PShader implements PConstants {
|
||||
static protected int getShaderType(String[] source, int defaultType) {
|
||||
for (int i = 0; i < source.length; i++) {
|
||||
String line = source[i].trim();
|
||||
if (PApplet.match(line, pointShaderAttrRegexp) != null)
|
||||
return PShader.POINT;
|
||||
else if (PApplet.match(line, pointShaderInRegexp) != null)
|
||||
return PShader.POINT;
|
||||
else if (PApplet.match(line, lineShaderAttrRegexp) != null)
|
||||
return PShader.LINE;
|
||||
else if (PApplet.match(line, lineShaderInRegexp) != null)
|
||||
return PShader.LINE;
|
||||
else if (PApplet.match(line, pointShaderDefRegexp) != null)
|
||||
return PShader.POINT;
|
||||
else if (PApplet.match(line, lineShaderDefRegexp) != null)
|
||||
return PShader.LINE;
|
||||
else if (PApplet.match(line, colorShaderDefRegexp) != null)
|
||||
|
||||
if (PApplet.match(line, colorShaderDefRegexp) != null)
|
||||
return PShader.COLOR;
|
||||
else if (PApplet.match(line, lightShaderDefRegexp) != null)
|
||||
return PShader.LIGHT;
|
||||
@@ -1046,6 +1035,18 @@ public class PShader implements PConstants {
|
||||
return PShader.POLY;
|
||||
else if (PApplet.match(line, quadShaderAttrRegexp) != null)
|
||||
return PShader.POLY;
|
||||
else if (PApplet.match(line, pointShaderDefRegexp) != null)
|
||||
return PShader.POINT;
|
||||
else if (PApplet.match(line, lineShaderDefRegexp) != null)
|
||||
return PShader.LINE;
|
||||
else if (PApplet.match(line, pointShaderAttrRegexp) != null)
|
||||
return PShader.POINT;
|
||||
else if (PApplet.match(line, pointShaderInRegexp) != null)
|
||||
return PShader.POINT;
|
||||
else if (PApplet.match(line, lineShaderAttrRegexp) != null)
|
||||
return PShader.LINE;
|
||||
else if (PApplet.match(line, lineShaderInRegexp) != null)
|
||||
return PShader.LINE;
|
||||
}
|
||||
return defaultType;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user