35 ColorFormat(
int size, BYTE r, BYTE rs, BYTE g, BYTE gs, BYTE b, BYTE bs, BYTE a=0, BYTE as=0)
63 static const char*
TYPENAME() {
return "Color"; }
78 Color(BYTE r, BYTE g, BYTE b, BYTE a=255) {
95 void Set(DWORD value) { rgba = value; }
96 void Set(BYTE r, BYTE g, BYTE b, BYTE a=255) {
99 DWORD
Value()
const {
return rgba; }
111 float fRed()
const {
return (
float)(
Red() /255.0); }
127 DWORD
Shaded(
int shade)
const;
154 static void SetPalette(PALETTEENTRY* pal,
int palsize, BYTE* invpal=0);
175 static bool standard_format;
176 static PALETTEENTRY palette[256];
177 static BYTE table[32768];
179 static int texture_alpha_level;
182 static Color fade_color;
193 static const char*
TYPENAME() {
return "ColorValue"; }
204 float aa=1.0f) : r(ar), g(ag), b(ab), a(aa) { }
215 void Set(
float ar,
float ag,
float ab,
float aa=1.0f) { r=ar; g=ag; b=ab; a=aa; }
222 float Red()
const {
return r; }
224 float Blue()
const {
return b; }
246 static const char*
TYPENAME() {
return "ColorIndex"; }
257 BYTE
Index()
const {
return index; }
259 DWORD
Red()
const {
return Color::palette[index].peRed; }
260 DWORD
Green()
const {
return Color::palette[index].peGreen; }
261 DWORD
Blue()
const {
return Color::palette[index].peBlue; }
263 float fRed()
const {
return (
float)(
Red() /255.0); }
268 DWORD
Unfaded()
const {
return unfaded_palette[index]; }
269 DWORD
Formatted()
const {
return formatted_palette[index]; }
270 DWORD
Shaded(
int shade)
const {
return shade_table[shade*256+index]; }
279 BYTE
IndexedBlend(BYTE dst)
const {
return blend_table[dst*256+index]; }
284 static DWORD* texture_palette;
285 static DWORD texture_palettes[4][256];
286 static DWORD unfaded_palette[256];
287 static DWORD formatted_palette[256];
288 static DWORD shade_table[256*256];
289 static BYTE blend_table[256*256];