X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fglslideshow.c;h=162d4ff87a84bfb0c53a5caf9540b196e94b0f25;hp=c02f5aff25486ea28aa30eafc534e51707a41ea4;hb=447db08c956099b3b183886729108bf5b364c4b8;hpb=2d04c4f22466851aedb6ed0f2919d148f726b889 diff --git a/hacks/glx/glslideshow.c b/hacks/glx/glslideshow.c index c02f5aff..162d4ff8 100644 --- a/hacks/glx/glslideshow.c +++ b/hacks/glx/glslideshow.c @@ -89,15 +89,6 @@ # define DEF_MIPMAP "True" #define DEFAULTS "*delay: 20000 \n" \ - "*fadeDuration: " DEF_FADE_DURATION "\n" \ - "*panDuration: " DEF_PAN_DURATION "\n" \ - "*imageDuration: " DEF_IMAGE_DURATION "\n" \ - "*zoom: " DEF_ZOOM "\n" \ - "*titles: " DEF_TITLES "\n" \ - "*FPScutoff: " DEF_FPS_CUTOFF "\n" \ - "*letterbox: " DEF_LETTERBOX "\n" \ - "*debug: " DEF_DEBUG "\n" \ - "*mipmap: " DEF_MIPMAP "\n" \ "*wireframe: False \n" \ "*showFPS: False \n" \ "*fpsSolid: True \n" \ @@ -393,6 +384,24 @@ image_loaded_cb (const char *filename, XRectangle *geom, img->geom = *geom; img->title = (filename ? strdup (filename) : 0); + /* If the image's width doesn't come back as the width of the screen, + then the image must have been scaled down (due to insufficient + texture memory.) Scale up the coordinates to stretch the image + to fill the window. + */ + if (img->w != MI_WIDTH(mi)) + { + double scale = (double) MI_WIDTH(mi) / img->w; + img->w *= scale; + img->h *= scale; + img->tw *= scale; + img->th *= scale; + img->geom.x *= scale; + img->geom.y *= scale; + img->geom.width *= scale; + img->geom.height *= scale; + } + if (img->title) /* strip filename to part after last /. */ { char *s = strrchr (img->title, '/');