Skip to content
This repository has been archived by the owner on Jun 24, 2021. It is now read-only.

Commit

Permalink
Formatting changes
Browse files Browse the repository at this point in the history
- Tabs to spaces
- line at end of sources
- removal of "Falco"-comments
- changed policy of line separator
  • Loading branch information
ProggerFox committed Mar 14, 2019
1 parent 196d0cf commit 58be282
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,4 @@ public void setMaxRange(double maxRange) {
this.maxRange = maxRange < 0 ? 0 : maxRange;
visualsChanged();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -228,4 +228,4 @@ public void release() {
// TODO: 3D - Need to release native resources
// material, mesh and meshview have native backing that need clean up.
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ public interface MeshView {

public void setAmbientLight(float r, float g, float b);

public void setPointLight(int index,
float x, float y, float z,
public void setPointLight(int index, float x, float y, float z,
float r, float g, float b, float w,
float ca, float la, float qa, float maxRange);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -608,4 +608,4 @@ public void blit(RTTexture srcRTT, RTTexture dstRTT,
srcX0, srcY0, srcX1, srcY1,
dstX0, dstY0, dstX1, dstY1);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -448,11 +448,11 @@ void setWireframe(long nativeHandle, boolean wireframe) {
void setAmbientLight(long nativeHandle, float r, float g, float b) {
glContext.setAmbientLight(nativeHandle, r, g, b);
}
/*
* FacloTheBold: - new operator, added parameters for attenuation coefficients
*/
void setPointLight(long nativeHandle, int index, float x, float y, float z, float r, float g, float b, float w, float ra, float ca, float la, float qa) {

/*
* FacloTheBold: - new operator, added parameters for attenuation coefficients
*/
void setPointLight(long nativeHandle, int index, float x, float y, float z, float r, float g, float b, float w, float ra, float ca, float la, float qa) {
glContext.setPointLight(nativeHandle, index, x, y, z, r, g, b, w, ra, ca, la, qa);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,24 @@ class ES2Light {

float x, y, z = 0;
float r, g, b, w = 1;
float range, ca = 1.0f;
float la, qa = 0.0f;
float range, ca = 1.0f;
float la, qa = 0.0f;

ES2Light(float ix, float iy, float iz, float ir, float ig, float ib, float iw) {
this(ix, iy, iz, ir, ig, ib, iw, 1.0f, 1.0f, 0.0f, 0.0f);
this(ix, iy, iz, ir, ig, ib, iw, 1.0f, 1.0f, 0.0f, 0.0f);
}
ES2Light(float ix, float iy, float iz, float ir, float ig, float ib, float iw, float irange, float ica, float ila, float iqa) {

ES2Light(float ix, float iy, float iz, float ir, float ig, float ib, float iw, float irange, float ica, float ila, float iqa) {
x = ix;
y = iy;
z = iz;
r = ir;
g = ig;
b = ib;
w = iw;
range = irange;
ca = ica;
la = ila;
qa = iqa;
range = irange;
ca = ica;
la = ila;
qa = iqa;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,7 @@ float getAmbientLightGreen() {
float getAmbientLightBlue() {
return ambientLightBlue;
}

/*
* FalcoTheBold - transferred expressions from the old operator to the new overloaded operator
*/

@Override
public void setPointLight(int index, float x, float y, float z, float r, float g, float b, float w,
float ca, float la, float qa, float maxRange) {
Expand All @@ -111,7 +108,7 @@ public void setPointLight(int index, float x, float y, float z, float r, float g
lights[index] = new ES2Light(x, y, z, r, g, b, w, maxRange, ca, la, qa);
context.setPointLight(nativeHandle, index, x, y, z, r, g, b, w, maxRange, ca, la, qa);
}
}
}

ES2Light[] getPointLights() {
return lights;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,6 @@ private static native void nSetWireframe(long nativeCtxInfo, long nativeMeshView
boolean wireframe);
private static native void nSetAmbientLight(long nativeCtxInfo, long nativeMeshViewInfo,
float r, float g, float b);
/*
* FalcoTheBold: - added additional parameters for the attenuation coefficients
*/
private static native void nSetPointLight(long nativeCtxInfo, long nativeMeshViewInfo,
int index, float x, float y, float z, float r, float g, float b, float w, float ra, float ca, float la, float qa);
private static native void nRenderMeshView(long nativeCtxInfo, long nativeMeshViewInfo);
Expand Down Expand Up @@ -811,9 +808,6 @@ void setAmbientLight(long nativeMeshViewInfo, float r, float g, float b) {
nSetAmbientLight(nativeCtxInfo, nativeMeshViewInfo, r, g, b);
}

/*
* FalcoTheBold: - added parameters for the attenuation coefficients
*/
void setPointLight(long nativeMeshViewInfo, int index, float x, float y, float z, float r, float g, float b, float w, float ra, float ca, float la, float qa) {
nSetPointLight(nativeCtxInfo, nativeMeshViewInfo, index, x, y, z, r, g, b, w, ra, ca, la, qa);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ void phong(
s += pow(saturate(dot(-refl, l)), power) * gLightColor[i].xyz * attn;
}
}
}
}
18 changes: 5 additions & 13 deletions modules/javafx.graphics/src/main/native-prism-es2/GLContext.c
Original file line number Diff line number Diff line change
Expand Up @@ -2083,10 +2083,6 @@ JNIEXPORT void JNICALL Java_com_sun_prism_es2_GLContext_nSetMap
pmInfo->maps[mapType] = texID;
}

/*
* FalcoTheBold: modified MeshViewInfo to hold datas of the attenuation values
*/
/*
* Class: com_sun_prism_es2_GLContext
* Method: nCreateES2MeshView
* Signature: (JJ)J
Expand Down Expand Up @@ -2125,7 +2121,7 @@ JNIEXPORT jlong JNICALL Java_com_sun_prism_es2_GLContext_nCreateES2MeshView
meshViewInfo->pointLightPosition[1] = 0;
meshViewInfo->pointLightPosition[2] = 0;
meshViewInfo->pointLightWeight = 0;
meshViewInfo->pointLightRange = 1;
meshViewInfo->pointLightRange = 1;
meshViewInfo->pointLightAttenuation[0] = 1;
meshViewInfo->pointLightAttenuation[1] = 0;
meshViewInfo->pointLightAttenuation[2] = 0;
Expand Down Expand Up @@ -2265,9 +2261,6 @@ JNIEXPORT void JNICALL Java_com_sun_prism_es2_GLContext_nSetAmbientLight
meshViewInfo->ambientLightColor[2] = b;
}

/*
* FalcoTheBold: modified native operator to add attenuation coefficients
*/
/*
* Class: com_sun_prism_es2_GLContext
* Method: nSetPointLight
Expand All @@ -2291,10 +2284,10 @@ JNIEXPORT void JNICALL Java_com_sun_prism_es2_GLContext_nSetPointLight
meshViewInfo->pointLightColor[1] = g;
meshViewInfo->pointLightColor[2] = b;
meshViewInfo->pointLightWeight = w;
meshViewInfo->pointLightRange = range;
meshViewInfo->pointLightAttenuation[0] = ca;
meshViewInfo->pointLightAttenuation[1] = la;
meshViewInfo->pointLightAttenuation[2] = qa;
meshViewInfo->pointLightRange = range;
meshViewInfo->pointLightAttenuation[0] = ca;
meshViewInfo->pointLightAttenuation[1] = la;
meshViewInfo->pointLightAttenuation[2] = qa;
}

/*
Expand Down Expand Up @@ -2353,4 +2346,3 @@ JNIEXPORT void JNICALL Java_com_sun_prism_es2_GLContext_nRenderMeshView
ctxInfo->glBindBuffer(GL_ARRAY_BUFFER, 0);
ctxInfo->glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
}

0 comments on commit 58be282

Please sign in to comment.