Skip to content

Commit 7f9ad6c

Browse files
committed
Merge branch 'master' of github.com:processing/processing
2 parents 2a4b7c7 + 49c6968 commit 7f9ad6c

File tree

4 files changed

+25
-8
lines changed

4 files changed

+25
-8
lines changed

core/src/processing/opengl/shaders/LightVert-vc4.glsl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ varying vec4 backVertColor;
4747

4848
const float zero_float = 0.0;
4949
const float one_float = 1.0;
50-
const vec3 zero_vec3 = vec3(0);
50+
const vec3 zero_vec3 = vec3(0.0);
51+
const vec3 minus_one_vec3 = vec3(0.0-1.0);
5152

5253
float falloffFactor(vec3 lightPos, vec3 vertPos, vec3 coeff) {
5354
vec3 lpv = lightPos - vertPos;
@@ -59,7 +60,7 @@ float falloffFactor(vec3 lightPos, vec3 vertPos, vec3 coeff) {
5960

6061
float spotFactor(vec3 lightPos, vec3 vertPos, vec3 lightNorm, float minCos, float spotExp) {
6162
vec3 lpv = normalize(lightPos - vertPos);
62-
vec3 nln = -one_float * lightNorm;
63+
vec3 nln = minus_one_vec3 * lightNorm;
6364
float spotCos = dot(nln, lpv);
6465
return spotCos <= minCos ? zero_float : pow(spotCos, spotExp);
6566
}
@@ -83,7 +84,7 @@ void main() {
8384

8485
// Normal vector in eye coordinates
8586
vec3 ecNormal = normalize(normalMatrix * normal);
86-
vec3 ecNormalInv = ecNormal * -one_float;
87+
vec3 ecNormalInv = ecNormal * minus_one_vec3;
8788

8889
// Light calculations
8990
vec3 totalAmbient = vec3(0, 0, 0);
@@ -110,7 +111,7 @@ void main() {
110111

111112
if (isDir) {
112113
falloff = one_float;
113-
lightDir = -one_float * lightNormal[i];
114+
lightDir = minus_one_vec3 * lightNormal[i];
114115
} else {
115116
falloff = falloffFactor(lightPos, ecVertex, lightFalloff[i]);
116117
lightDir = normalize(lightPos - ecVertex);

core/src/processing/opengl/shaders/TexLightVert-vc4.glsl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ varying vec4 vertTexCoord;
5050

5151
const float zero_float = 0.0;
5252
const float one_float = 1.0;
53-
const vec3 zero_vec3 = vec3(0);
53+
const vec3 zero_vec3 = vec3(0.0);
54+
const vec3 minus_one_vec3 = vec3(0.0-1.0);
5455

5556
float falloffFactor(vec3 lightPos, vec3 vertPos, vec3 coeff) {
5657
vec3 lpv = lightPos - vertPos;
@@ -62,7 +63,7 @@ float falloffFactor(vec3 lightPos, vec3 vertPos, vec3 coeff) {
6263

6364
float spotFactor(vec3 lightPos, vec3 vertPos, vec3 lightNorm, float minCos, float spotExp) {
6465
vec3 lpv = normalize(lightPos - vertPos);
65-
vec3 nln = -one_float * lightNorm;
66+
vec3 nln = minus_one_vec3 * lightNorm;
6667
float spotCos = dot(nln, lpv);
6768
return spotCos <= minCos ? zero_float : pow(spotCos, spotExp);
6869
}
@@ -86,7 +87,7 @@ void main() {
8687

8788
// Normal vector in eye coordinates
8889
vec3 ecNormal = normalize(normalMatrix * normal);
89-
vec3 ecNormalInv = ecNormal * -one_float;
90+
vec3 ecNormalInv = ecNormal * minus_one_vec3;
9091

9192
// Light calculations
9293
vec3 totalAmbient = vec3(0, 0, 0);
@@ -113,7 +114,7 @@ void main() {
113114

114115
if (isDir) {
115116
falloff = one_float;
116-
lightDir = -one_float * lightNormal[i];
117+
lightDir = minus_one_vec3 * lightNormal[i];
117118
} else {
118119
falloff = falloffFactor(lightPos, ecVertex, lightFalloff[i]);
119120
lightDir = normalize(lightPos - ecVertex);

java/src/processing/mode/java/Commander.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ public Commander(String[] args) {
275275
} else {
276276
runner.launch(sketchArgs);
277277
}
278+
success = !runner.vmReturnedError();
278279
}
279280
} else {
280281
success = false;

java/src/processing/mode/java/runner/Runner.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public class Runner implements MessageConsumer {
5959

6060
// Running remote VM
6161
protected VirtualMachine vm;
62+
protected boolean vmReturnedError;
6263

6364
// Thread transferring remote error stream to our error stream
6465
protected Thread errThread = null;
@@ -130,6 +131,14 @@ public VirtualMachine present(String[] args) {
130131
}
131132

132133

134+
/**
135+
* Whether the last invocation of launchJava() was successful or not
136+
*/
137+
public boolean vmReturnedError() {
138+
return vmReturnedError;
139+
}
140+
141+
133142
/**
134143
* Simple non-blocking launch of the virtual machine. VM starts suspended.
135144
* @return debuggee VM or null on failure
@@ -408,6 +417,7 @@ protected void launchJava(final String[] args) {
408417
new Thread(new Runnable() {
409418
public void run() {
410419
// PApplet.println("java starting");
420+
vmReturnedError = false;
411421
process = PApplet.exec(args);
412422
try {
413423
// PApplet.println("java waiting");
@@ -445,6 +455,7 @@ public void run() {
445455
// changing this to separate editor and listener [091124]
446456
//if (editor != null) {
447457
listener.statusError("Could not run the sketch.");
458+
vmReturnedError = true;
448459
//}
449460
// return null;
450461
}
@@ -659,6 +670,9 @@ public static boolean handleCommonErrors(final String exceptionClass,
659670
}
660671
} else if (exceptionClass.equals("java.lang.UnsatisfiedLinkError")) {
661672
listener.statusError("A library used by this sketch is not installed properly.");
673+
if (PApplet.platform == PConstants.LINUX) {
674+
System.out.println(message);
675+
}
662676
err.println("A library relies on native code that's not available.");
663677
err.println("Or only works properly when the sketch is run as a " +
664678
((Platform.getNativeBits() == 32) ? "64-bit" : "32-bit") + " application.");

0 commit comments

Comments
 (0)