summaryrefslogtreecommitdiffstats
path: root/image.c
diff options
context:
space:
mode:
authorBert <ber.t@gmx.com>2011-09-10 18:41:20 +0200
committerBert <ber.t@gmx.com>2011-09-10 18:41:20 +0200
commit510512714df01110cf42cb2a11d944f55297c5cc (patch)
tree38a7393df90254e9d89e80c37c9ae4a16eb58b6b /image.c
parent79d780a701e47ea1aacf49728e28900bb2b17743 (diff)
downloadnsxiv-510512714df01110cf42cb2a11d944f55297c5cc.tar.zst
Added slideshow support
Diffstat (limited to 'image.c')
-rw-r--r--image.c5
1 files changed, 3 insertions, 2 deletions
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;