mirror of
https://github.com/processing/processing4.git
synced 2026-02-14 19:05:34 +01:00
NO_FLYING_POO
This commit is contained in:
@@ -249,8 +249,9 @@ public interface PConstants {
|
||||
static final int DISABLE_TEXT_SMOOTH = 3;
|
||||
static final int DISABLE_SMOOTH_HACK = 4;
|
||||
static final int NO_DEPTH_TEST = 5;
|
||||
static final int NO_FLYING_POO = 6;
|
||||
|
||||
static final int HINT_COUNT = 6;
|
||||
static final int HINT_COUNT = 7;
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -254,6 +254,24 @@ public class PLine implements PConstants
|
||||
m_drawFlags &= ~R_SMOOTH;
|
||||
}
|
||||
|
||||
// line hack
|
||||
if (parent.hints[NO_FLYING_POO]) {
|
||||
float nwidth2 = -SCREEN_WIDTH;
|
||||
float nheight2 = -SCREEN_HEIGHT;
|
||||
float width2 = SCREEN_WIDTH * 2;
|
||||
float height2 = SCREEN_HEIGHT * 2;
|
||||
if ((x_array[1] < nwidth2) ||
|
||||
(x_array[1] > width2) ||
|
||||
(x_array[0] < nwidth2) ||
|
||||
(x_array[0] > width2) ||
|
||||
(y_array[1] < nheight2) ||
|
||||
(y_array[1] > height2) ||
|
||||
(y_array[0] < nheight2) ||
|
||||
(y_array[0] > height2)) {
|
||||
return; // this is a bad line
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////
|
||||
// line clipping
|
||||
visible = lineClipping();
|
||||
|
||||
@@ -201,6 +201,22 @@ public class PPolygon implements PConstants {
|
||||
r[i] = 0; dr[i] = 0; l[i] = 0; dl[i] = 0;
|
||||
}
|
||||
|
||||
// hack to not make polygons fly into the screen
|
||||
if (parent.hints[NO_FLYING_POO]) {
|
||||
float nwidth2 = -width * 2;
|
||||
float nheight2 = -height * 2;
|
||||
float width2 = width * 2;
|
||||
float height2 = height * 2;
|
||||
for (int i = 0; i < vertexCount; i++) {
|
||||
if ((vertices[i][X] < nwidth2) ||
|
||||
(vertices[i][X] > width2) ||
|
||||
(vertices[i][Y] < nheight2) ||
|
||||
(vertices[i][Y] > height2)) {
|
||||
return; // this is a bad poly
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (smoothing) {
|
||||
for (int i = 0; i < vertexCount; i++) {
|
||||
vertices[i][X] *= SUBXRES;
|
||||
|
||||
@@ -127,7 +127,10 @@ X fix array functions not returning a value
|
||||
|
||||
040726
|
||||
X noiseSeed and randomSeed
|
||||
X http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_Software;action=display;num=1090749784;start=0
|
||||
|
||||
040727
|
||||
X incorporated NO_FLYING_POO line/poly hack developed for axel
|
||||
|
||||
_ processing.net -> PClient, PServer
|
||||
|
||||
|
||||
Reference in New Issue
Block a user