open_fli(3alleg4)

✨ open_fli β€” the Allegro manual, bestie edition ✨

okay so this is open_fli(3alleg4) from the Allegro manual, and it's literally about getting a FLI file open and ready to play. sit with me, this one's short and sweet πŸŽ€


πŸ’– NAME πŸ’–

open_fli, open_memory_fli β€” Makes a FLI file open and ready for playing. Allegro game programming library.


🌸 SYNOPSIS 🌸

#include <allegro.h>

int open_fli(const char *filename);

int open_memory_fli(const void *fli_data);

πŸ¦‹ DESCRIPTION πŸ¦‹

So these two functions open FLI files and get them ready for playing β€” and the only difference is where the data comes from: open_fli reads it from disk, open_memory_fli reads it from memory. Respectively, bestie, that's the whole vibe. πŸ’…

The tea about the current FLI lives in the global variables fli_bitmap and fli_palette, and you can absolutely use those if this function succeeds. 🫢

⚠️ but listen β€” you can only have ONE animation open at a time. one. that's it. don't be greedy. πŸ™ˆ

Example, because we love a demo:

if (open_fli("intro.fli") == FLI_ERROR)
   abort_on_error("Error playing intro");

πŸ”₯ RETURN VALUE πŸ”₯

  • Returns FLI_OK when it ate and left no crumbs (success, bestie ✨).
  • Returns FLI_ERROR if something went wrong β€” like trying to open another FLI file without closing the previous one first. not the forbidden double-open 😭

πŸ’œ SEE ALSO πŸ’œ


and that's the whole page, bestie πŸ’– this was open_fli(3alleg4) from Allegro, version 4.4.3. go open exactly one FLI file and slay πŸ‘‘βœ¨