gif counter

This commit is contained in:
p.kosyh 2009-10-04 05:21:52 +00:00
parent 59c4198a34
commit 9041380465
2 changed files with 5 additions and 4 deletions

View file

@ -275,7 +275,7 @@ int AG_LoadGIF_RW( SDL_RWops* src, AG_Frame* frames, int maxFrames, int *loop)
gd = malloc( sizeof(*gd) );
memset( gd, 0, sizeof(*gd) );
gd->src = src;
gd->loop = 1;
start = SDL_RWtell( src );
if ( !SDL_RWread(src,buf,6,1) )
@ -448,9 +448,8 @@ static int DoExtension( gifdata* gd, int label )
break;
if (buf[0] != 1)
break;
gd->loop = buf[1] | (buf[2] << 8);
gd->loop = (unsigned int)buf[1] | (((unsigned int)buf[2]) << 8);
break;
case 0xfe: /* Comment Extension */
while ( GetDataBlock(gd,buf) != 0 )
;

View file

@ -651,8 +651,10 @@ int gfx_frame_gif(img_t img)
if ((timer_counter - ag->delay) < (ag->frames[ag->cur_frame].delay / HZ))
return 0;
if (ag->loop > 1 || !ag->loop)
anigif_disposal(ag);
anigif_disposal(ag);
ag->cur_frame ++;
if (ag->cur_frame >= ag->nr_frames) {