play_fli(3alleg4)
π play_fli β bestie, it's literally Allegro manual time β¨
okay so this page lives in play_fli(3alleg4), straight out of the Allegro manual, and it's about playing FLI/FLC animations from disk. iconic. let's get into it π¦
πΈ NAME πΈ
play_fli β plays a FLI or FLC animation from disk. it's the Allegro game programming library, no cap π
β¨ SYNOPSIS β¨
#include <allegro.h>
int play_fli(const char *filename, BITMAP *bmp, int loop, int
(*callback)());
π DESCRIPTION π
so basically? it plays an Autodesk Animator FLI or FLC animation file onto the BITMAP you pass in, and it reads the data off the disk as it needs it (yes, streaming, we love a low-memory queen π).
about loop: if it's not zero, the player just keeps cycling when it hits the end of the file β infinite main character energy. if it is zero, it plays the whole animation through once and then comes back. one and done, periodt.
and for the whole callback parameter situation, go read the beginning of the chapter "FLIC routines" β that's where the lore lives π.
Example, because we love a demo:
/* Let users skip looped animations. */
int check_escape_key(void)
{
if (key[KEY_ESC])
return 1;
else
return 0;
}
...
int ret = play_fli("animlogo.fli", screen, 1,
check_escape_key);
if (ret == FLI_ERROR)
abort_on_error("Error playing intro!");
π RETURN VALUE π
the FLI player hands you back:
FLI_OKβ yay, it reached the end of the file π₯³FLI_ERRORβ nope, something went wrong π- or literally whatever the callback function returned, if that was the thing that stopped it π«Ά
π SEE ALSO π
and that's the whole page, bestie π this was Allegro version 4.4.3, play_fli(3alleg4), signing off β go play some animations, you ate πβ¨
π¦ where this page comes from
- debian bookworm: allegro4-doc 2:4.4.3.1-3 Β· Allegro-gift-ware
- debian trixie: allegro4-doc 2:4.4.3.1-5 Β· Allegro-gift-ware
- ubuntu jammy: allegro4-doc 2:4.4.3.1-2 Β· Allegro-gift-ware
- ubuntu noble: allegro4-doc 2:4.4.3.1-4.1build3 Β· Allegro-gift-ware
- ubuntu questing: allegro4-doc 2:4.4.3.1-6
- ubuntu resolute: allegro4-doc 2:4.4.3.1-7 Β· Allegro-gift-ware
- ubuntu stonking: allegro4-doc 2:4.4.3.1-9 Β· Allegro-gift-ware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms