7 #define PAL_READ_ERROR 1
9 #define PAL_READ_NOOPT -1
24 * Colors in the palette are in the range 0..63.
26 * The first element (index 0) is always considered transparent (actual
27 * color is ignored). If the value of one color component is not in the
28 * range 0..63, in a special table the index is marked as unused, and
29 * all components of the color are set to 0.
31 * Elements from 229 to 254 are used as 'animation colors' and Fallout
32 * sets their values itself. 229 to 232 are animated green (for
33 * radioactive waste), 238 to 247 are orange, red and yellow (for
34 * fires), and the rest are bright blue (computer screens).
36 struct pal_rgb colors[256];
38 /** Table for converting RGB values => to index in the palette. */
39 uint8_t element[32768];
51 /** Tag for the availability of additional tables.?
57 /** Additional table */
58 int8_t table[3][65536];
62 * Reads PAL informations about pallette
64 * @param in opened stream for reading
65 * @param _pal reference to structure where read informations will be stored
67 * @return when succesful function returns PAL_READ_OK, otherwise PAL_READ_ERROR
68 * and errno should be checked for details.
70 int pal_read(FILE * in, struct pal * _pal);
73 * Reads PAL optional informations about pallette
75 * @param in opened stream for reading
76 * @param _optional reference to structure where read informations will be stored
78 * @return when succesfully read optional informations, function returns
79 * PAL_READ_OK and opt value contains read information. When there were
80 * no informations in input stream, returns PAL_READ_NOOPT and opt is
81 * unchanged, otherwise PAL_READ_ERROR is returned, opt is unchanged and
82 * errno should be checked for details.
84 int pal_read_optional(FILE * in, struct pal_optional * opt);