summaryrefslogtreecommitdiffstats
path: root/hacks/glx/topblock.h
diff options
context:
space:
mode:
authorSimon Rettberg2018-10-16 10:08:48 +0200
committerSimon Rettberg2018-10-16 10:08:48 +0200
commitd3a98cf6cbc3bd0b9efc570f58e8812c03931c18 (patch)
treecbddf8e50f35a9c6e878a5bfe3c6d625d99e12ba /hacks/glx/topblock.h
downloadxscreensaver-d3a98cf6cbc3bd0b9efc570f58e8812c03931c18.tar.gz
xscreensaver-d3a98cf6cbc3bd0b9efc570f58e8812c03931c18.tar.xz
xscreensaver-d3a98cf6cbc3bd0b9efc570f58e8812c03931c18.zip
Original 5.40
Diffstat (limited to 'hacks/glx/topblock.h')
-rw-r--r--hacks/glx/topblock.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/hacks/glx/topblock.h b/hacks/glx/topblock.h
new file mode 100644
index 0000000..1a66c5d
--- /dev/null
+++ b/hacks/glx/topblock.h
@@ -0,0 +1,45 @@
+/* topblock - openGL based hack */
+
+static void buildCarpet(ModeInfo *);
+static void polygonPlane(int, int, int, int, int ,int);
+static void buildBlock(ModeInfo *);
+static void generateNewBlock(ModeInfo *);
+static void followBlock(ModeInfo *);
+static void buildBlobBlock(ModeInfo *);
+static double quadrantCorrection(double,int,int,int,int);
+
+/* this structure holds all the attributes about a block */
+typedef struct blockNode {
+ int color; /* indexed */
+ int rotation; /* indexed: 0=S-N, 1=W-E, 2=N-S, 3=E-W */
+ GLfloat height;
+ GLfloat x;
+ GLfloat y;
+ int falling;
+ struct blockNode *next;
+} NODE;
+
+
+/* some handy macros and definitions */
+#define blockHeight 1.49f
+#define getHeight(a) (a * blockHeight)
+
+#define getOrientation(a) (a * 90)
+
+#define blockWidth 2.0f
+#define getLocation(a) (a * blockWidth)
+
+#define TOLERANCE 0.1f
+
+#define cylSize 0.333334f
+#define uddSize 0.4f
+#define singleThick 0.29 /* defines the thickness of the carpet */
+
+
+
+
+
+
+
+
+