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