Debian Codegraph @

manage/shippage.cpp

raw symbols SCIP
1 /*
2 * Descent 3
3 * Copyright (C) 2024 Parallax Software
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 --- HISTORICAL COMMENTS FOLLOW ---
19
20 * $Logfile: /DescentIII/Main/manage/shippage.cpp $
21 * $Revision: 46 $
22 * $Date: 10/22/01 12:41p $
23 * $Author: Matt $
24 *
25 * $Log: /DescentIII/Main/manage/shippage.cpp $
26 *
27 * 46 10/22/01 12:41p Matt
28 * After loading a ship model to check for errors, unload it so it can get
29 * loaded again later after the textures have been read in.
30 *
31 * 45 10/08/01 4:20p Matt
32 * Added system to check for errors when reading in add-on data.
33 *
34 * 44 9/06/01 10:32a Matt
35 * Added code to fix problem poping add-on pages when the original pages
36 * were in the extra.gam file.
37 *
38 * 43 4/19/00 5:07p Matt
39 * From Duane for 1.4
40 * Added checks, asserts, and fixes for bad return values
41 *
42 * 42 10/26/99 3:30p Jeff
43 * handle extra.gam addon tablefile
44 *
45 * 41 10/20/99 6:27p Jeff
46 * sped up addon page popping (by saving page offsets)
47 *
48 * 40 10/20/99 1:30p Jeff
49 * fixed fusion recharge hack
50 *
51 * 39 8/11/99 5:32p Jeff
52 * changes to fix addon tablefile support so it works correctly
53 *
54 * 38 7/27/99 1:14p Jason
55 * fixed fusion firing time
56 *
57 * 37 5/14/99 11:56a Jeff
58 * fixed copy/paste bug (Jason)
59 *
60 * 36 4/14/99 1:33a Jeff
61 * fixed case mismatched #includes
62 *
63 * 35 3/04/99 4:47p Jason
64 * temp fix (ie BAD HACK) for OEM table file woes
65 *
66 * 34 1/13/99 7:05a Jeff
67 * put #ifdef around #include <windows.h>
68 *
69 * 33 12/29/98 4:30p Jason
70 * added add-on data functionality
71 *
72 * 32 11/13/98 12:30p Jason
73 * changes for weapons
74 *
75 * 31 11/06/98 12:35p Jason
76 * more speedups for manage system
77 *
78 * 30 11/05/98 7:55p Jason
79 * changes for new manage system
80 *
81 * 29 11/03/98 6:16p Chris
82 * Starting to make on/off and spray weapons accessable to robots
83 *
84 * 28 11/02/98 6:02p Jason
85 * made yes network updates much faster
86 *
87 * 27 10/13/98 12:56p Matt
88 * Finished (hopefully) with the ammo system. Added support for napalm
89 * fuel.
90 *
91 * 26 10/09/98 2:27p Jason
92 * reorganized table file system
93 *
94 * 25 10/02/98 1:47p Jason
95 * added lod player ships
96 *
97 * 24 10/01/98 11:51a Matt
98 * When loading or saving the player ship page, check for spew powerups
99 * that aren't powerups & fix them.
100 *
101 * 23 9/21/98 8:19p Chris
102 * Improved volatile and forcefield hits
103 *
104 * 22 9/10/98 11:53a Jason
105 * added hud config filename to ship page
106 *
107 * 21 8/24/98 2:37p Jason
108 * made table file more efficient with regards to invalid names
109 *
110 * 20 8/14/98 5:25p Jeff
111 * fixed stupid bug setting wrong varible (nothing dangerous)
112 *
113 * 19 8/14/98 4:56p Jeff
114 * added quad fire mask for weapon battery
115 *
116 * 18 8/07/98 2:06p Jason
117 * now saves flags field
118 *
119 * 17 7/31/98 5:23p Jason
120 * added ship armor scalars
121 *
122 * 16 6/01/98 10:37a Matt
123 * Added system to spew powerups when the player dies. Still needs Jason
124 * to deal with mng_FindSpecificGenericPage().
125 *
126 * 15 5/04/98 6:08p Jason
127 * sped up predictive pagefile loading
128 *
129 * 14 4/02/98 3:54p Jason
130 * first pass in getting polymodel paging to work
131 *
132 * 13 3/19/98 1:07p Jason
133 * added cockpit name
134 *
135 * 12 2/23/98 1:22p Jason
136 * made FindSpecific* read from the local drive, not the net drive - when
137 * starting the editor
138 *
139 * 11 2/17/98 8:12p Matt
140 * Added looping & release sounds for player weapons
141 *
142 * 10 1/23/98 6:25p Jason
143 * Got spray weapons working
144 *
145 * 9 1/15/98 6:22p Jason
146 * added safety checks so the network won't copy over a primitive you have
147 * held locally
148 *
149 * 8 12/22/97 6:19p Chris
150 * Moved weapon battery firing sound off the projectile (weapon) and into
151 * the weapon battery.
152 *
153 * 7 11/12/97 5:35p Jason
154 * made energy/ammo usage work with weapon batteries
155 *
156 * 6 11/12/97 1:13p Jason
157 * added weapons that can ramp up
158 *
159 * 5 11/05/97 12:22p Chris
160 * Fixed size of wb_info in the page file
161 *
162 * 4 11/05/97 10:45a Chris
163 * Now init's the ship struct to zero (and fills in some values) before
164 * reading.
165 *
166 * 3 11/04/97 6:18p Chris
167 * Added support so that the player ship uses the robot's firing dialog.
168 *
169 * 2 10/21/97 11:57a Jason
170 * added ability to set dying model for player ship
171 *
172 * 8 5/08/97 12:41p Jason
173 * made manage system work with device dependant path names
174 *
175 * 7 4/25/97 6:16p Jason
176 * added switcheroo function
177 *
178 * 6 4/09/97 9:57p Chris
179 * Added more ability to customize ships/objects.
180 *
181 * 5 4/08/97 1:16a Chris
182 * Fixed the bug with initial values for some items being random. It also
183 * fixed a intermitent bug that was caused because the used flag was
184 * random... we wanted it to be 1 (non-zero), but it was random so there
185 * was a chance it could be zero(1 in 2^(sizeof(used_flag)))
186 *
187 * 4 4/07/97 3:13p Chris
188 *
189 * 3 4/04/97 2:44p Matt
190 * Changed object pages to store physics info in a physics_info structure.
191 *
192 * 2 3/31/97 4:34p Jason
193 * added player ship page
194 *
195 * 1 3/31/97 12:10p Jason
196 * Page file for player ship management
197 *
198 * $NoKeywords: $
199 */
200
201 #include <cstring>
202 #include <filesystem>
203
204 #include "cfile.h"cxx . . $ `<file>/cfile/cfile.h`/
205 #include "manage.h"cxx . . $ `<file>/lib/manage.h`/
206 #include "ship.h"cxx . . $ `<file>/Descent3/ship.h`/
207 #include "shippage.h"cxx . . $ `<file>/manage/shippage.h`/
208 #include "mono.h"cxx . . $ `<file>/ddebug/mono.h`/
209 #include "pserror.h"cxx . . $ `<file>/misc/pserror.h`/
210 #include "polymodel.h"cxx . . $ `<file>/model/polymodel.h`/
211 #include "ddio.h"cxx . . $ `<file>/ddio/ddio.h`/
212 #include "robotfire.h"cxx . . $ `<file>/Descent3/robotfire.h`/
213 #include "weaponpage.h"cxx . . $ `<file>/manage/weaponpage.h`/
214 #include "soundload.h"cxx . . $ `<file>/sndlib/soundload.h`/
215 #include "sounds.h"cxx . . $ `<file>/Descent3/sounds.h`/
216 #include "soundpage.h"cxx . . $ `<file>/manage/soundpage.h`/
217 #include "genericpage.h"cxx . . $ `<file>/manage/genericpage.h`/
218 #include "args.h"cxx . . $ `<file>/Descent3/args.h`/
219
220 // shippage commands that are read/written
221 // A command is followed by a byte count describing how many bytes
222 // are in the data for the command
223 #define SHIPPAGE_COMMAND_NAMEcxx . . $ `manage/shippage.cpp:223:9`! 1
224 #define SHIPPAGE_COMMAND_ENDcxx . . $ `manage/shippage.cpp:224:9`! 2
225 #define SHIPPAGE_COMMAND_IMAGE_NAMEcxx . . $ `manage/shippage.cpp:225:9`! 3
226 #define SHIPPAGE_COMMAND_VERSIONcxx . . $ `manage/shippage.cpp:226:9`! 4
227 #define SHIPPAGE_COMMAND_MASScxx . . $ `manage/shippage.cpp:227:9`! 5
228 #define SHIPPAGE_COMMAND_DRAGcxx . . $ `manage/shippage.cpp:228:9`! 6
229 #define SHIPPAGE_COMMAND_SIZEcxx . . $ `manage/shippage.cpp:229:9`! 7
230 #define SHIPPAGE_COMMAND_WIGGLE_AMPLITUDEcxx . . $ `manage/shippage.cpp:230:9`! 8
231 #define SHIPPAGE_COMMAND_THRUSTcxx . . $ `manage/shippage.cpp:231:9`! 9
232 #define SHIPPAGE_COMMAND_ROTTHRUSTcxx . . $ `manage/shippage.cpp:232:9`! 10
233 #define SHIPPAGE_COMMAND_TURNROLLRATEcxx . . $ `manage/shippage.cpp:233:9`! 11
234 #define SHIPPAGE_COMMAND_ROTDRAGcxx . . $ `manage/shippage.cpp:234:9`! 12
235 #define SHIPPAGE_COMMAND_PHYSICS_FLAGScxx . . $ `manage/shippage.cpp:235:9`! 13
236 #define SHIPPAGE_COMMAND_WIGGLE_PER_SECcxx . . $ `manage/shippage.cpp:236:9`! 14
237 #define SHIPPAGE_COMMAND_TURNROLL_RATIOcxx . . $ `manage/shippage.cpp:237:9`! 15
238 #define SHIPPAGE_COMMAND_DYING_IMAGE_NAMEcxx . . $ `manage/shippage.cpp:238:9`! 16
239 #define SHIPPAGE_COMMAND_WB_INFOcxx . . $ `manage/shippage.cpp:239:9`! 17
240 #define SHIPPAGE_COMMAND_WB_WEAPONcxx . . $ `manage/shippage.cpp:240:9`! 18
241 #define SHIPPAGE_COMMAND_FIRE_FLAGScxx . . $ `manage/shippage.cpp:241:9`! 19
242 #define SHIPPAGE_COMMAND_RESOURCE_USAGEcxx . . $ `manage/shippage.cpp:242:9`! 20
243 #define SHIPPAGE_COMMAND_WB_FIRE_SOUNDcxx . . $ `manage/shippage.cpp:243:9`! 21
244 #define SHIPPAGE_COMMAND_WB_FLAGScxx . . $ `manage/shippage.cpp:244:9`! 22
245 #define SHIPPAGE_COMMAND_FIRING_SOUNDcxx . . $ `manage/shippage.cpp:245:9`! 23
246 #define SHIPPAGE_COMMAND_RELEASE_SOUNDcxx . . $ `manage/shippage.cpp:246:9`! 24
247 #define SHIPPAGE_COMMAND_COCKPIT_NAMEcxx . . $ `manage/shippage.cpp:247:9`! 25
248 #define SHIPPAGE_COMMAND_SPEW_POWERUPcxx . . $ `manage/shippage.cpp:248:9`! 26
249 #define SHIPPAGE_COMMAND_ARMOR_SCALARcxx . . $ `manage/shippage.cpp:249:9`! 27
250 #define SHIPPAGE_COMMAND_FLAGScxx . . $ `manage/shippage.cpp:250:9`! 28
251 #define SHIPPAGE_COMMAND_WB_QUADMASKcxx . . $ `manage/shippage.cpp:251:9`! 29
252 #define SHIPPAGE_COMMAND_HUD_NAMEcxx . . $ `manage/shippage.cpp:252:9`! 30
253 #define SHIPPAGE_COMMAND_LOD_MODELScxx . . $ `manage/shippage.cpp:253:9`! 31
254 #define SHIPPAGE_COMMAND_LOD_DISTANCEcxx . . $ `manage/shippage.cpp:254:9`! 32
255 #define SHIPPAGE_COMMAND_MAX_AMMOcxx . . $ `manage/shippage.cpp:255:9`! 33
256
257 #define SHIPPAGE_VERSIONcxx . . $ `manage/shippage.cpp:257:9`! 6
258
259 extern char *TablefileNameOverridecxx . . $ TablefileNameOverride.;
260
261 // Given an open file pointer and a ship_page struct, writes that ship page out
262 void mng_WriteShipPagecxx . . $ mng_WriteShipPage(d82cdf4b89141491).(CFILEcxx . . $ CFILE# *outfile, mngs_ship_pagecxx . . $ mngs_ship_page# *shippage) {
263 int i;
264 int j;
265 int size;
266
267 ASSERTcxx . . $ `misc/pserror.h:246:9`!(outfile != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
268 ASSERTcxx . . $ `misc/pserror.h:246:9`!(shippage != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
269
270 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, PAGETYPE_SHIPcxx . . $ `lib/manage.h:54:9`!);
271
272 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, SHIPPAGE_COMMAND_VERSIONcxx . . $ `manage/shippage.cpp:226:9`!);
273 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, 1);
274 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, SHIPPAGE_VERSIONcxx . . $ `manage/shippage.cpp:257:9`!);
275
276 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, SHIPPAGE_COMMAND_NAMEcxx . . $ `manage/shippage.cpp:223:9`!); // write out ship name
277 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!);
278 for (i = 0; i < PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!; i++)
279 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..namecxx . . $ ship#name.[i]);
280
281 // Write out cockpit name
282 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, SHIPPAGE_COMMAND_COCKPIT_NAMEcxx . . $ `manage/shippage.cpp:247:9`!); // write out ship name
283 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, strlen(shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..cockpit_namecxx . . $ ship#cockpit_name.) + 1);
284 cf_WriteStringcxx . . $ cf_WriteString(643e1411966bd56c).(outfile, shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..cockpit_namecxx . . $ ship#cockpit_name.);
285
286 // Write out hud config name
287 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, SHIPPAGE_COMMAND_HUD_NAMEcxx . . $ `manage/shippage.cpp:252:9`!); // write out ship name
288 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, strlen(shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..hud_config_namecxx . . $ ship#hud_config_name.) + 1);
289 cf_WriteStringcxx . . $ cf_WriteString(643e1411966bd56c).(outfile, shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..hud_config_namecxx . . $ ship#hud_config_name.);
290
291 // Write out its models name
292 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, SHIPPAGE_COMMAND_IMAGE_NAMEcxx . . $ `manage/shippage.cpp:225:9`!); // get ready to write out name
293 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!);
294 for (i = 0; i < PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!; i++)
295 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, shippage->image_namecxx . . $ mngs_ship_page#image_name.[i]);
296
297 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, SHIPPAGE_COMMAND_DYING_IMAGE_NAMEcxx . . $ `manage/shippage.cpp:238:9`!); // get ready to write out name
298 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, strlen(shippage->dying_image_namecxx . . $ mngs_ship_page#dying_image_name.) + 1);
299 cf_WriteStringcxx . . $ cf_WriteString(643e1411966bd56c).(outfile, shippage->dying_image_namecxx . . $ mngs_ship_page#dying_image_name.);
300
301 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, SHIPPAGE_COMMAND_MASScxx . . $ `manage/shippage.cpp:227:9`!);
302 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, 4);
303 cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..phys_infocxx . . $ ship#phys_info..masscxx . . $ physics_info#mass.);
304
305 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, SHIPPAGE_COMMAND_DRAGcxx . . $ `manage/shippage.cpp:228:9`!);
306 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, 4);
307 cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..phys_infocxx . . $ ship#phys_info..dragcxx . . $ physics_info#drag.);
308
309 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, SHIPPAGE_COMMAND_SIZEcxx . . $ `manage/shippage.cpp:229:9`!);
310 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, 4);
311 cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..sizecxx . . $ ship#size.);
312
313 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, SHIPPAGE_COMMAND_WIGGLE_AMPLITUDEcxx . . $ `manage/shippage.cpp:230:9`!);
314 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, 4);
315 cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..phys_infocxx . . $ ship#phys_info..wiggle_amplitudecxx . . $ physics_info#wiggle_amplitude.);
316
317 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, SHIPPAGE_COMMAND_THRUSTcxx . . $ `manage/shippage.cpp:231:9`!);
318 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, 4);
319 cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..phys_infocxx . . $ ship#phys_info..full_thrustcxx . . $ physics_info#$anonymous_type_3#full_thrust.);
320
321 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, SHIPPAGE_COMMAND_ROTTHRUSTcxx . . $ `manage/shippage.cpp:232:9`!);
322 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, 4);
323 cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..phys_infocxx . . $ ship#phys_info..full_rotthrustcxx . . $ physics_info#$anonymous_type_4#full_rotthrust.);
324
325 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, SHIPPAGE_COMMAND_TURNROLLRATEcxx . . $ `manage/shippage.cpp:233:9`!);
326 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, 4);
327 cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..phys_infocxx . . $ ship#phys_info..max_turnroll_ratecxx . . $ physics_info#max_turnroll_rate.);
328
329 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, SHIPPAGE_COMMAND_ROTDRAGcxx . . $ `manage/shippage.cpp:234:9`!);
330 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, 4);
331 cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..phys_infocxx . . $ ship#phys_info..rotdragcxx . . $ physics_info#rotdrag.);
332
333 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, SHIPPAGE_COMMAND_WIGGLE_PER_SECcxx . . $ `manage/shippage.cpp:236:9`!);
334 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, 4);
335 cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..phys_infocxx . . $ ship#phys_info..wiggles_per_seccxx . . $ physics_info#wiggles_per_sec.);
336
337 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, SHIPPAGE_COMMAND_TURNROLL_RATIOcxx . . $ `manage/shippage.cpp:237:9`!);
338 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, 4);
339 cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..phys_infocxx . . $ ship#phys_info..turnroll_ratiocxx . . $ physics_info#turnroll_ratio.);
340
341 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, SHIPPAGE_COMMAND_PHYSICS_FLAGScxx . . $ `manage/shippage.cpp:235:9`!);
342 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, 4);
343 cf_WriteIntcxx . . $ cf_WriteInt(966989f25543eb13).(outfile, shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..phys_infocxx . . $ ship#phys_info..flagscxx . . $ physics_info#flags.);
344
345 // Write the LOD model names
346 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, SHIPPAGE_COMMAND_LOD_MODELScxx . . $ `manage/shippage.cpp:253:9`!);
347 size = strlen(shippage->med_image_namecxx . . $ mngs_ship_page#med_image_name.) + 1;
348 size += strlen(shippage->lo_image_namecxx . . $ mngs_ship_page#lo_image_name.) + 1;
349
350 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, size);
351 cf_WriteStringcxx . . $ cf_WriteString(643e1411966bd56c).(outfile, shippage->med_image_namecxx . . $ mngs_ship_page#med_image_name.);
352 cf_WriteStringcxx . . $ cf_WriteString(643e1411966bd56c).(outfile, shippage->lo_image_namecxx . . $ mngs_ship_page#lo_image_name.);
353
354 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, SHIPPAGE_COMMAND_LOD_DISTANCEcxx . . $ `manage/shippage.cpp:254:9`!);
355 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, 8);
356 cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..med_lod_distancecxx . . $ ship#med_lod_distance.);
357 cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..lo_lod_distancecxx . . $ ship#lo_lod_distance.);
358
359 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, SHIPPAGE_COMMAND_ARMOR_SCALARcxx . . $ `manage/shippage.cpp:249:9`!);
360 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, 4);
361 cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..armor_scalarcxx . . $ ship#armor_scalar.);
362
363 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, SHIPPAGE_COMMAND_FLAGScxx . . $ `manage/shippage.cpp:250:9`!);
364 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, 4);
365 cf_WriteIntcxx . . $ cf_WriteInt(966989f25543eb13).(outfile, shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..flagscxx . . $ ship#flags.);
366
367 for (i = 0; i < MAX_PLAYER_WEAPONScxx . . $ `Descent3/player_external_struct.h:91:9`!; i++) {
368 int j;
369 int size;
370
371 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, SHIPPAGE_COMMAND_WB_INFOcxx . . $ `manage/shippage.cpp:239:9`!);
372 size = sizeof(otype_wb_infocxx . . $ otype_wb_info#);
373 size++; // add a byte for the wb index
374
375 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, size);
376
377 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, i);
378 for (j = 0; j < MAX_WB_GUNPOINTScxx . . $ `lib/robotfirestruct_external.h:22:9`!; j++)
379 cf_WriteShortcxx . . $ cf_WriteShort(d7cf1a05aca96fe5).(outfile, shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..static_wbcxx . . $ ship#static_wb.[i].gp_weapon_indexcxx . . $ otype_wb_info#gp_weapon_index.[j]);
380 cf_WriteShortcxx . . $ cf_WriteShort(d7cf1a05aca96fe5).(outfile, shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..static_wbcxx . . $ ship#static_wb.[i].aiming_gp_indexcxx . . $ otype_wb_info#aiming_gp_index.);
381
382 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..static_wbcxx . . $ ship#static_wb.[i].num_maskscxx . . $ otype_wb_info#num_masks.);
383 for (j = 0; j < MAX_WB_FIRING_MASKScxx . . $ `lib/robotfirestruct_external.h:23:9`!; j++)
384 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..static_wbcxx . . $ ship#static_wb.[i].gp_fire_maskscxx . . $ otype_wb_info#gp_fire_masks.[j]);
385 for (j = 0; j < MAX_WB_FIRING_MASKScxx . . $ `lib/robotfirestruct_external.h:23:9`!; j++)
386 cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..static_wbcxx . . $ ship#static_wb.[i].gp_fire_waitcxx . . $ otype_wb_info#gp_fire_wait.[j]);
387
388 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..static_wbcxx . . $ ship#static_wb.[i].aiming_flagscxx . . $ otype_wb_info#aiming_flags.);
389 cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..static_wbcxx . . $ ship#static_wb.[i].aiming_3d_dotcxx . . $ otype_wb_info#aiming_3d_dot.);
390 cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..static_wbcxx . . $ ship#static_wb.[i].aiming_3d_distcxx . . $ otype_wb_info#aiming_3d_dist.);
391 cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..static_wbcxx . . $ ship#static_wb.[i].aiming_XZ_dotcxx . . $ otype_wb_info#aiming_XZ_dot.);
392 }
393
394 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, SHIPPAGE_COMMAND_WB_FLAGScxx . . $ `manage/shippage.cpp:244:9`!);
395 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, MAX_PLAYER_WEAPONScxx . . $ `Descent3/player_external_struct.h:91:9`!);
396 for (i = 0; i < MAX_PLAYER_WEAPONScxx . . $ `Descent3/player_external_struct.h:91:9`!; i++)
397 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..static_wbcxx . . $ ship#static_wb.[i].flagscxx . . $ otype_wb_info#flags.);
398
399 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, SHIPPAGE_COMMAND_WB_QUADMASKcxx . . $ `manage/shippage.cpp:251:9`!);
400 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, MAX_PLAYER_WEAPONScxx . . $ `Descent3/player_external_struct.h:91:9`!);
401 for (i = 0; i < MAX_PLAYER_WEAPONScxx . . $ `Descent3/player_external_struct.h:91:9`!; i++)
402 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..static_wbcxx . . $ ship#static_wb.[i].gp_quad_fire_maskcxx . . $ otype_wb_info#gp_quad_fire_mask.);
403
404 for (i = 0; i < MAX_PLAYER_WEAPONScxx . . $ `Descent3/player_external_struct.h:91:9`!; i++) {
405 for (j = 0; j < MAX_WB_GUNPOINTScxx . . $ `lib/robotfirestruct_external.h:22:9`!; j++) {
406 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, SHIPPAGE_COMMAND_WB_WEAPONcxx . . $ `manage/shippage.cpp:240:9`!);
407 size = strlen(shippage->weapon_namecxx . . $ mngs_ship_page#weapon_name.[i][j]) + 1 + 2; // 1 for the null charactor and 2 for the 2 indices
408
409 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, size);
410
411 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, i);
412 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, j);
413 cf_WriteStringcxx . . $ cf_WriteString(643e1411966bd56c).(outfile, shippage->weapon_namecxx . . $ mngs_ship_page#weapon_name.[i][j]);
414 }
415 }
416
417 for (i = 0; i < MAX_PLAYER_WEAPONScxx . . $ `Descent3/player_external_struct.h:91:9`!; i++) {
418 for (j = 0; j < MAX_WB_FIRING_MASKScxx . . $ `lib/robotfirestruct_external.h:23:9`!; j++) {
419 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, SHIPPAGE_COMMAND_WB_FIRE_SOUNDcxx . . $ `manage/shippage.cpp:243:9`!);
420 size = strlen(shippage->fire_sound_namecxx . . $ mngs_ship_page#fire_sound_name.[i][j]) + 1 + 2; // 1 for the null charactor and 2 for the 2 indices
421
422 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, size);
423
424 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, i);
425 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, j);
426 cf_WriteStringcxx . . $ cf_WriteString(643e1411966bd56c).(outfile, shippage->fire_sound_namecxx . . $ mngs_ship_page#fire_sound_name.[i][j]);
427 }
428 }
429
430 for (i = 0; i < MAX_PLAYER_WEAPONScxx . . $ `Descent3/player_external_struct.h:91:9`!; i++) {
431 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, SHIPPAGE_COMMAND_FIRE_FLAGScxx . . $ `manage/shippage.cpp:241:9`!);
432 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, 2);
433
434 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, i);
435 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..fire_flagscxx . . $ ship#fire_flags.[i]);
436 }
437
438 for (i = 0; i < MAX_PLAYER_WEAPONScxx . . $ `Descent3/player_external_struct.h:91:9`!; i++) {
439 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, SHIPPAGE_COMMAND_RESOURCE_USAGEcxx . . $ `manage/shippage.cpp:242:9`!);
440 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, 9);
441
442 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, i);
443 cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..static_wbcxx . . $ ship#static_wb.[i].energy_usagecxx . . $ otype_wb_info#energy_usage.);
444 cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..static_wbcxx . . $ ship#static_wb.[i].ammo_usagecxx . . $ otype_wb_info#ammo_usage.);
445 }
446
447 for (i = 0; i < MAX_PLAYER_WEAPONScxx . . $ `Descent3/player_external_struct.h:91:9`!; i++) {
448 if (shippage->firing_sound_namecxx . . $ mngs_ship_page#firing_sound_name.[i][0] != 0) {
449 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, SHIPPAGE_COMMAND_FIRING_SOUNDcxx . . $ `manage/shippage.cpp:245:9`!);
450 size = strlen(shippage->firing_sound_namecxx . . $ mngs_ship_page#firing_sound_name.[i]) + 1 + 1; // 1 for the null charactor and 1 for the index
451 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, size);
452 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, i);
453 cf_WriteStringcxx . . $ cf_WriteString(643e1411966bd56c).(outfile, shippage->firing_sound_namecxx . . $ mngs_ship_page#firing_sound_name.[i]);
454 }
455 }
456 for (i = 0; i < MAX_PLAYER_WEAPONScxx . . $ `Descent3/player_external_struct.h:91:9`!; i++) {
457 if (shippage->release_sound_namecxx . . $ mngs_ship_page#release_sound_name.[i][0] != 0) {
458 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, SHIPPAGE_COMMAND_RELEASE_SOUNDcxx . . $ `manage/shippage.cpp:246:9`!);
459 size = strlen(shippage->release_sound_namecxx . . $ mngs_ship_page#release_sound_name.[i]) + 1 + 1; // 1 for the null charactor and 1 for the index
460 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, size);
461 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, i);
462 cf_WriteStringcxx . . $ cf_WriteString(643e1411966bd56c).(outfile, shippage->release_sound_namecxx . . $ mngs_ship_page#release_sound_name.[i]);
463 }
464 }
465 for (i = 0; i < MAX_PLAYER_WEAPONScxx . . $ `Descent3/player_external_struct.h:91:9`!; i++) {
466 if (shippage->spew_powerup_namecxx . . $ mngs_ship_page#spew_powerup_name.[i][0] != 0) {
467 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, SHIPPAGE_COMMAND_SPEW_POWERUPcxx . . $ `manage/shippage.cpp:248:9`!);
468 size = strlen(shippage->spew_powerup_namecxx . . $ mngs_ship_page#spew_powerup_name.[i]) + 1 + 1; // 1 for the null charactor and 1 for the index
469 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, size);
470 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, i);
471 cf_WriteStringcxx . . $ cf_WriteString(643e1411966bd56c).(outfile, shippage->spew_powerup_namecxx . . $ mngs_ship_page#spew_powerup_name.[i]);
472 }
473 }
474 for (i = 0; i < MAX_PLAYER_WEAPONScxx . . $ `Descent3/player_external_struct.h:91:9`!; i++) {
475 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, SHIPPAGE_COMMAND_MAX_AMMOcxx . . $ `manage/shippage.cpp:255:9`!);
476 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, 5);
477
478 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, i);
479 cf_WriteIntcxx . . $ cf_WriteInt(966989f25543eb13).(outfile, shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..max_ammocxx . . $ ship#max_ammo.[i]);
480 }
481
482 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, SHIPPAGE_COMMAND_ENDcxx . . $ `manage/shippage.cpp:224:9`!); // we're all done
483 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, 0);
484 }
485
486 // Given an open file pointer and a ship_page struct, writes that ship page out
487 void mng_WriteNewShipPagecxx . . $ mng_WriteNewShipPage(d82cdf4b89141491).(CFILEcxx . . $ CFILE# *outfile, mngs_ship_pagecxx . . $ mngs_ship_page# *shippage) {
488 int i;
489
490 ASSERTcxx . . $ `misc/pserror.h:246:9`!(outfile != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
491 ASSERTcxx . . $ `misc/pserror.h:246:9`!(shippage != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
492
493 int offset = StartManagePagecxx . . $ StartManagePage(d1801a78c3072b68).(outfile, PAGETYPE_SHIPcxx . . $ `lib/manage.h:54:9`!);
494
495 cf_WriteShortcxx . . $ cf_WriteShort(d7cf1a05aca96fe5).(outfile, SHIPPAGE_VERSIONcxx . . $ `manage/shippage.cpp:257:9`!);
496
497 cf_WriteStringcxx . . $ cf_WriteString(643e1411966bd56c).(outfile, shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..namecxx . . $ ship#name.);
498
499 cf_WriteStringcxx . . $ cf_WriteString(643e1411966bd56c).(outfile, shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..cockpit_namecxx . . $ ship#cockpit_name.);
500
501 cf_WriteStringcxx . . $ cf_WriteString(643e1411966bd56c).(outfile, shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..hud_config_namecxx . . $ ship#hud_config_name.);
502
503 // Write out its models name
504 cf_WriteStringcxx . . $ cf_WriteString(643e1411966bd56c).(outfile, shippage->image_namecxx . . $ mngs_ship_page#image_name.);
505 cf_WriteStringcxx . . $ cf_WriteString(643e1411966bd56c).(outfile, shippage->dying_image_namecxx . . $ mngs_ship_page#dying_image_name.);
506 cf_WriteStringcxx . . $ cf_WriteString(643e1411966bd56c).(outfile, shippage->med_image_namecxx . . $ mngs_ship_page#med_image_name.);
507 cf_WriteStringcxx . . $ cf_WriteString(643e1411966bd56c).(outfile, shippage->lo_image_namecxx . . $ mngs_ship_page#lo_image_name.);
508
509 // Write out lod distance
510 cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..med_lod_distancecxx . . $ ship#med_lod_distance.);
511 cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..lo_lod_distancecxx . . $ ship#lo_lod_distance.);
512
513 mng_WritePhysicsChunkcxx . . $ mng_WritePhysicsChunk(94fabf1e8396697f).(&shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..phys_infocxx . . $ ship#phys_info., outfile);
514
515 cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..sizecxx . . $ ship#size.);
516 cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..armor_scalarcxx . . $ ship#armor_scalar.);
517 cf_WriteIntcxx . . $ cf_WriteInt(966989f25543eb13).(outfile, shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..flagscxx . . $ ship#flags.);
518
519 for (i = 0; i < MAX_PLAYER_WEAPONScxx . . $ `Descent3/player_external_struct.h:91:9`!; i++) {
520 int j;
521
522 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..fire_flagscxx . . $ ship#fire_flags.[i]);
523 cf_WriteStringcxx . . $ cf_WriteString(643e1411966bd56c).(outfile, shippage->firing_sound_namecxx . . $ mngs_ship_page#firing_sound_name.[i]);
524 cf_WriteStringcxx . . $ cf_WriteString(643e1411966bd56c).(outfile, shippage->release_sound_namecxx . . $ mngs_ship_page#release_sound_name.[i]);
525 cf_WriteStringcxx . . $ cf_WriteString(643e1411966bd56c).(outfile, shippage->spew_powerup_namecxx . . $ mngs_ship_page#spew_powerup_name.[i]);
526 cf_WriteIntcxx . . $ cf_WriteInt(966989f25543eb13).(outfile, shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..max_ammocxx . . $ ship#max_ammo.[i]);
527
528 mng_WriteWeaponBatteryChunkcxx . . $ mng_WriteWeaponBatteryChunk(ad20a081f57bd899).(&shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..static_wbcxx . . $ ship#static_wb.[i], outfile);
529
530 for (j = 0; j < MAX_WB_GUNPOINTScxx . . $ `lib/robotfirestruct_external.h:22:9`!; j++)
531 cf_WriteStringcxx . . $ cf_WriteString(643e1411966bd56c).(outfile, shippage->fire_sound_namecxx . . $ mngs_ship_page#fire_sound_name.[i][j]);
532
533 for (j = 0; j < MAX_WB_FIRING_MASKScxx . . $ `lib/robotfirestruct_external.h:23:9`!; j++)
534 cf_WriteStringcxx . . $ cf_WriteString(643e1411966bd56c).(outfile, shippage->weapon_namecxx . . $ mngs_ship_page#weapon_name.[i][j]);
535 }
536
537 EndManagePagecxx . . $ EndManagePage(966989f25543eb13).(outfile, offset);
538 }
539
540 // Reads a ship page from an open file. Returns 0 on error.
541 int mng_ReadNewShipPagecxx . . $ mng_ReadNewShipPage(ec0053c10eec018b).(CFILEcxx . . $ CFILE# *infile, mngs_ship_pagecxx . . $ mngs_ship_page# *shippage) {
542 int i, j;
543
544 ASSERTcxx . . $ `misc/pserror.h:246:9`!(infile != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
545
546 // Defaults
547 memset(shippage, 0, sizeof(mngs_ship_pagecxx . . $ mngs_ship_page#));
548
549 int version = cf_ReadShortcxx . . $ cf_ReadShort(30b00389b433b379).(infile);
550
551 // Read In misc names
552 cf_ReadStringcxx . . $ cf_ReadString(38cd788e4423eff6).(shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..namecxx . . $ ship#name., PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!, infile);
553 cf_ReadStringcxx . . $ cf_ReadString(38cd788e4423eff6).(shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..cockpit_namecxx . . $ ship#cockpit_name., PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!, infile);
554 cf_ReadStringcxx . . $ cf_ReadString(38cd788e4423eff6).(shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..hud_config_namecxx . . $ ship#hud_config_name., PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!, infile);
555
556 // Read in model names
557 cf_ReadStringcxx . . $ cf_ReadString(38cd788e4423eff6).(shippage->image_namecxx . . $ mngs_ship_page#image_name., PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!, infile);
558 cf_ReadStringcxx . . $ cf_ReadString(38cd788e4423eff6).(shippage->dying_image_namecxx . . $ mngs_ship_page#dying_image_name., PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!, infile);
559 cf_ReadStringcxx . . $ cf_ReadString(38cd788e4423eff6).(shippage->med_image_namecxx . . $ mngs_ship_page#med_image_name., PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!, infile);
560 cf_ReadStringcxx . . $ cf_ReadString(38cd788e4423eff6).(shippage->lo_image_namecxx . . $ mngs_ship_page#lo_image_name., PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!, infile);
561
562 // read lod distance
563 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..med_lod_distancecxx . . $ ship#med_lod_distance. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile);
564 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..lo_lod_distancecxx . . $ ship#lo_lod_distance. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile);
565
566 // Read physics
567 mng_ReadPhysicsChunkcxx . . $ mng_ReadPhysicsChunk(94fabf1e8396697f).(&shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..phys_infocxx . . $ ship#phys_info., infile);
568
569 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..sizecxx . . $ ship#size. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile);
570 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..armor_scalarcxx . . $ ship#armor_scalar. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile);
571 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..flagscxx . . $ ship#flags. = cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(infile);
572
573 for (i = 0; i < MAX_PLAYER_WEAPONScxx . . $ `Descent3/player_external_struct.h:91:9`!; i++) {
574 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..fire_flagscxx . . $ ship#fire_flags.[i] = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile);
575 cf_ReadStringcxx . . $ cf_ReadString(38cd788e4423eff6).(shippage->firing_sound_namecxx . . $ mngs_ship_page#firing_sound_name.[i], PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!, infile);
576 cf_ReadStringcxx . . $ cf_ReadString(38cd788e4423eff6).(shippage->release_sound_namecxx . . $ mngs_ship_page#release_sound_name.[i], PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!, infile);
577 cf_ReadStringcxx . . $ cf_ReadString(38cd788e4423eff6).(shippage->spew_powerup_namecxx . . $ mngs_ship_page#spew_powerup_name.[i], PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!, infile);
578 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..max_ammocxx . . $ ship#max_ammo.[i] = cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(infile);
579
580 if (version >= 6)
581 mng_ReadWeaponBatteryChunkcxx . . $ mng_ReadWeaponBatteryChunk(14ef5bf56b093803).(&shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..static_wbcxx . . $ ship#static_wb.[i], infile, 2);
582 else
583 mng_ReadWeaponBatteryChunkcxx . . $ mng_ReadWeaponBatteryChunk(14ef5bf56b093803).(&shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..static_wbcxx . . $ ship#static_wb.[i], infile, 1);
584
585 for (j = 0; j < MAX_WB_GUNPOINTScxx . . $ `lib/robotfirestruct_external.h:22:9`!; j++)
586 cf_ReadStringcxx . . $ cf_ReadString(38cd788e4423eff6).(shippage->fire_sound_namecxx . . $ mngs_ship_page#fire_sound_name.[i][j], PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!, infile);
587
588 for (j = 0; j < MAX_WB_FIRING_MASKScxx . . $ `lib/robotfirestruct_external.h:23:9`!; j++)
589 cf_ReadStringcxx . . $ cf_ReadString(38cd788e4423eff6).(shippage->weapon_namecxx . . $ mngs_ship_page#weapon_name.[i][j], PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!, infile);
590 }
591
592 // Mark the newly filled structure as used
593 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..usedcxx . . $ ship#used. = 1;
594
595 // Bash Fusion recharge times for the ships
596 if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(shippage->ship_struct.name, "Pyro-GL")) {
597 // Pyro-GL
598 for (j = 0; j < MAX_WB_FIRING_MASKScxx . . $ `lib/robotfirestruct_external.h:23:9`!; j++)
599 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..static_wbcxx . . $ ship#static_wb.[FUSION_INDEXcxx . . $ `Descent3/weapon_external.h:26:9`!].gp_fire_waitcxx . . $ otype_wb_info#gp_fire_wait.[j] = 0.66f;
600 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(shippage->ship_struct.name, "Phoenix")) {
601 // Phoenix
602 for (j = 0; j < MAX_WB_FIRING_MASKScxx . . $ `lib/robotfirestruct_external.h:23:9`!; j++)
603 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..static_wbcxx . . $ ship#static_wb.[FUSION_INDEXcxx . . $ `Descent3/weapon_external.h:26:9`!].gp_fire_waitcxx . . $ otype_wb_info#gp_fire_wait.[j] = 0.792f;
604 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(shippage->ship_struct.name, "Magnum-AHT")) {
605 // Magnum
606 for (j = 0; j < MAX_WB_FIRING_MASKScxx . . $ `lib/robotfirestruct_external.h:23:9`!; j++)
607 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..static_wbcxx . . $ ship#static_wb.[FUSION_INDEXcxx . . $ `Descent3/weapon_external.h:26:9`!].gp_fire_waitcxx . . $ otype_wb_info#gp_fire_wait.[j] = 1.122f;
608 } else {
609 // Other
610 }
611
612 return 1; // successfully read
613 }
614
615 // Reads a ship page from an open file. Returns 0 on error.
616 int mng_ReadShipPagecxx . . $ mng_ReadShipPage(ec0053c10eec018b).(CFILEcxx . . $ CFILE# *infile, mngs_ship_pagecxx . . $ mngs_ship_page# *shippage) {
617 int done = 0;
618 char command;
619 uint8_tcxx . . $ uint8_t# len;
620 int i;
621 int version = 0;
622
623 if (!Old_table_methodcxx . . $ Old_table_method.)
624 return mng_ReadNewShipPagecxx . . $ mng_ReadNewShipPage(ec0053c10eec018b).(infile, shippage);
625
626 strcpy(shippage->dying_image_namecxx . . $ mngs_ship_page#dying_image_name., "");
627 ASSERTcxx . . $ `misc/pserror.h:246:9`!(infile != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
628
629 // Defaults
630 memset(shippage, 0, sizeof(mngs_ship_pagecxx . . $ mngs_ship_page#));
631 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..armor_scalarcxx . . $ ship#armor_scalar. = 1.0;
632
633 strcpy(shippage->med_image_namecxx . . $ mngs_ship_page#med_image_name., "");
634 strcpy(shippage->lo_image_namecxx . . $ mngs_ship_page#lo_image_name., "");
635
636 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..med_lod_distancecxx . . $ ship#med_lod_distance. = DEFAULT_MED_LOD_DISTANCEcxx . . $ `Descent3/objinfo.h:349:9`!;
637 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..lo_lod_distancecxx . . $ ship#lo_lod_distance. = DEFAULT_LO_LOD_DISTANCEcxx . . $ `Descent3/objinfo.h:350:9`!;
638
639 for (i = 0; i < MAX_PLAYER_WEAPONScxx . . $ `Descent3/player_external_struct.h:91:9`!; i++) {
640 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..static_wbcxx . . $ ship#static_wb.[i].aiming_3d_distcxx . . $ otype_wb_info#aiming_3d_dist. = 1.0;
641 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..static_wbcxx . . $ ship#static_wb.[i].num_maskscxx . . $ otype_wb_info#num_masks. = 1;
642 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..fire_flagscxx . . $ ship#fire_flags.[i] = 0;
643 shippage->firing_sound_namecxx . . $ mngs_ship_page#firing_sound_name.[i][0] = 0;
644 shippage->release_sound_namecxx . . $ mngs_ship_page#release_sound_name.[i][0] = 0;
645 shippage->spew_powerup_namecxx . . $ mngs_ship_page#spew_powerup_name.[i][0] = 0;
646 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..max_ammocxx . . $ ship#max_ammo.[i] = 0;
647 }
648
649 while (!done) {
650 // Read in command byte then read in the length of that commands data
651
652 command = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile);
653 len = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile);
654
655 switch (command) {
656 case SHIPPAGE_COMMAND_ENDcxx . . $ `manage/shippage.cpp:224:9`!:
657 done = 1;
658 break;
659 case SHIPPAGE_COMMAND_VERSIONcxx . . $ `manage/shippage.cpp:226:9`!:
660 version = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile);
661 break;
662 case SHIPPAGE_COMMAND_IMAGE_NAMEcxx . . $ `manage/shippage.cpp:225:9`!: // the name of the ship model
663 for (i = 0; i < PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!; i++)
664 shippage->image_namecxx . . $ mngs_ship_page#image_name.[i] = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile);
665 break;
666 case SHIPPAGE_COMMAND_DYING_IMAGE_NAMEcxx . . $ `manage/shippage.cpp:238:9`!:
667 cf_ReadStringcxx . . $ cf_ReadString(38cd788e4423eff6).(shippage->dying_image_namecxx . . $ mngs_ship_page#dying_image_name., PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!, infile);
668 break;
669 case SHIPPAGE_COMMAND_LOD_MODELScxx . . $ `manage/shippage.cpp:253:9`!: // the name of the lower res models
670 cf_ReadStringcxx . . $ cf_ReadString(38cd788e4423eff6).(shippage->med_image_namecxx . . $ mngs_ship_page#med_image_name., len + 1, infile);
671 cf_ReadStringcxx . . $ cf_ReadString(38cd788e4423eff6).(shippage->lo_image_namecxx . . $ mngs_ship_page#lo_image_name., len + 1, infile);
672 break;
673 case SHIPPAGE_COMMAND_LOD_DISTANCEcxx . . $ `manage/shippage.cpp:254:9`!:
674 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..med_lod_distancecxx . . $ ship#med_lod_distance. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile);
675 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..lo_lod_distancecxx . . $ ship#lo_lod_distance. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile);
676 break;
677 case SHIPPAGE_COMMAND_COCKPIT_NAMEcxx . . $ `manage/shippage.cpp:247:9`!:
678 cf_ReadStringcxx . . $ cf_ReadString(38cd788e4423eff6).(shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..cockpit_namecxx . . $ ship#cockpit_name., PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!, infile);
679 break;
680 case SHIPPAGE_COMMAND_HUD_NAMEcxx . . $ `manage/shippage.cpp:252:9`!:
681 cf_ReadStringcxx . . $ cf_ReadString(38cd788e4423eff6).(shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..hud_config_namecxx . . $ ship#hud_config_name., PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!, infile);
682 break;
683 case SHIPPAGE_COMMAND_NAMEcxx . . $ `manage/shippage.cpp:223:9`!:
684 for (i = 0; i < PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!; i++)
685 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..namecxx . . $ ship#name.[i] = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile);
686 break;
687 case SHIPPAGE_COMMAND_SIZEcxx . . $ `manage/shippage.cpp:229:9`!:
688 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..sizecxx . . $ ship#size. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile);
689 break;
690 case SHIPPAGE_COMMAND_ARMOR_SCALARcxx . . $ `manage/shippage.cpp:249:9`!:
691 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..armor_scalarcxx . . $ ship#armor_scalar. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile);
692 break;
693 case SHIPPAGE_COMMAND_MASScxx . . $ `manage/shippage.cpp:227:9`!:
694 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..phys_infocxx . . $ ship#phys_info..masscxx . . $ physics_info#mass. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile);
695 break;
696 case SHIPPAGE_COMMAND_DRAGcxx . . $ `manage/shippage.cpp:228:9`!:
697 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..phys_infocxx . . $ ship#phys_info..dragcxx . . $ physics_info#drag. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile);
698 break;
699 case SHIPPAGE_COMMAND_WIGGLE_AMPLITUDEcxx . . $ `manage/shippage.cpp:230:9`!:
700 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..phys_infocxx . . $ ship#phys_info..wiggle_amplitudecxx . . $ physics_info#wiggle_amplitude. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile);
701 break;
702 case SHIPPAGE_COMMAND_THRUSTcxx . . $ `manage/shippage.cpp:231:9`!:
703 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..phys_infocxx . . $ ship#phys_info..full_thrustcxx . . $ physics_info#$anonymous_type_3#full_thrust. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile);
704 break;
705 case SHIPPAGE_COMMAND_ROTTHRUSTcxx . . $ `manage/shippage.cpp:232:9`!:
706 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..phys_infocxx . . $ ship#phys_info..full_rotthrustcxx . . $ physics_info#$anonymous_type_4#full_rotthrust. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile);
707 break;
708 case SHIPPAGE_COMMAND_TURNROLLRATEcxx . . $ `manage/shippage.cpp:233:9`!:
709 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..phys_infocxx . . $ ship#phys_info..max_turnroll_ratecxx . . $ physics_info#max_turnroll_rate. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile);
710 break;
711 case SHIPPAGE_COMMAND_ROTDRAGcxx . . $ `manage/shippage.cpp:234:9`!:
712 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..phys_infocxx . . $ ship#phys_info..rotdragcxx . . $ physics_info#rotdrag. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile);
713 break;
714 case SHIPPAGE_COMMAND_WIGGLE_PER_SECcxx . . $ `manage/shippage.cpp:236:9`!:
715 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..phys_infocxx . . $ ship#phys_info..wiggles_per_seccxx . . $ physics_info#wiggles_per_sec. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile);
716 break;
717 case SHIPPAGE_COMMAND_TURNROLL_RATIOcxx . . $ `manage/shippage.cpp:237:9`!:
718 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..phys_infocxx . . $ ship#phys_info..turnroll_ratiocxx . . $ physics_info#turnroll_ratio. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile);
719 break;
720 case SHIPPAGE_COMMAND_PHYSICS_FLAGScxx . . $ `manage/shippage.cpp:235:9`!:
721 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..phys_infocxx . . $ ship#phys_info..flagscxx . . $ physics_info#flags. = cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(infile);
722 break;
723 case SHIPPAGE_COMMAND_FLAGScxx . . $ `manage/shippage.cpp:250:9`!:
724 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..flagscxx . . $ ship#flags. = cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(infile);
725 break;
726 case SHIPPAGE_COMMAND_WB_FLAGScxx . . $ `manage/shippage.cpp:244:9`!: {
727 for (int i = 0; i < MAX_PLAYER_WEAPONScxx . . $ `Descent3/player_external_struct.h:91:9`!; i++)
728 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..static_wbcxx . . $ ship#static_wb.[i].flagscxx . . $ otype_wb_info#flags. = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile);
729 } break;
730 case SHIPPAGE_COMMAND_WB_QUADMASKcxx . . $ `manage/shippage.cpp:251:9`!: {
731 for (int i = 0; i < MAX_PLAYER_WEAPONScxx . . $ `Descent3/player_external_struct.h:91:9`!; i++)
732 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..static_wbcxx . . $ ship#static_wb.[i].gp_quad_fire_maskcxx . . $ otype_wb_info#gp_quad_fire_mask. = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile);
733 } break;
734 case SHIPPAGE_COMMAND_WB_INFOcxx . . $ `manage/shippage.cpp:239:9`!: {
735 int i, j;
736 i = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile);
737
738 if (version < 1) {
739 for (j = 0; j < MAX_WB_GUNPOINTScxx . . $ `lib/robotfirestruct_external.h:22:9`!; j++)
740 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..static_wbcxx . . $ ship#static_wb.[i].gp_weapon_indexcxx . . $ otype_wb_info#gp_weapon_index.[j] = cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(infile);
741 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..static_wbcxx . . $ ship#static_wb.[i].aiming_gp_indexcxx . . $ otype_wb_info#aiming_gp_index. = cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(infile);
742 } else {
743 for (j = 0; j < MAX_WB_GUNPOINTScxx . . $ `lib/robotfirestruct_external.h:22:9`!; j++)
744 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..static_wbcxx . . $ ship#static_wb.[i].gp_weapon_indexcxx . . $ otype_wb_info#gp_weapon_index.[j] = cf_ReadShortcxx . . $ cf_ReadShort(30b00389b433b379).(infile);
745 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..static_wbcxx . . $ ship#static_wb.[i].aiming_gp_indexcxx . . $ otype_wb_info#aiming_gp_index. = cf_ReadShortcxx . . $ cf_ReadShort(30b00389b433b379).(infile);
746 }
747 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..static_wbcxx . . $ ship#static_wb.[i].num_maskscxx . . $ otype_wb_info#num_masks. = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile);
748 for (j = 0; j < MAX_WB_FIRING_MASKScxx . . $ `lib/robotfirestruct_external.h:23:9`!; j++)
749 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..static_wbcxx . . $ ship#static_wb.[i].gp_fire_maskscxx . . $ otype_wb_info#gp_fire_masks.[j] = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile);
750 for (j = 0; j < MAX_WB_FIRING_MASKScxx . . $ `lib/robotfirestruct_external.h:23:9`!; j++)
751 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..static_wbcxx . . $ ship#static_wb.[i].gp_fire_waitcxx . . $ otype_wb_info#gp_fire_wait.[j] = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile);
752
753 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..static_wbcxx . . $ ship#static_wb.[i].aiming_flagscxx . . $ otype_wb_info#aiming_flags. = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile);
754 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..static_wbcxx . . $ ship#static_wb.[i].aiming_3d_dotcxx . . $ otype_wb_info#aiming_3d_dot. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile);
755 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..static_wbcxx . . $ ship#static_wb.[i].aiming_3d_distcxx . . $ otype_wb_info#aiming_3d_dist. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile);
756 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..static_wbcxx . . $ ship#static_wb.[i].aiming_XZ_dotcxx . . $ otype_wb_info#aiming_XZ_dot. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile);
757 break;
758 }
759
760 case SHIPPAGE_COMMAND_WB_WEAPONcxx . . $ `manage/shippage.cpp:240:9`!: {
761 int i, j;
762
763 i = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile);
764 j = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile);
765 cf_ReadStringcxx . . $ cf_ReadString(38cd788e4423eff6).(shippage->weapon_namecxx . . $ mngs_ship_page#weapon_name.[i][j], len - 1, infile);
766 break;
767 }
768 case SHIPPAGE_COMMAND_WB_FIRE_SOUNDcxx . . $ `manage/shippage.cpp:243:9`!: {
769 int i, j;
770
771 i = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile);
772 j = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile);
773 cf_ReadStringcxx . . $ cf_ReadString(38cd788e4423eff6).(shippage->fire_sound_namecxx . . $ mngs_ship_page#fire_sound_name.[i][j], len - 1, infile);
774 break;
775 }
776 case SHIPPAGE_COMMAND_FIRING_SOUNDcxx . . $ `manage/shippage.cpp:245:9`!: {
777 int i = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile);
778 cf_ReadStringcxx . . $ cf_ReadString(38cd788e4423eff6).(shippage->firing_sound_namecxx . . $ mngs_ship_page#firing_sound_name.[i], len, infile);
779 break;
780 }
781 case SHIPPAGE_COMMAND_RELEASE_SOUNDcxx . . $ `manage/shippage.cpp:246:9`!: {
782 int i = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile);
783 cf_ReadStringcxx . . $ cf_ReadString(38cd788e4423eff6).(shippage->release_sound_namecxx . . $ mngs_ship_page#release_sound_name.[i], len, infile);
784 break;
785 }
786 case SHIPPAGE_COMMAND_SPEW_POWERUPcxx . . $ `manage/shippage.cpp:248:9`!: {
787 int i = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile);
788 cf_ReadStringcxx . . $ cf_ReadString(38cd788e4423eff6).(shippage->spew_powerup_namecxx . . $ mngs_ship_page#spew_powerup_name.[i], len, infile);
789 break;
790 }
791 case SHIPPAGE_COMMAND_FIRE_FLAGScxx . . $ `manage/shippage.cpp:241:9`!: {
792 uint8_tcxx . . $ uint8_t# slot;
793
794 slot = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile);
795 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..fire_flagscxx . . $ ship#fire_flags.[slot] = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile);
796 break;
797 }
798 case SHIPPAGE_COMMAND_MAX_AMMOcxx . . $ `manage/shippage.cpp:255:9`!: {
799 uint8_tcxx . . $ uint8_t# slot;
800
801 slot = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile);
802 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..max_ammocxx . . $ ship#max_ammo.[slot] = cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(infile);
803 break;
804 }
805 case SHIPPAGE_COMMAND_RESOURCE_USAGEcxx . . $ `manage/shippage.cpp:242:9`!: {
806 uint8_tcxx . . $ uint8_t# slot;
807
808 slot = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile);
809 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..static_wbcxx . . $ ship#static_wb.[slot].energy_usagecxx . . $ otype_wb_info#energy_usage. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile);
810 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..static_wbcxx . . $ ship#static_wb.[slot].ammo_usagecxx . . $ otype_wb_info#ammo_usage. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile);
811 break;
812 }
813 default:
814 // Ignore the ones we don't know
815 for (i = 0; i < len; i++)
816 cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile);
817 break;
818 }
819 }
820
821 for (int xxx = 0; xxx < MAX_WBS_PER_OBJcxx . . $ `lib/robotfirestruct.h:32:9`!; xxx++) {
822 if ((version < 5) && (shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..fire_flagscxx . . $ ship#fire_flags.[xxx] & 2)) {
823 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..static_wbcxx . . $ ship#static_wb.[xxx].flagscxx . . $ otype_wb_info#flags. |= WBF_ON_OFFcxx . . $ `lib/robotfirestruct_external.h:34:9`!;
824 }
825 }
826
827 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..phys_infocxx . . $ ship#phys_info..num_bouncescxx . . $ physics_info#num_bounces. = -1;
828 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..phys_infocxx . . $ ship#phys_info..coeff_restitutioncxx . . $ physics_info#coeff_restitution. = 1.0f;
829
830 // Mark the newly filled structure as used
831 shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..usedcxx . . $ ship#used. = 1;
832
833 return 1; // successfully read
834 }
835
836 // Reads in the ship named "name" into shippage struct
837 // Returns 0 on error or couldn't find, else 1 if all is good
838 int mng_FindSpecificShipPagecxx . . $ mng_FindSpecificShipPage(e928a488c1cbedd4).(char *name, mngs_ship_pagecxx . . $ mngs_ship_page# *shippage, int offset) {
839 CFILEcxx . . $ CFILE# *infile;
840 uint8_tcxx . . $ uint8_t# pagetype;
841 int done = 0, found = 0;
842 int first_try = 1;
843 stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::pathcxx . . $ std/filesystem/__cxx11/path# tablenamecxx . . $ std/filesystem/__cxx11/path#path(ced63f7c635d850d).;
844
845 if (Loading_localscxx . . $ Loading_locals.) {
846 infile = cfopencxx . . $ cfopen(7c7b94e455f1ae56).(LocalTableFilenamecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., "rb");
847 } else if (Loading_addon_tablecxx . . $ Loading_addon_table. != -1) {
848 infile = cfopencxx . . $ cfopen(7c7b94e455f1ae56).(AddOnDataTablescxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).[Loading_addon_tablecxx . . $ Loading_addon_table.].AddOnTableFilenamecxx . . $ AddOnTablefile#AddOnTableFilename., "rb");
849 } else {
850 if (Network_upcxx . . $ Network_up. && Starting_editorcxx . . $ Starting_editor.) {
851 int farg = FindArgcxx . . $ FindArg(5c4306d8553b3696).("-filter");
852
853 if (farg)
854 tablename =cxx . . $ std/filesystem/__cxx11/path#`operator=`(d30197541d75bb9a). GameArgscxx . . $ GameArgs.[farg + 1];
855 else
856 tablename =cxx . . $ std/filesystem/__cxx11/path#`operator=`(9c9aa2f17f237d0f). LocalTableDircxx . . $ LocalTableDir. /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). NET_TABLEcxx . . $ `lib/manage.h:36:9`!;
857
858 infile = cfopencxx . . $ cfopen(7c7b94e455f1ae56).(tablename, "rb");
859 } else {
860 infile = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
861 if (TablefileNameOverridecxx . . $ TablefileNameOverride.) {
862 infile = cfopencxx . . $ cfopen(7c7b94e455f1ae56).(TablefileNameOverridecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., "rb");
863 }
864
865 if (!infile)
866 infile = cfopencxx . . $ cfopen(7c7b94e455f1ae56).(TableFilenamecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., "rb");
867 }
868 }
869
870 if (!infile) {
871 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Couldn't open table file to find ship!\n");
872 Int3cxx . . $ `misc/pserror.h:247:9`!();
873 return 0;
874 }
875
876 try_again:;
877
878 if (offset)
879 cfseekcxx . . $ cfseek(f9992d249f032805).(infile, offset, SEEK_SETcxx . . $ `<external>/14710646456994434043/fcntl.h:137:10`!);
880
881 // Read in the entire page file until we find the page we want
882 while (!done) {
883 if (cfeofcxx . . $ cfeof(413716a422df0036).(infile)) {
884 done = 1;
885 continue;
886 }
887 pagetype = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile);
888 int len = cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(infile);
889
890 // If not a ship page, just read it in and ignore it
891 if (pagetype != PAGETYPE_SHIPcxx . . $ `lib/manage.h:54:9`!) {
892 cfseekcxx . . $ cfseek(f9992d249f032805).(infile, len - 4, SEEK_CURcxx . . $ `<external>/14710646456994434043/fcntl.h:138:10`!);
893 continue;
894 }
895
896 mng_ReadNewShipPagecxx . . $ mng_ReadNewShipPage(ec0053c10eec018b).(infile, shippage);
897
898 if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(name, shippage->ship_struct.name)) {
899 // This is the page we want
900 found = 1;
901 done = 1;
902 }
903 }
904
905 cfclosecxx . . $ cfclose(3639e799710acb68).(infile);
906
907 if (!found && first_try) {
908 done = first_try = 0;
909 infile = cfopencxx . . $ cfopen(7c7b94e455f1ae56).("extra.gam"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., "rb");
910 if (infile)
911 goto try_again;
912 }
913
914 return found; // successful!
915 }
916
917 // Given a ship page, allocs a ship and calls AssignShipPageToShip to actually
918 // load models and values. Rturns ship handle on success, -1 if fail
919 int mng_SetAndLoadShipcxx . . $ mng_SetAndLoadShip(7b471d26e5a265f8).(mngs_ship_pagecxx . . $ mngs_ship_page# *shippage, CFILEcxx . . $ CFILE# *infile) {
920 int n;
921
922 n = AllocShipcxx . . $ AllocShip(b126dc7c1de90089).();
923 if (n < 0)
924 return -1;
925 if (!mng_AssignShipPageToShipcxx . . $ mng_AssignShipPageToShip(9d5a2a40285cb110).(shippage, n, infile))
926 return -1;
927
928 return n;
929 }
930
931 // Given a shippage and a ship handle, attempts to make ship n correspond to
932 // to the shippage.
933 // Returns 1 on success, 0 otherwise
934 int mng_AssignShipPageToShipcxx . . $ mng_AssignShipPageToShip(9d5a2a40285cb110).(mngs_ship_pagecxx . . $ mngs_ship_page# *shippage, int n, CFILEcxx . . $ CFILE# *infile) {
935 shipcxx . . $ ship# *shippointer = &Shipscxx . . $ Ships.[n];
936 int img_handle;
937 int i, j;
938
939 // copy our values
940 memcpy(shippointer, &shippage->ship_structcxx . . $ mngs_ship_page#ship_struct., sizeof(shipcxx . . $ ship#));
941 strcpy(shippointer->namecxx . . $ ship#name., shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..namecxx . . $ ship#name.);
942
943 // First see if our image differs from the one on the net
944 // If it is, make a copy
945 // If its a release version, don't do any of this
946
947 #ifndef RELEASE
948 if (Network_upcxx . . $ Network_up.) {
949 UpdatePrimitivecxx . . $ UpdatePrimitive(563e7f6fc320b4cb).(LocalModelsDircxx . . $ LocalModelsDir. /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). shippagecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).->image_namecxx . . $ mngs_ship_page#image_name., NetModelsDircxx . . $ NetModelsDir. /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). shippagecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).->image_namecxx . . $ mngs_ship_page#image_name., shippage->image_namecxx . . $ mngs_ship_page#image_name.,
950 PAGETYPE_SHIPcxx . . $ `lib/manage.h:54:9`!, shippointer->namecxx . . $ ship#name.);
951
952 if (stricmpcxx . . $ `linux/linux_fix.h:43:9`!("INVALID IMAGE NAME", shippage->dying_image_name) != 0 && shippage->dying_image_namecxx . . $ mngs_ship_page#dying_image_name.[0] != 0) {
953 UpdatePrimitivecxx . . $ UpdatePrimitive(563e7f6fc320b4cb).(LocalModelsDircxx . . $ LocalModelsDir. /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). shippagecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).->dying_image_namecxx . . $ mngs_ship_page#dying_image_name., NetModelsDircxx . . $ NetModelsDir. /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). shippagecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).->dying_image_namecxx . . $ mngs_ship_page#dying_image_name.,
954 shippage->dying_image_namecxx . . $ mngs_ship_page#dying_image_name., PAGETYPE_SHIPcxx . . $ `lib/manage.h:54:9`!, shippointer->namecxx . . $ ship#name.);
955 }
956
957 if (shippage->med_image_namecxx . . $ mngs_ship_page#med_image_name.[0] != 0) {
958 UpdatePrimitivecxx . . $ UpdatePrimitive(563e7f6fc320b4cb).(LocalModelsDircxx . . $ LocalModelsDir. /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). shippagecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).->med_image_namecxx . . $ mngs_ship_page#med_image_name., NetModelsDircxx . . $ NetModelsDir. /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). shippagecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).->med_image_namecxx . . $ mngs_ship_page#med_image_name.,
959 shippage->med_image_namecxx . . $ mngs_ship_page#med_image_name., PAGETYPE_SHIPcxx . . $ `lib/manage.h:54:9`!, shippointer->namecxx . . $ ship#name.);
960 }
961
962 if (shippage->lo_image_namecxx . . $ mngs_ship_page#lo_image_name.[0] != 0) {
963 UpdatePrimitivecxx . . $ UpdatePrimitive(563e7f6fc320b4cb).(LocalModelsDircxx . . $ LocalModelsDir. /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). shippagecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).->lo_image_namecxx . . $ mngs_ship_page#lo_image_name., NetModelsDircxx . . $ NetModelsDir. /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). shippagecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).->lo_image_namecxx . . $ mngs_ship_page#lo_image_name.,
964 shippage->lo_image_namecxx . . $ mngs_ship_page#lo_image_name., PAGETYPE_SHIPcxx . . $ `lib/manage.h:54:9`!, shippointer->namecxx . . $ ship#name.);
965 }
966 }
967 #endif
968
969 // Try and load our ship model from the disk
970
971 img_handle = LoadPolyModelcxx . . $ LoadPolyModel(220e687f58daa9be).(shippagecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).->image_namecxx . . $ mngs_ship_page#image_name., 1);
972
973 if (img_handle < 0) {
974 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Couldn't load file '%s' in AssignShipPage...\n", shippage->image_name);
975 shippointer->model_handlecxx . . $ ship#model_handle. = -1;
976 return 0;
977 } else
978 shippointer->model_handlecxx . . $ ship#model_handle. = img_handle;
979
980 if (stricmpcxx . . $ `linux/linux_fix.h:43:9`!("INVALID IMAGE NAME", shippage->dying_image_name) && shippage->dying_image_namecxx . . $ mngs_ship_page#dying_image_name.[0] != 0) {
981 img_handle = LoadPolyModelcxx . . $ LoadPolyModel(220e687f58daa9be).(shippagecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).->dying_image_namecxx . . $ mngs_ship_page#dying_image_name., 1);
982
983 if (img_handle < 0) {
984 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Couldn't load file '%s' in AssignShipPage...\n", shippage->dying_image_name);
985 shippointer->dying_model_handlecxx . . $ ship#dying_model_handle. = -1;
986 return 0;
987 } else
988 shippointer->dying_model_handlecxx . . $ ship#dying_model_handle. = img_handle;
989 } else
990 shippointer->dying_model_handlecxx . . $ ship#dying_model_handle. = -1;
991
992 // Load lo-res stuff
993 if (shippage->med_image_namecxx . . $ mngs_ship_page#med_image_name.[0] != 0) {
994 img_handle = LoadPolyModelcxx . . $ LoadPolyModel(220e687f58daa9be).(shippagecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).->med_image_namecxx . . $ mngs_ship_page#med_image_name., 1);
995
996 if (img_handle < 0) {
997 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Couldn't load file '%s' in AssignShipPage...\n", shippage->med_image_name);
998 shippointer->med_render_handlecxx . . $ ship#med_render_handle. = -1;
999 return 0;
1000 } else
1001 shippointer->med_render_handlecxx . . $ ship#med_render_handle. = img_handle;
1002 } else
1003 shippointer->med_render_handlecxx . . $ ship#med_render_handle. = -1;
1004
1005 if (shippage->lo_image_namecxx . . $ mngs_ship_page#lo_image_name.[0] != 0) {
1006 img_handle = LoadPolyModelcxx . . $ LoadPolyModel(220e687f58daa9be).(shippagecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).->lo_image_namecxx . . $ mngs_ship_page#lo_image_name., 1);
1007
1008 if (img_handle < 0) {
1009 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Couldn't load file '%s' in AssignGenericPage...\n", shippage->lo_image_name);
1010 shippointer->lo_render_handlecxx . . $ ship#lo_render_handle. = -1;
1011 return 0;
1012 } else
1013 shippointer->lo_render_handlecxx . . $ ship#lo_render_handle. = img_handle;
1014 } else
1015 shippointer->lo_render_handlecxx . . $ ship#lo_render_handle. = -1;
1016
1017 // Try and load the various weapons
1018 for (i = 0; i < MAX_PLAYER_WEAPONScxx . . $ `Descent3/player_external_struct.h:91:9`!; i++) {
1019 for (j = 0; j < MAX_WB_GUNPOINTScxx . . $ `lib/robotfirestruct_external.h:22:9`!; j++) {
1020 if (shippage->weapon_namecxx . . $ mngs_ship_page#weapon_name.[i][j][0] != '\0') {
1021 int weapon_handle = mng_GetGuaranteedWeaponPagecxx . . $ mng_GetGuaranteedWeaponPage(a1d8d01c9983cd45).(shippage->weapon_namecxx . . $ mngs_ship_page#weapon_name.[i][j], infile);
1022
1023 if (weapon_handle < 0) {
1024 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Couldn't load weapon file '%s' in AssignPowPage %s...\n", shippage->weapon_name[i][j],
1025 shippage->ship_struct.name);
1026 shippointer->static_wbcxx . . $ ship#static_wb.[i].gp_weapon_indexcxx . . $ otype_wb_info#gp_weapon_index.[j] = LASER_INDEXcxx . . $ `Descent3/weapon_external.h:22:9`!;
1027 } else
1028 shippointer->static_wbcxx . . $ ship#static_wb.[i].gp_weapon_indexcxx . . $ otype_wb_info#gp_weapon_index.[j] = weapon_handle;
1029 } else
1030 shippointer->static_wbcxx . . $ ship#static_wb.[i].gp_weapon_indexcxx . . $ otype_wb_info#gp_weapon_index.[j] = LASER_INDEXcxx . . $ `Descent3/weapon_external.h:22:9`!;
1031 }
1032 }
1033
1034 // Try and load the various weapons
1035 for (i = 0; i < MAX_PLAYER_WEAPONScxx . . $ `Descent3/player_external_struct.h:91:9`!; i++) {
1036 for (j = 0; j < MAX_WB_FIRING_MASKScxx . . $ `lib/robotfirestruct_external.h:23:9`!; j++) {
1037 if (shippage->fire_sound_namecxx . . $ mngs_ship_page#fire_sound_name.[i][j][0] != '\0') {
1038 int fire_sound_handle = mng_GetGuaranteedSoundPagecxx . . $ mng_GetGuaranteedSoundPage(a1d8d01c9983cd45).(shippage->fire_sound_namecxx . . $ mngs_ship_page#fire_sound_name.[i][j], infile);
1039
1040 if (fire_sound_handle < 0) {
1041 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Couldn't load fire_sound file '%s' in AssignPowPage %s...\n", shippage->fire_sound_name[i][j],
1042 shippage->ship_struct.name);
1043 shippointer->static_wbcxx . . $ ship#static_wb.[i].fm_fire_sound_indexcxx . . $ otype_wb_info#fm_fire_sound_index.[j] = SOUND_NONE_INDEXcxx . . $ `Descent3/sounds.h:105:9`!;
1044 } else
1045 shippointer->static_wbcxx . . $ ship#static_wb.[i].fm_fire_sound_indexcxx . . $ otype_wb_info#fm_fire_sound_index.[j] = fire_sound_handle;
1046 } else
1047 shippointer->static_wbcxx . . $ ship#static_wb.[i].fm_fire_sound_indexcxx . . $ otype_wb_info#fm_fire_sound_index.[j] = SOUND_NONE_INDEXcxx . . $ `Descent3/sounds.h:105:9`!;
1048 }
1049 }
1050
1051 for (i = 0; i < MAX_PLAYER_WEAPONScxx . . $ `Descent3/player_external_struct.h:91:9`!; i++) {
1052 if (shippage->firing_sound_namecxx . . $ mngs_ship_page#firing_sound_name.[i][0] != 0) {
1053 int sound_handle = mng_GetGuaranteedSoundPagecxx . . $ mng_GetGuaranteedSoundPage(a1d8d01c9983cd45).(shippage->firing_sound_namecxx . . $ mngs_ship_page#firing_sound_name.[i], infile);
1054
1055 if (sound_handle < 0) {
1056 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Couldn't load firing_sound file '%s' in AssignPowPage %s...\n", shippage->firing_sound_name[i],
1057 shippage->ship_struct.name);
1058 shippointer->firing_soundcxx . . $ ship#firing_sound.[i] = SOUND_NONE_INDEXcxx . . $ `Descent3/sounds.h:105:9`!;
1059 } else
1060 shippointer->firing_soundcxx . . $ ship#firing_sound.[i] = sound_handle;
1061 } else
1062 shippointer->firing_soundcxx . . $ ship#firing_sound.[i] = -1;
1063
1064 if (shippage->release_sound_namecxx . . $ mngs_ship_page#release_sound_name.[i][0] != 0) {
1065 int sound_handle = mng_GetGuaranteedSoundPagecxx . . $ mng_GetGuaranteedSoundPage(a1d8d01c9983cd45).(shippage->release_sound_namecxx . . $ mngs_ship_page#release_sound_name.[i], infile);
1066
1067 if (sound_handle < 0) {
1068 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Couldn't load firing_sound file '%s' in AssignPowPage %s...\n", shippage->release_sound_name[i],
1069 shippage->ship_struct.name);
1070 shippointer->firing_release_soundcxx . . $ ship#firing_release_sound.[i] = SOUND_NONE_INDEXcxx . . $ `Descent3/sounds.h:105:9`!;
1071 } else
1072 shippointer->firing_release_soundcxx . . $ ship#firing_release_sound.[i] = sound_handle;
1073 } else
1074 shippointer->firing_release_soundcxx . . $ ship#firing_release_sound.[i] = -1;
1075
1076 if (shippage->spew_powerup_namecxx . . $ mngs_ship_page#spew_powerup_name.[i][0] != 0) {
1077 shippointer->spew_powerupcxx . . $ ship#spew_powerup.[i] = mng_GetGuaranteedGenericPagecxx . . $ mng_GetGuaranteedGenericPage(a1d8d01c9983cd45).(shippage->spew_powerup_namecxx . . $ mngs_ship_page#spew_powerup_name.[i], infile);
1078 if (shippointer->spew_powerupcxx . . $ ship#spew_powerup.[i] > -1 &&
1079 Object_infocxx . . $ Object_info.[shippointer->spew_powerupcxx . . $ ship#spew_powerup.[i]].typecxx . . $ object_info#type. != OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!) { // DAJ -1FIX
1080 mprintfcxx . . $ `ddebug/mono.h:82:9`!(1, "Spew powerup is not a powerup! Setting to none.\n");
1081 shippointer->spew_powerupcxx . . $ ship#spew_powerup.[i] = -1;
1082 }
1083 } else
1084 shippointer->spew_powerupcxx . . $ ship#spew_powerup.[i] = -1;
1085 }
1086
1087 return 1;
1088 }
1089
1090 // Copies values from a ship into a ship_page
1091 void mng_AssignShipToShipPagecxx . . $ mng_AssignShipToShipPage(6c9ae2d5ec570cce).(int n, mngs_ship_pagecxx . . $ mngs_ship_page# *shippage) {
1092 shipcxx . . $ ship# *shippointer = &Shipscxx . . $ Ships.[n];
1093 int i, j;
1094
1095 // Assign the values
1096 memcpy(&shippage->ship_structcxx . . $ mngs_ship_page#ship_struct., shippointer, sizeof(shipcxx . . $ ship#));
1097
1098 strcpy(shippage->ship_structcxx . . $ mngs_ship_page#ship_struct..namecxx . . $ ship#name., shippointer->namecxx . . $ ship#name.);
1099
1100 if (shippointer->model_handlecxx . . $ ship#model_handle. != -1)
1101 strcpy(shippage->image_namecxx . . $ mngs_ship_page#image_name., Poly_modelscxx . . $ Poly_models.[shippointer->model_handlecxx . . $ ship#model_handle.].namecxx . . $ poly_model#name.);
1102 else
1103 strcpy(shippage->image_namecxx . . $ mngs_ship_page#image_name., "");
1104
1105 if (shippointer->dying_model_handlecxx . . $ ship#dying_model_handle. != -1)
1106 strcpy(shippage->dying_image_namecxx . . $ mngs_ship_page#dying_image_name., Poly_modelscxx . . $ Poly_models.[shippointer->dying_model_handlecxx . . $ ship#dying_model_handle.].namecxx . . $ poly_model#name.);
1107 else
1108 strcpy(shippage->dying_image_namecxx . . $ mngs_ship_page#dying_image_name., "");
1109
1110 if (shippointer->med_render_handlecxx . . $ ship#med_render_handle. != -1)
1111 strcpy(shippage->med_image_namecxx . . $ mngs_ship_page#med_image_name., Poly_modelscxx . . $ Poly_models.[shippointer->med_render_handlecxx . . $ ship#med_render_handle.].namecxx . . $ poly_model#name.);
1112 else
1113 strcpy(shippage->med_image_namecxx . . $ mngs_ship_page#med_image_name., "");
1114
1115 if (shippointer->lo_render_handlecxx . . $ ship#lo_render_handle. != -1)
1116 strcpy(shippage->lo_image_namecxx . . $ mngs_ship_page#lo_image_name., Poly_modelscxx . . $ Poly_models.[shippointer->lo_render_handlecxx . . $ ship#lo_render_handle.].namecxx . . $ poly_model#name.);
1117 else
1118 strcpy(shippage->lo_image_namecxx . . $ mngs_ship_page#lo_image_name., "");
1119
1120 for (i = 0; i < MAX_PLAYER_WEAPONScxx . . $ `Descent3/player_external_struct.h:91:9`!; i++) {
1121 for (j = 0; j < MAX_WB_GUNPOINTScxx . . $ `lib/robotfirestruct_external.h:22:9`!; j++) {
1122 if (shippointer->static_wbcxx . . $ ship#static_wb.[i].gp_weapon_indexcxx . . $ otype_wb_info#gp_weapon_index.[j] >= 0)
1123 strcpy(shippage->weapon_namecxx . . $ mngs_ship_page#weapon_name.[i][j], Weaponscxx . . $ Weapons.[shippointer->static_wbcxx . . $ ship#static_wb.[i].gp_weapon_indexcxx . . $ otype_wb_info#gp_weapon_index.[j]].namecxx . . $ weapon#name.);
1124 else
1125 strcpy(shippage->weapon_namecxx . . $ mngs_ship_page#weapon_name.[i][j], "Laser");
1126 }
1127 }
1128
1129 for (i = 0; i < MAX_PLAYER_WEAPONScxx . . $ `Descent3/player_external_struct.h:91:9`!; i++) {
1130 for (j = 0; j < MAX_WB_FIRING_MASKScxx . . $ `lib/robotfirestruct_external.h:23:9`!; j++) {
1131 if (shippointer->static_wbcxx . . $ ship#static_wb.[i].fm_fire_sound_indexcxx . . $ otype_wb_info#fm_fire_sound_index.[j] >= 0)
1132 strcpy(shippage->fire_sound_namecxx . . $ mngs_ship_page#fire_sound_name.[i][j], Soundscxx . . $ Sounds.[shippointer->static_wbcxx . . $ ship#static_wb.[i].fm_fire_sound_indexcxx . . $ otype_wb_info#fm_fire_sound_index.[j]].namecxx . . $ sound_info#name.);
1133 else
1134 strcpy(shippage->fire_sound_namecxx . . $ mngs_ship_page#fire_sound_name.[i][j], "");
1135 }
1136 }
1137
1138 for (i = 0; i < MAX_PLAYER_WEAPONScxx . . $ `Descent3/player_external_struct.h:91:9`!; i++) {
1139
1140 if (shippointer->firing_soundcxx . . $ ship#firing_sound.[i] != -1)
1141 strcpy(shippage->firing_sound_namecxx . . $ mngs_ship_page#firing_sound_name.[i], Soundscxx . . $ Sounds.[shippointer->firing_soundcxx . . $ ship#firing_sound.[i]].namecxx . . $ sound_info#name.);
1142 else
1143 shippage->firing_sound_namecxx . . $ mngs_ship_page#firing_sound_name.[i][0] = 0;
1144
1145 if (shippointer->firing_release_soundcxx . . $ ship#firing_release_sound.[i] != -1)
1146 strcpy(shippage->release_sound_namecxx . . $ mngs_ship_page#release_sound_name.[i], Soundscxx . . $ Sounds.[shippointer->firing_release_soundcxx . . $ ship#firing_release_sound.[i]].namecxx . . $ sound_info#name.);
1147 else
1148 shippage->release_sound_namecxx . . $ mngs_ship_page#release_sound_name.[i][0] = 0;
1149
1150 if (shippointer->spew_powerupcxx . . $ ship#spew_powerup.[i] != -1) {
1151 if (Object_infocxx . . $ Object_info.[shippointer->spew_powerupcxx . . $ ship#spew_powerup.[i]].typecxx . . $ object_info#type. != OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!) {
1152 mprintfcxx . . $ `ddebug/mono.h:82:9`!(1, "Spew powerup is not a powerup! Setting to none.\n");
1153 shippage->spew_powerup_namecxx . . $ mngs_ship_page#spew_powerup_name.[i][0] = 0;
1154 } else
1155 strcpy(shippage->spew_powerup_namecxx . . $ mngs_ship_page#spew_powerup_name.[i], Object_infocxx . . $ Object_info.[shippointer->spew_powerupcxx . . $ ship#spew_powerup.[i]].namecxx . . $ object_info#name.);
1156 } else
1157 shippage->spew_powerup_namecxx . . $ mngs_ship_page#spew_powerup_name.[i][0] = 0;
1158 }
1159 }
1160
1161 // Loads a ship found in the net table file. It then allocs a ship and
1162 // then calls SetAndLoadShip to actually load in any images/models associated
1163 // with it
1164 void mng_LoadNetShipPagecxx . . $ mng_LoadNetShipPage(5a5441f2f69caf20).(CFILEcxx . . $ CFILE# *infile, bool overlay) {
1165 mngs_ship_pagecxx . . $ mngs_ship_page# shippage;
1166 // Have to zero out all fields that are not in the page (some physics fields), else we
1167 // end up with random values for initial velocity and the such... :)
1168 memset(&shippage, 0, sizeof(mngs_ship_pagecxx . . $ mngs_ship_page#));
1169
1170 if (mng_ReadNewShipPagecxx . . $ mng_ReadNewShipPage(ec0053c10eec018b).(infile, &shippage)) {
1171 int n = FindShipNamecxx . . $ FindShipName(5c4306d8553b3696).(shippage.ship_structcxx . . $ mngs_ship_page#ship_struct..namecxx . . $ ship#name.);
1172 if (n != -1) {
1173 if (overlay) {
1174 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "OVERLAYING SHIP %s\n", shippage.ship_struct.name);
1175 mng_FreePagetypePrimitivescxx . . $ mng_FreePagetypePrimitives(99469d7ff9a1485a).(PAGETYPE_SHIPcxx . . $ `lib/manage.h:54:9`!, shippage.ship_structcxx . . $ mngs_ship_page#ship_struct..namecxx . . $ ship#name., 0);
1176 mng_AssignShipPageToShipcxx . . $ mng_AssignShipPageToShip(9d5a2a40285cb110).(&shippage, n);
1177 }
1178 return;
1179 }
1180 int ret = mng_SetAndLoadShipcxx . . $ mng_SetAndLoadShip(7b471d26e5a265f8).(&shippage, infile);
1181 ASSERTcxx . . $ `misc/pserror.h:246:9`!(ret >= 0);
1182 } else
1183 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Could not load shippage named %s!\n", shippage.ship_struct.name);
1184 }
1185
1186 // Reads a ship page from a local table file. It then allocs a ship and
1187 // loads any images/models associated with that ship
1188 void mng_LoadLocalShipPagecxx . . $ mng_LoadLocalShipPage(3639e799710acb68).(CFILEcxx . . $ CFILE# *infile) {
1189 mngs_ship_pagecxx . . $ mngs_ship_page# shippage;
1190 int ok = 0;
1191 // Have to zero out all fields that are not in the page (some physics fields), else we
1192 // end up with random values for initial velocity and the such... :)
1193 memset(&shippage, 0, sizeof(mngs_ship_pagecxx . . $ mngs_ship_page#));
1194
1195 if (mng_ReadNewShipPagecxx . . $ mng_ReadNewShipPage(ec0053c10eec018b).(infile, &shippage)) {
1196 // Check to see if this is a local copy that is supposed
1197 // to go over a network copy (supersede the net copy)
1198
1199 int i = FindShipNamecxx . . $ FindShipName(5c4306d8553b3696).(shippage.ship_structcxx . . $ mngs_ship_page#ship_struct..namecxx . . $ ship#name.);
1200 if (i != -1) {
1201 // Make sure we really have this page checked out
1202 mngs_Pagelockcxx . . $ mngs_Pagelock# pl;
1203
1204 strcpy(pl.namecxx . . $ mngs_Pagelock#name., shippage.ship_structcxx . . $ mngs_ship_page#ship_struct..namecxx . . $ ship#name.);
1205 pl.pagetypecxx . . $ mngs_Pagelock#pagetype. = PAGETYPE_SHIPcxx . . $ `lib/manage.h:54:9`!;
1206
1207 /*if (Network_up && Stand_alone==0)
1208 {
1209 int locked=mng_CheckIfPageOwned(&pl,TableUser);
1210 if (locked!=1)
1211 Int3(); // Your local vs net copies of the lock file do not match
1212 }*/
1213 ok = 1;
1214 bool need_to_load_page = true;
1215
1216 if (Loading_addon_tablecxx . . $ Loading_addon_table. != -1) {
1217 AddOnTablefilecxx . . $ AddOnTablefile# *addon;
1218 int tidx;
1219
1220 // see if we really need to load this page
1221 // check to see if we already have loaded this page (because it was
1222 // a dependancy of another)
1223 addon = &AddOnDataTablescxx . . $ AddOnDataTables.[Loading_addon_tablecxx . . $ Loading_addon_table.];
1224 for (tidx = 0; tidx < addon->Num_addon_tracklockscxx . . $ AddOnTablefile#Num_addon_tracklocks.; tidx++) {
1225 if (addon->Addon_tracklockscxx . . $ AddOnTablefile#Addon_tracklocks.[tidx].pagetypecxx . . $ mngs_track_lock#pagetype. == PAGETYPE_SHIPcxx . . $ `lib/manage.h:54:9`! &&
1226 !stricmpcxx . . $ `linux/linux_fix.h:43:9`!(addon->Addon_tracklocks[tidx].name, shippage.ship_struct.name)) {
1227 // found it!!
1228 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "ShipPage: %s previously loaded\n", shippage.ship_struct.name);
1229 need_to_load_page = false;
1230 break;
1231 }
1232 }
1233 }
1234
1235 if (need_to_load_page) {
1236 mng_FreePagetypePrimitivescxx . . $ mng_FreePagetypePrimitives(99469d7ff9a1485a).(PAGETYPE_SHIPcxx . . $ `lib/manage.h:54:9`!, shippage.ship_structcxx . . $ mngs_ship_page#ship_struct..namecxx . . $ ship#name., 0);
1237 mng_AssignShipPageToShipcxx . . $ mng_AssignShipPageToShip(9d5a2a40285cb110).(&shippage, i);
1238
1239 // For addon data
1240 if (ok && Loading_addon_tablecxx . . $ Loading_addon_table. != -1) {
1241 // this is an overlay of some sort..see which we are overlaying
1242 int overlay = 1;
1243 int addidx, tidx;
1244 bool found = false;
1245 for (addidx = Num_addon_tablescxx . . $ Num_addon_tables. - 1; addidx >= 0; addidx--) {
1246 if (addidx == Loading_addon_tablecxx . . $ Loading_addon_table.)
1247 continue;
1248 AddOnTablefilecxx . . $ AddOnTablefile# *addon = &AddOnDataTablescxx . . $ AddOnDataTables.[addidx];
1249
1250 // look for the page in this table file
1251 for (tidx = 0; tidx < addon->Num_addon_tracklockscxx . . $ AddOnTablefile#Num_addon_tracklocks.; tidx++) {
1252 if (addon->Addon_tracklockscxx . . $ AddOnTablefile#Addon_tracklocks.[tidx].pagetypecxx . . $ mngs_track_lock#pagetype. == PAGETYPE_SHIPcxx . . $ `lib/manage.h:54:9`! &&
1253 !stricmpcxx . . $ `linux/linux_fix.h:43:9`!(addon->Addon_tracklocks[tidx].name, shippage.ship_struct.name)) {
1254 // found it!!
1255 found = true;
1256 overlay = addidx + 2;
1257 break;
1258 }
1259 }
1260
1261 if (found)
1262 break;
1263 }
1264
1265 mng_PushAddonPagecxx . . $ mng_PushAddonPage(99469d7ff9a1485a).(PAGETYPE_SHIPcxx . . $ `lib/manage.h:54:9`!, shippage.ship_structcxx . . $ mngs_ship_page#ship_struct..namecxx . . $ ship#name., overlay);
1266 }
1267 }
1268 } else {
1269 // This is a local ship that has never been checked in
1270 if ((i = mng_SetAndLoadShipcxx . . $ mng_SetAndLoadShip(7b471d26e5a265f8).(&shippage, infile)) < 0)
1271 ok = 0;
1272 else
1273 ok = 1;
1274
1275 // For addon data
1276 if (ok && Loading_addon_tablecxx . . $ Loading_addon_table. != -1)
1277 mng_PushAddonPagecxx . . $ mng_PushAddonPage(99469d7ff9a1485a).(PAGETYPE_SHIPcxx . . $ `lib/manage.h:54:9`!, shippage.ship_structcxx . . $ mngs_ship_page#ship_struct..namecxx . . $ ship#name., 0);
1278 }
1279
1280 ASSERTcxx . . $ `misc/pserror.h:246:9`!(ok == 1);
1281
1282 if (Loading_addon_tablecxx . . $ Loading_addon_table. == -1)
1283 mng_AllocTrackLockcxx . . $ mng_AllocTrackLock(6abd07ddb1a912f0).(shippage.ship_structcxx . . $ mngs_ship_page#ship_struct..namecxx . . $ ship#name., PAGETYPE_SHIPcxx . . $ `lib/manage.h:54:9`!);
1284
1285 if (i != -1) {
1286 poly_modelcxx . . $ poly_model# *pm = GetPolymodelPointercxx . . $ GetPolymodelPointer(ac85e77c73ebf794).(Shipscxx . . $ Ships.[i].model_handlecxx . . $ ship#model_handle.); // page in the model
1287 if (pm->n_attachcxx . . $ poly_model#n_attach. < 3) { // check for enough attach points
1288 DataErrorcxx . . $ DataError(326aeb464d16410c).("Model <%s> for ship <%s> has %d attach points (must have at least 3)\n", pm->namecxx . . $ poly_model#name., Shipscxx . . $ Ships.[i].namecxx . . $ ship#name.,
1289 pm->n_attachcxx . . $ poly_model#n_attach.);
1290 }
1291 FreePolymodelDatacxx . . $ FreePolymodelData(d4f767463ce0a6b3).(
1292 Shipscxx . . $ Ships.[i].model_handlecxx . . $ ship#model_handle.); // Unload the data so it will get loaded later after the textures are in memory
1293 }
1294 } else
1295
1296 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Could not load shippage named %s!\n", shippage.ship_struct.name);
1297 }