NO_FLYING_POO

This commit is contained in:
benfry
2004-07-27 14:40:10 +00:00
parent af7058f4e2
commit ecd0785d69
4 changed files with 39 additions and 1 deletions

View File

@@ -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;
//////////////////////////////////////////////////////////////

View File

@@ -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();

View File

@@ -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;

View File

@@ -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