FS2_Open
Open source remastering of the Freespace 2 engine
palman.h
Go to the documentation of this file.
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 the
6  * source.
7  *
8 */
9 
10 
11 
12 #ifndef _PALMAN_H
13 #define _PALMAN_H
14 
15 #include "globalincs/pstypes.h"
16 
17 // Calculate tables for this palette.
18 // Assumes gr_palette is filled in.
19 extern void palette_update(const char *name, int restrict_colors_to_upper_128 );
20 
21 // Writes current tables to disk.
22 extern void palette_flush();
23 
24 // Functions to query a palette
25 extern uint palette_compute_checksum( ubyte *pal ); // computes checksum of palette
26 extern ubyte *palette_get_blend_table(float alpha);
27 
28 extern uint palette_find( int r, int g, int b );
29 
30 // Data used to query a palette
31 extern ubyte gr_palette[256*3];
32 extern ubyte gr_fade_table[(256*34)*2];
34 
35 // Functions to deal with changing the palette.
36 // These just call gr_set_palette, which will in turn
37 // call palette_flush and palette_update.
38 extern void palette_load_table( const char * filename );
39 extern void palette_use_bm_palette(int n);
40 extern void palette_restore_palette( void );
41 
42 // nondarkening texture pixel colors
43 #define MAX_NONDARK_COLORS 10
44 
47 
48 extern int Palman_num_nondarkening;
50 
51 extern int palman_is_nondarkening(int r,int g, int b);
52 extern void palman_load_pixels();
53 extern void palman_set_nondarkening(ubyte colors[MAX_NONDARK_COLORS][3], int size);
54 
55 #endif
int Palman_num_nondarkening
Definition: palman.cpp:50
int Palman_num_nondarkening_default
Definition: palman.cpp:47
GLsizeiptr size
Definition: Glext.h:5496
void palette_use_bm_palette(int n)
Definition: palman.cpp:578
uint palette_find(int r, int g, int b)
Definition: palman.cpp:184
GLdouble GLdouble GLdouble r
Definition: Glext.h:5337
unsigned int uint
Definition: pstypes.h:64
GLboolean GLboolean g
Definition: Glext.h:5781
char * filename
void palette_update(const char *name, int restrict_colors_to_upper_128)
Definition: palman.cpp:497
ubyte Palman_non_darkening[MAX_NONDARK_COLORS][3]
Definition: palman.cpp:51
#define MAX_NONDARK_COLORS
Definition: palman.h:43
GLclampd n
Definition: Glext.h:7286
unsigned char ubyte
Definition: pstypes.h:62
GLuint const GLchar * name
Definition: Glext.h:5608
GLboolean GLboolean GLboolean b
Definition: Glext.h:5781
ubyte gr_palette[256 *3]
Definition: palman.cpp:27
ubyte * palette_get_blend_table(float alpha)
Definition: palman.cpp:532
void palette_load_table(const char *filename)
Definition: palman.cpp:132
void palette_restore_palette(void)
Definition: palman.cpp:588
uint palette_compute_checksum(ubyte *pal)
Definition: palman.cpp:559
ubyte Palman_non_darkening_default[MAX_NONDARK_COLORS][3]
Definition: palman.cpp:48
ubyte gr_fade_table[(256 *34)*2]
Definition: palman.cpp:28
uint gr_palette_checksum
Definition: palman.cpp:34
int palman_is_nondarkening(int r, int g, int b)
Definition: palman.cpp:53
void palman_load_pixels()
Definition: palman.cpp:65
GLclampf GLclampf GLclampf alpha
Definition: Glext.h:5177
void palman_set_nondarkening(ubyte colors[MAX_NONDARK_COLORS][3], int size)
Definition: palman.cpp:93
void palette_flush()
Definition: palman.cpp:483