gif counter
This commit is contained in:
parent
59c4198a34
commit
9041380465
|
@ -275,7 +275,7 @@ int AG_LoadGIF_RW( SDL_RWops* src, AG_Frame* frames, int maxFrames, int *loop)
|
||||||
gd = malloc( sizeof(*gd) );
|
gd = malloc( sizeof(*gd) );
|
||||||
memset( gd, 0, sizeof(*gd) );
|
memset( gd, 0, sizeof(*gd) );
|
||||||
gd->src = src;
|
gd->src = src;
|
||||||
|
gd->loop = 1;
|
||||||
start = SDL_RWtell( src );
|
start = SDL_RWtell( src );
|
||||||
|
|
||||||
if ( !SDL_RWread(src,buf,6,1) )
|
if ( !SDL_RWread(src,buf,6,1) )
|
||||||
|
@ -448,9 +448,8 @@ static int DoExtension( gifdata* gd, int label )
|
||||||
break;
|
break;
|
||||||
if (buf[0] != 1)
|
if (buf[0] != 1)
|
||||||
break;
|
break;
|
||||||
gd->loop = buf[1] | (buf[2] << 8);
|
gd->loop = (unsigned int)buf[1] | (((unsigned int)buf[2]) << 8);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0xfe: /* Comment Extension */
|
case 0xfe: /* Comment Extension */
|
||||||
while ( GetDataBlock(gd,buf) != 0 )
|
while ( GetDataBlock(gd,buf) != 0 )
|
||||||
;
|
;
|
||||||
|
|
|
@ -651,8 +651,10 @@ int gfx_frame_gif(img_t img)
|
||||||
|
|
||||||
if ((timer_counter - ag->delay) < (ag->frames[ag->cur_frame].delay / HZ))
|
if ((timer_counter - ag->delay) < (ag->frames[ag->cur_frame].delay / HZ))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
if (ag->loop > 1 || !ag->loop)
|
||||||
|
anigif_disposal(ag);
|
||||||
|
|
||||||
anigif_disposal(ag);
|
|
||||||
ag->cur_frame ++;
|
ag->cur_frame ++;
|
||||||
|
|
||||||
if (ag->cur_frame >= ag->nr_frames) {
|
if (ag->cur_frame >= ag->nr_frames) {
|
||||||
|
|
Reference in a new issue