1fixup_datafile(3)               Allegro manual               fixup_datafile(3)
2
3
4

NAME

6       fixup_datafile  - Fixes truecolor images in compiled datafiles. Allegro
7       game programming library.
8

SYNOPSIS

10       #include <allegro.h>
11
12
13       void fixup_datafile(DATAFILE *data);
14

DESCRIPTION

16       If you are using compiled datafiles (produced by the  dat2s  and  dat2c
17       utilities)  on  a platform that doesn't support constructors (currently
18       any non GCC-based platform), or  if  the  datafiles  contain  truecolor
19       images,  you must call this function once after your set the video mode
20       that you will be using. This will ensure  the  datafiles  are  properly
21       initialised  in  the  first  case and convert the color values into the
22       appropriate format in the second case. It handles flipping between  RGB
23       and BGR formats, and converting between different color depths whenever
24       that can be done without changing the size of the image  (ie.  changing
25       15<->16-bit  hicolor  for both bitmaps and RLE sprites, and 24<->32-bit
26       truecolor for RLE sprites).
27
28       Note that you can only call this once and expect it to work  correctly,
29       because  after  the  call the DATAFILE you fixed up is permanently con‐
30       verted to whatever is the current component ordering  for  your  screen
31       mode. If you call fixup_datafile again, the function assumes you have a
32       freshly loaded datafile. It cannot "undo" the previous conversion.
33
34       If your program supports changing resolution and/or color depth  during
35       runtime,  you  have two choices: either call fixup_datafile() just once
36       and hope that the component ordering and bit depth doesn't change  when
37       the  screen  mode changes (unlikely). Or, you can reload your datafiles
38       when the screen mode changes.
39
40

SEE ALSO

42       set_gfx_mode(3), set_color_conversion(3)
43
44
45
46Allegro                          version 4.4.3               fixup_datafile(3)
Impressum