]> git.draconx.ca Git - liblbx.git/commitdiff
liblbx: Kill lbx_img_getinfo
authorNick Bowler <nbowler@draconx.ca>
Fri, 31 Jan 2014 03:12:11 +0000 (22:12 -0500)
committerNick Bowler <nbowler@draconx.ca>
Fri, 31 Jan 2014 05:39:01 +0000 (00:39 -0500)
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
src/image.c
src/image.h
src/lbximg.c

index e9726a6b58c9855b49320299d719c049606d99d7..0db5561555b64a49adc73fdda63cc31a78f90793 100644 (file)
@@ -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"));
 
index 853852000492e3413cf8e17f851ee6458c0be9e5..27c82734bf853ec56742aefd9dbbe66295fa6ca6 100644 (file)
@@ -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;
index 05d36608e085fd576344ce2b803f95685acbc84e..454b15b386c078561b9fc875e983c2c7a1b9744d 100644 (file)
@@ -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
index cdba3af56bca64d05dc51a7a90cc996f45ace2ea..98d2676dea7294e2527f006172691b239c3e1302 100644 (file)
@@ -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) {