{
static double elapsed = 0;
double seconds_per_frame = 1.0/15;
- struct lbx_imginfo info;
GtkSpinButton *spin;
GtkToggleButton *play;
unsigned frame, newframe;
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"));
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;
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);
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
}
if (verbose || mode == MODE_IDENT) {
- struct lbx_imginfo info;
int palette_count;
if (!file)
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) {