]> icculus.org git repositories - btb/d2x.git/blob - main/gamemine.h
fix a bug introduced with change of 2004-06-26
[btb/d2x.git] / main / gamemine.h
1 /* $Id: gamemine.h,v 1.7 2004-06-26 16:27:17 schaffner 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 #if 0
84 struct mtfi {
85         ushort  fileinfo_signature;
86         ushort  fileinfo_version;
87         int     fileinfo_sizeof;
88 };    // Should be same as first two fields below...
89
90 struct mfi {
91         ushort  fileinfo_signature;
92         ushort  fileinfo_version;
93         int     fileinfo_sizeof;
94         int     header_offset;      // Stuff common to game & editor
95         int     header_size;
96         int     editor_offset;      // Editor specific stuff
97         int     editor_size;
98         int     segment_offset;
99         int     segment_howmany;
100         int     segment_sizeof;
101         int     newseg_verts_offset;
102         int     newseg_verts_howmany;
103         int     newseg_verts_sizeof;
104         int     group_offset;
105         int     group_howmany;
106         int     group_sizeof;
107         int     vertex_offset;
108         int     vertex_howmany;
109         int     vertex_sizeof;
110         int     texture_offset;
111         int     texture_howmany;
112         int     texture_sizeof;
113         int     walls_offset;
114         int     walls_howmany;
115         int     walls_sizeof;
116         int     triggers_offset;
117         int     triggers_howmany;
118         int     triggers_sizeof;
119         int     links_offset;
120         int     links_howmany;
121         int     links_sizeof;
122         int     object_offset;      // Object info
123         int     object_howmany;
124         int     object_sizeof;
125         int     unused_offset;      // was: doors_offset
126         int     unused_howmamy;     // was: doors_howmany
127         int     unused_sizeof;      // was: doors_sizeof
128         short   level_shake_frequency, level_shake_duration;
129         // Shakes every level_shake_frequency seconds
130         // for level_shake_duration seconds (on average, random).  In 16ths second.
131         int     secret_return_segment;
132         vms_matrix secret_return_orient;
133
134         int     dl_indices_offset;
135         int     dl_indices_howmany;
136         int     dl_indices_sizeof;
137
138         int     delta_light_offset;
139         int     delta_light_howmany;
140         int     delta_light_sizeof;
141
142         int     segment2_offset;
143         int     segment2_howmany;
144         int     segment2_sizeof;
145 };
146 #endif // 0
147
148 struct mh {
149         int num_vertices;
150         int num_segments;
151 };
152
153 struct me {
154         int current_seg;
155         int newsegment_offset;
156         int newsegment_size;
157         int Curside;
158         int Markedsegp;
159         int Markedside;
160         int Groupsegp[10];
161         int Groupside[10];
162         int num_groups;
163         int current_group;
164         //int num_objects;
165 };
166
167 extern struct mtfi mine_top_fileinfo;   // Should be same as first two fields below...
168 extern struct mfi mine_fileinfo;
169 extern struct mh mine_header;
170 extern struct me mine_editor;
171
172 // returns 1 if error, else 0
173 int game_load_mine(char * filename);
174
175 // loads from an already-open file
176 // returns 0=everything ok, 1=old version, -1=error
177 int load_mine_data(CFILE *LoadFile);
178 int load_mine_data_compiled(CFILE *LoadFile);
179
180 extern short tmap_xlate_table[];
181 extern fix Level_shake_frequency, Level_shake_duration;
182 extern int Secret_return_segment;
183 extern vms_matrix Secret_return_orient;
184
185 /* stuff for loading descent.pig of descent 1 */
186 extern short convert_d1_tmap_num(short d1_tmap_num);
187 extern int d1_tmap_num_unique(short d1_tmap_num); //is d1_tmap_num's texture only in d1?
188
189 #endif /* _GAMEMINE_H */