X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Frubikblocks.c;h=71682fc3f738039e7cc6cfcc495320438e828b53;hp=14872367e3dbcdf7208a35aa1d9c5ea1e19dd9a1;hb=aa75c7476aeaa84cf3abc192b376a8b03c325213;hpb=88cfe534a698a0562e81345957a50714af1453bc diff --git a/hacks/glx/rubikblocks.c b/hacks/glx/rubikblocks.c index 14872367..71682fc3 100644 --- a/hacks/glx/rubikblocks.c +++ b/hacks/glx/rubikblocks.c @@ -19,7 +19,8 @@ #define DEFAULTS "*delay: 20000 \n" \ "*showFPS: False \n" \ - "*wireframe: False \n" + "*wireframe: False \n" \ + "*suppressRotationAnimation: True\n" \ # define refresh_rubikblocks 0 #include "xlockmore.h" @@ -259,6 +260,7 @@ draw_main(ModeInfo *mi, rubikblocks_conf *cp) glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity(); + get_position(cp->rot, &x, &y, &z, !cp->button_down); glTranslatef((x-0.5)*6, (y-0.5)*6, -20); @@ -270,6 +272,15 @@ draw_main(ModeInfo *mi, rubikblocks_conf *cp) glRotatef(z*360, 0, 0, 1); glScalef(size, size, size); +# 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 + if(cp->wire) glColor3f(0.7, 0.7, 0.7); if(!cp->pause) for(i = 0; i < 27; i++)