X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fspheremonics.c;h=9cefbf3dbb322b196c9cb8d446b1ff85edf38877;hb=39809ded547bdbb08207d3e514950425215b4410;hp=70b7ff6eb19486861c214e72f6057bb83facbd28;hpb=aa75c7476aeaa84cf3abc192b376a8b03c325213;p=xscreensaver diff --git a/hacks/glx/spheremonics.c b/hacks/glx/spheremonics.c index 70b7ff6e..9cefbf3d 100644 --- a/hacks/glx/spheremonics.c +++ b/hacks/glx/spheremonics.c @@ -66,7 +66,7 @@ "*suppressRotationAnimation: True\n" \ "*labelfont: -*-helvetica-medium-r-normal-*-*-180-*-*-*-*-*-*\n" -# define refresh_spheremonics 0 +# define free_spheremonics 0 # define release_spheremonics 0 #undef countof #define countof(x) (sizeof((x))/sizeof((*x))) @@ -166,8 +166,15 @@ ENTRYPOINT void reshape_spheremonics (ModeInfo *mi, int width, int height) { GLfloat h = (GLfloat) height / (GLfloat) width; + int y = 0; - glViewport (0, 0, (GLint) width, (GLint) height); + if (width > height * 5) { /* tiny window: show middle */ + height = width * 9/16; + y = -height/2; + h = height / (GLfloat) width; + } + + glViewport (0, y, (GLint) width, (GLint) height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); @@ -695,14 +702,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); cc = &ccs[MI_SCREEN(mi)];