diff --git a/src/sdl-instead/game.c b/src/sdl-instead/game.c index e2a1ec8..8aaa94f 100644 --- a/src/sdl-instead/game.c +++ b/src/sdl-instead/game.c @@ -459,7 +459,7 @@ static void anigif_do(void *data) { if (gfx_frame_gif(el_img(el_spic))) { game_cursor(CURSOR_ON); - gfx_flip(); + gfx_update_gif(el_img(el_spic)); } } diff --git a/src/sdl-instead/graphics.c b/src/sdl-instead/graphics.c index 3ee236a..7ae6b06 100644 --- a/src/sdl-instead/graphics.c +++ b/src/sdl-instead/graphics.c @@ -658,6 +658,17 @@ int gfx_frame_gif(img_t img) return 1; } +void gfx_update_gif(img_t img) +{ + anigif_t ag; + ag = is_anigif(img); + if (!ag) + return; + if (!ag->drawn) + return; + gfx_update(ag->x, ag->y, gfx_img_w(img), gfx_img_h(img)); +} + void gfx_draw_wh(img_t p, int x, int y, int w, int h) { SDL_Surface *pixbuf = (SDL_Surface *)p; diff --git a/src/sdl-instead/graphics.h b/src/sdl-instead/graphics.h index ee9e4c1..341152a 100644 --- a/src/sdl-instead/graphics.h +++ b/src/sdl-instead/graphics.h @@ -127,5 +127,6 @@ extern void gfx_stop_gif(img_t img); extern int gfx_frame_gif(img_t img); extern void gfx_del_timer(timer_t han); extern timer_t gfx_add_timer(int delay, int (*fn)(int, void*), void *aux); +extern void gfx_update_gif(img_t img); #endif