1 #ifndef __TEXTURES_H
2 #define __TEXTURES_H
3 
4 /*
5 TEXTURES.H
6 
7 	Copyright (C) 1991-2001 and beyond by Bungie Studios, Inc.
8 	and the "Aleph One" developers.
9 
10 	This program is free software; you can redistribute it and/or modify
11 	it under the terms of the GNU General Public License as published by
12 	the Free Software Foundation; either version 3 of the License, or
13 	(at your option) any later version.
14 
15 	This program is distributed in the hope that it will be useful,
16 	but WITHOUT ANY WARRANTY; without even the implied warranty of
17 	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 	GNU General Public License for more details.
19 
20 	This license is contained in the file "COPYING",
21 	which is included with this source code; it is available online at
22 	http://www.gnu.org/licenses/gpl.html
23 
24 Saturday, August 20, 1994 12:08:34 PM
25 */
26 
27 #include    "cseries.h"
28 
29 /* ---------- structures */
30 
31 enum /* bitmap flags */
32 {
33 	_COLUMN_ORDER_BIT= 0x8000,
34 	_TRANSPARENT_BIT= 0x4000,
35 	_PATCHED_BIT= 0x2000, // the bitmap should take precedent over MML
36 };
37 
38 struct bitmap_definition
39 {
40 	int16 width, height; /* in pixels */
41 	int16 bytes_per_row; /* if ==NONE this is a transparent RLE shape */
42 
43 	int16 flags; /* [column_order.1] [unused.15] */
44 	int16 bit_depth; /* should always be ==8 */
45 
46 	int16 unused[8];
47 
48 	pixel8 *row_addresses[1];
49 };
50 const int SIZEOF_bitmap_definition = 30;
51 
52 /* ---------- prototypes/TEXTURES.C */
53 
54 /* assumes pixel data follows bitmap_definition structure immediately */
55 pixel8 *calculate_bitmap_origin(struct bitmap_definition *bitmap);
56 
57 /* initialize bytes_per_row, height and row_address[0] before calling */
58 void precalculate_bitmap_row_addresses(struct bitmap_definition *texture);
59 
60 void map_bytes(byte *buffer, byte *table, int32 size);
61 void remap_bitmap(struct bitmap_definition *bitmap,	pixel8 *table);
62 
63 #endif
64 
65