diff options
author | Harry Jeffery <harry@exec64.co.uk> | 2015-11-10 15:03:42 +0000 |
---|---|---|
committer | Harry Jeffery <harry@exec64.co.uk> | 2015-11-10 15:03:42 +0000 |
commit | 3158d22a54ae100198952070b2b9c91754c4decc (patch) | |
tree | 9f7c33ecbae56119dfe9a03904920099ddf9276b | |
parent | 9bad6406b64ce29d90a2b2644b21166594fa6634 (diff) | |
download | imv-3158d22a54ae100198952070b2b9c91754c4decc.tar.gz |
Fix step-by-step playback
-rw-r--r-- | main.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -246,6 +246,7 @@ int main(int argc, char** argv) const char* current_path = NULL; double last_time = SDL_GetTicks() / 1000.0; + int last_frame = img.cur_frame; int quit = 0; while(!quit) { @@ -336,13 +337,13 @@ int main(int argc, char** argv) } if(g_view.playing) { - int last_frame = img.cur_frame; imv_image_play(&img, dt); - if(img.cur_frame != last_frame) { - imv_texture_set_image(&tex, img.cur_bmp); - g_view.redraw = 1; - } } + if(img.cur_frame != last_frame) { + imv_texture_set_image(&tex, img.cur_bmp); + g_view.redraw = 1; + } + last_frame = img.cur_frame; if(g_view.redraw) { SDL_RenderClear(renderer); |