]> icculus.org git repositories - taylor/freespace2.git/blob - include/palman.h
Initial revision
[taylor/freespace2.git] / include / palman.h
1 /*
2  * $Logfile: /Freespace2/code/Palman/PalMan.h $
3  * $Revision$
4  * $Date$
5  * $Author$
6  *
7  * Palette Manager header file
8  *
9  * $Log$
10  * Revision 1.1  2002/05/03 03:28:12  root
11  * Initial revision
12  *
13  * 
14  * 4     3/31/99 8:24p Dave
15  * Beefed up all kinds of stuff, incluging beam weapons, nebula effects
16  * and background nebulae. Added per-ship non-dimming pixel colors.
17  * 
18  * 3     2/05/99 12:52p Dave
19  * Fixed Glide nondarkening textures.
20  * 
21  * 2     10/07/98 10:53a Dave
22  * Initial checkin.
23  * 
24  * 1     10/07/98 10:50a Dave
25  * 
26  * 14    5/20/98 9:46p John
27  * added code so the places in code that change half the palette don't
28  * have to clear the screen.
29  * 
30  * 13    12/02/97 4:00p John
31  * Added first rev of thruster glow, along with variable levels of
32  * translucency, which retquired some restructing of palman.
33  * 
34  * 12    11/21/97 11:32a John
35  * Added nebulas.   Fixed some warpout bugs.
36  * 
37  * 11    11/14/97 12:31p John
38  * Fixed some DirectX bugs.  Moved the 8-16 xlat tables into Graphics
39  * libs.  Made 16-bpp DirectX modes know what bitmap format they're in.
40  * 
41  * 10    7/16/97 5:29p John
42  * added palette table caching and made scaler and liner no light tmapper
43  * do alpha blending in 8 bpp mode.
44  * 
45  * 9     7/16/97 3:07p John
46  * 
47  * 8     5/21/97 11:06a Lawrance
48  * added user_palette_find()
49  * 
50  * 7     5/12/97 12:27p John
51  * Restructured Graphics Library to add support for multiple renderers.
52  * 
53  * 6     11/26/96 6:50p John
54  * Added some more hicolor primitives.  Made windowed mode run as current
55  * bpp, if bpp is 8,16,or 32.
56  * 
57  * 5     11/26/96 9:44a Allender
58  * allow for use of different bitmap palettes
59  *
60  * $NoKeywords: $
61  */
62
63 #ifndef _PALMAN_H
64 #define _PALMAN_H 
65
66 #include "pstypes.h"
67
68 // Calculate tables for this palette.
69 // Assumes gr_palette is filled in.
70 extern void palette_update(char *name, int restrict_colors_to_upper_128 );
71
72 // Writes current tables to disk.
73 extern void palette_flush();
74
75 // Functions to query a palette
76 extern uint palette_compute_checksum( ubyte *pal );             // computes checksum of palette
77 extern ubyte *palette_get_blend_table(float alpha);
78 extern ubyte *palette_get_fade_table();
79
80 extern uint palette_find( int r, int g, int b );
81
82 // Data used to query a palette
83 extern ubyte gr_palette[256*3];
84 extern ubyte gr_fade_table[(256*34)*2];
85 extern uint gr_palette_checksum;
86
87 // Functions to deal with changing the palette.
88 // These just call gr_set_palette, which will in turn
89 // call palette_flush and palette_update.
90 extern void palette_load_table( char * filename );
91 extern void palette_use_bm_palette(int n);
92 extern void palette_restore_palette( void );
93
94 // nondarkening texture pixel colors
95 #define MAX_NONDARK_COLORS                                      10
96
97 extern int Palman_num_nondarkening_default;
98 extern ubyte Palman_non_darkening_default[MAX_NONDARK_COLORS][3];
99
100 extern int Palman_num_nondarkening;
101 extern ubyte Palman_non_darkening[MAX_NONDARK_COLORS][3];
102
103 extern int palman_is_nondarkening(int r,int g, int b);
104 extern void palman_load_pixels();
105 extern void palman_set_nondarkening(ubyte colors[MAX_NONDARK_COLORS][3], int size);
106
107 #endif
108