File: palman.h

package info (click to toggle)
freespace2 3.7.4%2Brepack-1.1
  • links: PTS, VCS
  • area: non-free
  • in suites: bullseye
  • size: 22,268 kB
  • sloc: cpp: 393,535; ansic: 4,106; makefile: 1,091; xml: 181; sh: 137
file content (55 lines) | stat: -rw-r--r-- 1,646 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
 * Copyright (C) Volition, Inc. 1999.  All rights reserved.
 *
 * All source code herein is the property of Volition, Inc. You may not sell 
 * or otherwise commercially exploit the source or things you created based on the 
 * source.
 *
*/



#ifndef _PALMAN_H
#define _PALMAN_H 

#include "globalincs/pstypes.h"

// Calculate tables for this palette.
// Assumes gr_palette is filled in.
extern void palette_update(const char *name, int restrict_colors_to_upper_128 );

// Writes current tables to disk.
extern void palette_flush();

// Functions to query a palette
extern uint palette_compute_checksum( ubyte *pal );		// computes checksum of palette
extern ubyte *palette_get_blend_table(float alpha);

extern uint palette_find( int r, int g, int b );

// Data used to query a palette
extern ubyte gr_palette[256*3];
extern ubyte gr_fade_table[(256*34)*2];
extern uint gr_palette_checksum;

// Functions to deal with changing the palette.
// These just call gr_set_palette, which will in turn
// call palette_flush and palette_update.
extern void palette_load_table( const char * filename );
extern void palette_use_bm_palette(int n);
extern void palette_restore_palette( void );

// nondarkening texture pixel colors
#define MAX_NONDARK_COLORS					10

extern int Palman_num_nondarkening_default;
extern ubyte Palman_non_darkening_default[MAX_NONDARK_COLORS][3];

extern int Palman_num_nondarkening;
extern ubyte Palman_non_darkening[MAX_NONDARK_COLORS][3];

extern int palman_is_nondarkening(int r,int g, int b);
extern void palman_load_pixels();
extern void palman_set_nondarkening(ubyte colors[MAX_NONDARK_COLORS][3], int size);

#endif