X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fvigilance.c;fp=hacks%2Fglx%2Fvigilance.c;h=c4f590f889b0c0efcb878fa0d2d2d4a6973b93ae;hp=e276bd75bd3dc9ffbff065fe3d4c9d2eeb978eda;hb=39809ded547bdbb08207d3e514950425215b4410;hpb=4361b69d3178d7fc98d0388f9a223af6c2651aba diff --git a/hacks/glx/vigilance.c b/hacks/glx/vigilance.c index e276bd75..c4f590f8 100644 --- a/hacks/glx/vigilance.c +++ b/hacks/glx/vigilance.c @@ -22,7 +22,7 @@ "*lensColor: #000000" "\n" \ "*groundColor: #004400" "\n" \ -# define refresh_camera 0 +# define free_camera 0 # define release_camera 0 #undef countof #define countof(x) (sizeof((x))/sizeof((*x))) @@ -136,7 +136,15 @@ ENTRYPOINT void reshape_camera (ModeInfo *mi, int width, int height) { GLfloat h = (GLfloat) height / (GLfloat) width; - glViewport (0, 0, width, height); + int y = 0; + + if (width > height * 5) { /* tiny window: show middle */ + height = width * 9/16; + y = -height/2; + h = height / (GLfloat) width; + } + + glViewport (0, y, width, height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective (30.0, 1/h, 1.0, 200); @@ -216,7 +224,7 @@ init_camera (ModeInfo *mi) camera_configuration *bp; int wire = MI_IS_WIREFRAME(mi); int i; - MI_INIT (mi, bps, 0); + MI_INIT (mi, bps); bp = &bps[MI_SCREEN(mi)]; @@ -879,8 +887,10 @@ tick_camera (ModeInfo *mi, camera *c) which = i-2; else if (i >= 1 && which == 1) which = i-1; - else if (i < bp->ncameras-1 && which == 2) + else if (i < bp->ncameras-2 && which == 2) which = i+2; + else if (i == bp->ncameras-1) + which = i-1; else /* (i < bp->ncameras-2 && which == 3) */ which = i+1;