ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
gr_pal.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef M4_GRAPHICS_GR_PAL_H
23 #define M4_GRAPHICS_GR_PAL_H
24 
25 #include "m4/m4_types.h"
26 
27 namespace M4 {
28 
29 constexpr int MIN_PAL_ENTRY = 1;
30 constexpr int MAX_PAL_ENTRY = 255;
31 
32 #define __BLACK (gr_pal_get_ega_color(0))
33 #define __BLUE (gr_pal_get_ega_color(1))
34 #define __GREEN (gr_pal_get_ega_color(2))
35 #define __CYAN (gr_pal_get_ega_color(3))
36 #define __RED (gr_pal_get_ega_color(4))
37 #define __VIOLET (gr_pal_get_ega_color(5))
38 #define __BROWN (gr_pal_get_ega_color(6))
39 #define __LTGRAY (gr_pal_get_ega_color(7))
40 #define __DKGRAY (gr_pal_get_ega_color(8))
41 #define __LTBLUE (gr_pal_get_ega_color(9))
42 #define __LTGREEN (gr_pal_get_ega_color(10))
43 #define __LTCYAN (gr_pal_get_ega_color(11))
44 #define __LTRED (gr_pal_get_ega_color(12))
45 #define __PINK (gr_pal_get_ega_color(13))
46 #define __YELLOW (gr_pal_get_ega_color(14))
47 #define __WHITE (gr_pal_get_ega_color(15))
48 
49 uint8 gr_pal_get_ega_color(uint8 myColor);
50 
51 void gr_color_create_ipl5(uint8 *inverseColorTable, char *fname, int room_num);
52 uint8 *gr_color_load_ipl5(const char *filename, uint8 *inverseColors);
53 void gr_color_set(int32 c);
54 byte gr_color_get_current();
55 
56 void gr_pal_set_range(RGB8 *pal, int first_color, int num_colors);
57 void gr_pal_set_range(int first_color, int num_colors);
58 void gr_pal_set(RGB8 *pal);
59 void gr_pal_set_RGB8(RGB8 *entry, int r, int g, int b);
60 void gr_pal_set_entry(int32 index, RGB8 *entry);
61 void gr_pal_clear(RGB8 *palette);
62 void gr_pal_clear_range(RGB8 *palette, int first_color, int last_color);
63 uint8 gr_pal_find_best_match(RGB8 *pal, uint8 r, uint8 g, uint8 b);
64 void gr_pal_interface(RGB8 *fixpal);
65 void gr_pal_reset_ega_colors(RGB8 *pal);
66 void gr_backup_palette();
67 void gr_restore_palette();
68 
69 void pal_mirror_colours(int first_color, int last_color, RGB8 *pal);
70 void pal_mirror_colours(int first_color, int last_color);
71 
72 } // namespace M4
73 
74 #endif
Definition: database.h:28