X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fglsnake.c;h=2616ad273be4ad16d73e885739f19aa33f687ea2;hp=094b12a0c4fd0459d1417c26529d7986c98b54b5;hb=aa75c7476aeaa84cf3abc192b376a8b03c325213;hpb=88cfe534a698a0562e81345957a50714af1453bc diff --git a/hacks/glx/glsnake.c b/hacks/glx/glsnake.c index 094b12a0..2616ad27 100644 --- a/hacks/glx/glsnake.c +++ b/hacks/glx/glsnake.c @@ -28,13 +28,16 @@ #ifdef HAVE_GLUT # include #else -# ifdef HAVE_COCOA +# ifdef HAVE_JWXYZ # define HAVE_GETTIMEOFDAY # else # include # include # endif #endif +# ifdef HAVE_ANDROID +# include +#endif #ifdef HAVE_JWZGLES # include "jwzgles.h" @@ -149,6 +152,7 @@ static GLfloat angvel; #define DEFAULTS "*delay: 30000 \n" \ "*count: 30 \n" \ "*showFPS: False \n" \ + "*suppressRotationAnimation: True\n" \ "*labelfont: -*-helvetica-medium-r-normal-*-*-180-*-*-*-*-*-*\n" \ @@ -2263,6 +2267,15 @@ 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); + } +# endif + /* now draw each node along the snake -- this is quite ugly :p */ mi->polygon_count = 0; for (i = 0; i < NODE_COUNT; i++) {