1 #ifndef __TAGS_H
2 #define __TAGS_H
3 
4 #include "cstypes.h"
5 
6 /*
7 	TAGS.H
8 
9 	Copyright (C) 1991-2001 and beyond by Bungie Studios, Inc.
10 	and the "Aleph One" developers.
11 
12 	This program is free software; you can redistribute it and/or modify
13 	it under the terms of the GNU General Public License as published by
14 	the Free Software Foundation; either version 3 of the License, or
15 	(at your option) any later version.
16 
17 	This program is distributed in the hope that it will be useful,
18 	but WITHOUT ANY WARRANTY; without even the implied warranty of
19 	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 	GNU General Public License for more details.
21 
22 	This license is contained in the file "COPYING",
23 	which is included with this source code; it is available online at
24 	http://www.gnu.org/licenses/gpl.html
25 
26 	Sunday, July 3, 1994 5:33:15 PM
27 
28 	This is a list of all of the tags used by code that uses the wad file format.
29 	One tag, KEY_TAG, has special meaning, and KEY_TAG_SIZE must be set to the
30 	size of an index entry.  Each wad can only have one index entry.  You can get the
31 	index entry from a wad, or from all of the wads in the file easily.
32 
33 	Marathon uses the KEY_TAG as the name of the level.
34 
35 Feb 2, 2000 (Loren Petrich):
36 	Changed application creator to 26.A "Aleph One"
37 	Changed soundfile type to 'snd�' to be Marathon-Infinity compatible
38 
39 Feb 3, 2000 (Loren Petrich):
40 	Changed shapes-file type to 'shp�' to be Marathon-Infinity compatible
41 
42 Feb 4, 2000 (Loren Petrich):
43 	Changed most of the other 2's to �'s to be Marathon-Infinity compatible,
44 	except for the map file type.
45 
46 Feb 6, 2000 (Loren Petrich):
47 	Added loading of typecodes from the resource fork
48 
49 Aug 21, 2000 (Loren Petrich):
50 	Added a preferences filetype
51 
52 Aug 22, 2000 (Loren Petrich):
53 	Added an images filetype
54 
55 Aug 28, 2000 (Loren Petrich):
56 	get_typecode() now defaults to '????' for unrecognized typecodes
57 
58 Mar 14, 2001 (Loren Petrich):
59 	Added a music filetype
60 
61 Jul 4, 2002 (Loren Petrich):
62 	Added a "set" function for the typecode
63 */
64 
65 #include <vector>
66 
67 #define MAXIMUM_LEVEL_NAME_SIZE 64
68 
69 /* OSTypes.. */
70 // LP change: moved values to filetypes_macintosh.c
71 enum Typecode {
72 	_typecode_unknown= NONE,
73 	_typecode_creator= 0,
74 	_typecode_scenario,
75 	_typecode_savegame,
76 	_typecode_film,
77 	_typecode_physics,
78 	_typecode_shapes,
79 	_typecode_sounds,
80 	_typecode_patch,
81 	_typecode_images,
82 	_typecode_preferences,
83 	_typecode_music,
84 	_typecode_theme,	// pseudo type code
85 	_typecode_netscript,	// ZZZ pseudo typecode
86 	_typecode_shapespatch,
87 	_typecode_movie,
88 	NUMBER_OF_TYPECODES
89 };
90 
91 // LP addition: typecode handling
92 // Initializer: loads from resource fork
93 void initialize_typecodes();
94 
95 // Accessors
96 uint32 get_typecode(Typecode which);
97 void set_typecode(Typecode which, uint32 _type);
98 
99 // These are no longer constants, which will cause trouble for switch/case constructions
100 // These have been eliminated in favor of using the above enum of abstracted filetypes
101 // as much as possible
102 /*
103 #define APPLICATION_CREATOR (get_typecode(_typecode_creator))
104 #define SCENARIO_FILE_TYPE (get_typecode(_typecode_scenario))
105 #define SAVE_GAME_TYPE (get_typecode(_typecode_savegame))
106 #define FILM_FILE_TYPE (get_typecode(_typecode_film))
107 #define PHYSICS_FILE_TYPE (get_typecode(_typecode_physics))
108 #define SHAPES_FILE_TYPE (get_typecode(_typecode_shapes))
109 #define SOUNDS_FILE_TYPE (get_typecode(_typecode_sounds))
110 #define PATCH_FILE_TYPE (get_typecode(_typecode_patch))
111 #define IMAGES_FILE_TYPE (get_typecode(_typcode_images))
112 #define PREFERENCES_FILE_TYPE (get_typecode(_typecode_prefs))
113 */
114 
115 /* Other tags-  */
116 #define POINT_TAG FOUR_CHARS_TO_INT('P','N','T','S')
117 #define LINE_TAG FOUR_CHARS_TO_INT('L','I','N','S')
118 #define SIDE_TAG FOUR_CHARS_TO_INT('S','I','D','S')
119 #define POLYGON_TAG FOUR_CHARS_TO_INT('P','O','L','Y')
120 #define LIGHTSOURCE_TAG FOUR_CHARS_TO_INT('L','I','T','E')
121 #define ANNOTATION_TAG FOUR_CHARS_TO_INT('N','O','T','E')
122 #define OBJECT_TAG FOUR_CHARS_TO_INT('O','B','J','S')
123 #define GUARDPATH_TAG FOUR_CHARS_TO_INT('p','\x8c','t','h')
124 #define MAP_INFO_TAG FOUR_CHARS_TO_INT('M','i','n','f')
125 #define ITEM_PLACEMENT_STRUCTURE_TAG FOUR_CHARS_TO_INT('p','l','a','c')
126 #define DOOR_EXTRA_DATA_TAG FOUR_CHARS_TO_INT('d','o','o','r')
127 #define PLATFORM_STATIC_DATA_TAG FOUR_CHARS_TO_INT('p','l','a','t')
128 #define ENDPOINT_DATA_TAG FOUR_CHARS_TO_INT('E','P','N','T')
129 #define MEDIA_TAG FOUR_CHARS_TO_INT('m','e','d','i')
130 #define AMBIENT_SOUND_TAG FOUR_CHARS_TO_INT('a','m','b','i')
131 #define RANDOM_SOUND_TAG FOUR_CHARS_TO_INT('b','o','n','k')
132 #define TERMINAL_DATA_TAG FOUR_CHARS_TO_INT('t','e','r','m')
133 
134 /* Save/Load game tags. */
135 #define PLAYER_STRUCTURE_TAG FOUR_CHARS_TO_INT('p','l','y','r')
136 #define DYNAMIC_STRUCTURE_TAG FOUR_CHARS_TO_INT('d','w','o','l')
137 #define OBJECT_STRUCTURE_TAG FOUR_CHARS_TO_INT('m','o','b','j')
138 #define DOOR_STRUCTURE_TAG FOUR_CHARS_TO_INT('d','o','o','r')
139 #define MAP_INDEXES_TAG FOUR_CHARS_TO_INT('i','i','d','x')
140 #define AUTOMAP_LINES FOUR_CHARS_TO_INT('a','l','i','n')
141 #define AUTOMAP_POLYGONS FOUR_CHARS_TO_INT('a','p','o','l')
142 #define MONSTERS_STRUCTURE_TAG FOUR_CHARS_TO_INT('m','O','n','s')
143 #define EFFECTS_STRUCTURE_TAG FOUR_CHARS_TO_INT('f','x',' ',' ')
144 #define PROJECTILES_STRUCTURE_TAG FOUR_CHARS_TO_INT('b','a','n','g')
145 #define PLATFORM_STRUCTURE_TAG FOUR_CHARS_TO_INT('P','L','A','T')
146 #define WEAPON_STATE_TAG FOUR_CHARS_TO_INT('w','e','a','p')
147 #define TERMINAL_STATE_TAG FOUR_CHARS_TO_INT('c','i','n','t')
148 #define LUA_STATE_TAG FOUR_CHARS_TO_INT('s','l','u','a')
149 
150 /* Save metadata tags */
151 #define SAVE_META_TAG FOUR_CHARS_TO_INT('S', 'M', 'E', 'T')
152 #define SAVE_IMG_TAG FOUR_CHARS_TO_INT('S', 'I', 'M', 'G')
153 
154 /* Physix model tags */
155 #define MONSTER_PHYSICS_TAG FOUR_CHARS_TO_INT('M','N','p','x')
156 #define EFFECTS_PHYSICS_TAG FOUR_CHARS_TO_INT('F','X','p','x')
157 #define PROJECTILE_PHYSICS_TAG FOUR_CHARS_TO_INT('P','R','p','x')
158 #define PHYSICS_PHYSICS_TAG FOUR_CHARS_TO_INT('P','X','p','x')
159 #define WEAPONS_PHYSICS_TAG FOUR_CHARS_TO_INT('W','P','p','x')
160 
161 #define M1_MONSTER_PHYSICS_TAG FOUR_CHARS_TO_INT('m','o','n','s')
162 #define M1_EFFECTS_PHYSICS_TAG FOUR_CHARS_TO_INT('e','f','f','e')
163 #define M1_PROJECTILE_PHYSICS_TAG FOUR_CHARS_TO_INT('p','r','o','j')
164 #define M1_PHYSICS_PHYSICS_TAG FOUR_CHARS_TO_INT('p','h','y','s')
165 #define M1_WEAPONS_PHYSICS_TAG FOUR_CHARS_TO_INT('w','e','a','p')
166 
167 /* Embedded shapes */
168 #define SHAPE_PATCH_TAG FOUR_CHARS_TO_INT('S','h','P','a')
169 
170 /* Embedded scripts */
171 #define MMLS_TAG FOUR_CHARS_TO_INT('M','M','L','S')
172 #define LUAS_TAG FOUR_CHARS_TO_INT('L','U','A','S')
173 
174 /* Preferences Tags.. */
175 #define prefGRAPHICS_TAG FOUR_CHARS_TO_INT('g','r','a','f')
176 #define prefSERIAL_TAG FOUR_CHARS_TO_INT('s','e','r','l')
177 #define prefNETWORK_TAG FOUR_CHARS_TO_INT('n','e','t','w')
178 #define prefPLAYER_TAG FOUR_CHARS_TO_INT('p','l','y','r')
179 #define prefINPUT_TAG FOUR_CHARS_TO_INT('i','n','p','u')
180 #define prefSOUND_TAG FOUR_CHARS_TO_INT('s','n','d',' ')
181 #define prefENVIRONMENT_TAG FOUR_CHARS_TO_INT('e','n','v','r')
182 
183 #endif
184