]> icculus.org git repositories - btb/d2x.git/blob - main/gamemine.h
these routines are in tmerge.c
[btb/d2x.git] / main / gamemine.h
1 /* $Id: gamemine.h,v 1.3 2002-08-02 23:28:40 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 #ifndef _GAMEMINE_H
18 #define _GAMEMINE_H
19
20 #define MINE_VERSION                                    20      // Current version expected
21 #define COMPATIBLE_VERSION              16 // Oldest version that can safely be loaded.
22
23 struct mtfi {
24         ushort  fileinfo_signature;
25         ushort  fileinfo_version;
26         int     fileinfo_sizeof;
27 };    // Should be same as first two fields below...
28
29 struct mfi {
30         ushort  fileinfo_signature;
31         ushort  fileinfo_version;
32         int             fileinfo_sizeof;
33         int             header_offset;          // Stuff common to game & editor
34         int             header_size;
35         int             editor_offset;   // Editor specific stuff
36         int             editor_size;
37         int             segment_offset;
38         int             segment_howmany;
39         int             segment_sizeof;
40         int             newseg_verts_offset;
41         int             newseg_verts_howmany;
42         int             newseg_verts_sizeof;
43         int             group_offset;
44         int             group_howmany;
45         int             group_sizeof;
46         int             vertex_offset;
47         int             vertex_howmany;
48         int             vertex_sizeof;
49         int             texture_offset;
50         int             texture_howmany;
51         int             texture_sizeof;
52         int             walls_offset;
53         int             walls_howmany;
54         int             walls_sizeof;
55         int             triggers_offset;
56         int             triggers_howmany;
57         int             triggers_sizeof;
58         int             links_offset;
59         int             links_howmany;
60         int             links_sizeof;
61         int             object_offset;                          // Object info
62         int             object_howmany;
63         int             object_sizeof;
64         int             unused_offset;                  //was: doors_offset
65         int             unused_howmamy;         //was: doors_howmany
66         int             unused_sizeof;                  //was: doors_sizeof
67         short   level_shake_frequency, level_shake_duration;    //      Shakes every level_shake_frequency seconds
68                                                                                                                                                         // for level_shake_duration seconds (on average, random).  In 16ths second.
69         int             secret_return_segment;
70         vms_matrix      secret_return_orient;
71
72         int             dl_indices_offset;
73         int             dl_indices_howmany;
74         int             dl_indices_sizeof;
75
76         int             delta_light_offset;
77         int             delta_light_howmany;
78         int             delta_light_sizeof;
79
80         int             segment2_offset;
81         int             segment2_howmany;
82         int             segment2_sizeof;
83
84 };
85
86 struct mh {
87         int     num_vertices;
88         int     num_segments;
89 };
90
91 struct me {
92         int current_seg;
93         int newsegment_offset;
94         int newsegment_size;
95         int Curside;
96         int Markedsegp;
97         int Markedside;
98         int Groupsegp[10];
99         int Groupside[10];
100         int num_groups;
101         int current_group;
102 //      int num_objects;
103 };
104
105 extern struct mtfi mine_top_fileinfo;    // Should be same as first two fields below...
106 extern struct mfi mine_fileinfo;
107 extern struct mh mine_header;
108 extern struct me mine_editor;
109
110 // returns 1 if error, else 0
111 int game_load_mine(char * filename);
112
113 //loads from an already-open file
114 // returns 0=everything ok, 1=old version, -1=error
115 int load_mine_data(CFILE *LoadFile);
116 int load_mine_data_compiled(CFILE *LoadFile);
117
118 extern short tmap_xlate_table[];
119 extern fix Level_shake_frequency, Level_shake_duration;
120 extern int Secret_return_segment;
121 extern vms_matrix Secret_return_orient;
122 #endif