]> icculus.org git repositories - btb/d2x.git/blob - main/gamemine.h
added pigsize for registered d1 v1.0
[btb/d2x.git] / main / gamemine.h
1 /* $Id: gamemine.h,v 1.6 2003-10-10 09:36:35 btb Exp $ */
2 /*
3 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
4 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
5 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
6 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
7 IN USING, DISPLAYING,  AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
8 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
9 FREE PURPOSES.  IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
10 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES.  THE END-USER UNDERSTANDS
11 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
12 COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
13 */
14
15 /*
16  *
17  * Header for gamemine.c
18  *
19  * Old Log:
20  * Revision 1.1  1995/05/16  15:57:02  allender
21  * Initial revision
22  *
23  * Revision 2.0  1995/02/27  11:28:50  john
24  * New version 2.0, which has no anonymous unions, builds with
25  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
26  *
27  * Revision 1.15  1994/11/17  11:39:34  matt
28  * Ripped out code to load old mines
29  *
30  * Revision 1.14  1994/10/19  16:46:40  matt
31  * Made tmap overrides for robots remap texture numbers
32  *
33  * Revision 1.13  1994/09/23  22:14:37  matt
34  * Took out obsolete structure fields
35  *
36  * Revision 1.12  1994/07/22  12:36:32  matt
37  * Cleaned up editor/game interactions some more.
38  *
39  * Revision 1.11  1994/06/01  11:21:37  yuan
40  * Added controlcentertriggers to the gamesave.
41  *
42  * Revision 1.10  1994/05/10  12:14:26  yuan
43  * Game save/load... Demo levels 1-5 added...
44  * High scores fixed...
45  *
46  * Revision 1.9  1994/05/04  18:25:05  yuan
47  * Working on gamesave.
48  *
49  * Revision 1.8  1994/05/03  15:53:27  yuan
50  * Readded structure field groups for backward compatibility...
51  *
52  * Revision 1.7  1994/05/03  11:36:26  yuan
53  * Stabilizing gamesave stuff.
54  *
55  * Revision 1.6  1994/04/28  11:01:32  yuan
56  * Added objects in structure.
57  *
58  * Revision 1.5  1994/04/06  18:30:03  john
59  * Added Refueling segments.
60  *
61  * Revision 1.4  1994/03/17  18:06:53  yuan
62  * Removed switch code... Now we just have Walls, Triggers, and Links...
63  *
64  * Revision 1.3  1994/03/01  18:12:24  yuan
65  * Wallswitches, triggers, and more!
66  *
67  * Revision 1.2  1994/02/10  15:36:01  matt
68  * Various changes to make editor compile out.
69  *
70  * Revision 1.1  1994/02/09  17:11:45  matt
71  * Initial revision
72  *
73  *
74  */
75
76
77 #ifndef _GAMEMINE_H
78 #define _GAMEMINE_H
79
80 #define MINE_VERSION        20  // Current version expected
81 #define COMPATIBLE_VERSION  16  // Oldest version that can safely be loaded.
82
83 struct mtfi {
84         ushort  fileinfo_signature;
85         ushort  fileinfo_version;
86         int     fileinfo_sizeof;
87 };    // Should be same as first two fields below...
88
89 struct mfi {
90         ushort  fileinfo_signature;
91         ushort  fileinfo_version;
92         int     fileinfo_sizeof;
93         int     header_offset;      // Stuff common to game & editor
94         int     header_size;
95         int     editor_offset;      // Editor specific stuff
96         int     editor_size;
97         int     segment_offset;
98         int     segment_howmany;
99         int     segment_sizeof;
100         int     newseg_verts_offset;
101         int     newseg_verts_howmany;
102         int     newseg_verts_sizeof;
103         int     group_offset;
104         int     group_howmany;
105         int     group_sizeof;
106         int     vertex_offset;
107         int     vertex_howmany;
108         int     vertex_sizeof;
109         int     texture_offset;
110         int     texture_howmany;
111         int     texture_sizeof;
112         int     walls_offset;
113         int     walls_howmany;
114         int     walls_sizeof;
115         int     triggers_offset;
116         int     triggers_howmany;
117         int     triggers_sizeof;
118         int     links_offset;
119         int     links_howmany;
120         int     links_sizeof;
121         int     object_offset;      // Object info
122         int     object_howmany;
123         int     object_sizeof;
124         int     unused_offset;      // was: doors_offset
125         int     unused_howmamy;     // was: doors_howmany
126         int     unused_sizeof;      // was: doors_sizeof
127         short   level_shake_frequency, level_shake_duration;
128         // Shakes every level_shake_frequency seconds
129         // for level_shake_duration seconds (on average, random).  In 16ths second.
130         int     secret_return_segment;
131         vms_matrix secret_return_orient;
132
133         int     dl_indices_offset;
134         int     dl_indices_howmany;
135         int     dl_indices_sizeof;
136
137         int     delta_light_offset;
138         int     delta_light_howmany;
139         int     delta_light_sizeof;
140
141         int     segment2_offset;
142         int     segment2_howmany;
143         int     segment2_sizeof;
144
145 };
146
147 struct mh {
148         int num_vertices;
149         int num_segments;
150 };
151
152 struct me {
153         int current_seg;
154         int newsegment_offset;
155         int newsegment_size;
156         int Curside;
157         int Markedsegp;
158         int Markedside;
159         int Groupsegp[10];
160         int Groupside[10];
161         int num_groups;
162         int current_group;
163         //int num_objects;
164 };
165
166 extern struct mtfi mine_top_fileinfo;   // Should be same as first two fields below...
167 extern struct mfi mine_fileinfo;
168 extern struct mh mine_header;
169 extern struct me mine_editor;
170
171 // returns 1 if error, else 0
172 int game_load_mine(char * filename);
173
174 // loads from an already-open file
175 // returns 0=everything ok, 1=old version, -1=error
176 int load_mine_data(CFILE *LoadFile);
177 int load_mine_data_compiled(CFILE *LoadFile);
178
179 extern short tmap_xlate_table[];
180 extern fix Level_shake_frequency, Level_shake_duration;
181 extern int Secret_return_segment;
182 extern vms_matrix Secret_return_orient;
183
184 /* stuff for loading descent.pig of descent 1 */
185 extern short convert_d1_tmap_num(short d1_tmap_num);
186 extern int d1_tmap_num_unique(short d1_tmap_num); //is d1_tmap_num's texture only in d1?
187
188 #endif /* _GAMEMINE_H */