X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fgears.c;h=0c292a2eae8ef04f1d6369c88b71875cad22ec21;hp=61599f9ae5e372ed490379bea978101acf41f69c;hb=4361b69d3178d7fc98d0388f9a223af6c2651aba;hpb=d5186197bc394e10a4402f7f6d23fbb14103bc50 diff --git a/hacks/glx/gears.c b/hacks/glx/gears.c index 61599f9a..0c292a2e 100644 --- a/hacks/glx/gears.c +++ b/hacks/glx/gears.c @@ -16,6 +16,7 @@ "*count: 0 \n" \ "*showFPS: False \n" \ "*wireframe: False \n" \ + "*suppressRotationAnimation: True\n" \ # define refresh_gears 0 # define release_gears 0 @@ -98,6 +99,14 @@ reshape_gears (ModeInfo *mi, int width, int height) 0.0, 0.0, 0.0, 0.0, 1.0, 0.0); +# ifdef HAVE_MOBILE /* Keep it the same relative size when rotated. */ + { + int o = (int) current_device_rotation(); + if (o != 0 && o != 180 && o != -180) + glScalef (1/h, 1/h, 1/h); + } +# endif + glClear(GL_COLOR_BUFFER_BIT); } @@ -689,14 +698,7 @@ init_gears (ModeInfo *mi) int wire = MI_IS_WIREFRAME(mi); int i; - if (!bps) { - bps = (gears_configuration *) - calloc (MI_NUM_SCREENS(mi), sizeof (gears_configuration)); - if (!bps) { - fprintf(stderr, "%s: out of memory\n", progname); - exit(1); - } - } + MI_INIT (mi, bps, NULL); bp = &bps[MI_SCREEN(mi)]; @@ -759,7 +761,7 @@ init_gears (ModeInfo *mi) bp->planetary_p = False; if (total_gears <= 0) - total_gears = 3 + abs (BELLRAND (8) - 4); /* 3 - 7, mostly 3. */ + total_gears = 3 + fabs (BELLRAND (8) - 4); /* 3 - 7, mostly 3. */ bp->gears = (gear **) calloc (total_gears+2, sizeof(**bp->gears)); bp->ngears = 0;