2 * Copyright (C) Volition, Inc. 1999. All rights reserved.
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
10 * $Logfile: /Freespace2/code/Palman/PalMan.h $
15 * Palette Manager header file
18 * Revision 1.2 2002/06/09 04:41:14 relnev
19 * added copyright header
21 * Revision 1.1.1.1 2002/05/03 03:28:12 root
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.
29 * 3 2/05/99 12:52p Dave
30 * Fixed Glide nondarkening textures.
32 * 2 10/07/98 10:53a Dave
35 * 1 10/07/98 10:50a Dave
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.
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.
45 * 12 11/21/97 11:32a John
46 * Added nebulas. Fixed some warpout bugs.
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.
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.
56 * 9 7/16/97 3:07p John
58 * 8 5/21/97 11:06a Lawrance
59 * added user_palette_find()
61 * 7 5/12/97 12:27p John
62 * Restructured Graphics Library to add support for multiple renderers.
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.
68 * 5 11/26/96 9:44a Allender
69 * allow for use of different bitmap palettes
79 // Calculate tables for this palette.
80 // Assumes gr_palette is filled in.
81 extern void palette_update(char *name, int restrict_colors_to_upper_128 );
83 // Writes current tables to disk.
84 extern void palette_flush();
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();
91 extern uint palette_find( int r, int g, int b );
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;
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( char * filename );
102 extern void palette_use_bm_palette(int n);
103 extern void palette_restore_palette( void );
105 // nondarkening texture pixel colors
106 #define MAX_NONDARK_COLORS 10
108 extern int Palman_num_nondarkening_default;
109 extern ubyte Palman_non_darkening_default[MAX_NONDARK_COLORS][3];
111 extern int Palman_num_nondarkening;
112 extern ubyte Palman_non_darkening[MAX_NONDARK_COLORS][3];
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);