From 510512714df01110cf42cb2a11d944f55297c5cc Mon Sep 17 00:00:00 2001 From: Bert Date: Sat, 10 Sep 2011 18:41:20 +0200 Subject: Added slideshow support --- image.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'image.c') diff --git a/image.c b/image.c index 20c4ff3..7402835 100644 --- a/image.c +++ b/image.c @@ -56,6 +56,8 @@ void img_init(img_t *img, win_t *win) { img->zoom = MIN(img->zoom, zoom_max); img->aa = options->aa; img->alpha = 1; + img->slideshow = 0; + img->ss_delay = SLIDESHOW_DELAY * 1000; } if (win) { @@ -651,7 +653,7 @@ int img_frame_animate(img_t *img, int restart) { return 0; if (img->multi.sel + 1 >= img->multi.cnt) { - if (restart || GIF_LOOP) { + if (restart || (GIF_LOOP && !img->slideshow)) { img_frame_goto(img, 0); } else { img->multi.animate = 0; @@ -660,7 +662,6 @@ int img_frame_animate(img_t *img, int restart) { } else if (!restart) { img_frame_goto(img, img->multi.sel + 1); } - img->multi.animate = 1; return img->multi.frames[img->multi.sel].delay; -- cgit v1.2.3-54-g00ecf