1load_datafile(3) Allegro manual load_datafile(3)
2
3
4
6 load_datafile - Loads a datafile into memory. Allegro game programming
7 library.
8
10 #include <allegro.h>
11
12
13 DATAFILE *load_datafile(const char *filename);
14
16 Loads a datafile into memory in one go. If the datafile has been
17 encrypted, you must first call packfile_password() to set the appropriā
18 ate key. If the datafile contains truecolor graphics, you must set the
19 video mode or call set_color_conversion() before loading it. Example:
20
21 /* Load the resources for our game. */
22 DATAFILE *dat = load_datafile("game.dat");
23 if (!dat)
24 abort_on_error("Couldn't load sound resources!");
25 /* Use resources. */
26 ...
27 /* Destroy them when we don't need them any more. */
28 unload_datafile(dat);
29
31 Returns a pointer to the DATAFILE, or NULL on error. Remember to free
32 this DATAFILE later to avoid memory leaks.
33
34
36 load_datafile_callback(3), unload_datafile(3), load_datafile_object(3),
37 set_color_conversion(3), fixup_datafile(3), packfile_password(3),
38 find_datafile_object(3), register_datafile_object(3), excustom(3),
39 exdata(3), exexedat(3), exgui(3), exsprite(3), exunicod(3)
40
41
42
43Allegro version 4.4.2 load_datafile(3)