Debian Codegraph @

prboom2/src/dsda/palette.h

raw
1 //
2 // Copyright(C) 2020 by Ryan Krafnick
3 //
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
7 // of the License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // DESCRIPTION:
15 // DSDA Palette Management
16 //
17
18 #ifndef __DSDA_PALETTE__
19 #define __DSDA_PALETTE__
20
21 #include "SDL.h"
22
23 typedef enum {
24 playpal_default,
25 playpal_1,
26 playpal_2,
27 playpal_3,
28 playpal_4,
29 playpal_5,
30 playpal_6,
31 playpal_7,
32 playpal_8,
33 playpal_9,
34 playpal_heretic_e2end,
35 NUMPALETTES
36 } dsda_playpal_index_t;
37
38 typedef struct playpal_data_s {
39 const int index;
40 const char* lump_name;
41 unsigned char* lump;
42 int length;
43 // See r_patch.c
44 int transparent;
45 int duplicate;
46 int darkest;
47 int lightest;
48
49 // Array of SDL_Color structs used for setting the 256-colour palette
50 SDL_Color* colours;
51 } dsda_playpal_t;
52
53 double dsda_PaletteEntryLightness(const byte *playpal, int i);
54 dsda_playpal_t* dsda_PlayPalData(void);
55 void dsda_CyclePlayPal(void);
56 void dsda_SetPlayPal(int index);
57 void dsda_FreePlayPal(void);
58 void dsda_InitPlayPal(void);
59
60 #endif