1 #ifndef __SHAPE_DESCRIPTORS_H
2 #define __SHAPE_DESCRIPTORS_H
3 
4 /*
5 SHAPE_DESCRIPTORS.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, July 9, 1994 3:24:56 PM
25 
26 Saturday, July 9, 1994 6:47:04 PM
27 	this header file is not in the makefile, so changing it won�t result in the nearly-full
28 	rebuild that it should.  if you change this, which you shouldn�t, you must touch the makefile.
29 
30 Feb 3, 2000 (Loren Petrich):
31 	Renamed _collection_madd to _collection_vacbob
32 	Annotated some of the _collection's better
33 */
34 
35 #include "cstypes.h"
36 
37 /* ---------- types */
38 
39 typedef uint16 shape_descriptor; /* [clut.3] [collection.5] [shape.8] */
40 
41 #define DESCRIPTOR_SHAPE_BITS 8
42 #define DESCRIPTOR_COLLECTION_BITS 5
43 #define DESCRIPTOR_CLUT_BITS 3
44 
45 #define MAXIMUM_COLLECTIONS (1<<DESCRIPTOR_COLLECTION_BITS)
46 #define MAXIMUM_SHAPES_PER_COLLECTION (1<<DESCRIPTOR_SHAPE_BITS)
47 #define MAXIMUM_CLUTS_PER_COLLECTION (1<<DESCRIPTOR_CLUT_BITS)
48 
49 /* ---------- collections */
50 
51 enum /* collection numbers */
52 {
53 	_collection_interface, // 0
54 	_collection_weapons_in_hand, // 1
55 	_collection_juggernaut, // 2
56 	_collection_tick, // 3
57 	_collection_rocket, // 4 -- LP: also known as "Explosion Effects"
58 	_collection_hunter, // 5
59 	_collection_player, // 6
60 	_collection_items, // 7
61 	_collection_trooper, // 8
62 	_collection_fighter, // 9
63 	_collection_defender, // 10
64 	_collection_yeti, // 11
65 	_collection_civilian, // 12
66 	_collection_civilian_fusion, // 13 -- LP: formerly _collection_madd
67 	_collection_enforcer, // 14
68 	_collection_hummer, // 15
69 	_collection_compiler, // 16
70 	_collection_walls1, // 17 -- LP: Lh'owon water
71 	_collection_walls2, // 18 -- LP: Lh'owon lava
72 	_collection_walls3, // 19 -- LP: Lh'owon sewage
73 	_collection_walls4, // 20 -- LP: Jjaro
74 	_collection_walls5, // 21 -- LP: Pfhor
75 	_collection_scenery1, // 22 -- LP: Lh'owon water
76 	_collection_scenery2, // 23 -- LP: Lh'owon lava
77 	_collection_scenery3, // 24 -- LP: Lh'owon sewage
78 	_collection_scenery4, // 25 pathways -- LP: Jjaro
79 	_collection_scenery5, // 26 alien -- LP: Pfhor
80 	_collection_landscape1, // 27 day -- LP: Lh'owon day
81 	_collection_landscape2, // 28 night -- LP: Lh'owon night
82 	_collection_landscape3, // 29 moon -- LP: Lh'owon moon
83 	_collection_landscape4, // 30 -- LP: outer space
84 	_collection_cyborg, // 31
85 
86 	NUMBER_OF_COLLECTIONS
87 };
88 
89 /* ---------- macros */
90 
91 #define GET_DESCRIPTOR_SHAPE(d) ((d)&(uint16)(MAXIMUM_SHAPES_PER_COLLECTION-1))
92 #define GET_DESCRIPTOR_COLLECTION(d) (((d)>>DESCRIPTOR_SHAPE_BITS)&(uint16)((1<<(DESCRIPTOR_COLLECTION_BITS+DESCRIPTOR_CLUT_BITS))-1))
93 #define BUILD_DESCRIPTOR(collection,shape) (((collection)<<DESCRIPTOR_SHAPE_BITS)|(shape))
94 
95 #define BUILD_COLLECTION(collection,clut) ((collection)|(uint16)((clut)<<DESCRIPTOR_COLLECTION_BITS))
96 #define GET_COLLECTION_CLUT(collection) (((collection)>>DESCRIPTOR_COLLECTION_BITS)&(uint16)(MAXIMUM_CLUTS_PER_COLLECTION-1))
97 #define GET_COLLECTION(collection) ((collection)&(MAXIMUM_COLLECTIONS-1))
98 
99 #endif
100