From 2b32a2f8d9ab7bdc899bb04cac6fb73101400481 Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Thu, 30 Jan 2014 22:12:11 -0500 Subject: [PATCH] liblbx: Kill lbx_img_getinfo There is no longer any reason to use this function. Its removal has been a long time coming; it is time for it to go. --- src/gui/lbxgui.c | 2 -- src/image.c | 16 ---------------- src/image.h | 7 ------- src/lbximg.c | 8 +++----- 4 files changed, 3 insertions(+), 30 deletions(-) diff --git a/src/gui/lbxgui.c b/src/gui/lbxgui.c index e9726a6..0db5561 100644 --- a/src/gui/lbxgui.c +++ b/src/gui/lbxgui.c @@ -99,7 +99,6 @@ static void tick(void *p, double delta) { static double elapsed = 0; double seconds_per_frame = 1.0/15; - struct lbx_imginfo info; GtkSpinButton *spin; GtkToggleButton *play; unsigned frame, newframe; @@ -107,7 +106,6 @@ static void tick(void *p, double delta) if (!image) return; - lbx_img_getinfo(image, &info); spin = GTK_SPIN_BUTTON(gtk_builder_get_object(builder, "framespin")); play = GTK_TOGGLE_BUTTON(gtk_builder_get_object(builder, "playbutton")); diff --git a/src/image.c b/src/image.c index 8538520..27c8273 100644 --- a/src/image.c +++ b/src/image.c @@ -400,22 +400,6 @@ readerr: return -1; } -void lbx_img_getinfo(struct lbx_image *pub, struct lbx_imginfo *info) -{ - struct lbx_image_priv *img = (struct lbx_image_priv *)pub; - - *info = (struct lbx_imginfo) { 0 }; - - /* There seems to be two ways of specifying that an image loops. */ - if (img->flags & FLAG_LOOPING) { - info->loopstart = 0; - info->looping = 1; - } else if (img->pub.leadin != pub->frames - 1) { - info->loopstart = img->pub.leadin; - info->looping = 1; - } -} - int lbx_img_close(struct lbx_image *pub) { struct lbx_image_priv *img = (struct lbx_image_priv *)pub; diff --git a/src/image.h b/src/image.h index 05d3660..454b15b 100644 --- a/src/image.h +++ b/src/image.h @@ -14,11 +14,6 @@ struct lbx_colour { unsigned red:6, green:6, blue:6, active:1; }; -struct lbx_imginfo { - unsigned char loopstart; - int looping; -}; - struct lbx_image *lbx_img_open(void *f, const struct lbx_file_ops *fops, int (*destructor)(void *)); struct lbx_image *lbx_img_fopen(const char *file); @@ -32,6 +27,4 @@ int lbx_img_getpalette(struct lbx_image *img, struct lbx_colour *palette); int lbx_img_loadpalette(void *f, const struct lbx_file_ops *fops, struct lbx_colour *palette); -void lbx_img_getinfo(struct lbx_image *img, struct lbx_imginfo *info); - #endif diff --git a/src/lbximg.c b/src/lbximg.c index cdba3af..98d2676 100644 --- a/src/lbximg.c +++ b/src/lbximg.c @@ -537,7 +537,6 @@ int main(int argc, char **argv) } if (verbose || mode == MODE_IDENT) { - struct lbx_imginfo info; int palette_count; if (!file) @@ -549,12 +548,11 @@ int main(int argc, char **argv) return EXIT_FAILURE; } - lbx_img_getinfo(img, &info); printf("%s is %hux%hu LBX image, %hhu frame(s)%s%s%s\n", file, img->width, img->height, img->frames, - palette_count ? ", embedded palette" : "", - img->chunk ? ", chunked" : "", - info.looping ? ", loops" : ""); + palette_count ? ", embedded palette" : "", + img->chunk ? ", chunked" : "", + img->leadin+1 < img->frames ? ", loops" : ""); } switch (mode) { -- 2.43.2