| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7220,12 +7220,6 @@ public void applyMatrix(float n00, float n01, float n02, float n03, | |||
| 7220 | 7220 | } | |
| 7221 | 7221 | ||
| 7222 | 7222 | ||
| 7223 | - public void loadMatrix() { | ||
| 7224 | - if (recorder != null) recorder.loadMatrix(); | ||
| 7225 | - g.loadMatrix(); | ||
| 7226 | - } | ||
| 7227 | - | ||
| 7228 | - | ||
| 7229 | 7223 | public void printMatrix() { | |
| 7230 | 7224 | if (recorder != null) recorder.printMatrix(); | |
| 7231 | 7225 | g.printMatrix(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -174,6 +174,10 @@ public class PGraphics extends PImage implements PConstants { | |||
| 174 | 174 | protected boolean[] hints = new boolean[HINT_COUNT]; | |
| 175 | 175 | ||
| 176 | 176 | ||
| 177 | + // ........................................................ | ||
| 178 | + | ||
| 179 | + | ||
| 180 | + | ||
| 177 | 181 | //////////////////////////////////////////////////////////// | |
| 178 | 182 | ||
| 179 | 183 | // STYLE PROPERTIES | |
@@ -283,9 +287,9 @@ public class PGraphics extends PImage implements PConstants { | |||
| 283 | 287 | // ........................................................ | |
| 284 | 288 | ||
| 285 | 289 | // Shape placement properties | |
| 286 | - | ||
| 290 | + | ||
| 287 | 291 | // imageMode() is inherited from PImage | |
| 288 | - | ||
| 292 | + | ||
| 289 | 293 | /** The current rect mode (read-only) */ | |
| 290 | 294 | public int rectMode; | |
| 291 | 295 | ||
@@ -329,11 +333,10 @@ public class PGraphics extends PImage implements PConstants { | |||
| 329 | 333 | public float specularR, specularG, specularB; | |
| 330 | 334 | public float emissiveR, emissiveG, emissiveB; | |
| 331 | 335 | public float shininess; | |
| 332 | - | ||
| 333 | - // ........................................................ | ||
| 334 | - | ||
| 335 | - // Style stack | ||
| 336 | 336 | ||
| 337 | + | ||
| 338 | + // Style stack | ||
| 339 | + | ||
| 337 | 340 | static final int STYLE_STACK_DEPTH = 64; | |
| 338 | 341 | PStyle[] styleStack = new PStyle[STYLE_STACK_DEPTH]; | |
| 339 | 342 | int styleStackDepth; | |
@@ -355,15 +358,16 @@ public class PGraphics extends PImage implements PConstants { | |||
| 355 | 358 | * Current model-view matrix transformation of the form m[row][column], | |
| 356 | 359 | * which is a "column vector" (as opposed to "row vector") matrix. | |
| 357 | 360 | */ | |
| 358 | - public float m00, m01, m02, m03; | ||
| 359 | - public float m10, m11, m12, m13; | ||
| 360 | - public float m20, m21, m22, m23; | ||
| 361 | - public float m30, m31, m32, m33; | ||
| 361 | + // PMatrix matrix; | ||
| 362 | + // public float m00, m01, m02, m03; | ||
| 363 | + // public float m10, m11, m12, m13; | ||
| 364 | + // public float m20, m21, m22, m23; | ||
| 365 | + // public float m30, m31, m32, m33; | ||
| 362 | 366 | ||
| 363 | - static final int MATRIX_STACK_DEPTH = 32; | ||
| 364 | - float[][] matrixStack = new float[MATRIX_STACK_DEPTH][16]; | ||
| 365 | - float[][] matrixInvStack = new float[MATRIX_STACK_DEPTH][16]; | ||
| 366 | - int matrixStackDepth; | ||
| 367 | + // static final int MATRIX_STACK_DEPTH = 32; | ||
| 368 | + // float[][] matrixStack = new float[MATRIX_STACK_DEPTH][16]; | ||
| 369 | + // float[][] matrixInvStack = new float[MATRIX_STACK_DEPTH][16]; | ||
| 370 | + // int matrixStackDepth; | ||
| 367 | 371 | ||
| 368 | 372 | // ........................................................ | |
| 369 | 373 | ||
@@ -737,7 +741,7 @@ protected void defaultSettings() { // ignore | |||
| 737 | 741 | shape = 0; | |
| 738 | 742 | ||
| 739 | 743 | // init matrices (must do before lights) | |
| 740 | - matrixStackDepth = 0; | ||
| 744 | + //matrixStackDepth = 0; | ||
| 741 | 745 | ||
| 742 | 746 | rectMode(CORNER); | |
| 743 | 747 | ellipseMode(DIAMETER); | |
@@ -1137,14 +1141,14 @@ public void endShape(int mode) { | |||
| 1137 | 1141 | ////////////////////////////////////////////////////////////// | |
| 1138 | 1142 | ||
| 1139 | 1143 | // STYLE | |
| 1140 | - | ||
| 1141 | - | ||
| 1144 | + | ||
| 1145 | + | ||
| 1142 | 1146 | public void style(PStyle s) { | |
| 1143 | - if (s.smooth) { | ||
| 1144 | - smooth(); | ||
| 1145 | - } else { | ||
| 1146 | - noSmooth(); | ||
| 1147 | - } | ||
| 1147 | + // if (s.smooth) { | ||
| 1148 | + // smooth(); | ||
| 1149 | + // } else { | ||
| 1150 | + // noSmooth(); | ||
| 1151 | + // } | ||
| 1148 | 1152 | ||
| 1149 | 1153 | imageMode(s.imageMode); | |
| 1150 | 1154 | rectMode(s.rectMode); | |
@@ -1200,15 +1204,15 @@ public void style(PStyle s) { | |||
| 1200 | 1204 | colorMode(s.colorMode, | |
| 1201 | 1205 | s.colorModeX, s.colorModeY, s.colorModeZ, s.colorModeA); | |
| 1202 | 1206 | ||
| 1203 | - // This is a bit assymetric, since there's no way to do "noFont()", | ||
| 1207 | + // This is a bit asymmetric, since there's no way to do "noFont()", | ||
| 1204 | 1208 | // and a null textFont will produce an error (since usually that means that | |
| 1205 | 1209 | // the font couldn't load properly). So in some cases, the font won't be | |
| 1206 | 1210 | // 'cleared' to null, even though that's technically correct. | |
| 1207 | 1211 | if (s.textFont != null) { | |
| 1208 | 1212 | textFont(s.textFont, s.textSize); | |
| 1209 | 1213 | textLeading(s.textLeading); | |
| 1210 | 1214 | } | |
| 1211 | - // These don't requre a font to be set. | ||
| 1215 | + // These don't require a font to be set. | ||
| 1212 | 1216 | textAlign(s.textAlign, s.textAlignY); | |
| 1213 | 1217 | textMode(s.textMode); | |
| 1214 | 1218 | } | |
@@ -1926,9 +1930,9 @@ protected void splineSegment(int offset, int start, PMatrix3D basis, | |||
| 1926 | 1930 | float z4 = splineVertices[offset+3][Z]; | |
| 1927 | 1931 | float z0 = splineVertices[start][Z]; | |
| 1928 | 1932 | ||
| 1929 | - float zplot1 = m10*z1 + m11*z2 + m12*z3 + m13*z4; | ||
| 1930 | - float zplot2 = m20*z1 + m21*z2 + m22*z3 + m23*z4; | ||
| 1931 | - float zplot3 = m30*z1 + m31*z2 + m32*z3 + m33*z4; | ||
| 1933 | + float zplot1 = basis.m10*z1 + basis.m11*z2 + basis.m12*z3 + basis.m13*z4; | ||
| 1934 | + float zplot2 = basis.m20*z1 + basis.m21*z2 + basis.m22*z3 + basis.m23*z4; | ||
| 1935 | + float zplot3 = basis.m30*z1 + basis.m31*z2 + basis.m32*z3 + basis.m33*z4; | ||
| 1932 | 1936 | ||
| 1933 | 1937 | vertex(x0, y0, z0); | |
| 1934 | 1938 | for (int j = 0; j < segments; j++) { | |
@@ -3032,7 +3036,7 @@ public void scale(float x, float y, float z) { | |||
| 3032 | 3036 | ||
| 3033 | 3037 | ||
| 3034 | 3038 | static final String ERROR_PUSHMATRIX_OVERFLOW = | |
| 3035 | - "Too many calls to pushMatrix(), the maximum is " + MATRIX_STACK_DEPTH + "."; | ||
| 3039 | + "Too many calls to pushMatrix()."; | ||
| 3036 | 3040 | static final String ERROR_PUSHMATRIX_UNDERFLOW = | |
| 3037 | 3041 | "Too many calls to popMatrix(), and not enough to pushMatrix()."; | |
| 3038 | 3042 | ||
@@ -3077,14 +3081,14 @@ public void applyMatrix(float n00, float n01, float n02, float n03, | |||
| 3077 | 3081 | ||
| 3078 | 3082 | ||
| 3079 | 3083 | /** | |
| 3080 | - * Loads the current matrix into m00, m01 etc (or modelview and | ||
| 3081 | - * projection when using 3D) so that the values can be read. | ||
| 3084 | + * Loads the current matrix into the local 'matrix' object so that the values | ||
| 3085 | + * can be used for other purposes. | ||
| 3082 | 3086 | * <P/> | |
| 3083 | 3087 | * Note that there is no "updateMatrix" because that gets too | |
| 3084 | 3088 | * complicated (unnecessary) when considering the 3D matrices. | |
| 3085 | 3089 | */ | |
| 3086 | - public void loadMatrix() { | ||
| 3087 | - } | ||
| 3090 | + // public void loadMatrix() { | ||
| 3091 | + // } | ||
| 3088 | 3092 | ||
| 3089 | 3093 | ||
| 3090 | 3094 | /** | |
@@ -3170,7 +3174,8 @@ public void printProjection() { | |||
| 3170 | 3174 | * scale(), or any other transformations. | |
| 3171 | 3175 | */ | |
| 3172 | 3176 | public float screenX(float x, float y) { | |
| 3173 | - return m00*x + m01*y + m02; | ||
| 3177 | + methodError("screenX"); | ||
| 3178 | + return 0; | ||
| 3174 | 3179 | } | |
| 3175 | 3180 | ||
| 3176 | 3181 | ||
@@ -3180,7 +3185,8 @@ public float screenX(float x, float y) { | |||
| 3180 | 3185 | * scale(), or any other transformations. | |
| 3181 | 3186 | */ | |
| 3182 | 3187 | public float screenY(float x, float y) { | |
| 3183 | - return m10*x + m11*y + m12; | ||
| 3188 | + methodError("screenY"); | ||
| 3189 | + return 0; | ||
| 3184 | 3190 | } | |
| 3185 | 3191 | ||
| 3186 | 3192 | ||
@@ -3295,7 +3301,7 @@ public PStyle getStyle() { // ignore | |||
| 3295 | 3301 | ||
| 3296 | 3302 | ||
| 3297 | 3303 | public void getStyle(PStyle s) { // ignore | |
| 3298 | - s.smooth = smooth; | ||
| 3304 | + // s.smooth = smooth; | ||
| 3299 | 3305 | ||
| 3300 | 3306 | s.imageMode = imageMode; | |
| 3301 | 3307 | s.rectMode = rectMode; | |
@@ -4040,14 +4046,14 @@ protected void backgroundImpl() { | |||
| 4040 | 4046 | // MESSAGES / ERRORS / LOGGING | |
| 4041 | 4047 | ||
| 4042 | 4048 | ||
| 4043 | - HashMap<String, Object> errors; | ||
| 4049 | + static protected HashMap<String, Object> errors; | ||
| 4044 | 4050 | ||
| 4045 | 4051 | ||
| 4046 | 4052 | /** | |
| 4047 | 4053 | * Show a renderer error, and keep track of it so that it's only shown once. | |
| 4048 | 4054 | * @param msg the error message (which will be stored for later comparison) | |
| 4049 | 4055 | */ | |
| 4050 | - protected void showError(String msg) { | ||
| 4056 | + static protected void showError(String msg) { | ||
| 4051 | 4057 | if (errors == null) { | |
| 4052 | 4058 | errors = new HashMap<String, Object>(); | |
| 4053 | 4059 | } | |
@@ -4058,20 +4064,20 @@ protected void showError(String msg) { | |||
| 4058 | 4064 | } | |
| 4059 | 4065 | ||
| 4060 | 4066 | ||
| 4061 | - protected void depthError(String method) { | ||
| 4067 | + static protected void depthError(String method) { | ||
| 4062 | 4068 | showError(method + "() can only be used with a renderer that " + | |
| 4063 | 4069 | "supports 3D, such as P3D or OPENGL."); | |
| 4064 | 4070 | } | |
| 4065 | 4071 | ||
| 4066 | 4072 | ||
| 4067 | - protected void depthErrorXYZ(String method) { | ||
| 4073 | + static protected void depthErrorXYZ(String method) { | ||
| 4068 | 4074 | showError(method + "(x, y, z) can only be used with a renderer that " + | |
| 4069 | 4075 | "supports 3D, such as P3D or OPENGL. " + | |
| 4070 | 4076 | "Use " + method + "(x, y) instead."); | |
| 4071 | 4077 | } | |
| 4072 | 4078 | ||
| 4073 | 4079 | ||
| 4074 | - protected void methodError(String method) { | ||
| 4080 | + static protected void methodError(String method) { | ||
| 4075 | 4081 | showError(method + "() is not available with this renderer."); | |
| 4076 | 4082 | } | |
| 4077 | 4083 | ||
@@ -4081,7 +4087,7 @@ protected void methodError(String method) { | |||
| 4081 | 4087 | * other variations are). For instance, if vertex(x, y, u, v) is unavailable, | |
| 4082 | 4088 | * but vertex(x, y) is just fine, it doesn't make sense to use methodError(). | |
| 4083 | 4089 | */ | |
| 4084 | - protected void variationError(String str) { | ||
| 4090 | + static protected void variationError(String str) { | ||
| 4085 | 4091 | showError(str + " is not available with this renderer."); | |
| 4086 | 4092 | } | |
| 4087 | 4093 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments