diff options
author | Sean Fox <dyntryx@gmail.com> | 2008-06-26 19:49:08 +0000 |
---|---|---|
committer | Sean Fox <dyntryx@gmail.com> | 2008-06-26 19:49:08 +0000 |
commit | 8083eae40da40bc00ac2dd21382cbbd84e492f8e (patch) | |
tree | 31204b10de1b56f8e69e78b2242c5a7fad618ef3 /examples | |
parent | bb91c0edc3a0adf5638b94c2343bffedb56ceb68 (diff) | |
download | libnsgif-8083eae40da40bc00ac2dd21382cbbd84e492f8e.tar.gz libnsgif-8083eae40da40bc00ac2dd21382cbbd84e492f8e.tar.bz2 |
Bitmap callbacks are now set during the call to gif_create
svn path=/branches/dynis/libnsgif/; revision=4458
Diffstat (limited to 'examples')
-rw-r--r-- | examples/decode_gif.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/examples/decode_gif.c b/examples/decode_gif.c index 08f8a21..9c7a40f 100644 --- a/examples/decode_gif.c +++ b/examples/decode_gif.c @@ -38,16 +38,15 @@ void bitmap_modified(void *bitmap); int main(int argc, char *argv[]) { - gif_animation gif = { - .bitmap_callbacks = { - bitmap_create, - bitmap_destroy, - bitmap_get_buffer, - bitmap_set_opaque, - bitmap_test_opaque, - bitmap_modified - } + gif_bitmap_callback_vt bitmap_callbacks = { + bitmap_create, + bitmap_destroy, + bitmap_get_buffer, + bitmap_set_opaque, + bitmap_test_opaque, + bitmap_modified }; + gif_animation gif; size_t size; int code; unsigned int i; @@ -58,7 +57,7 @@ int main(int argc, char *argv[]) } /* create our gif animation */ - gif_create(&gif); + gif_create(&gif, &bitmap_callbacks); /* load file into memory */ unsigned char *data = load_file(argv[1], &size); @@ -106,6 +105,7 @@ int main(int argc, char *argv[]) /* clean up */ gif_finalise(&gif); + free(data); return 0; } |