ScummVM API documentation
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
27namespace M4 {
28
29constexpr int MIN_PAL_ENTRY = 1;
30constexpr 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
49uint8 gr_pal_get_ega_color(uint8 myColor);
50
51void gr_color_set(int32 c);
52byte gr_color_get_current();
53
54void gr_pal_set_range(RGB8 *pal, int first_color, int num_colors);
55void gr_pal_set_range(int first_color, int num_colors);
56void gr_pal_set(RGB8 *pal);
57void gr_pal_set_RGB8(RGB8 *entry, int r, int g, int b);
58void gr_pal_set_entry(int32 index, RGB8 *entry);
59void gr_pal_clear(RGB8 *palette);
60void gr_pal_clear_range(RGB8 *palette, int first_color, int last_color);
61uint8 gr_pal_find_best_match(RGB8 *pal, uint8 r, uint8 g, uint8 b);
62void gr_pal_interface(RGB8 *fixpal);
63void gr_pal_reset_ega_colors(RGB8 *pal);
64void gr_backup_palette();
65void gr_restore_palette();
66
67void pal_mirror_colours(int first_color, int last_color, RGB8 *pal);
68void pal_mirror_colours(int first_color, int last_color);
69
70} // namespace M4
71
72#endif
Definition: database.h:28