summaryrefslogtreecommitdiffstats
path: root/hacks/glx/circuit.c
diff options
context:
space:
mode:
authorSimon Rettberg2021-04-06 14:43:39 +0200
committerSimon Rettberg2021-04-07 13:38:37 +0200
commit38886de0c3e9ea5729ef23e4c653fa2822f52e8f (patch)
tree9b799c8c968a92cc77746a95e0e8bdd90b6b13c3 /hacks/glx/circuit.c
parentMaybe not remove, but ... (diff)
downloadxscreensaver-openslx.tar.gz
xscreensaver-openslx.tar.xz
xscreensaver-openslx.zip
xscreensaver 6.00v28r1openslx
Diffstat (limited to 'hacks/glx/circuit.c')
-rw-r--r--hacks/glx/circuit.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/hacks/glx/circuit.c b/hacks/glx/circuit.c
index b8b845e..00e88c8 100644
--- a/hacks/glx/circuit.c
+++ b/hacks/glx/circuit.c
@@ -33,7 +33,7 @@
#define DEFAULTS "*delay: 20000 \n" \
"*showFPS: False \n" \
"*suppressRotationAnimation: True\n" \
- "*componentFont: -*-courier-bold-r-normal-*-*-140-*-*-*-*-*-*"
+ "*componentFont: monospace bold 12" \
# define release_circuit 0
# define circuit_handle_event xlockmore_no_events
@@ -57,18 +57,12 @@
#include "texfont.h"
-#undef countof
-#define countof(x) (sizeof((x))/sizeof((*x)))
-
static int maxparts;
static int rotatespeed;
static int spin;
static int uselight;
static int seven;
-#undef countof
-#define countof(x) (sizeof((x))/sizeof((*x)))
-
static XrmOptionDescRec opts[] = {
{"-parts", ".circuit.parts", XrmoptionSepArg, 0 },
{"-rotate-speed", ".circuit.rotatespeed", XrmoptionSepArg, 0 },
@@ -1117,6 +1111,7 @@ static int DrawIC(Circuit *ci, IC *c)
glTranslatef (-w/2, 0, 0);
glColor4fv (texfg);
print_texture_string (ci->font, c->text);
+ glEnable(GL_LIGHTING);
glPopMatrix();
}
@@ -1358,6 +1353,7 @@ static int DrawTransistor(Circuit *ci, Transistor *t)
glTranslatef (-w/2, 0, 0);
glColor4fv (texfg);
print_texture_string (ci->font, t->text);
+ glEnable (GL_LIGHTING);
glPopMatrix();
}
@@ -1385,6 +1381,7 @@ static int DrawTransistor(Circuit *ci, Transistor *t)
glTranslatef (-w/2, 0, 0);
glColor4fv (texfg);
print_texture_string (ci->font, t->text);
+ glEnable (GL_LIGHTING);
glPopMatrix();
}
glDisable(GL_TEXTURE_2D);
@@ -1932,6 +1929,16 @@ static void display(ModeInfo *mi)
h = 2;
glScalef (h, h, h);
}
+# else
+ {
+ /* Don't understand why this clause doesn't work on mobile, but it
+ doesn't. */
+ GLfloat s = (MI_WIDTH(mi) < MI_HEIGHT(mi)
+ ? (MI_WIDTH(mi) / (GLfloat) MI_HEIGHT(mi))
+ : 1);
+ s = 1/s;
+ glScalef (s, s, s);
+ }
# endif
mi->polygon_count += drawgrid(ci);