faster gif render

This commit is contained in:
p.kosyh 2009-10-02 18:08:24 +00:00
parent a2d831d5bf
commit 87950856e8
3 changed files with 13 additions and 1 deletions

View file

@ -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));
}
}

View file

@ -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;

View file

@ -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