summaryrefslogtreecommitdiffstats
path: root/hacks/glx/glsnake.c
diff options
context:
space:
mode:
Diffstat (limited to 'hacks/glx/glsnake.c')
-rw-r--r--hacks/glx/glsnake.c38
1 files changed, 8 insertions, 30 deletions
diff --git a/hacks/glx/glsnake.c b/hacks/glx/glsnake.c
index 8efc681..d7e133e 100644
--- a/hacks/glx/glsnake.c
+++ b/hacks/glx/glsnake.c
@@ -19,33 +19,16 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
/* HAVE_GLUT defined if we're building a standalone glsnake,
* and not defined if we're building as an xscreensaver hack */
#ifdef HAVE_GLUT
# include <GL/glut.h>
#else
-# ifdef HAVE_JWXYZ
+# include "xlockmoreI.h"
+# ifndef HAVE_GETTIMEOFDAY
# define HAVE_GETTIMEOFDAY
-# else
-# include <GL/gl.h>
-# include <GL/glu.h>
# endif
#endif
-# ifdef HAVE_ANDROID
-# include <GLES/gl.h>
-#endif
-
-#ifdef HAVE_JWZGLES
-# include "jwzgles.h"
-#endif /* HAVE_JWZGLES */
-
-#ifdef STANDALONE
-# include "xlockmoreI.h"
-#endif
#include <stdio.h>
#include <stddef.h>
@@ -151,13 +134,10 @@ static GLfloat angvel;
#define DEFAULTS "*delay: 30000 \n" \
"*count: 30 \n" \
"*showFPS: False \n" \
- "*suppressRotationAnimation: True\n" \
- "*labelfont: -*-helvetica-medium-r-normal-*-*-180-*-*-*-*-*-*\n" \
+ "*suppressRotationAnimation: True\n" \
+ "*labelfont: sans-serif 18\n" \
-#undef countof
-#define countof(x) (sizeof((x))/sizeof((*x)))
-
#include "xlockmore.h"
#include "texfont.h"
@@ -2269,14 +2249,12 @@ ENTRYPOINT void glsnake_display(
glRotatef(yspin, 0.0, 1.0, 0.0);
glRotatef(zspin, 0.0, 0.0, 1.0);
-# ifdef HAVE_MOBILE /* Keep it the same relative size when rotated. */
{
- GLfloat h = MI_HEIGHT(mi) / (GLfloat) MI_WIDTH(mi);
- int o = (int) current_device_rotation();
- if (o != 0 && o != 180 && o != -180)
- glScalef (1/h, 1/h, 1/h);
+ GLfloat s = (MI_WIDTH(mi) < MI_HEIGHT(mi)
+ ? (MI_WIDTH(mi) / (GLfloat) MI_HEIGHT(mi))
+ : 1);
+ glScalef (s, s, s);
}
-# endif
/* now draw each node along the snake -- this is quite ugly :p */
mi->polygon_count = 0;