aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarry Jeffery <harry@exec64.co.uk>2015-11-10 15:03:42 +0000
committerHarry Jeffery <harry@exec64.co.uk>2015-11-10 15:03:42 +0000
commit3158d22a54ae100198952070b2b9c91754c4decc (patch)
tree9f7c33ecbae56119dfe9a03904920099ddf9276b
parent9bad6406b64ce29d90a2b2644b21166594fa6634 (diff)
downloadimv-3158d22a54ae100198952070b2b9c91754c4decc.tar.gz
Fix step-by-step playback
-rw-r--r--main.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/main.c b/main.c
index 02d2e22..f38988d 100644
--- a/main.c
+++ b/main.c
@@ -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);