X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fsuperquadrics.c;h=9293218f2f56c5ba11da0802896707fcf019dbc6;hp=f52cc6b28e11f7e8a7162c37bbd47a6ea4f77bbc;hb=aa75c7476aeaa84cf3abc192b376a8b03c325213;hpb=88cfe534a698a0562e81345957a50714af1453bc diff --git a/hacks/glx/superquadrics.c b/hacks/glx/superquadrics.c index f52cc6b2..9293218f 100644 --- a/hacks/glx/superquadrics.c +++ b/hacks/glx/superquadrics.c @@ -75,7 +75,8 @@ static const char sccsid[] = "@(#)superquadrics.c 4.07 97/11/24 xlockmore"; "*count: 25 \n" \ "*cycles: 40 \n" \ "*showFPS: False \n" \ - "*wireframe: False \n" + "*wireframe: False \n" \ + "*suppressRotationAnimation: True\n" \ # define superquadrics_handle_event 0 # include "xlockmore.h" /* from the xscreensaver distribution */ @@ -547,8 +548,9 @@ NextSuperquadric(superquadricsstruct * sp) } static int -DisplaySuperquadrics(superquadricsstruct * sp) +DisplaySuperquadrics(ModeInfo *mi) { + superquadricsstruct *sp = &superquadrics[MI_SCREEN(mi)]; int polys = 0; glDrawBuffer(GL_BACK); if (sp->wireframe) @@ -569,6 +571,16 @@ DisplaySuperquadrics(superquadricsstruct * sp) SetCull(0, sp); glScalef(0.7, 0.7, 0.7); /* jwz: scale it down a bit */ + +# 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 + polys = DoneScale(sp); glPopMatrix(); @@ -578,10 +590,11 @@ DisplaySuperquadrics(superquadricsstruct * sp) } static int -NextSuperquadricDisplay(superquadricsstruct * sp) +NextSuperquadricDisplay(ModeInfo *mi) { + superquadricsstruct *sp = &superquadrics[MI_SCREEN(mi)]; NextSuperquadric(sp); - return DisplaySuperquadrics(sp); + return DisplaySuperquadrics(mi); } #define MINSIZE 200 @@ -740,7 +753,7 @@ init_superquadrics(ModeInfo * mi) MI_COUNT(mi), MI_CYCLES(mi), spinspeed, sp); ReshapeSuperquadrics(MI_WIDTH(mi), MI_HEIGHT(mi)); - DisplaySuperquadrics(sp); + DisplaySuperquadrics(mi); glFinish(); glXSwapBuffers(display, window); } else { @@ -760,7 +773,7 @@ draw_superquadrics(ModeInfo * mi) glXMakeCurrent(display, window, *(sp->glx_context)); - mi->polygon_count = NextSuperquadricDisplay(sp); + mi->polygon_count = NextSuperquadricDisplay(mi); if (mi->fps_p) do_fps (mi); glFinish();