X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fglslideshow.c;h=be77dc1fef0a66e6af3960e2ff55beadeb1d9adf;hb=5f9c47ca98dd43d8f59b7c27d3fde6edfde4fe21;hp=0cdf14d34065700d992be9787586471a9ab4d5e9;hpb=c1b9b55ad8d59dc05ef55e316aebf5863e7dfa56;p=xscreensaver diff --git a/hacks/glx/glslideshow.c b/hacks/glx/glslideshow.c index 0cdf14d3..be77dc1f 100644 --- a/hacks/glx/glslideshow.c +++ b/hacks/glx/glslideshow.c @@ -1,4 +1,4 @@ -/* glslideshow, Copyright (c) 2003-2008 Jamie Zawinski +/* glslideshow, Copyright (c) 2003-2011 Jamie Zawinski * Loads a sequence of images and smoothly pans around them; crossfades * when loading new images. * @@ -358,11 +358,17 @@ image_loaded_cb (const char *filename, XRectangle *geom, img->geom.height *= scale; } - if (img->title) /* strip filename to part after last /. */ +# if 0 /* xscreensaver-getimage returns paths relative to the image directory + now, so leave the sub-directory part in. + */ + if (img->title) /* strip filename to part between last "/" and last ".". */ { char *s = strrchr (img->title, '/'); if (s) strcpy (img->title, s+1); + s = strrchr (img->title, '.'); + if (s) *s = 0; } +# endif /* 0 */ if (debug_p) fprintf (stderr, "%s: loaded img %2d: \"%s\"\n", @@ -468,30 +474,22 @@ randomize_sprite (ModeInfo *mi, sprite *sp) int vp_h = MI_HEIGHT(mi); int img_w = sp->img->geom.width; int img_h = sp->img->geom.height; - int min_w, min_h, max_w, max_h; + int min_w, max_w; double ratio = (double) img_h / img_w; if (letterbox_p) { min_w = img_w; - min_h = img_h; } else { if (img_w < vp_w) - { - min_w = vp_w; - min_h = img_h * (float) vp_w / img_w; - } + min_w = vp_w; else - { - min_w = img_w * (float) vp_h / img_h; - min_h = vp_h; - } + min_w = img_w * (float) vp_h / img_h; } max_w = min_w * 100 / zoom; - max_h = min_h * 100 / zoom; sp->from.w = min_w + frand ((max_w - min_w) * 0.4); sp->to.w = max_w - frand ((max_w - min_w) * 0.4);