X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fcage.c;h=268d0830c604255b979221fc5d699c54fb3d1ed4;hp=bcd382b64449197f9fc2651198b2a4f9056a6644;hb=aa75c7476aeaa84cf3abc192b376a8b03c325213;hpb=88cfe534a698a0562e81345957a50714af1453bc diff --git a/hacks/glx/cage.c b/hacks/glx/cage.c index bcd382b6..268d0830 100644 --- a/hacks/glx/cage.c +++ b/hacks/glx/cage.c @@ -79,10 +79,10 @@ static const char sccsid[] = "@(#)cage.c 5.01 2001/03/01 xlockmore"; # define MODE_cage # define DEFAULTS "*delay: 25000 \n" \ "*showFPS: False \n" \ - "*wireframe: False \n" + "*wireframe: False \n" \ + "*suppressRotationAnimation: True\n" \ # define refresh_cage 0 -# define reshape_cage 0 # define cage_handle_event 0 # include "xlockmore.h" /* from the xscreensaver distribution */ #else /* !STANDALONE */ @@ -291,7 +291,7 @@ draw_impossiblecage(ModeInfo *mi, cagestruct * cp, int wire) } static void -reshape(ModeInfo * mi, int width, int height) +reshape_cage(ModeInfo * mi, int width, int height) { cagestruct *cp = &cage[MI_SCREEN(mi)]; int i; @@ -415,7 +415,7 @@ init_cage (ModeInfo * mi) cp->step = NRAND(90); if ((cp->glx_context = init_GL(mi)) != NULL) { - reshape(mi, MI_WIDTH(mi), MI_HEIGHT(mi)); + reshape_cage(mi, MI_WIDTH(mi), MI_HEIGHT(mi)); glDrawBuffer(GL_BACK); pinit(mi); } else { @@ -452,6 +452,18 @@ draw_cage (ModeInfo * mi) glScalef(Scale4Iconic * cp->WindH / cp->WindW, Scale4Iconic, Scale4Iconic); } +# ifdef HAVE_MOBILE /* Keep it the same relative size when rotated. */ + { + int o = (int) current_device_rotation(); + GLfloat h = MI_HEIGHT(mi) / (GLfloat) MI_WIDTH(mi); + if (o != 0 && o != 180 && o != -180) { + glScalef (1/h, h, 1/h); /* #### not quite right */ + h = 1.7; + glScalef (h, h, h); + } + } +# endif + /* cage */ glRotatef(cp->step * 100, 0, 0, 1); glRotatef(25 + cos(cp->step * 5) * 6, 1, 0, 0);