Skip to content

Commit 8a06bb8

Browse files
committed
removed obsolete hints
1 parent 5991080 commit 8a06bb8

6 files changed

Lines changed: 44 additions & 236 deletions

File tree

android/core/src/processing/core/PConstants.java

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -403,31 +403,22 @@ public interface PConstants {
403403
static final int DISABLE_OPENGL_ERRORS = 4;
404404
static final int ENABLE_OPENGL_ERRORS = -4;
405405

406-
static final int ENABLE_ACCURATE_TEXTURES = 5;
407-
static final int DISABLE_ACCURATE_TEXTURES = -5;
406+
static final int DISABLE_DEPTH_MASK = 5;
407+
static final int ENABLE_DEPTH_MASK = -5;
408408

409-
static final int DISABLE_DEPTH_MASK = 6;
410-
static final int ENABLE_DEPTH_MASK = -6;
409+
static final int ENABLE_ACCURATE_2D = 6;
410+
static final int DISABLE_ACCURATE_2D = -6;
411411

412-
static final int ENABLE_ACCURATE_2D = 7;
413-
static final int DISABLE_ACCURATE_2D = -7;
412+
static final int ENABLE_STROKE_PERSPECTIVE = 7;
413+
static final int DISABLE_STROKE_PERSPECTIVE = -7;
414414

415-
static final int DISABLE_TEXTURE_CACHE = 8;
416-
static final int ENABLE_TEXTURE_CACHE = -8;
415+
static final int DISABLE_TEXTURE_MIPMAPS = 8;
416+
static final int ENABLE_TEXTURE_MIPMAPS = -8;
417417

418-
static final int DISABLE_TRANSFORM_CACHE = 9;
419-
static final int ENABLE_TRANSFORM_CACHE = -9;
418+
static final int ENABLE_STROKE_PURE = 9;
419+
static final int DISABLE_STROKE_PURE = -9;
420420

421-
static final int ENABLE_STROKE_PERSPECTIVE = 10;
422-
static final int DISABLE_STROKE_PERSPECTIVE = -10;
423-
424-
static final int DISABLE_TEXTURE_MIPMAPS = 11;
425-
static final int ENABLE_TEXTURE_MIPMAPS = -11;
426-
427-
static final int ENABLE_STROKE_PURE = 12;
428-
static final int DISABLE_STROKE_PURE = -12;
429-
430-
static final int HINT_COUNT = 13;
421+
static final int HINT_COUNT = 10;
431422

432423

433424
// error messages

android/core/src/processing/opengl/PGraphicsOpenGL.java

Lines changed: 11 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -2125,8 +2125,6 @@ public void hint(int which) {
21252125
} else if (which == ENABLE_ACCURATE_2D) {
21262126
flush();
21272127
setFlushMode(FLUSH_CONTINUOUSLY);
2128-
} else if (which == DISABLE_TEXTURE_CACHE) {
2129-
flush();
21302128
} else if (which == DISABLE_STROKE_PERSPECTIVE) {
21312129
if (0 < tessGeo.lineVertexCount && 0 < tessGeo.lineIndexCount) {
21322130
// We flush the geometry using the previous line setting.
@@ -2174,15 +2172,6 @@ public void beginShape(int kind) {
21742172

21752173
@Override
21762174
public void endShape(int mode) {
2177-
if (flushMode == FLUSH_WHEN_FULL && hints[DISABLE_TEXTURE_CACHE] &&
2178-
textureImage0 != null && textureImage == null) {
2179-
// The previous shape had a texture and this one doesn't. So we need to
2180-
// flush the textured geometry.
2181-
textureImage = textureImage0;
2182-
flush();
2183-
textureImage = null;
2184-
}
2185-
21862175
tessellate(mode);
21872176

21882177
if ((flushMode == FLUSH_CONTINUOUSLY) ||
@@ -2203,15 +2192,6 @@ protected void endShape(int[] indices, int[] edges) {
22032192
"TRIANGLE shapes");
22042193
}
22052194

2206-
if (flushMode == FLUSH_WHEN_FULL && hints[DISABLE_TEXTURE_CACHE] &&
2207-
textureImage0 != null && textureImage == null) {
2208-
// The previous shape had a texture and this one doesn't. So we need to
2209-
// flush the textured geometry.
2210-
textureImage = textureImage0;
2211-
flush();
2212-
textureImage = null;
2213-
}
2214-
22152195
tessellate(indices, edges);
22162196

22172197
if (flushMode == FLUSH_CONTINUOUSLY ||
@@ -2232,34 +2212,6 @@ public void textureSampling(int sampling) {
22322212
}
22332213

22342214

2235-
@Override
2236-
public void texture(PImage image) {
2237-
if (flushMode == FLUSH_WHEN_FULL && hints[DISABLE_TEXTURE_CACHE] &&
2238-
image != textureImage0) {
2239-
// Changing the texture image, so we need to flush the
2240-
// tessellated geometry accumulated until now, so that
2241-
// textures are not mixed.
2242-
textureImage = textureImage0;
2243-
flush();
2244-
}
2245-
super.texture(image);
2246-
}
2247-
2248-
2249-
@Override
2250-
public void noTexture() {
2251-
if (flushMode == FLUSH_WHEN_FULL && hints[DISABLE_TEXTURE_CACHE] &&
2252-
null != textureImage0) {
2253-
// Changing the texture image, so we need to flush the
2254-
// tessellated geometry accumulated until now, so that
2255-
// textures are not mixed.
2256-
textureImage = textureImage0;
2257-
flush();
2258-
}
2259-
super.noTexture();
2260-
}
2261-
2262-
22632215
@Override
22642216
public void beginContour() {
22652217
if (openContour) {
@@ -2518,7 +2470,7 @@ public void flush() {
25182470
if (hasPoints || hasLines || hasPolys) {
25192471
PMatrix3D modelview0 = null;
25202472
PMatrix3D modelviewInv0 = null;
2521-
if (flushMode == FLUSH_WHEN_FULL && !hints[DISABLE_TRANSFORM_CACHE]) {
2473+
if (flushMode == FLUSH_WHEN_FULL) {
25222474
// The modelview transformation has been applied already to the
25232475
// tessellated vertices, so we set the OpenGL modelview matrix as
25242476
// the identity to avoid applying the model transformations twice.
@@ -2554,7 +2506,7 @@ public void flush() {
25542506
}
25552507
}
25562508

2557-
if (flushMode == FLUSH_WHEN_FULL && !hints[DISABLE_TRANSFORM_CACHE]) {
2509+
if (flushMode == FLUSH_WHEN_FULL) {
25582510
modelview = modelview0;
25592511
modelviewInv = modelviewInv0;
25602512
calcProjmodelview();
@@ -2667,8 +2619,7 @@ void rawPolys() {
26672619
int argb1 = PGL.nativeToJavaARGB(color[i1]);
26682620
int argb2 = PGL.nativeToJavaARGB(color[i2]);
26692621

2670-
if (flushMode == FLUSH_CONTINUOUSLY ||
2671-
hints[DISABLE_TRANSFORM_CACHE]) {
2622+
if (flushMode == FLUSH_CONTINUOUSLY) {
26722623
float[] src0 = {0, 0, 0, 0};
26732624
float[] src1 = {0, 0, 0, 0};
26742625
float[] src2 = {0, 0, 0, 0};
@@ -2804,7 +2755,7 @@ void rawLines() {
28042755
int argb0 = PGL.nativeToJavaARGB(color[i0]);
28052756
int argb1 = PGL.nativeToJavaARGB(color[i1]);
28062757

2807-
if (flushMode == FLUSH_CONTINUOUSLY || hints[DISABLE_TRANSFORM_CACHE]) {
2758+
if (flushMode == FLUSH_CONTINUOUSLY) {
28082759
float[] src0 = {0, 0, 0, 0};
28092760
float[] src1 = {0, 0, 0, 0};
28102761
PApplet.arrayCopy(vertices, 4 * i0, src0, 0, 4);
@@ -2907,7 +2858,7 @@ void rawPoints() {
29072858
int argb0 = PGL.nativeToJavaARGB(color[i0]);
29082859
float[] pt0 = {0, 0, 0, 0};
29092860

2910-
if (flushMode == FLUSH_CONTINUOUSLY || hints[DISABLE_TRANSFORM_CACHE]) {
2861+
if (flushMode == FLUSH_CONTINUOUSLY) {
29112862
float[] src0 = {0, 0, 0, 0};
29122863
PApplet.arrayCopy(vertices, 4 * i0, src0, 0, 4);
29132864
modelview.mult(src0, pt0);
@@ -3625,10 +3576,6 @@ public void pushMatrix() {
36253576

36263577
@Override
36273578
public void popMatrix() {
3628-
if (hints[DISABLE_TRANSFORM_CACHE]) {
3629-
flush();
3630-
}
3631-
36323579
if (modelviewStackDepth == 0) {
36333580
throw new RuntimeException(ERROR_PUSHMATRIX_UNDERFLOW);
36343581
}
@@ -3659,10 +3606,6 @@ public void translate(float tx, float ty, float tz) {
36593606

36603607

36613608
protected void translateImpl(float tx, float ty, float tz) {
3662-
if (hints[DISABLE_TRANSFORM_CACHE]) {
3663-
flush();
3664-
}
3665-
36663609
modelview.translate(tx, ty, tz);
36673610
invTranslate(modelviewInv, tx, ty, tz);
36683611
projmodelview.translate(tx, ty, tz);
@@ -3719,10 +3662,6 @@ public void rotate(float angle, float v0, float v1, float v2) {
37193662

37203663

37213664
protected void rotateImpl(float angle, float v0, float v1, float v2) {
3722-
if (hints[DISABLE_TRANSFORM_CACHE]) {
3723-
flush();
3724-
}
3725-
37263665
float norm2 = v0 * v0 + v1 * v1 + v2 * v2;
37273666
if (zero(norm2)) {
37283667
// The vector is zero, cannot apply rotation.
@@ -3786,10 +3725,6 @@ public void scale(float sx, float sy, float sz) {
37863725
* Scale in three dimensions.
37873726
*/
37883727
protected void scaleImpl(float sx, float sy, float sz) {
3789-
if (hints[DISABLE_TRANSFORM_CACHE]) {
3790-
flush();
3791-
}
3792-
37933728
modelview.scale(sx, sy, sz);
37943729
invScale(modelviewInv, sx, sy, sz);
37953730
projmodelview.scale(sx, sy, sz);
@@ -3828,10 +3763,6 @@ public void shearY(float angle) {
38283763

38293764
@Override
38303765
public void resetMatrix() {
3831-
if (hints[DISABLE_TRANSFORM_CACHE]) {
3832-
flush();
3833-
}
3834-
38353766
modelview.reset();
38363767
modelviewInv.reset();
38373768
projmodelview.set(projection);
@@ -3890,9 +3821,6 @@ protected void applyMatrixImpl(float n00, float n01, float n02, float n03,
38903821
float n10, float n11, float n12, float n13,
38913822
float n20, float n21, float n22, float n23,
38923823
float n30, float n31, float n32, float n33) {
3893-
if (hints[DISABLE_TRANSFORM_CACHE]) {
3894-
flush();
3895-
}
38963824
modelview.apply(n00, n01, n02, n03,
38973825
n10, n11, n12, n13,
38983826
n20, n21, n22, n23,
@@ -4234,10 +4162,6 @@ public void camera() {
42344162
public void camera(float eyeX, float eyeY, float eyeZ,
42354163
float centerX, float centerY, float centerZ,
42364164
float upX, float upY, float upZ) {
4237-
if (hints[DISABLE_TRANSFORM_CACHE]) {
4238-
flush();
4239-
}
4240-
42414165
// Calculating Z vector
42424166
float z0 = eyeX - centerX;
42434167
float z1 = eyeY - centerY;
@@ -9669,8 +9593,7 @@ void setPointVertex(int tessIdx, InGeometry in, int inIdx) {
96699593
float y = in.vertices[index++];
96709594
float z = in.vertices[index ];
96719595

9672-
if (renderMode == IMMEDIATE && flushMode == FLUSH_WHEN_FULL &&
9673-
!hints[DISABLE_TRANSFORM_CACHE]) {
9596+
if (renderMode == IMMEDIATE && flushMode == FLUSH_WHEN_FULL) {
96749597
PMatrix3D mm = modelview;
96759598

96769599
index = 4 * tessIdx;
@@ -9701,8 +9624,7 @@ void setLineVertex(int tessIdx, InGeometry in, int inIdx0, int rgba) {
97019624
float y0 = in.vertices[index++];
97029625
float z0 = in.vertices[index ];
97039626

9704-
if (renderMode == IMMEDIATE && flushMode == FLUSH_WHEN_FULL &&
9705-
!hints[DISABLE_TRANSFORM_CACHE]) {
9627+
if (renderMode == IMMEDIATE && flushMode == FLUSH_WHEN_FULL) {
97069628
PMatrix3D mm = modelview;
97079629

97089630
index = 4 * tessIdx;
@@ -9742,8 +9664,7 @@ void setLineVertex(int tessIdx, InGeometry in, int inIdx0, int inIdx1,
97429664
float y1 = in.vertices[index++];
97439665
float z1 = in.vertices[index ];
97449666

9745-
if (renderMode == IMMEDIATE && flushMode == FLUSH_WHEN_FULL &&
9746-
!hints[DISABLE_TRANSFORM_CACHE]) {
9667+
if (renderMode == IMMEDIATE && flushMode == FLUSH_WHEN_FULL) {
97479668
PMatrix3D mm = modelview;
97489669

97499670
index = 4 * tessIdx;
@@ -9792,8 +9713,7 @@ void setPolyVertex(int tessIdx, float x, float y, float z,
97929713
int am, int sp, int em, float shine) {
97939714
int index;
97949715

9795-
if (renderMode == IMMEDIATE && flushMode == FLUSH_WHEN_FULL &&
9796-
!hints[DISABLE_TRANSFORM_CACHE]) {
9716+
if (renderMode == IMMEDIATE && flushMode == FLUSH_WHEN_FULL) {
97979717
PMatrix3D mm = modelview;
97989718
PMatrix3D nm = modelviewInv;
97999719

@@ -9841,8 +9761,7 @@ void addPolyVertex(float x, float y, float z,
98419761
int index;
98429762
int count = polyVertexCount - 1;
98439763

9844-
if (renderMode == IMMEDIATE && flushMode == FLUSH_WHEN_FULL &&
9845-
!hints[DISABLE_TRANSFORM_CACHE]) {
9764+
if (renderMode == IMMEDIATE && flushMode == FLUSH_WHEN_FULL) {
98469765
PMatrix3D mm = modelview;
98479766
PMatrix3D nm = modelviewInv;
98489767

@@ -9895,8 +9814,7 @@ void addPolyVertices(InGeometry in, int i0, int i1) {
98959814

98969815
polyVertexCheck(nvert);
98979816

9898-
if (renderMode == IMMEDIATE && flushMode == FLUSH_WHEN_FULL &&
9899-
!hints[DISABLE_TRANSFORM_CACHE]) {
9817+
if (renderMode == IMMEDIATE && flushMode == FLUSH_WHEN_FULL) {
99009818
PMatrix3D mm = modelview;
99019819
PMatrix3D nm = modelviewInv;
99029820

core/src/processing/core/PApplet.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10479,11 +10479,6 @@ public void flush() {
1047910479
* hint(DISABLE_OPENGL_ERROR_REPORT) - Speeds up the P3D renderer setting
1048010480
* by not checking for errors while running. Undo with hint(ENABLE_OPENGL_ERROR_REPORT).
1048110481
* <br/> <br/>
10482-
* <!--hint(ENABLE_ACCURATE_TEXTURES) - Enables better texture accuracy for
10483-
* the P3D renderer. This option will do a better job of dealing with
10484-
* textures in perspective. hint(DISABLE_ACCURATE_TEXTURES) returns to the
10485-
* default. This hint is not likely to last long.
10486-
* <br/> <br/>-->
1048710482
* As of release 0149, unhint() has been removed in favor of adding
1048810483
* additional ENABLE/DISABLE constants to reset the default behavior. This
1048910484
* prevents the double negatives, and also reinforces which hints can be

core/src/processing/core/PConstants.java

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -450,31 +450,22 @@ public interface PConstants {
450450
static final int DISABLE_OPENGL_ERRORS = 4;
451451
static final int ENABLE_OPENGL_ERRORS = -4;
452452

453-
static final int ENABLE_ACCURATE_TEXTURES = 5;
454-
static final int DISABLE_ACCURATE_TEXTURES = -5;
453+
static final int DISABLE_DEPTH_MASK = 5;
454+
static final int ENABLE_DEPTH_MASK = -5;
455455

456-
static final int DISABLE_DEPTH_MASK = 6;
457-
static final int ENABLE_DEPTH_MASK = -6;
456+
static final int ENABLE_ACCURATE_2D = 6;
457+
static final int DISABLE_ACCURATE_2D = -6;
458458

459-
static final int ENABLE_ACCURATE_2D = 7;
460-
static final int DISABLE_ACCURATE_2D = -7;
459+
static final int ENABLE_STROKE_PERSPECTIVE = 7;
460+
static final int DISABLE_STROKE_PERSPECTIVE = -7;
461461

462-
static final int DISABLE_TEXTURE_CACHE = 8;
463-
static final int ENABLE_TEXTURE_CACHE = -8;
462+
static final int DISABLE_TEXTURE_MIPMAPS = 8;
463+
static final int ENABLE_TEXTURE_MIPMAPS = -8;
464464

465-
static final int DISABLE_TRANSFORM_CACHE = 9;
466-
static final int ENABLE_TRANSFORM_CACHE = -9;
465+
static final int ENABLE_STROKE_PURE = 9;
466+
static final int DISABLE_STROKE_PURE = -9;
467467

468-
static final int ENABLE_STROKE_PERSPECTIVE = 10;
469-
static final int DISABLE_STROKE_PERSPECTIVE = -10;
470-
471-
static final int DISABLE_TEXTURE_MIPMAPS = 11;
472-
static final int ENABLE_TEXTURE_MIPMAPS = -11;
473-
474-
static final int ENABLE_STROKE_PURE = 12;
475-
static final int DISABLE_STROKE_PURE = -12;
476-
477-
static final int HINT_COUNT = 13;
468+
static final int HINT_COUNT = 10;
478469

479470
// error messages
480471

core/src/processing/core/PGraphics.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,11 +1060,6 @@ protected void reapplySettings() {
10601060
* hint(DISABLE_OPENGL_ERROR_REPORT) - Speeds up the P3D renderer setting
10611061
* by not checking for errors while running. Undo with hint(ENABLE_OPENGL_ERROR_REPORT).
10621062
* <br/> <br/>
1063-
* <!--hint(ENABLE_ACCURATE_TEXTURES) - Enables better texture accuracy for
1064-
* the P3D renderer. This option will do a better job of dealing with
1065-
* textures in perspective. hint(DISABLE_ACCURATE_TEXTURES) returns to the
1066-
* default. This hint is not likely to last long.
1067-
* <br/> <br/>-->
10681063
* As of release 0149, unhint() has been removed in favor of adding
10691064
* additional ENABLE/DISABLE constants to reset the default behavior. This
10701065
* prevents the double negatives, and also reinforces which hints can be

0 commit comments

Comments
 (0)