Debian Codegraph @

common/main/gamemine.h

raw
1 /*
2 * Portions of this file are copyright Rebirth contributors and licensed as
3 * described in COPYING.txt.
4 * Portions of this file are copyright Parallax Software and licensed
5 * according to the Parallax license below.
6 * See COPYING.txt for license details.
7
8 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
9 SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
10 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
11 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
12 IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
13 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
14 FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
15 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
16 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
17 COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
18 */
19
20 /*
21 *
22 * Header for gamemine.c
23 *
24 */
25
26 #pragma once
27
28 #include "fwd-segment.h"
29 #include "maths.h"
30 #include "physfsx.h"
31
32 #ifdef DXX_BUILD_DESCENT
33 #if DXX_BUILD_DESCENT == 1
34 #define MINE_VERSION 17 // Current version expected
35 #elif DXX_BUILD_DESCENT == 2
36 #define MINE_VERSION 20 // Current version expected
37 #include "vecmat.h"
38 #endif
39 #endif
40 #define COMPATIBLE_VERSION 16 // Oldest version that can safely be loaded.
41
42 #if DXX_USE_EDITOR
43 struct mtfi {
44 ushort fileinfo_signature;
45 ushort fileinfo_version;
46 int fileinfo_sizeof;
47 }; // Should be same as first two fields below...
48
49 #ifdef DXX_BUILD_DESCENT
50 struct mfi {
51 ushort fileinfo_signature;
52 ushort fileinfo_version;
53 int fileinfo_sizeof;
54 int header_offset; // Stuff common to game & editor
55 int header_size;
56 int editor_offset; // Editor specific stuff
57 int editor_size;
58 int segment_offset;
59 int segment_howmany;
60 int segment_sizeof;
61 int newseg_verts_offset;
62 int newseg_verts_howmany;
63 int newseg_verts_sizeof;
64 int group_offset;
65 int group_howmany;
66 int group_sizeof;
67 int vertex_offset;
68 unsigned vertex_howmany;
69 int vertex_sizeof;
70 int texture_offset;
71 uint32_t texture_howmany;
72 int texture_sizeof;
73 int walls_offset;
74 int walls_howmany;
75 int walls_sizeof;
76 int triggers_offset;
77 int triggers_howmany;
78 int triggers_sizeof;
79 int links_offset;
80 int links_howmany;
81 int links_sizeof;
82 int object_offset; // Object info
83 int object_howmany;
84 int object_sizeof;
85 int unused_offset; // was: doors_offset
86 int unused_howmamy; // was: doors_howmany
87 int unused_sizeof; // was: doors_sizeof
88 #if DXX_BUILD_DESCENT == 2
89 short level_shake_frequency, level_shake_duration;
90 // Shakes every level_shake_frequency seconds
91 // for level_shake_duration seconds (on average, random). In 16ths second.
92 int secret_return_segment;
93 vms_matrix secret_return_orient;
94
95 int dl_indices_offset;
96 int dl_indices_howmany;
97 int dl_indices_sizeof;
98
99 int delta_light_offset;
100 int delta_light_howmany;
101 int delta_light_sizeof;
102
103 int segment2_offset;
104 int segment2_howmany;
105 int segment2_sizeof;
106 #endif
107 };
108 #endif
109 #endif // EDITOR
110
111 struct mh {
112 int num_vertices;
113 int num_segments;
114 };
115
116 struct me {
117 int current_seg;
118 int newsegment_offset;
119 int newsegment_size;
120 int Curside;
121 int Markedsegp;
122 int Markedside;
123 int Groupsegp[10];
124 int Groupside[10];
125 int num_groups;
126 int current_group;
127 //int num_objects;
128 };
129
130 extern struct mtfi mine_top_fileinfo; // Should be same as first two fields below...
131 extern struct mfi mine_fileinfo;
132 extern struct mh mine_header;
133 extern struct me mine_editor;
134
135 // loads from an already-open file
136 // returns 0=everything ok, 1=old version, -1=error
137 #ifdef DXX_BUILD_DESCENT
138 namespace dsx {
139 int load_mine_data_compiled(NamedPHYSFS_File LoadFile, const char *Gamesave_current_filename);
140 }
141
142 #if DXX_BUILD_DESCENT == 2
143 namespace dsx {
144
145 extern uint8_t d1_pig_present;
146
147 /* stuff for loading descent.pig of descent 1 */
148 texture_index convert_d1_tmap_num(texture_index d1_tmap_num);
149
150 }
151 #endif
152 #endif