aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorHarry Jeffery <harry@exec64.co.uk>2015-12-10 15:26:01 +0000
committerHarry Jeffery <harry@exec64.co.uk>2015-12-10 15:26:01 +0000
commit3e1523d6a7c83d74673f5106ff87f7da465f467c (patch)
tree9a93d3b3df80e2593649101339780904808cc0a9 /src/main.c
parent6cd76000aa7875fcc7a74cce0ce31783fd82196d (diff)
downloadimv-3e1523d6a7c83d74673f5106ff87f7da465f467c.tar.gz
Make imv_loader_get_image more informative
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/main.c b/src/main.c
index fc6c76f..9e5c171 100644
--- a/src/main.c
+++ b/src/main.c
@@ -275,8 +275,7 @@ int main(int argc, char** argv)
unsigned int last_time;
unsigned int current_time;
- /* used to keep track of when the selected image has changed */
- int is_new_image = 1;
+ /* do we need to redraw the window? */
int need_redraw = 1;
/* used to calculate when to skip to the next image in slideshow mode */
@@ -412,17 +411,16 @@ int main(int argc, char** argv)
imv_loader_load_path(&ldr, current_path);
view.playing = 1;
- is_new_image = 1;
}
/* check if a new image is available to display */
- FIBITMAP *bmp = imv_loader_get_image(&ldr);
- if(bmp) {
+ FIBITMAP *bmp;
+ int is_new_image;
+ if(imv_loader_get_image(&ldr, &bmp, &is_new_image)) {
imv_texture_set_image(&tex, bmp);
FreeImage_Unload(bmp);
need_redraw = 1;
if(is_new_image) {
- is_new_image = 0;
if(g_options.actual) {
imv_viewport_scale_to_actual(&view, &tex);
} else {