From 38886de0c3e9ea5729ef23e4c653fa2822f52e8f Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 6 Apr 2021 14:43:39 +0200 Subject: xscreensaver 6.00 --- hacks/glx/glsnake.c | 38 ++++++++------------------------------ 1 file changed, 8 insertions(+), 30 deletions(-) (limited to 'hacks/glx/glsnake.c') 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 #else -# ifdef HAVE_JWXYZ +# include "xlockmoreI.h" +# ifndef HAVE_GETTIMEOFDAY # define HAVE_GETTIMEOFDAY -# else -# include -# include # endif #endif -# ifdef HAVE_ANDROID -# include -#endif - -#ifdef HAVE_JWZGLES -# include "jwzgles.h" -#endif /* HAVE_JWZGLES */ - -#ifdef STANDALONE -# include "xlockmoreI.h" -#endif #include #include @@ -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; -- cgit v1.2.3-55-g7522