Debian Codegraph @

src/palette.h

raw symbols SCIP
1 /*
2 * OpenTyrian: A modern cross-platform port of Tyrian
3 * Copyright (C) 2007-2009 The OpenTyrian Development Team
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19 #ifndef PALETTE_H
20 #define PALETTE_H
21
22 #include "opentyr.h"
23
24 #include "SDL.h"
25
26 typedef SDL_Color Palette[256];
27
28 extern Palette palettes[];
29 extern int palette_count;
30
31 extern Uint32 rgb_palette[256], yuv_palette[256];
32
33 extern Palette colors; // TODO: get rid of this
34
35 void JE_loadPals(void);
36
37 void set_palette(Palette colors, unsigned int first_color, unsigned int last_color);
38 void set_colors(SDL_Color color, unsigned int first_color, unsigned int last_color);
39
40 void init_step_fade_palette(int diff[256][3], Palette colors, unsigned int first_color, unsigned int last_color);
41 void init_step_fade_solid(int diff[256][3], SDL_Color color, unsigned int first_color, unsigned int last_color);
42 void step_fade_palette(int diff[256][3], int steps, unsigned int first_color, unsigned int last_color);
43
44 void fade_palette(Palette colors, int steps, unsigned int first_color, unsigned int last_color);
45 void fade_solid(SDL_Color color, int steps, unsigned int first_color, unsigned int last_color);
46
47 void fade_black(int steps);
48 void fade_white(int steps);
49
50 #endif /* PALETTE_H */