play_memory_fli(3alleg4)
π play_memory_fli π
okay bestie, so this is a page from the Allegro manual β Allegro being the game programming library, yes the whole vibe β¨ β and it's filed under section 3alleg4. The function is play_memory_fli, and no cap, it's giving "animation but make it RAM".
β¨ SYNOPSIS β¨
#include <allegro.h>
int play_memory_fli(const void *fli_data, BITMAP *bmp, int loop, int
(*callback)());
πΈ DESCRIPTION πΈ
So basically play_memory_fli plays an Autodesk Animator FLI or FLC animation onto the BITMAP you point it at, except β and this is the moment β it reads the data from a copy of the file held in memory, not from disk. Iconic behavior, honestly.
You get that fli_data pointer one of two ways:
- allocate a block of memory and read an FLI file into it, or
- import an FLI into a grabber datafile.
Now the loop parameter, listen: if loop is not zero, the player cycles back around when it hits the end of the file. If it is zero, it plays the whole animation through exactly once and then returns. That's it, that's the deal. π
And for the callback parameter? Girl, go read the beginning of the chapter called "FLIC routines" β it's all described there, I'm not gonna paraphrase the good people.
Playing animations from memory is obviously faster than cueing them directly from disk, and it's lowkey perfect for short, looped FLI's. But here's the tea: animations can get very large very fast, so in most cases you'll probably be better off just using play_fli(). Fr fr. Think of this function as a cute little wrapper layered on top of open_memory_fli(), next_fli_frame() and close_fli(). She's a girlboss delegating π
Example, bestie:
int ret = play_memory_fli(anim_data, screen, 0, NULL);
if (ret == FLI_ERROR)
abort_on_error("Corrupted animation data?");
π₯ RETURN VALUE π₯
The FLI player hands you back:
FLI_OKβ she reached the end of the file, slayFLI_ERRORβ something went wrong π- whatever value the callback function returned β but only if that was the thing that stopped her
π¦ SEE ALSO π¦
k that's the whole page, you ate it. this was Allegro version 4.4.3, manual page play_memory_fli(3alleg4), and yes she's been sitting here since forever β go read the source, it's giving history π byeeee π«Ά
π¦ 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