From http://www.jwz.org/xscreensaver/xscreensaver-5.37.tar.gz
[xscreensaver] / hacks / glx / spheremonics.c
index 3690c88e0ae1a63fc87fdd33c03fb404c0c2dc59..658b6e456022f12b38d8c6c3eefc6f0ff05b9537 100644 (file)
@@ -63,6 +63,7 @@
 #define DEFAULTS "*delay:      30000       \n" \
                 "*showFPS:     False       \n" \
                 "*wireframe:   False       \n" \
+                "*suppressRotationAnimation: True\n" \
         "*labelfont:   -*-helvetica-medium-r-normal-*-*-180-*-*-*-*-*-*\n"
 
 # define refresh_spheremonics 0
@@ -178,6 +179,14 @@ reshape_spheremonics (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);
 }
 
@@ -686,14 +695,7 @@ init_spheremonics (ModeInfo *mi)
 {
   spheremonics_configuration *cc;
 
-  if (!ccs) {
-    ccs = (spheremonics_configuration *)
-      calloc (MI_NUM_SCREENS(mi), sizeof (spheremonics_configuration));
-    if (!ccs) {
-      fprintf(stderr, "%s: out of memory\n", progname);
-      exit(1);
-    }
-  }
+  MI_INIT (mi, ccs, NULL);
 
   cc = &ccs[MI_SCREEN(mi)];