Debian Codegraph @

Descent3/pilot.cpp

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
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/pilot.cpp $
21 * $Revision: 175 $
22 * $Date: 3/20/00 12:07p $
23 * $Author: Matt $
24 *
25 * Player/Pilot configuration
26 *
27 * $Log: /DescentIII/main/pilot.cpp $
28 *
29 * 175 3/20/00 12:07p Matt
30 * Merge of Duane's post-1.3 changes.
31 * Changed difficulty level to be a global variable instead of a function
32 * call
33 *
34 * 174 11/30/99 5:08p Jeff
35 * don't let the Black Pyro be selected in LInux
36 *
37 * 173 10/21/99 9:27p Jeff
38 * B.A. Macintosh code merge
39 *
40 * 172 10/19/99 4:55p Jeff
41 * only let them select Black Pyro if they own Mercenary
42 *
43 * 171 10/04/99 9:57a Kevin
44 * #ifdef for demo, only pyro is available
45 *
46 * 170 9/12/99 12:09a Jeff
47 * fixed stupid axtoi bug
48 *
49 * 169 9/03/99 4:37p Jeff
50 * fixed bug related to highlighting an oaf if it is supposed to be
51 * selected in the pilot config dialog
52 *
53 * 168 7/23/99 2:36p Jeff
54 * put in warning message if imported oaf file is too large
55 *
56 * 167 7/06/99 11:47p Jeff
57 * Added delete buttons for audio taunts and logos
58 *
59 * 166 5/25/99 3:09a Jeff
60 * don't let a player start in secret levels if they beat the game
61 *
62 * 165 5/24/99 7:24p Samir
63 * use correct string length for DoEditDialog now.
64 *
65 * 164 5/23/99 2:22a Jeff
66 * don't update some mission stuff for secret levels. correctly update
67 * when finished the level
68 *
69 * 163 5/12/99 2:24p Jeff
70 * Descent3 now has a setable temp directory for all temp files
71 *
72 * 162 5/12/99 2:02p Samir
73 * don't open pilot interface until inputted name of new pilot.
74 *
75 * 161 5/10/99 10:23p Ardussi
76 * changes to compile on Mac
77 *
78 * 160 5/09/99 6:30a Jeff
79 * fixed copy controls bug when there was .pld's but only 1 plt
80 *
81 * 159 5/05/99 12:43a Jeff
82 * selected imported logo, don't stop sounds
83 *
84 * 158 5/03/99 8:38a Jeff
85 * fixed copy controls
86 *
87 * 157 5/02/99 12:55a Jeff
88 * save ship permissions at highest level achieved and use that on restore
89 * to a level previously played
90 *
91 * 156 5/01/99 12:17a Jeff
92 * adjusted config due to new artwork
93 *
94 * 155 4/29/99 5:52p Jeff
95 * if displaying 1 pilot pic, don't put index number at the end of name
96 *
97 * 154 4/29/99 2:19a Samir
98 * updated art for options style menu.
99 *
100 * 153 4/28/99 5:06p Jeff
101 * widened copy controls dialog
102 *
103 * 152 4/27/99 1:56p Jeff
104 * audio taunts stuff in pilot menu, added stringtables
105 *
106 * 151 4/26/99 2:13p Jeff
107 * go right into preset select on new pilot
108 *
109 * 150 4/25/99 4:53p Jeff
110 * fixed startframe/endframe bugs in D3D
111 *
112 * 149 4/25/99 2:32a Jeff
113 * fixed bug trying to read pilot files that are too new
114 *
115 * 148 4/23/99 9:52p Jeff
116 * fixed messed up string for ship selection
117 *
118 * 147 4/21/99 4:54p Jeff
119 * display name of pilot being configured
120 *
121 * 146 4/21/99 12:58p Samir
122 * progress bar for ship config.
123 *
124 * 145 4/21/99 12:43p Samir
125 * redid pilot taunt menu for newui.
126 *
127 * 144 4/20/99 7:28p Jeff
128 * added guidebot name
129 *
130 * 143 4/18/99 7:55p Samir
131 * new progress indicator for delays when loading data.
132 *
133 * 142 4/16/99 6:00p Kevin
134 * Bunches of Demo stuff
135 *
136 * 141 4/16/99 12:05p Matt
137 * Changed code to use cfile functions, & took out include of io.h.
138 *
139 * 140 4/16/99 12:39a Matt
140 * Took out Linux ifdef around include of io.h, since it's a system header
141 * file and there's no harm in including it in the Windows version.
142 *
143 * 139 4/14/99 3:57a Jeff
144 * fixed case mismatch in #includes
145 *
146 * 138 4/09/99 7:04p Jason
147 * changed some texture defines
148 *
149 * 137 4/04/99 3:27p Jeff
150 * localized pilot.cpp
151 *
152 * 136 4/03/99 9:26p Jeff
153 * changed dialogs that weren't using UID_OK and UID_CANCEL to use and
154 * handle them properly
155 *
156 * 135 4/03/99 2:18a Jeff
157 * added profanity filter stuff
158 *
159 * 134 3/30/99 7:41p Jeff
160 * error handling...reset ppic if there isn't a valid one
161 *
162 * 133 3/30/99 5:30p Jeff
163 * fixed bug when canceling out of multiplayer ship config
164 *
165 * 132 3/24/99 1:41p Jeff
166 * some dedicated server fixups...ability to set number of teams
167 *
168 * 131 3/23/99 4:26p Jeff
169 * new pilot choose dialog
170 *
171 * 130 3/23/99 12:45p Jeff
172 * added preset control selection for pilot
173 *
174 * 129 3/22/99 6:22p Jeff
175 * added 2 more audio taunts. a mulitplayer event when someone plays an
176 * audio taunt. option to disable audio taunts.
177 *
178 * 128 3/19/99 9:14p Jeff
179 * converted multiplayer ship selection dialog
180 *
181 * 127 3/18/99 2:33p Jeff
182 * fixed bug clearing the Current pilot stuff before we were done using it
183 *
184 * 126 3/17/99 11:48a Jeff
185 * enter selects pilot on dialog display
186 *
187 * 125 3/15/99 9:24p Gwar
188 *
189 * 124 3/15/99 4:31p Jeff
190 * fixed some memory leaks
191 *
192 * 123 3/04/99 6:07p Samir
193 * fixed bug with entering pilot names for the first time (buffer sent to
194 * DoEditDialog was not null terminated.) Also added wait screen.
195 *
196 * 122 3/04/99 11:40a Jeff
197 * better error messages on pilot write error
198 *
199 * 121 3/03/99 5:09p Samir
200 * fixed audio taunt combobox. Passed incorrect flag values.
201 *
202 * 120 3/01/99 4:39p Samir
203 * made AddOption to AddSimpleOption for options without sheets.
204 *
205 * 119 2/28/99 6:05p Jeff
206 * use UID_OK and UID_CANCEL
207 *
208 * 118 2/28/99 3:17p Jeff
209 * multiplayer ship selection only has Pyro-GL
210 *
211 * 117 2/28/99 3:06a Jeff
212 * converted "select pilot pic" dialog
213 *
214 * 116 2/27/99 4:18p Jeff
215 * added support for .pld files (used to copy pilot default controls),
216 * audio taunt size import error fixed...removed dead code
217 *
218 * 115 2/25/99 4:30p Jeff
219 * mission data of pilot keeps track of all missions, not just after you
220 * beat a level
221 *
222 * 114 2/23/99 7:34p Jeff
223 * use new ui for add dialog
224 *
225 * 113 2/23/99 1:47a Jeff
226 * attempted to convert add new pilot
227 *
228 * 109 2/19/99 12:14a Jeff
229 * start of new ui conversion
230 *
231 * 108 2/15/99 7:50p Jeff
232 * new pilot file class and read/write system checked in...should be more
233 * robust than old
234 *
235 * 107 2/10/99 4:45p Jeff
236 * table file parser stuff
237 *
238 * 106 1/29/99 5:22p Jeff
239 * localization
240 *
241 * 105 1/27/99 5:47p Jeff
242 * audio taunts implemented!
243 *
244 * 104 1/21/99 11:15p Jeff
245 * pulled out some structs and defines from header files and moved them
246 * into seperate header files so that multiplayer dlls don't require major
247 * game headers, just those new headers. Side effect is a shorter build
248 * time. Also cleaned up some header file #includes that weren't needed.
249 * This affected polymodel.h, object.h, player.h, vecmat.h, room.h,
250 * manage.h and multi.h
251 *
252 * 103 1/16/99 2:55p Jeff
253 * mission data doesn't get updated in a multiplayer game
254 *
255 * 102 1/11/99 4:08p Jason
256 * added multiplayer taunt macros
257 *
258 * 101 12/30/98 6:51p Matt
259 * Fixed compile warnings
260 *
261 * 100 12/17/98 5:59p Samir
262 * moved mouse enabled and joy enabled to config menu.
263 *
264 * 99 12/17/98 12:44p Samir
265 * fixed bugs in writing 0 length strings in pilot file!
266 *
267 * 98 12/16/98 1:57p Samir
268 * added finished field to mission data structure.
269 *
270 * 97 12/15/98 4:28p Jeff
271 * added mission data information to the pilot files to save what the
272 * highest level they achieved on a mission is. Added level select dialog
273 * (not hooked up) and level warp cheat.
274 *
275 * 96 12/03/98 11:06a Samir
276 * added axis sensitivity
277 *
278 * 95 12/02/98 11:43a Samir
279 * added better code to handle changes in controller function list for
280 * pilot files (needed to have a constant giving number of controller
281 * functions in demo 1.0)
282 *
283 * 94 12/01/98 5:47p Jeff
284 * created pilot picture selection dialog
285 *
286 * 93 11/30/98 11:56a Jeff
287 * fixed bug, allowing unlimited pilots
288 *
289 * 92 11/23/98 11:25a Jeff
290 * fixed import animated bitmap message box bug
291 *
292 * 91 10/27/98 2:31p Jeff
293 * adjusted play button for audio taunts on ship config dialog
294 *
295 * 90 10/23/98 2:58p Samir
296 * set defaults for controller sensitivities.
297 *
298 * 89 10/22/98 10:55p Jeff
299 * return error if reading a pilot file that is newer than we support
300 *
301 * 88 10/22/98 10:38p Jeff
302 * a decent pilot file version check for later pilot file versions
303 *
304 * 87 10/22/98 2:58p Chris
305 * Difficulty levels are in beta
306 *
307 * 86 10/22/98 2:41p Samir
308 * fixed autoselection for good.
309 *
310 * 85 10/22/98 2:25p Jeff
311 * fixed bug
312 *
313 * 84 10/22/98 1:35p Jeff
314 *
315 * 83 10/22/98 1:30p Jeff
316 * brought back difficulty
317 *
318 * 82 10/21/98 11:54p Samir
319 * fixed typos.
320 *
321 * 81 10/21/98 7:15p Samir
322 * added joy and mouse sensitivities for pilot.
323 *
324 * 80 10/21/98 10:36a Samir
325 * added code to turn on or off joystick or mouse.
326 *
327 * 79 10/20/98 1:41a Jeff
328 * a couple more improvements to ImportGraphic
329 *
330 * 78 10/20/98 12:59a Jeff
331 * fixed pilot import bitmap
332 *
333 * 77 10/19/98 10:41a Jeff
334 * moved pilot select window down to uncover "demo"
335 *
336 * 76 10/18/98 10:07p Jeff
337 * automatically chooses the last used pilot
338 *
339 * 75 10/17/98 7:31p Samir
340 * added invertible axes
341 *
342 * 74 10/15/98 1:36p Jeff
343 * allow cancel out of pilot select menu
344 *
345 * 73 10/15/98 11:48a Samir
346 * fixed pilot create so it initializes the proper defaults.
347 *
348 * 72 10/14/98 6:39p Samir
349 * save screen size for game.
350 *
351 * 71 10/14/98 2:48p Kevin
352 * Changed memory code to comply with mem lib
353 *
354 * 70 10/12/98 3:02p Jeff
355 * added a verify function, give warning when they go into Multiplayer
356 * ship customize with a bad ship
357 *
358 * 69 10/11/98 3:02a Jeff
359 * handle the case where a player has a ship selected in his pilot file,
360 * but the ship doesn't exist in the game
361 *
362 * 68 10/09/98 3:32p Kevin
363 * New memory library
364 *
365 * 67 10/09/98 3:36p Jeff
366 * attempted to fix Pyro-SE for demo again
367 *
368 * 66 10/09/98 3:06p Jeff
369 * fixed default_ship for demo
370 *
371 * 65 10/08/98 6:41p Jeff
372 * when creating your first pilot it immediatly returns you to main menu
373 *
374 * 64 10/08/98 4:23p Kevin
375 * Changed code to comply with memory library usage. Always use mem_malloc
376 * , mem_free and mem_strdup
377 *
378 * 63 10/06/98 5:34p Jeff
379 * various UI changes/improvements
380 *
381 * 62 10/01/98 2:19p Samir
382 * took out DEMO define.
383 *
384 * 61 10/01/98 12:58p Samir
385 * save autoselect ordering.
386 *
387 * 60 9/29/98 11:20a Jeff
388 * set buffer length on pilotcreate to correct size
389 *
390 * 59 9/28/98 4:35p Jeff
391 * general UI changes and improvements
392 *
393 * 58 9/24/98 10:45a Jeff
394 * keep PyroGL the only ship to be allowed to be selected
395 *
396 * 57 9/23/98 6:19p Jeff
397 * finished up (hopefully) updating the config/ui dialogs to meet our
398 * standard. Keyboard/joystick config still needs some work
399 *
400 * 56 9/23/98 3:07p Jeff
401 * updated the colors and various other items of config and UI
402 *
403 * 55 9/22/98 3:56p Samir
404 * special demo code doesn't allow pilot and mission stuff.
405 *
406 * 54 9/08/98 11:41a Jeff
407 * new pilot selection interface
408 *
409 * 53 9/04/98 3:52p Jeff
410 * changes made from UI meeting
411 *
412 * 52 9/04/98 1:20p Jeff
413 * updates to ship selection, now includes audio taunts, strips crc's from
414 * filenames when displaying
415 *
416 * 51 9/02/98 2:54p Jeff
417 * added defines for text colors to be used throughout the game...fixed up
418 * buddy menu too
419 *
420 * 50 8/31/98 5:20p Jeff
421 * put in callback for ship selection UI
422 *
423 * 49 8/31/98 12:38p Samir
424 * don't call setlistindex.
425 *
426 * 48 8/29/98 6:53p Jeff
427 * added single-player ship selection
428 *
429 * 47 8/15/98 5:16p Matt
430 * Added new Base_directory variable. Got rid of D3_LOCAL check and
431 * 'local directory' registry variable.
432 *
433 * 46 8/14/98 2:24p Jeff
434 * give error message on error import
435 *
436 * 45 8/06/98 4:59p Jeff
437 * now imports graphic files to ogfs
438 *
439 * 44 8/04/98 5:41p Jeff
440 * fixed bug if user selected none for texture
441 *
442 * 43 8/03/98 12:20p Jeff
443 * fixed some more bugs in ship config
444 *
445 * 42 8/03/98 10:42a Jeff
446 * forgot to DrawPolymodel with effect on ship config
447 *
448 * 41 7/30/98 2:48p Jeff
449 *
450 * 40 7/30/98 12:32p Jeff
451 * everything working for ship customization, including importing of ifl
452 *
453 * 39 7/29/98 5:39p Jeff
454 * updated
455 *
456 * 38 7/28/98 4:16p Jeff
457 * ship dialog is in and working good
458 *
459 * 37 7/27/98 6:26p Jeff
460 * basic implementation of ship configurations...needs to be purtied up
461 *
462 * 36 6/22/98 7:31p Samir
463 * added UIEdit::Activate, which activates an edit box manually.
464 *
465 * 35 6/19/98 5:39p Samir
466 * save out hud mode too.
467 *
468 * 34 6/19/98 3:32p Samir
469 * initialize hud layout in PilotInit.
470 *
471 * 33 6/19/98 3:30p Samir
472 * added hud layout info in pilot file.
473 *
474 * 32 6/18/98 4:48p Samir
475 * added changes for multiple configs for joystick controls.
476 *
477 * 31 6/17/98 3:28p Jeff
478 * localization changes. made an init function
479 *
480 * 30 6/16/98 10:54a Jeff
481 *
482 * 29 6/12/98 5:56p Jeff
483 * localization test
484 *
485 * 28 6/01/98 10:57a Jeff
486 * Fixed Pilot read bug. Fixed name length on Pilot create dialog
487 *
488 * 27 5/24/98 2:56a Jeff
489 * Pilot dialogs up to date
490 *
491 * 26 4/23/98 11:14p Samir
492 * added read controller flag to pilot
493 *
494 * 25 4/14/98 7:31p Matt
495 * Changed code to use ddio_MakePath() instead of sprintf() to create file
496 * spec
497 *
498 * 24 4/13/98 7:01p Samir
499 * added snazzy listbox and edit box art.
500 *
501 * 23 4/02/98 7:58p Samir
502 * Fixed up control setting saving and restoring.
503 *
504 * 22 4/01/98 3:34p Jeff
505 * ship_model is now a string
506 *
507 * 21 3/23/98 11:09a Jeff
508 * Fixed up the "Choose A Pilot" window
509 *
510 * 20 3/20/98 5:34p Jeff
511 * Added Copy Controls from a pilot support
512 *
513 * 19 3/20/98 1:19p Jeff
514 * Changes made to use Default_pilot string for pilot filename to use.
515 *
516 * 18 3/19/98 6:57p Jeff
517 * Pilot stuff reads and writes to the correct directories
518 *
519 * 17 3/18/98 7:49p Samir
520 * Maybe fixed controller config init mess.
521 *
522 * 16 3/16/98 3:26p Samir
523 * Fixed controller need ID and index discrepancy.
524 *
525 * 15 3/13/98 8:55p Jeff
526 * Various changes to move control configuration into Pilot file
527 *
528 * 14 3/13/98 5:32p Jeff
529 * close the display window before displaying delete confirmation box
530 *
531 * 13 3/13/98 5:19p Jeff
532 * UIListBoxes have scroll button code now
533 *
534 * 12 3/12/98 7:10p Jeff
535 * double clicking on pilot list selects pilot
536 *
537 * 11 3/12/98 2:00p Jeff
538 * Various changes to improve pilot dialogs
539 *
540 * 10 3/11/98 5:38p Jeff
541 * Now use the NewUIMessageBox for small windows
542 *
543 * 9 3/10/98 7:08p Jeff
544 * Various changes due to new window class
545 *
546 * 8 3/10/98 11:57a Jeff
547 * Corrected some function comments and made '.' a valid filename
548 * character
549 *
550 * 7 3/10/98 11:50a Jeff
551 * Added filename field to pilot structure, which keeps track of the pilot
552 * filename...fixes any bugs that come with renaming a file. Made changes
553 * to take advantage of this.
554 *
555 * 6 3/10/98 11:12a Jeff
556 * Made various changes to accomodate Samir's Listbox callback paradigm
557 *
558 * 5 3/09/98 6:27p Jeff
559 * Cleaned up code, made file operations more robust, pretty sturdy now
560 *
561 * 4 3/09/98 4:00p Jeff
562 * Various improvements
563 *
564 * 3 3/06/98 6:32p Jeff
565 * Added Pilot files and major functionality
566 *
567 * 2 3/05/98 4:28p Jeff
568 * Initial creation
569 *
570 * $NoKeywords: $
571 */
572
573 #include <cstdio>
574
575 #include <stdlib.h>
576 #include <string.h>
577 #include <stdarg.h>
578
579 #include "pilot.h"cxx . . $ `<file>/Descent3/pilot.h`/
580 #include "mono.h"cxx . . $ `<file>/ddebug/mono.h`/
581 #include "renderer.h"cxx . . $ `<file>/lib/renderer.h`/
582 #include "render.h"cxx . . $ `<file>/Descent3/render.h`/
583 #include "ddio.h"cxx . . $ `<file>/ddio/ddio.h`/
584 #include "descent.h"cxx . . $ `<file>/Descent3/descent.h`/
585 #include "game.h"cxx . . $ `<file>/Descent3/game.h`/
586 #include "cfile.h"cxx . . $ `<file>/cfile/cfile.h`/
587 #include "application.h"cxx . . $ `<file>/lib/application.h`/
588 #include "manage.h"cxx . . $ `<file>/lib/manage.h`/
589 #include "newui.h"cxx . . $ `<file>/Descent3/newui.h`/
590 #include "grtext.h"cxx . . $ `<file>/grtext/grtext.h`/
591 #include "gamefont.h"cxx . . $ `<file>/Descent3/gamefont.h`/
592 #include "ConfigItem.h"cxx . . $ `<file>/Descent3/ConfigItem.h`/
593 #include "ctlconfig.h"cxx . . $ `<file>/Descent3/ctlconfig.h`/
594 #include "hud.h"cxx . . $ `<file>/Descent3/hud.h`/
595 #include "stringtable.h"cxx . . $ `<file>/Descent3/stringtable.h`/
596 #include "gametexture.h"cxx . . $ `<file>/Descent3/gametexture.h`/
597 #include "vclip.h"cxx . . $ `<file>/Descent3/vclip.h`/
598 #include "hlsoundlib.h"cxx . . $ `<file>/sndlib/hlsoundlib.h`/
599 #include "weapon.h"cxx . . $ `<file>/Descent3/weapon.h`/
600 #include "config.h"cxx . . $ `<file>/Descent3/config.h`/
601 #include "difficulty.h"cxx . . $ `<file>/Descent3/difficulty.h`/
602 #include "PilotPicsAPI.h"cxx . . $ `<file>/Descent3/PilotPicsAPI.h`/
603 #include "Mission.h"cxx . . $ `<file>/Descent3/Mission.h`/
604 #include "mem.h"cxx . . $ `<file>/mem/mem.h`/
605 #include "polymodel.h"cxx . . $ `<file>/model/polymodel.h`/
606 #include "audiotaunts.h"cxx . . $ `<file>/Descent3/audiotaunts.h`/
607 #include "streamaudio.h"cxx . . $ `<file>/stream_audio/streamaudio.h`/
608 #include "ship.h"cxx . . $ `<file>/Descent3/ship.h`/
609 #include "dedicated_server.h"cxx . . $ `<file>/lib/dedicated_server.h`/
610
611 // some general defines
612 #define IDP_SAVEcxx . . $ `Descent3/pilot.cpp:612:9`! 10
613 #define IDP_CANCELcxx . . $ `Descent3/pilot.cpp:613:9`! 11
614 #define IDP_APPLYcxx . . $ `Descent3/pilot.cpp:614:9`! 12
615
616 // used for the Pilot file functions
617 #define PLTWILDCARDcxx . . $ `Descent3/pilot.cpp:617:9`! "*.plt"
618 #define PLTEXTENSIONcxx . . $ `Descent3/pilot.cpp:618:9`! ".plt"
619 #define DPLTWILDCARDcxx . . $ `Descent3/pilot.cpp:619:9`! "*.pld"
620 #define PLTFILELENcxx . . $ `Descent3/pilot.cpp:620:9`! 260
621
622 #define MAX_AUDIOTAUNTSIZEcxx . . $ `Descent3/pilot.cpp:622:9`! (32 * 1024)
623
624 // !!!!!(PLEASE VERSION CHECK ON READ TO MAINTAIN PILOT COMPAT.)!!!!
625 // 0x20 NEW PILOT FILE READ->WRITE
626 // 0x12 ????
627 // 0x11 added finished field to mission data -Samir
628 // 0x10 added mission data - Jeff
629 // 0xf write out multiple joystick and mouse sensitivities.-Samir
630 // 0xe write out number of controller functions in file-Samir
631 // 0xd added pilot picture id
632 // 0xc added mouse and joy sensitivities -Samir.
633 // 0xb added invertible axes - Samir
634 // 0xa Added game window size-Samir
635 // 0x9 Added weapon selection info -Samir
636 // 0x8 Added audio taunt files - Jeffrey
637 // 0x7 Added ship logo - Jeff
638 // 0x6 Added default hud mode- Samir
639 // 0x5 Added hud layout info- Samir
640 // 0x4 Added read controller flag- Samir.
641 #define PLTFILEVERSIONcxx . . $ `Descent3/pilot.cpp:641:9`! 0x12
642
643 // border size of the UI window
644 #define UI_BORDERSIZEcxx . . $ `Descent3/pilot.cpp:644:9`! 20
645
646 ///////////////////////////////////////////////
647 // Externals (Globals for the game)
648
649 // Game global for current pilot
650 pilotcxx . . $ pilot# Current_pilotcxx . . $ Current_pilot.;
651 char Default_pilotcxx . . $ Default_pilot.[_MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`!] = {" "};
652 uint8_tcxx . . $ uint8_t# ingame_difficultycxx . . $ ingame_difficulty. = 1;
653
654 ///////////////////////////////////////////////
655 // Internals (Globals for the file)
656
657 bool DisplayFileDialogcxx . . $ DisplayFileDialog(d208b9c33548a144).(char *path, char *title, char *wildcards, int flags);
658
659 // internal function prototypes
660 bool PltDeletecxx . . $ PltDelete(70381b455242efa3).(pilotcxx . . $ pilot# *Pilot);
661 void NewPltUpdatecxx . . $ NewPltUpdate(f5615d74c210c1ee).(newuiListBoxcxx . . $ newuiListBox# *list, char **flist, int filecount, int selected, char *filename = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
662 bool PilotChoosecxx . . $ PilotChoose(350c0e311af7e077).(pilotcxx . . $ pilot# *Pilot, bool presets = false);
663 bool PltCopyKeyConfigcxx . . $ PltCopyKeyConfig(f7d02c5db1b5d721).(pilotcxx . . $ pilot# *src, pilotcxx . . $ pilot# *dest);
664 bool PltSelectShipcxx . . $ PltSelectShip(70381b455242efa3).(pilotcxx . . $ pilot# *Pilot);
665 void ShipSelectCallBackcxx . . $ ShipSelectCallBack(d4f767463ce0a6b3).(int c);
666 void CustomCallBackcxx . . $ CustomCallBack(d4f767463ce0a6b3).(int c);
667 void PilotCopyDefaultControlscxx . . $ PilotCopyDefaultControls(1794bc617d3f3266).(pilotcxx . . $ pilot# *Pilot);
668
669 int Pilot_NewReadcxx . . $ Pilot_NewRead(dc87e4d8d497527c).(pilotcxx . . $ pilot# *Pilot, bool read_keyconfig, bool read_missiondata);
670 int Pilot_NewWritecxx . . $ Pilot_NewWrite(98d330f13870b5ba).(pilotcxx . . $ pilot# *Pilot, bool newpilot);
671
672 struct tCustomListInfocxx . . $ tCustomListInfo# {
673 newuiListBoxcxx . . $ newuiListBox# *custom_bitmap_listcxx . . $ tCustomListInfo#custom_bitmap_list.;
674 int needed_sizecxx . . $ tCustomListInfo#needed_size.; // size of allocated memory for files
675 char *filescxx . . $ tCustomListInfo#files.; // string list of file names
676 // Initializes the struct
677 void Initcxx . . $ tCustomListInfo#Init(49f6e7a06ebc5aa8).() {
678 filescxx . . $ tCustomListInfo#files. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
679 custom_bitmap_listcxx . . $ tCustomListInfo#custom_bitmap_list. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
680 needed_sizecxx . . $ tCustomListInfo#needed_size. = 0;
681 }
682 // Frees and resets the struct
683 void Resetcxx . . $ tCustomListInfo#Reset(49f6e7a06ebc5aa8).() {
684 if (filescxx . . $ tCustomListInfo#files.) {
685 mem_freecxx . . $ `mem/mem.h:80:9`!(files);
686 filescxx . . $ tCustomListInfo#files. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
687 }
688 custom_bitmap_listcxx . . $ tCustomListInfo#custom_bitmap_list. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
689 needed_sizecxx . . $ tCustomListInfo#needed_size. = 0;
690 }
691 };
692
693 struct tAudioTauntComboBoxescxx . . $ tAudioTauntComboBoxes# {
694 newuiComboBoxcxx . . $ newuiComboBox# *taunt_acxx . . $ tAudioTauntComboBoxes#taunt_a., *taunt_bcxx . . $ tAudioTauntComboBoxes#taunt_b., *taunt_ccxx . . $ tAudioTauntComboBoxes#taunt_c., *taunt_dcxx . . $ tAudioTauntComboBoxes#taunt_d.;
695 };
696
697 // Deletes the currently selected audio taunt #4
698 void ShipSelectDeleteTauntcxx . . $ ShipSelectDeleteTaunt(41f8fca03256e92d).(pilotcxx . . $ pilot# *Pilot, tCustomListInfocxx . . $ tCustomListInfo# *cust_snds, newuiComboBoxcxx . . $ newuiComboBox# *lb,
699 tAudioTauntComboBoxescxx . . $ tAudioTauntComboBoxes# *taunt_boxex);
700
701 // Deletes the currently selected ship logo
702 void ShipSelectDeleteLogocxx . . $ ShipSelectDeleteLogo(1cadf8844d7abfa5).(tCustomListInfocxx . . $ tCustomListInfo# *cust_bmps, newuiListBoxcxx . . $ newuiListBox# *lb);
703
704 // -------------------------------------------------------
705 // ShowPilotPicDialog
706 // Purpose:
707 // Displays the dialog to choose a pilot picture for
708 // the given pilot.
709 // -------------------------------------------------------
710 void ShowPilotPicDialogcxx . . $ ShowPilotPicDialog(1794bc617d3f3266).(pilotcxx . . $ pilot# *Pilot);
711
712 UITextItemcxx . . $ UITextItem# *pilot_itemscxx . . $ pilot_items. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; // array of UITextItems for use in Pilot listbox
713 pilotcxx . . $ pilot# tempcxx . . $ temp.; // pilot in use by the listbox
714 NewUIGameWindowcxx . . $ NewUIGameWindow# *PilotDisplayWindowcxx . . $ PilotDisplayWindow.; // pointer to display_window (needed for listbox callback)
715 char **filelistcxx . . $ filelist.; // list of pilot filenames
716 int filecountcxx . . $ filecount.; // number of pilot filenames found
717 void PilotListSelectChangeCallbackcxx . . $ PilotListSelectChangeCallback(d4f767463ce0a6b3).(int index);
718
719 ////////////////////////////////////////////////////////////////////////////
720 // Dialog Functions
721 ////////////////////////////////////////////////////////////////////////////
722 void PilotInitDatacxx . . $ PilotInitData(1794bc617d3f3266).(pilotcxx . . $ pilot# *plt);
723
724 void PilotShutdowncxx . . $ PilotShutdown(49f6e7a06ebc5aa8).(void) {
725 Current_pilotcxx . . $ Current_pilot..flushcxx . . $ pilot#flush(73da94e76e6bd037).(false);
726 Current_pilotcxx . . $ Current_pilot..cleancxx . . $ pilot#clean(b45ddcbc8423892c).(false);
727 }
728
729 void PilotInitcxx . . $ PilotInit(49f6e7a06ebc5aa8).(void) {
730 PilotInitDatacxx . . $ PilotInitData(1794bc617d3f3266).(&Current_pilotcxx . . $ Current_pilot.);
731 atexitcxx . . $ atexit(cc8c495369588262).(PilotShutdowncxx . . $ PilotShutdown(49f6e7a06ebc5aa8).);
732 }
733
734 void PilotInitDatacxx . . $ PilotInitData(1794bc617d3f3266).(pilotcxx . . $ pilot# *plt) {
735 if (!plt) {
736 Int3cxx . . $ `misc/pserror.h:247:9`!();
737 } else {
738 plt->cleancxx . . $ pilot#clean(b45ddcbc8423892c).(true);
739 }
740 }
741
742 // VerifyPilotData
743 //
744 // Call this function to check the data that is in the given pilot struct...it will verify that all files
745 // listed are available, if they are not, then it will set them to defaults. Returns true if it had to
746 // fix the data (you may want to save the pilot immediatly)
747 bool VerifyPilotDatacxx . . $ VerifyPilotData(70381b455242efa3).(pilotcxx . . $ pilot# *Pilot) {
748 if (!Pilot) {
749 Int3cxx . . $ `misc/pserror.h:247:9`!();
750 return false;
751 }
752 Pilot->verifycxx . . $ pilot#verify(49f6e7a06ebc5aa8).();
753 return false;
754 }
755
756 /*
757 ***********************************************************
758 */
759
760 #define IDP_SELECTcxx . . $ `Descent3/pilot.cpp:760:9`! 0x50
761 #define IDP_SEL_PILOTLISTcxx . . $ `Descent3/pilot.cpp:761:9`! 0x51
762 #define IDP_DELETEcxx . . $ `Descent3/pilot.cpp:762:9`! 0x52
763 #define IDP_ADDcxx . . $ `Descent3/pilot.cpp:763:9`! 0x53
764 #define IDP_EDITcxx . . $ `Descent3/pilot.cpp:764:9`! 0x54
765 #define IDP_SHIPCONFIGcxx . . $ `Descent3/pilot.cpp:765:9`! 0x55
766 #define IDP_CHOOSEPICcxx . . $ `Descent3/pilot.cpp:766:9`! 0x56
767 #define IDP_CONFIGCONTcxx . . $ `Descent3/pilot.cpp:767:9`! 0x57
768 #define IDP_CONFIGKEYBcxx . . $ `Descent3/pilot.cpp:768:9`! 0x58
769 #define IDP_COPYCONTROLScxx . . $ `Descent3/pilot.cpp:769:9`! 0x59
770
771 struct pilot_select_menucxx . . $ pilot_select_menu# {
772 newuiSheetcxx . . $ newuiSheet# *sheetcxx . . $ pilot_select_menu#sheet.;
773
774 newuiListBoxcxx . . $ newuiListBox# *pilot_listcxx . . $ pilot_select_menu#pilot_list.;
775
776 // sets the menu up.
777 newuiSheetcxx . . $ newuiSheet# *setupcxx . . $ pilot_select_menu#setup(58668faa82d4e94e).(newuiMenucxx . . $ newuiMenu# *menu) {
778 sheetcxx . . $ pilot_select_menu#sheet. = menu->AddOptioncxx . . $ newuiMenu#AddOption(f02bcd29588925e6).(IDP_SELECTcxx . . $ `Descent3/pilot.cpp:760:9`!, TXT_PILOTScxx . . $ `Descent3/stringtable.h:47:9`!, NEWUIMENU_MEDIUMcxx . . $ `Descent3/newui_core.h:555:9`!);
779
780 // Pilot selection list
781 sheetcxx . . $ pilot_select_menu#sheet.->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, 6, 18);
782 pilot_listcxx . . $ pilot_select_menu#pilot_list. = sheetcxx . . $ pilot_select_menu#sheet.->AddListBoxcxx . . $ newuiSheet#AddListBox(b890ce7adcd9a5ed).(232, 168, IDP_SEL_PILOTLISTcxx . . $ `Descent3/pilot.cpp:761:9`!);
783 pilot_listcxx . . $ pilot_select_menu#pilot_list.->SetSelectChangeCallbackcxx . . $ newuiListBox#SetSelectChangeCallback(94eb4457dc8d4d10).(PilotListSelectChangeCallbackcxx . . $ PilotListSelectChangeCallback(d4f767463ce0a6b3).);
784
785 return sheetcxx . . $ pilot_select_menu#sheet.;
786 };
787
788 // retreive values from property sheet here.
789 void finishcxx . . $ pilot_select_menu#finish(49f6e7a06ebc5aa8).() { sheetcxx . . $ pilot_select_menu#sheet. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; };
790
791 // process
792 void processcxx . . $ pilot_select_menu#process(d4f767463ce0a6b3).(int res){};
793 };
794
795 struct pilot_edit_menucxx . . $ pilot_edit_menu# {
796 newuiSheetcxx . . $ newuiSheet# *sheetcxx . . $ pilot_edit_menu#sheet.;
797
798 int *difficultycxx . . $ pilot_edit_menu#difficulty.;
799 bool *profanitycxx . . $ pilot_edit_menu#profanity.;
800 bool *audiotauntscxx . . $ pilot_edit_menu#audiotaunts.;
801 char *pilot_namecxx . . $ pilot_edit_menu#pilot_name.;
802
803 newuiSheetcxx . . $ newuiSheet# *setupcxx . . $ pilot_edit_menu#setup(58668faa82d4e94e).(newuiMenucxx . . $ newuiMenu# *menu) {
804 sheetcxx . . $ pilot_edit_menu#sheet. = menu->AddOptioncxx . . $ newuiMenu#AddOption(f02bcd29588925e6).(IDP_EDITcxx . . $ `Descent3/pilot.cpp:764:9`!, TXT_CONFIGUREcxx . . $ `Descent3/stringtable.h:33:9`!, NEWUIMENU_MEDIUMcxx . . $ `Descent3/newui_core.h:555:9`!);
805
806 // pilot name
807 sheetcxx . . $ pilot_edit_menu#sheet.->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, 5, 0);
808 pilot_namecxx . . $ pilot_edit_menu#pilot_name. = sheetcxx . . $ pilot_edit_menu#sheet.->AddChangeableTextcxx . . $ newuiSheet#AddChangeableText(ff224f080444ee45).(64);
809
810 // difficulty
811 sheetcxx . . $ pilot_edit_menu#sheet.->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(TXT_PLTDIFFICULTcxx . . $ `Descent3/stringtable.h:52:9`!, 55, 12);
812 #if 1 // ndef DEMO
813 difficultycxx . . $ pilot_edit_menu#difficulty. = sheetcxx . . $ pilot_edit_menu#sheet.->AddFirstLongRadioButtoncxx . . $ newuiSheet#AddFirstLongRadioButton(c0389c32fb6fc938).(TXT_TRAINEEcxx . . $ `Descent3/stringtable.h:53:9`!);
814 sheetcxx . . $ pilot_edit_menu#sheet.->AddLongRadioButtoncxx . . $ newuiSheet#AddLongRadioButton(9a5cb738bb1a644).(TXT_ROOKIEcxx . . $ `Descent3/stringtable.h:54:9`!);
815 sheetcxx . . $ pilot_edit_menu#sheet.->AddLongRadioButtoncxx . . $ newuiSheet#AddLongRadioButton(9a5cb738bb1a644).(TXT_HOTSHOTcxx . . $ `Descent3/stringtable.h:55:9`!);
816 sheetcxx . . $ pilot_edit_menu#sheet.->AddLongRadioButtoncxx . . $ newuiSheet#AddLongRadioButton(9a5cb738bb1a644).(TXT_ACEcxx . . $ `Descent3/stringtable.h:56:9`!);
817 sheetcxx . . $ pilot_edit_menu#sheet.->AddLongRadioButtoncxx . . $ newuiSheet#AddLongRadioButton(9a5cb738bb1a644).(TXT_INSANEcxx . . $ `Descent3/stringtable.h:57:9`!);
818 *difficultycxx . . $ pilot_edit_menu#difficulty. = 0;
819 #else
820 difficulty = sheet->AddFirstLongRadioButton(TXT_TRAINEE);
821 sheet->AddLongRadioButton(TXT_HOTSHOT);
822 *difficulty = 0;
823 #endif
824 sheetcxx . . $ pilot_edit_menu#sheet.->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(TXT_CONTROLSCONFIGcxx . . $ `Descent3/stringtable.h:788:9`!, 55, 93);
825 sheetcxx . . $ pilot_edit_menu#sheet.->AddLongButtoncxx . . $ newuiSheet#AddLongButton(680bf41633375800).(TXT_CPYKEYCONFcxx . . $ `Descent3/stringtable.h:58:9`!, IDP_COPYCONTROLScxx . . $ `Descent3/pilot.cpp:769:9`!);
826 sheetcxx . . $ pilot_edit_menu#sheet.->AddLongButtoncxx . . $ newuiSheet#AddLongButton(680bf41633375800).(TXT_CUSTKEYBcxx . . $ `Descent3/stringtable.h:59:9`!, IDP_CONFIGKEYBcxx . . $ `Descent3/pilot.cpp:768:9`!);
827 sheetcxx . . $ pilot_edit_menu#sheet.->AddLongButtoncxx . . $ newuiSheet#AddLongButton(680bf41633375800).(TXT_CUSTGAMECcxx . . $ `Descent3/stringtable.h:60:9`!, IDP_CONFIGCONTcxx . . $ `Descent3/pilot.cpp:767:9`!);
828
829 sheetcxx . . $ pilot_edit_menu#sheet.->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(TXT_MULTIPLAYERCONFIGcxx . . $ `Descent3/stringtable.h:789:9`!, 55, 150);
830 #if (!defined(OEM) && !defined(DEMO))
831 sheetcxx . . $ pilot_edit_menu#sheet.->AddLongButtoncxx . . $ newuiSheet#AddLongButton(680bf41633375800).(TXT_SELPILOTPICcxx . . $ `Descent3/stringtable.h:698:9`!, IDP_CHOOSEPICcxx . . $ `Descent3/pilot.cpp:766:9`!);
832 #endif
833 sheetcxx . . $ pilot_edit_menu#sheet.->AddLongButtoncxx . . $ newuiSheet#AddLongButton(680bf41633375800).(TXT_SHIPCUSTOMIZEcxx . . $ `Descent3/stringtable.h:359:9`!, IDP_SHIPCONFIGcxx . . $ `Descent3/pilot.cpp:765:9`!);
834
835 sheetcxx . . $ pilot_edit_menu#sheet.->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(TXT_MISCELLANEOUScxx . . $ `Descent3/stringtable.h:790:9`!, 55, 195);
836 profanitycxx . . $ pilot_edit_menu#profanity. = sheetcxx . . $ pilot_edit_menu#sheet.->AddLongCheckBoxcxx . . $ newuiSheet#AddLongCheckBox(b1b99af17a84c782).(TXT_PROFFILTERcxx . . $ `Descent3/stringtable.h:791:9`!);
837 audiotauntscxx . . $ pilot_edit_menu#audiotaunts. = sheetcxx . . $ pilot_edit_menu#sheet.->AddLongCheckBoxcxx . . $ newuiSheet#AddLongCheckBox(b1b99af17a84c782).(TXT_AUDIOTAUNTScxx . . $ `Descent3/stringtable.h:867:9`!);
838
839 return sheetcxx . . $ pilot_edit_menu#sheet.;
840 };
841
842 // retreive values from property sheet here.
843 void finishcxx . . $ pilot_edit_menu#finish(49f6e7a06ebc5aa8).() { sheetcxx . . $ pilot_edit_menu#sheet. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; };
844
845 // process
846 void processcxx . . $ pilot_edit_menu#process(d4f767463ce0a6b3).(int res){};
847 };
848
849 struct pilot_add_menucxx . . $ pilot_add_menu# {
850 newuiSheetcxx . . $ newuiSheet# *sheetcxx . . $ pilot_add_menu#sheet.;
851 };
852
853 structcxx . . $ $anonymous_type_cbc8563ea5ce22a0_0# {
854 newuiMenucxx . . $ newuiMenu# *menucxx . . $ $anonymous_type_cbc8563ea5ce22a0_0#menu.;
855 pilot_select_menucxx . . $ pilot_select_menu# *selectcxx . . $ $anonymous_type_cbc8563ea5ce22a0_0#select.;
856 pilot_edit_menucxx . . $ pilot_edit_menu# *editcxx . . $ $anonymous_type_cbc8563ea5ce22a0_0#edit.;
857
858 bool initial_callcxx . . $ $anonymous_type_cbc8563ea5ce22a0_0#initial_call.;
859 bool all_setupcxx . . $ $anonymous_type_cbc8563ea5ce22a0_0#all_setup.;
860 } PilotChooseDialogInfocxx . . $ PilotChooseDialogInfo.;
861 pilotcxx . . $ pilot# working_pilotcxx . . $ working_pilot.;
862
863 void PilotListSelectChangeCallbackcxx . . $ PilotListSelectChangeCallback(d4f767463ce0a6b3).(int index) {
864 if (!filecountcxx . . $ filecount. || !PilotChooseDialogInfocxx . . $ PilotChooseDialogInfo..all_setupcxx . . $ $anonymous_type_cbc8563ea5ce22a0_0#all_setup.)
865 return;
866
867 pilotcxx . . $ pilot# *Pilot = &working_pilotcxx . . $ working_pilot.;
868 char name[PILOT_STRING_SIZEcxx . . $ `Descent3/pilot_class.h:124:9`!];
869 uint8_tcxx . . $ uint8_t# difficulty;
870 bool profanity, audiotaunts;
871 bool in_edit = false;
872
873 if (PilotChooseDialogInfocxx . . $ PilotChooseDialogInfo..menucxx . . $ $anonymous_type_cbc8563ea5ce22a0_0#menu.->GetCurrentOptioncxx . . $ newuiMenu#GetCurrentOption(524863554b4a534e).() == IDP_EDITcxx . . $ `Descent3/pilot.cpp:764:9`!) {
874 in_edit = true;
875 PilotChooseDialogInfocxx . . $ PilotChooseDialogInfo..editcxx . . $ $anonymous_type_cbc8563ea5ce22a0_0#edit.->sheetcxx . . $ pilot_edit_menu#sheet.->Realizecxx . . $ newuiSheet#Realize(49f6e7a06ebc5aa8).();
876 }
877
878 // Pilot has changed...reset all data to new pilot selected
879 if (!PilotChooseDialogInfocxx . . $ PilotChooseDialogInfo..initial_callcxx . . $ $anonymous_type_cbc8563ea5ce22a0_0#initial_call.) {
880 // save out old Pilot file so we can load up the new one
881 char filename[PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!];
882 working_pilotcxx . . $ working_pilot..get_filenamecxx . . $ pilot#get_filename(fda57c8427c60377).(filename);
883
884 if (cfexistcxx . . $ cfexist(293b0826c8d9cb54).(filenamecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).)) {
885 if (in_edit)
886 PilotChooseDialogInfocxx . . $ PilotChooseDialogInfo..editcxx . . $ $anonymous_type_cbc8563ea5ce22a0_0#edit.->sheetcxx . . $ pilot_edit_menu#sheet.->UpdateReturnValuescxx . . $ newuiSheet#UpdateReturnValues(49f6e7a06ebc5aa8).();
887
888 // only save if the file is already there
889 // which keeps us from bringing deleted pilots
890 // back from the dead.
891 difficulty = *PilotChooseDialogInfocxx . . $ PilotChooseDialogInfo..editcxx . . $ $anonymous_type_cbc8563ea5ce22a0_0#edit.->difficultycxx . . $ pilot_edit_menu#difficulty.;
892 profanity = *PilotChooseDialogInfocxx . . $ PilotChooseDialogInfo..editcxx . . $ $anonymous_type_cbc8563ea5ce22a0_0#edit.->profanitycxx . . $ pilot_edit_menu#profanity.;
893 audiotaunts = *PilotChooseDialogInfocxx . . $ PilotChooseDialogInfo..editcxx . . $ $anonymous_type_cbc8563ea5ce22a0_0#edit.->audiotauntscxx . . $ pilot_edit_menu#audiotaunts.;
894
895 Pilot->set_profanity_filtercxx . . $ pilot#set_profanity_filter(b45ddcbc8423892c).(profanity);
896 Pilot->set_difficultycxx . . $ pilot#set_difficulty(ac50b47256ae7414).(difficulty);
897 Pilot->set_audiotauntscxx . . $ pilot#set_audiotaunts(b45ddcbc8423892c).(audiotaunts);
898 PltWriteFilecxx . . $ PltWriteFile(98d330f13870b5ba).(&working_pilotcxx . . $ working_pilot.);
899 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Pilot saved\n");
900 } else {
901 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Skipping pilot save...has the old pilot been deleted?\n");
902 }
903
904 working_pilotcxx . . $ working_pilot..cleancxx . . $ pilot#clean(b45ddcbc8423892c).(true);
905 }
906
907 Pilot->set_filenamecxx . . $ pilot#set_filename(fda57c8427c60377).(filelistcxx . . $ filelist.[index]);
908 PltReadFilecxx . . $ PltReadFile(7ff4d2ff4894147e).(Pilot);
909
910 // Setup all values
911 ///////////////////////////////
912 Pilot->get_difficultycxx . . $ pilot#get_difficulty(f25546b61a629de7).(&difficulty);
913 Pilot->get_profanity_filtercxx . . $ pilot#get_profanity_filter(c13a04b6074e49a2).(&profanity);
914 Pilot->get_audiotauntscxx . . $ pilot#get_audiotaunts(c13a04b6074e49a2).(&audiotaunts);
915 *PilotChooseDialogInfocxx . . $ PilotChooseDialogInfo..editcxx . . $ $anonymous_type_cbc8563ea5ce22a0_0#edit.->difficultycxx . . $ pilot_edit_menu#difficulty. = difficulty;
916 *PilotChooseDialogInfocxx . . $ PilotChooseDialogInfo..editcxx . . $ $anonymous_type_cbc8563ea5ce22a0_0#edit.->profanitycxx . . $ pilot_edit_menu#profanity. = profanity;
917 *PilotChooseDialogInfocxx . . $ PilotChooseDialogInfo..editcxx . . $ $anonymous_type_cbc8563ea5ce22a0_0#edit.->audiotauntscxx . . $ pilot_edit_menu#audiotaunts. = audiotaunts;
918
919 if (in_edit)
920 PilotChooseDialogInfocxx . . $ PilotChooseDialogInfo..editcxx . . $ $anonymous_type_cbc8563ea5ce22a0_0#edit.->sheetcxx . . $ pilot_edit_menu#sheet.->UpdateChangescxx . . $ newuiSheet#UpdateChanges(49f6e7a06ebc5aa8).();
921 Pilot->get_namecxx . . $ pilot#get_name(fda57c8427c60377).(name);
922 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Pilot has changed to: %s\n", name);
923
924 if (PilotChooseDialogInfocxx . . $ PilotChooseDialogInfo..editcxx . . $ $anonymous_type_cbc8563ea5ce22a0_0#edit.->pilot_namecxx . . $ pilot_edit_menu#pilot_name.) {
925 strncpy(PilotChooseDialogInfocxx . . $ PilotChooseDialogInfo..editcxx . . $ $anonymous_type_cbc8563ea5ce22a0_0#edit.->pilot_namecxx . . $ pilot_edit_menu#pilot_name., name, 63);
926 PilotChooseDialogInfocxx . . $ PilotChooseDialogInfo..editcxx . . $ $anonymous_type_cbc8563ea5ce22a0_0#edit.->pilot_namecxx . . $ pilot_edit_menu#pilot_name.[63] = '\0';
927 }
928
929 PilotChooseDialogInfocxx . . $ PilotChooseDialogInfo..initial_callcxx . . $ $anonymous_type_cbc8563ea5ce22a0_0#initial_call. = false;
930 }
931
932 void selectcbcxx . . $ selectcb(bbe34d93e903f666).(newuiMenucxx . . $ newuiMenu# *menu, int16_t id, void *data) {
933 pilot_select_menucxx . . $ pilot_select_menu# *select = (pilot_select_menucxx . . $ pilot_select_menu# *)data;
934 if (id == IDP_SELECTcxx . . $ `Descent3/pilot.cpp:760:9`!) {
935 menu->SetFocusOnGadgetcxx . . $ UIWindow#SetFocusOnGadget(75ffd377f9406104).(select->pilot_listcxx . . $ pilot_select_menu#pilot_list.);
936 }
937 }
938
939 void PilotSelectcxx . . $ PilotSelect(49f6e7a06ebc5aa8).(void) {
940 newuiMenucxx . . $ newuiMenu# menucxx . . $ newuiMenu#newuiMenu(49f6e7a06ebc5aa8).;
941 pilot_select_menucxx . . $ pilot_select_menu# select;
942 pilot_edit_menucxx . . $ pilot_edit_menu# edit;
943
944 PilotChooseDialogInfocxx . . $ PilotChooseDialogInfo..menucxx . . $ $anonymous_type_cbc8563ea5ce22a0_0#menu. = &menu;
945 PilotChooseDialogInfocxx . . $ PilotChooseDialogInfo..selectcxx . . $ $anonymous_type_cbc8563ea5ce22a0_0#select. = &select;
946 PilotChooseDialogInfocxx . . $ PilotChooseDialogInfo..editcxx . . $ $anonymous_type_cbc8563ea5ce22a0_0#edit. = &edit;
947 PilotChooseDialogInfocxx . . $ PilotChooseDialogInfo..initial_callcxx . . $ $anonymous_type_cbc8563ea5ce22a0_0#initial_call. = true;
948 PilotChooseDialogInfocxx . . $ PilotChooseDialogInfo..all_setupcxx . . $ $anonymous_type_cbc8563ea5ce22a0_0#all_setup. = false;
949 filelistcxx . . $ filelist. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
950 filecountcxx . . $ filecount. = 0;
951
952 int res = -1;
953 bool done = false;
954
955 if (cfexistcxx . . $ cfexist(293b0826c8d9cb54).(Default_pilotcxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).) != CFES_NOT_FOUNDcxx . . $ CFES_NOT_FOUND.) {
956 // ok so the default pilot file is around, mark this as the current pilot
957 Current_pilotcxx . . $ Current_pilot..set_filenamecxx . . $ pilot#set_filename(fda57c8427c60377).(Default_pilotcxx . . $ Default_pilot.);
958 PltReadFilecxx . . $ PltReadFile(7ff4d2ff4894147e).(&Current_pilotcxx . . $ Current_pilot.);
959 }
960
961 char pfilename[_MAX_FNAMEcxx . . $ `linux/linux_fix.h:35:9`!];
962
963 // open menu
964 menu.Createcxx . . $ newuiMenu#Create(49f6e7a06ebc5aa8).();
965
966 select.setupcxx . . $ pilot_select_menu#setup(58668faa82d4e94e).(&menu); // setup pilot select menu IDP_SELECT
967 edit.setupcxx . . $ pilot_edit_menu#setup(58668faa82d4e94e).(&menu); // edit pilot
968 menu.AddSimpleOptioncxx . . $ newuiMenu#AddSimpleOption(6ed0a7151bf51ed1).(IDP_ADDcxx . . $ `Descent3/pilot.cpp:763:9`!, TXT_ADDcxx . . $ `Descent3/stringtable.h:695:9`!); // add
969 menu.AddSimpleOptioncxx . . $ newuiMenu#AddSimpleOption(6ed0a7151bf51ed1).(IDP_DELETEcxx . . $ `Descent3/pilot.cpp:762:9`!, TXT_DELETEcxx . . $ `Descent3/stringtable.h:32:9`!); // delete currently selected pilot
970 menu.AddSimpleOptioncxx . . $ newuiMenu#AddSimpleOption(6ed0a7151bf51ed1).(UID_OKcxx . . $ `ui/ui.h:368:9`!, TXT_OKcxx . . $ `Descent3/stringtable.h:34:9`!);
971 menu.AddSimpleOptioncxx . . $ newuiMenu#AddSimpleOption(6ed0a7151bf51ed1).(UID_CANCELcxx . . $ `ui/ui.h:369:9`!, TXT_CANCELcxx . . $ `Descent3/stringtable.h:35:9`!);
972 menu.SetCurrentOptioncxx . . $ newuiMenu#SetCurrentOption(68e3ae50fe6578a9).(IDP_SELECTcxx . . $ `Descent3/pilot.cpp:760:9`!);
973
974 menu.SetOnOptionFocusCBcxx . . $ newuiMenu#SetOnOptionFocusCB(d86502bad44a4a2).(selectcbcxx . . $ selectcb(bbe34d93e903f666)., &select);
975
976 PilotChooseDialogInfocxx . . $ PilotChooseDialogInfo..all_setupcxx . . $ $anonymous_type_cbc8563ea5ce22a0_0#all_setup. = true;
977 filelistcxx . . $ filelist. = PltGetPilotscxx . . $ PltGetPilots(af3cb7eb7beac68c).(&filecountcxx . . $ filecount.);
978
979 if (!filecountcxx . . $ filecount.) {
980 pilotcxx . . $ pilot# temp_pilotcxx . . $ pilot#pilot(49f6e7a06ebc5aa8).;
981 // if there are currently no pilots force player to create a new pilot
982 if (PilotCreatecxx . . $ PilotCreate(350c0e311af7e077).(&temp_pilot, true)) {
983 PltClearListcxx . . $ PltClearList(49f6e7a06ebc5aa8).();
984 PltGetPilotsFreecxx . . $ PltGetPilotsFree(49f6e7a06ebc5aa8).();
985 filelistcxx . . $ filelist. = PltGetPilotscxx . . $ PltGetPilots(af3cb7eb7beac68c).(&filecountcxx . . $ filecount.);
986 NewPltUpdatecxx . . $ NewPltUpdate(f5615d74c210c1ee).(select.pilot_listcxx . . $ pilot_select_menu#pilot_list., filelistcxx . . $ filelist., filecountcxx . . $ filecount., filecountcxx . . $ filecount. - 1);
987
988 int index = select.pilot_listcxx . . $ pilot_select_menu#pilot_list.->GetCurrentIndexcxx . . $ newuiListBox#GetCurrentIndex(b126dc7c1de90089).();
989
990 PilotListSelectChangeCallbackcxx . . $ PilotListSelectChangeCallback(d4f767463ce0a6b3).(index);
991
992 PilotCopyDefaultControlscxx . . $ PilotCopyDefaultControls(1794bc617d3f3266).(&working_pilotcxx . . $ working_pilot.);
993
994 menu.SetCurrentOptioncxx . . $ newuiMenu#SetCurrentOption(68e3ae50fe6578a9).(IDP_EDITcxx . . $ `Descent3/pilot.cpp:764:9`!);
995 }
996 }
997
998 Current_pilotcxx . . $ Current_pilot..get_filenamecxx . . $ pilot#get_filename(fda57c8427c60377).(pfilename);
999 NewPltUpdatecxx . . $ NewPltUpdate(f5615d74c210c1ee).(select.pilot_listcxx . . $ pilot_select_menu#pilot_list., filelistcxx . . $ filelist., filecountcxx . . $ filecount., 0, pfilename);
1000
1001 // if we get here than there is at least one pilot already
1002 char old_file[_MAX_FNAMEcxx . . $ `linux/linux_fix.h:35:9`!];
1003
1004 // use this in case they cancel out
1005 Current_pilotcxx . . $ Current_pilot..get_filenamecxx . . $ pilot#get_filename(fda57c8427c60377).(pfilename);
1006 if (cfexistcxx . . $ cfexist(293b0826c8d9cb54).(pfilenamecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).) != CFES_NOT_FOUNDcxx . . $ CFES_NOT_FOUND.) {
1007 strcpy(old_file, pfilename);
1008 } else {
1009 old_file[0] = '\0';
1010 }
1011
1012 DoWaitMessagecxx . . $ DoWaitMessage(ee90985596e8b4f9).(false);
1013
1014 menu.Opencxx . . $ UIWindow#Open(49f6e7a06ebc5aa8).();
1015
1016 // run menu
1017 do {
1018 res = menu.DoUIcxx . . $ newuiMenu#DoUI(b126dc7c1de90089).();
1019
1020 switch (res) {
1021 case IDP_EDITcxx . . $ `Descent3/pilot.cpp:764:9`!: {
1022 if (!filecountcxx . . $ filecount.) {
1023 menu.SetCurrentOptioncxx . . $ newuiMenu#SetCurrentOption(68e3ae50fe6578a9).(IDP_SELECTcxx . . $ `Descent3/pilot.cpp:760:9`!);
1024 }
1025 } break;
1026
1027 case IDP_SEL_PILOTLISTcxx . . $ `Descent3/pilot.cpp:761:9`!:
1028 case UID_OKcxx . . $ `ui/ui.h:368:9`!: {
1029 // Start Game
1030 if (filecountcxx . . $ filecount.) {
1031 int index = select.pilot_listcxx . . $ pilot_select_menu#pilot_list.->GetCurrentIndexcxx . . $ newuiListBox#GetCurrentIndex(b126dc7c1de90089).();
1032
1033 PilotListSelectChangeCallbackcxx . . $ PilotListSelectChangeCallback(d4f767463ce0a6b3).(index);
1034
1035 char filename[PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!];
1036 working_pilotcxx . . $ working_pilot..get_filenamecxx . . $ pilot#get_filename(fda57c8427c60377).(filename);
1037 Current_pilotcxx . . $ Current_pilot..set_filenamecxx . . $ pilot#set_filename(fda57c8427c60377).(filename);
1038 PltReadFilecxx . . $ PltReadFile(7ff4d2ff4894147e).(&Current_pilotcxx . . $ Current_pilot., true, true);
1039
1040 char pname[PILOT_STRING_SIZEcxx . . $ `Descent3/pilot_class.h:124:9`!];
1041 Current_pilotcxx . . $ Current_pilot..get_namecxx . . $ pilot#get_name(fda57c8427c60377).(pname);
1042 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Pilot To Use: %s\n", pname);
1043
1044 if (VerifyPilotDatacxx . . $ VerifyPilotData(70381b455242efa3).(&Current_pilotcxx . . $ Current_pilot.)) {
1045 // save out updated pilot since it had to be fixed
1046 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "PILOT: Saving out Pilot info due to bad data in pilot file\n");
1047 PltWriteFilecxx . . $ PltWriteFile(98d330f13870b5ba).(&Current_pilotcxx . . $ Current_pilot.);
1048 }
1049
1050 Current_pilotcxx . . $ Current_pilot..get_filenamecxx . . $ pilot#get_filename(fda57c8427c60377).(Default_pilotcxx . . $ Default_pilot.);
1051
1052 done = true;
1053
1054 } else {
1055 DoMessageBoxcxx . . $ DoMessageBox(dcc99837539e9edc).(TXT_PLTERRORcxx . . $ `Descent3/stringtable.h:48:9`!, TXT_NEEDTOCREATEcxx . . $ `Descent3/stringtable.h:49:9`!, MSGBOX_OKcxx . . $ `Descent3/newui_core.h:78:9`!, UICOL_WINDOW_TITLEcxx . . $ `Descent3/newui.h:219:9`!, UICOL_TEXT_NORMALcxx . . $ `Descent3/newui.h:218:9`!);
1056 menu.SetCurrentOptioncxx . . $ newuiMenu#SetCurrentOption(68e3ae50fe6578a9).(IDP_SELECTcxx . . $ `Descent3/pilot.cpp:760:9`!);
1057 }
1058 } break;
1059
1060 case UID_CANCELcxx . . $ `ui/ui.h:369:9`!: {
1061 // Cancel out
1062 bool found_old = (cfexistcxx . . $ cfexist(293b0826c8d9cb54).(old_filecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).) != CFES_NOT_FOUNDcxx . . $ CFES_NOT_FOUND.);
1063 bool display_error;
1064
1065 if (filecountcxx . . $ filecount. && found_old)
1066 display_error = false;
1067 else
1068 display_error = true;
1069
1070 if (filecountcxx . . $ filecount.) {
1071 int index = select.pilot_listcxx . . $ pilot_select_menu#pilot_list.->GetCurrentIndexcxx . . $ newuiListBox#GetCurrentIndex(b126dc7c1de90089).();
1072 PilotListSelectChangeCallbackcxx . . $ PilotListSelectChangeCallback(d4f767463ce0a6b3).(index);
1073
1074 if (found_old) {
1075 Current_pilotcxx . . $ Current_pilot..set_filenamecxx . . $ pilot#set_filename(fda57c8427c60377).(old_file);
1076 PltReadFilecxx . . $ PltReadFile(7ff4d2ff4894147e).(&Current_pilotcxx . . $ Current_pilot., true, true);
1077
1078 char pname[PILOT_STRING_SIZEcxx . . $ `Descent3/pilot_class.h:124:9`!];
1079 Current_pilotcxx . . $ Current_pilot..get_namecxx . . $ pilot#get_name(fda57c8427c60377).(pname);
1080
1081 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Pilot To Use: %s\n", pname);
1082 if (VerifyPilotDatacxx . . $ VerifyPilotData(70381b455242efa3).(&Current_pilotcxx . . $ Current_pilot.)) {
1083 // save out updated pilot since it had to be fixed
1084 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "PILOT: Saving out Pilot info due to bad data in pilot file\n");
1085 PltWriteFilecxx . . $ PltWriteFile(98d330f13870b5ba).(&Current_pilotcxx . . $ Current_pilot.);
1086 }
1087 done = true;
1088 }
1089 }
1090
1091 if (display_error) {
1092 if (filecountcxx . . $ filecount. > 0 && old_file[0] != '\0') {
1093 DoMessageBoxcxx . . $ DoMessageBox(dcc99837539e9edc).(TXT_PLTERRORcxx . . $ `Descent3/stringtable.h:48:9`!, TXT_OLDPILOTNOEXISTcxx . . $ `Descent3/stringtable.h:697:9`!, MSGBOX_OKcxx . . $ `Descent3/newui_core.h:78:9`!, UICOL_WINDOW_TITLEcxx . . $ `Descent3/newui.h:219:9`!, UICOL_TEXT_NORMALcxx . . $ `Descent3/newui.h:218:9`!);
1094 } else {
1095 DoMessageBoxcxx . . $ DoMessageBox(dcc99837539e9edc).(TXT_PLTERRORcxx . . $ `Descent3/stringtable.h:48:9`!, TXT_NEEDTOCREATEcxx . . $ `Descent3/stringtable.h:49:9`!, MSGBOX_OKcxx . . $ `Descent3/newui_core.h:78:9`!, UICOL_WINDOW_TITLEcxx . . $ `Descent3/newui.h:219:9`!, UICOL_TEXT_NORMALcxx . . $ `Descent3/newui.h:218:9`!);
1096 }
1097 }
1098
1099 } break;
1100
1101 case IDP_DELETEcxx . . $ `Descent3/pilot.cpp:762:9`!:
1102 // delete a pilot
1103 if (filecountcxx . . $ filecount.) {
1104 pilotcxx . . $ pilot# temp_pilotcxx . . $ pilot#pilot(49f6e7a06ebc5aa8).;
1105 char buff[200];
1106 int tindex = select.pilot_listcxx . . $ pilot_select_menu#pilot_list.->GetCurrentIndexcxx . . $ newuiListBox#GetCurrentIndex(b126dc7c1de90089).();
1107
1108 PilotListSelectChangeCallbackcxx . . $ PilotListSelectChangeCallback(d4f767463ce0a6b3).(tindex);
1109
1110 temp_pilot.set_filenamecxx . . $ pilot#set_filename(fda57c8427c60377).(filelistcxx . . $ filelist.[tindex]);
1111 PltReadFilecxx . . $ PltReadFile(7ff4d2ff4894147e).(&temp_pilot);
1112
1113 char pname[PILOT_STRING_SIZEcxx . . $ `Descent3/pilot_class.h:124:9`!];
1114 temp_pilot.get_namecxx . . $ pilot#get_name(fda57c8427c60377).(pname);
1115
1116 snprintf(buff, sizeof(buff), TXT_PLTOKDELcxx . . $ `Descent3/stringtable.h:50:9`!, pname);
1117 if (DoMessageBoxcxx . . $ DoMessageBox(dcc99837539e9edc).(TXT_PLTDELCONFcxx . . $ `Descent3/stringtable.h:51:9`!, buff, MSGBOX_YESNOcxx . . $ `Descent3/newui_core.h:80:9`!, UICOL_WINDOW_TITLEcxx . . $ `Descent3/newui.h:219:9`!, UICOL_TEXT_NORMALcxx . . $ `Descent3/newui.h:218:9`!)) {
1118 PltDeletecxx . . $ PltDelete(70381b455242efa3).(&temp_pilot);
1119 }
1120
1121 PltClearListcxx . . $ PltClearList(49f6e7a06ebc5aa8).();
1122 PltGetPilotsFreecxx . . $ PltGetPilotsFree(49f6e7a06ebc5aa8).();
1123 filelistcxx . . $ filelist. = PltGetPilotscxx . . $ PltGetPilots(af3cb7eb7beac68c).(&filecountcxx . . $ filecount.);
1124 if (tindex >= filecountcxx . . $ filecount.) {
1125 tindex = filecountcxx . . $ filecount. - 1;
1126 }
1127 NewPltUpdatecxx . . $ NewPltUpdate(f5615d74c210c1ee).(select.pilot_listcxx . . $ pilot_select_menu#pilot_list., filelistcxx . . $ filelist., filecountcxx . . $ filecount., tindex);
1128 }
1129 break;
1130
1131 case IDP_ADDcxx . . $ `Descent3/pilot.cpp:763:9`!: {
1132 // Create New Player
1133 bool go_into_edit = false;
1134 int cpilotindex = select.pilot_listcxx . . $ pilot_select_menu#pilot_list.->GetCurrentIndexcxx . . $ newuiListBox#GetCurrentIndex(b126dc7c1de90089).();
1135 pilotcxx . . $ pilot# temp_pilotcxx . . $ pilot#pilot(49f6e7a06ebc5aa8).;
1136 if (PilotCreatecxx . . $ PilotCreate(350c0e311af7e077).(&temp_pilot, !filecountcxx . . $ filecount.)) {
1137 PltClearListcxx . . $ PltClearList(49f6e7a06ebc5aa8).();
1138 PltGetPilotsFreecxx . . $ PltGetPilotsFree(49f6e7a06ebc5aa8).();
1139 filelistcxx . . $ filelist. = PltGetPilotscxx . . $ PltGetPilots(af3cb7eb7beac68c).(&filecountcxx . . $ filecount.);
1140
1141 char pfilename[_MAX_FNAMEcxx . . $ `linux/linux_fix.h:35:9`!];
1142 temp_pilot.get_filenamecxx . . $ pilot#get_filename(fda57c8427c60377).(pfilename);
1143 NewPltUpdatecxx . . $ NewPltUpdate(f5615d74c210c1ee).(select.pilot_listcxx . . $ pilot_select_menu#pilot_list., filelistcxx . . $ filelist., filecountcxx . . $ filecount., filecountcxx . . $ filecount. - 1, pfilename);
1144 go_into_edit = true;
1145 } else {
1146 if (filecountcxx . . $ filecount.)
1147 NewPltUpdatecxx . . $ NewPltUpdate(f5615d74c210c1ee).(select.pilot_listcxx . . $ pilot_select_menu#pilot_list., filelistcxx . . $ filelist., filecountcxx . . $ filecount., cpilotindex);
1148 }
1149
1150 int index = select.pilot_listcxx . . $ pilot_select_menu#pilot_list.->GetCurrentIndexcxx . . $ newuiListBox#GetCurrentIndex(b126dc7c1de90089).();
1151 PilotListSelectChangeCallbackcxx . . $ PilotListSelectChangeCallback(d4f767463ce0a6b3).(index);
1152
1153 if (go_into_edit) {
1154 PilotCopyDefaultControlscxx . . $ PilotCopyDefaultControls(1794bc617d3f3266).(&working_pilotcxx . . $ working_pilot.);
1155 }
1156
1157 if (go_into_edit)
1158 menu.SetCurrentOptioncxx . . $ newuiMenu#SetCurrentOption(68e3ae50fe6578a9).(IDP_EDITcxx . . $ `Descent3/pilot.cpp:764:9`!);
1159 else
1160 menu.SetCurrentOptioncxx . . $ newuiMenu#SetCurrentOption(68e3ae50fe6578a9).(IDP_SELECTcxx . . $ `Descent3/pilot.cpp:760:9`!);
1161 } break;
1162
1163 case IDP_SHIPCONFIGcxx . . $ `Descent3/pilot.cpp:765:9`!: {
1164 PltSelectShipcxx . . $ PltSelectShip(70381b455242efa3).(&working_pilotcxx . . $ working_pilot.);
1165 } break;
1166
1167 case IDP_CHOOSEPICcxx . . $ `Descent3/pilot.cpp:766:9`!: {
1168 char pname[PILOT_STRING_SIZEcxx . . $ `Descent3/pilot_class.h:124:9`!];
1169 working_pilotcxx . . $ working_pilot..get_namecxx . . $ pilot#get_name(fda57c8427c60377).(pname);
1170
1171 if (PPic_QueryPilotcxx . . $ PPic_QueryPilot(1c09e5b692edaacb).(pname)) {
1172 ShowPilotPicDialogcxx . . $ ShowPilotPicDialog(1794bc617d3f3266).(&working_pilotcxx . . $ working_pilot.);
1173 } else {
1174 uint16_tcxx . . $ uint16_t# pid;
1175 pid = PPIC_INVALID_IDcxx . . $ `Descent3/pilot_class.h:126:9`!;
1176 working_pilotcxx . . $ working_pilot..set_multiplayer_datacxx . . $ pilot#set_multiplayer_data(a7d02ca8b58088a9).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, &pid);
1177
1178 DoMessageBoxcxx . . $ DoMessageBox(dcc99837539e9edc).(TXT_PLTERRORcxx . . $ `Descent3/stringtable.h:48:9`!, TXT_NOPICSAVAILcxx . . $ `Descent3/stringtable.h:713:9`!, MSGBOX_OKcxx . . $ `Descent3/newui_core.h:78:9`!, UICOL_WINDOW_TITLEcxx . . $ `Descent3/newui.h:219:9`!, UICOL_TEXT_NORMALcxx . . $ `Descent3/newui.h:218:9`!);
1179 }
1180
1181 } break;
1182
1183 case IDP_CONFIGCONTcxx . . $ `Descent3/pilot.cpp:767:9`!:
1184 case IDP_CONFIGKEYBcxx . . $ `Descent3/pilot.cpp:768:9`!: {
1185 if (!filecountcxx . . $ filecount.) {
1186 break;
1187 }
1188
1189 int index = select.pilot_listcxx . . $ pilot_select_menu#pilot_list.->GetCurrentIndexcxx . . $ newuiListBox#GetCurrentIndex(b126dc7c1de90089).();
1190
1191 // this saves out the pilot we're currently working on
1192 PilotListSelectChangeCallbackcxx . . $ PilotListSelectChangeCallback(d4f767463ce0a6b3).(index);
1193
1194 // read the working pilot into the Current_pilot position
1195 char pfilename[_MAX_FNAMEcxx . . $ `linux/linux_fix.h:35:9`!];
1196 working_pilotcxx . . $ working_pilot..get_filenamecxx . . $ pilot#get_filename(fda57c8427c60377).(pfilename);
1197
1198 Current_pilotcxx . . $ Current_pilot..set_filenamecxx . . $ pilot#set_filename(fda57c8427c60377).(pfilename);
1199 PltReadFilecxx . . $ PltReadFile(7ff4d2ff4894147e).(&Current_pilotcxx . . $ Current_pilot., true, true);
1200 // configure the current pilot
1201 if (res == IDP_CONFIGKEYBcxx . . $ `Descent3/pilot.cpp:768:9`!)
1202 CtlConfigcxx . . $ CtlConfig(d4f767463ce0a6b3).(CTLCONFIG_KEYBOARDcxx . . $ `Descent3/ctlconfig.h:58:9`!);
1203 else
1204 CtlConfigcxx . . $ CtlConfig(d4f767463ce0a6b3).(CTLCONFIG_CONTROLLERcxx . . $ `Descent3/ctlconfig.h:59:9`!);
1205 // now save the current_pilot out to disk
1206 PltWriteFilecxx . . $ PltWriteFile(98d330f13870b5ba).(&Current_pilotcxx . . $ Current_pilot., false);
1207
1208 PltReadFilecxx . . $ PltReadFile(7ff4d2ff4894147e).(&working_pilotcxx . . $ working_pilot., true, true);
1209 } break;
1210
1211 case IDP_COPYCONTROLScxx . . $ `Descent3/pilot.cpp:769:9`!: {
1212 pilotcxx . . $ pilot# s_pilcxx . . $ pilot#pilot(49f6e7a06ebc5aa8).;
1213 char pfilename[_MAX_FNAMEcxx . . $ `linux/linux_fix.h:35:9`!];
1214 working_pilotcxx . . $ working_pilot..get_filenamecxx . . $ pilot#get_filename(fda57c8427c60377).(pfilename);
1215
1216 // destroy the current list of pilots and recreate, but
1217 // ignoring our current pilot
1218 PltClearListcxx . . $ PltClearList(49f6e7a06ebc5aa8).();
1219 PltGetPilotsFreecxx . . $ PltGetPilotsFree(49f6e7a06ebc5aa8).();
1220 filelistcxx . . $ filelist. = PltGetPilotscxx . . $ PltGetPilots(af3cb7eb7beac68c).(&filecountcxx . . $ filecount., pfilename, 1);
1221
1222 if (filecountcxx . . $ filecount. >= 1) {
1223 if (PilotChoosecxx . . $ PilotChoose(350c0e311af7e077).(&s_pil)) {
1224 char spfilename[_MAX_FNAMEcxx . . $ `linux/linux_fix.h:35:9`!];
1225 s_pil.get_filenamecxx . . $ pilot#get_filename(fda57c8427c60377).(spfilename);
1226
1227 if (strcmp(spfilename, pfilename) == 0) {
1228 // user choose the same file as what he is configuring
1229 DoMessageBoxcxx . . $ DoMessageBox(dcc99837539e9edc).(TXT_COPYCONFERRcxx . . $ `Descent3/stringtable.h:61:9`!, TXT_COPYCONFERR1cxx . . $ `Descent3/stringtable.h:62:9`!, MSGBOX_OKcxx . . $ `Descent3/newui_core.h:78:9`!, UICOL_WINDOW_TITLEcxx . . $ `Descent3/newui.h:219:9`!, UICOL_TEXT_NORMALcxx . . $ `Descent3/newui.h:218:9`!);
1230 } else {
1231 PltCopyKeyConfigcxx . . $ PltCopyKeyConfig(f7d02c5db1b5d721).(&s_pil, &working_pilotcxx . . $ working_pilot.);
1232 }
1233 }
1234 } else {
1235 DoMessageBoxcxx . . $ DoMessageBox(dcc99837539e9edc).(TXT_PLTERRORcxx . . $ `Descent3/stringtable.h:48:9`!, TXT_NOPILOTSTOCOPYcxx . . $ `Descent3/stringtable.h:792:9`!, MSGBOX_OKcxx . . $ `Descent3/newui_core.h:78:9`!, UICOL_WINDOW_TITLEcxx . . $ `Descent3/newui.h:219:9`!, UICOL_TEXT_NORMALcxx . . $ `Descent3/newui.h:218:9`!);
1236 }
1237
1238 // Restore the pilot list, ignoring none
1239 PltClearListcxx . . $ PltClearList(49f6e7a06ebc5aa8).();
1240 PltGetPilotsFreecxx . . $ PltGetPilotsFree(49f6e7a06ebc5aa8).();
1241 filelistcxx . . $ filelist. = PltGetPilotscxx . . $ PltGetPilots(af3cb7eb7beac68c).(&filecountcxx . . $ filecount.);
1242 } break;
1243 }
1244
1245 } while (!done);
1246
1247 PltClearListcxx . . $ PltClearList(49f6e7a06ebc5aa8).();
1248 PltGetPilotsFreecxx . . $ PltGetPilotsFree(49f6e7a06ebc5aa8).();
1249 Current_pilotcxx . . $ Current_pilot..get_difficultycxx . . $ pilot#get_difficulty(f25546b61a629de7).(&ingame_difficultycxx . . $ ingame_difficulty.);
1250
1251 // get settings
1252 select.finishcxx . . $ pilot_select_menu#finish(49f6e7a06ebc5aa8).();
1253 edit.finishcxx . . $ pilot_edit_menu#finish(49f6e7a06ebc5aa8).();
1254 menu.Closecxx . . $ UIWindow#Close(49f6e7a06ebc5aa8).();
1255 menu.Destroycxx . . $ UIWindow#Destroy(49f6e7a06ebc5aa8).();
1256 }
1257
1258 //////////////////////////////////////////////////////////////
1259 // Brings up the Create A New Pilot Dialog
1260 bool PilotCreatecxx . . $ PilotCreate(350c0e311af7e077).(pilotcxx . . $ pilot# *Pilot, bool forceselection) {
1261 bool done = false;
1262 bool ret;
1263 bool to_ret = false;
1264 char pname[PILOT_STRING_SIZEcxx . . $ `Descent3/pilot_class.h:124:9`!];
1265
1266 while (!done) {
1267 pname[0] = 0;
1268 ret = DoEditDialogcxx . . $ DoEditDialog(79e5ffcc21f8a1c7).(TXT_PLTENTERNAME1cxx . . $ `Descent3/stringtable.h:64:9`!, pname, PILOT_STRING_SIZEcxx . . $ `Descent3/pilot_class.h:124:9`! - 1);
1269
1270 if (!ret) {
1271 if (!forceselection) {
1272 done = true;
1273 to_ret = false;
1274 }
1275 } else {
1276 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Creating Pilot!");
1277
1278 // call this to initialize pilot data for player.
1279 PilotInitDatacxx . . $ PilotInitData(1794bc617d3f3266).(Pilot);
1280 char pfilename[_MAX_FNAMEcxx . . $ `linux/linux_fix.h:35:9`!];
1281
1282 // strip whitespace
1283 char *ptr = pname + strlen(pname) - 1;
1284 while ((ptr > pname) && (*ptr == ' ' || *ptr == '\t')) {
1285 *ptr = '\0';
1286 ptr--;
1287 }
1288
1289 ptr = pname;
1290 while (*ptr && (*ptr == ' ' || *ptr == '\t'))
1291 ptr++;
1292
1293 if (strlen(ptr) == 0) {
1294 DoMessageBoxcxx . . $ DoMessageBox(dcc99837539e9edc).(TXT_PLTERRORcxx . . $ `Descent3/stringtable.h:48:9`!, TXT_PLTERRORNAMEcxx . . $ `Descent3/stringtable.h:67:9`!, MSGBOX_OKcxx . . $ `Descent3/newui_core.h:78:9`!, UICOL_WINDOW_TITLEcxx . . $ `Descent3/newui.h:219:9`!, UICOL_TEXT_NORMALcxx . . $ `Descent3/newui.h:218:9`!);
1295 goto retry;
1296 }
1297
1298 Pilot->set_namecxx . . $ pilot#set_name(85c52e162fed56f9).(ptr);
1299 strcpy(pfilename, ptr);
1300 PltMakeFNValidcxx . . $ PltMakeFNValid(fda57c8427c60377).(pfilename);
1301 strcat(pfilename, PLTEXTENSIONcxx . . $ `Descent3/pilot.cpp:618:9`!);
1302
1303 Pilot->set_filenamecxx . . $ pilot#set_filename(fda57c8427c60377).(pfilename);
1304
1305 RestoreDefaultControlscxx . . $ RestoreDefaultControls(49f6e7a06ebc5aa8).();
1306
1307 for (int id = 0; id < NUM_CONTROLLER_FUNCTIONScxx . . $ NUM_CONTROLLER_FUNCTIONS.; id++) {
1308 ct_typecxx . . $ ct_type# type[2];
1309 ct_config_datacxx . . $ ct_config_data# value;
1310 uint8_tcxx . . $ uint8_t# flags[2];
1311 Controllercxx . . $ Controller.->get_controller_functioncxx . . $ gameController#get_controller_function(c004c324aa6068e0).(Controller_needscxx . . $ Controller_needs.[id].idcxx . . $ ct_function#id., type, &value, flags);
1312 Pilot->controlscxx . . $ pilot#controls.[id].idcxx . . $ cntrldata#id. = Controller_needscxx . . $ Controller_needs.[id].idcxx . . $ ct_function#id.;
1313 Pilot->controlscxx . . $ pilot#controls.[id].typecxx . . $ cntrldata#type.[0] = type[0];
1314 Pilot->controlscxx . . $ pilot#controls.[id].typecxx . . $ cntrldata#type.[1] = type[1];
1315 Pilot->controlscxx . . $ pilot#controls.[id].valuecxx . . $ cntrldata#value. = value;
1316 Pilot->controlscxx . . $ pilot#controls.[id].flagscxx . . $ cntrldata#flags.[0] = flags[0];
1317 Pilot->controlscxx . . $ pilot#controls.[id].flagscxx . . $ cntrldata#flags.[1] = flags[1];
1318 }
1319 switch (PltWriteFilecxx . . $ PltWriteFile(98d330f13870b5ba).(Pilot, true)) {
1320 case PLTW_CFILE_FATALcxx . . $ `Descent3/pilot_class.h:141:9`!: {
1321 // real bad error trying to open file to write to
1322 DoMessageBoxcxx . . $ DoMessageBox(dcc99837539e9edc).(TXT_FILEERRORcxx . . $ `Descent3/stringtable.h:65:9`!, TXT_PLTCFILEERRcxx . . $ `Descent3/stringtable.h:778:9`!, MSGBOX_OKcxx . . $ `Descent3/newui_core.h:78:9`!, UICOL_WINDOW_TITLEcxx . . $ `Descent3/newui.h:219:9`!, UICOL_TEXT_NORMALcxx . . $ `Descent3/newui.h:218:9`!);
1323 done = true;
1324 to_ret = false; // returning true, that way if they are out of drive space
1325 // they can't get to the pilot window, and delete some pilots
1326 } break;
1327
1328 case PLTW_UNKNOWN_FATALcxx . . $ `Descent3/pilot_class.h:142:9`!: {
1329 // real bad error trying to open file to write to
1330 DoMessageBoxcxx . . $ DoMessageBox(dcc99837539e9edc).(TXT_FILEERRORcxx . . $ `Descent3/stringtable.h:65:9`!, TXT_PLTUKNOWNERRcxx . . $ `Descent3/stringtable.h:779:9`!, MSGBOX_OKcxx . . $ `Descent3/newui_core.h:78:9`!, UICOL_WINDOW_TITLEcxx . . $ `Descent3/newui.h:219:9`!, UICOL_TEXT_NORMALcxx . . $ `Descent3/newui.h:218:9`!);
1331 done = true;
1332 to_ret = false; // returning true, that way if they are out of drive space
1333 // they can't get to the pilot window, and delete some pilots
1334 } break;
1335
1336 case PLTW_FILE_CANTOPENcxx . . $ `Descent3/pilot_class.h:140:9`!: {
1337 // real bad error trying to open file to write to
1338 DoMessageBoxcxx . . $ DoMessageBox(dcc99837539e9edc).(TXT_FILEERRORcxx . . $ `Descent3/stringtable.h:65:9`!, TXT_FILEERRPLT1cxx . . $ `Descent3/stringtable.h:66:9`!, MSGBOX_OKcxx . . $ `Descent3/newui_core.h:78:9`!, UICOL_WINDOW_TITLEcxx . . $ `Descent3/newui.h:219:9`!, UICOL_TEXT_NORMALcxx . . $ `Descent3/newui.h:218:9`!);
1339 done = true;
1340 to_ret = false; // returning true, that way if they are out of drive space
1341 // they can't get to the pilot window, and delete some pilots
1342 } break;
1343
1344 case PLTW_NO_FILENAMEcxx . . $ `Descent3/pilot_class.h:138:9`!: {
1345 // No name was given
1346 DoMessageBoxcxx . . $ DoMessageBox(dcc99837539e9edc).(TXT_PLTERRORcxx . . $ `Descent3/stringtable.h:48:9`!, TXT_PLTERRORNAMEcxx . . $ `Descent3/stringtable.h:67:9`!, MSGBOX_OKcxx . . $ `Descent3/newui_core.h:78:9`!, UICOL_WINDOW_TITLEcxx . . $ `Descent3/newui.h:219:9`!, UICOL_TEXT_NORMALcxx . . $ `Descent3/newui.h:218:9`!);
1347 } break;
1348
1349 case PLTW_FILE_EXISTScxx . . $ `Descent3/pilot_class.h:139:9`!: {
1350 // pilot already exists so bring up error window
1351 DoMessageBoxcxx . . $ DoMessageBox(dcc99837539e9edc).(TXT_PLTERRORcxx . . $ `Descent3/stringtable.h:48:9`!, TXT_PLTERREXISTScxx . . $ `Descent3/stringtable.h:68:9`!, MSGBOX_OKcxx . . $ `Descent3/newui_core.h:78:9`!, UICOL_WINDOW_TITLEcxx . . $ `Descent3/newui.h:219:9`!, UICOL_TEXT_NORMALcxx . . $ `Descent3/newui.h:218:9`!);
1352 } break;
1353
1354 case PLTW_NO_ERRORcxx . . $ `Descent3/pilot_class.h:137:9`!: {
1355 // File saved ok
1356 done = true;
1357 to_ret = true;
1358 } break;
1359 }
1360 }
1361 retry:;
1362 }
1363
1364 return to_ret;
1365 }
1366
1367 ///////////////////////////////////////////////////////////////////////////////////
1368 // Helper funktions
1369 ///////////////////////////////////////////////////////////////////////////////////
1370 void PilotCopyDefaultControlscxx . . $ PilotCopyDefaultControls(1794bc617d3f3266).(pilotcxx . . $ pilot# *Pilot) {
1371 PltClearListcxx . . $ PltClearList(49f6e7a06ebc5aa8).();
1372 PltGetPilotsFreecxx . . $ PltGetPilotsFree(49f6e7a06ebc5aa8).();
1373 filelistcxx . . $ filelist. = PltGetPilotscxx . . $ PltGetPilots(af3cb7eb7beac68c).(&filecountcxx . . $ filecount., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, 2);
1374
1375 // if(filecount>0 && DoMessageBox(TXT_PRESETCONTROLS,TXT_USEPRESETS,MSGBOX_YESNO))
1376 if (filecountcxx . . $ filecount. > 0) {
1377 pilotcxx . . $ pilot# s_pilcxx . . $ pilot#pilot(49f6e7a06ebc5aa8).;
1378
1379 if (PilotChoosecxx . . $ PilotChoose(350c0e311af7e077).(&s_pil, true)) {
1380 char spfilename[_MAX_FNAMEcxx . . $ `linux/linux_fix.h:35:9`!];
1381 s_pil.get_filenamecxx . . $ pilot#get_filename(fda57c8427c60377).(spfilename);
1382
1383 if (cfexistcxx . . $ cfexist(293b0826c8d9cb54).(spfilenamecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).)) {
1384 PltCopyKeyConfigcxx . . $ PltCopyKeyConfig(f7d02c5db1b5d721).(&s_pil, Pilot);
1385 } else {
1386 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "%s does not exist...not copying\n", spfilename);
1387 Int3cxx . . $ `misc/pserror.h:247:9`!();
1388 }
1389 }
1390 }
1391
1392 // Restore the pilot list, ignoring none
1393 PltClearListcxx . . $ PltClearList(49f6e7a06ebc5aa8).();
1394 PltGetPilotsFreecxx . . $ PltGetPilotsFree(49f6e7a06ebc5aa8).();
1395 filelistcxx . . $ filelist. = PltGetPilotscxx . . $ PltGetPilots(af3cb7eb7beac68c).(&filecountcxx . . $ filecount.);
1396 }
1397
1398 ///////////////////////////////////////////////////////////
1399 // Displays a window to select a pilot
1400 bool PilotChoosecxx . . $ PilotChoose(350c0e311af7e077).(pilotcxx . . $ pilot# *Pilot, bool presets) {
1401 #define IDP_PCLISTcxx . . $ `Descent3/pilot.cpp:1401:9`! 19
1402 #define PCHOOSE_WND_Hcxx . . $ `Descent3/pilot.cpp:1402:9`! 288
1403 #define PCHOOSE_WND_Wcxx . . $ `Descent3/pilot.cpp:1403:9`! 384
1404
1405 if (filecountcxx . . $ filecount. == 0)
1406 return false;
1407
1408 newuiTiledWindowcxx . . $ newuiTiledWindow# windowcxx . . $ newuiTiledWindow#newuiTiledWindow(49f6e7a06ebc5aa8).;
1409 newuiSheetcxx . . $ newuiSheet# *sheet;
1410 newuiListBoxcxx . . $ newuiListBox# *pilot_list;
1411
1412 bool exit_menu = false;
1413
1414 if (presets) {
1415 window.Createcxx . . $ newuiTiledWindow#Create(9860cac3d762132).(TXT_PRESETCONTROLScxx . . $ `Descent3/stringtable.h:75:9`!, 0, 0, PCHOOSE_WND_Wcxx . . $ `Descent3/pilot.cpp:1403:9`!, PCHOOSE_WND_Hcxx . . $ `Descent3/pilot.cpp:1402:9`!);
1416 } else {
1417 window.Createcxx . . $ newuiTiledWindow#Create(9860cac3d762132).(TXT_PLTCHOOSEcxx . . $ `Descent3/stringtable.h:69:9`!, 0, 0, PCHOOSE_WND_Wcxx . . $ `Descent3/pilot.cpp:1403:9`!, PCHOOSE_WND_Hcxx . . $ `Descent3/pilot.cpp:1402:9`!);
1418 }
1419 sheet = window.GetSheetcxx . . $ newuiTiledWindow#GetSheet(661381a276e5b628).();
1420
1421 sheet->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, 57, 0);
1422 sheet->AddTextcxx . . $ newuiSheet#AddText(326aeb464d16410c).(TXT_PILOTPICTITLEcxx . . $ `Descent3/stringtable.h:699:9`!);
1423 sheet->AddTextcxx . . $ newuiSheet#AddText(326aeb464d16410c).(TXT_COPYCONTBcxx . . $ `Descent3/stringtable.h:700:9`!);
1424 sheet->AddTextcxx . . $ newuiSheet#AddText(326aeb464d16410c).(TXT_COPYCONTOLSCcxx . . $ `Descent3/stringtable.h:701:9`!);
1425
1426 sheet->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, 7, 40);
1427 pilot_list = sheet->AddListBoxcxx . . $ newuiSheet#AddListBox(b890ce7adcd9a5ed).(284, 100, IDP_PCLISTcxx . . $ `Descent3/pilot.cpp:1401:9`!);
1428 pilot_list->SetCurrentIndexcxx . . $ newuiListBox#SetCurrentIndex(d4f767463ce0a6b3).(0);
1429 NewPltUpdatecxx . . $ NewPltUpdate(f5615d74c210c1ee).(pilot_list, filelistcxx . . $ filelist., filecountcxx . . $ filecount., 0);
1430
1431 sheet->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, 80, 180, NEWUI_ALIGN_HORIZcxx . . $ NEWUI_ALIGN_HORIZ.);
1432 sheet->AddButtoncxx . . $ newuiSheet#AddButton(680bf41633375800).(TXT_OKcxx . . $ `Descent3/stringtable.h:34:9`!, UID_OKcxx . . $ `ui/ui.h:368:9`!);
1433 sheet->AddButtoncxx . . $ newuiSheet#AddButton(680bf41633375800).(TXT_CANCELcxx . . $ `Descent3/stringtable.h:35:9`!, UID_CANCELcxx . . $ `ui/ui.h:369:9`!);
1434
1435 bool ret = false;
1436
1437 window.Opencxx . . $ UIWindow#Open(49f6e7a06ebc5aa8).();
1438
1439 while (!exit_menu) {
1440 int res = window.DoUIcxx . . $ newuiTiledWindow#DoUI(b126dc7c1de90089).();
1441
1442 // handle all UI results.
1443 switch (res) {
1444 case IDP_PCLISTcxx . . $ `Descent3/pilot.cpp:1401:9`!:
1445 case UID_OKcxx . . $ `ui/ui.h:368:9`!: {
1446 int index = pilot_list->GetCurrentIndexcxx . . $ newuiListBox#GetCurrentIndex(b126dc7c1de90089).();
1447 if (index >= 0) {
1448 Pilot->set_filenamecxx . . $ pilot#set_filename(fda57c8427c60377).(filelistcxx . . $ filelist.[index]);
1449 PltReadFilecxx . . $ PltReadFile(7ff4d2ff4894147e).(Pilot, false);
1450 ret = true;
1451 exit_menu = true;
1452 }
1453 } break;
1454
1455 case UID_CANCELcxx . . $ `ui/ui.h:369:9`!:
1456 ret = false;
1457 exit_menu = true;
1458 break;
1459 }
1460 }
1461
1462 window.Closecxx . . $ UIWindow#Close(49f6e7a06ebc5aa8).();
1463 window.Destroycxx . . $ UIWindow#Destroy(49f6e7a06ebc5aa8).();
1464
1465 return ret;
1466 }
1467
1468 ///////////////////////////////////////////////////////////
1469 // copies a pilot to another
1470 /***************************************************
1471 bool PilotCopy(pilot *Src,pilot *Dest)
1472 {
1473 char sname[PILOT_STRING_SIZE];
1474 char sship[PAGENAME_LEN];
1475 uint8_t sdiff;
1476
1477 Src->get_name(sname);
1478 Src->get_ship(sship);
1479 Src->get_difficulty(&sdiff);
1480
1481 Dest->set_name(sname);
1482 Dest->set_ship(sship);
1483 Dest->set_difficulty(sdiff);
1484
1485 return PltCopyKeyConfig(Src,Dest);
1486 }
1487 ***************************************************/
1488 /////////////////////////////////////////////////////
1489 // Updates the pilot listbox
1490 void NewPltUpdatecxx . . $ NewPltUpdate(f5615d74c210c1ee).(newuiListBoxcxx . . $ newuiListBox# *list, char **flist, int filecount, int selected, char *filename) {
1491 int index;
1492 pilotcxx . . $ pilot# tPilotcxx . . $ pilot#pilot(49f6e7a06ebc5aa8).;
1493
1494 list->RemoveAllcxx . . $ newuiListBox#RemoveAll(49f6e7a06ebc5aa8).();
1495
1496 if (pilot_itemscxx . . $ pilot_items.) {
1497 delete[] pilot_itemscxx . . $ pilot_items.;
1498 pilot_itemscxx . . $ pilot_items. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1499 }
1500
1501 if (filecount) {
1502 // create UIItems
1503 char pname[PILOT_STRING_SIZEcxx . . $ `Descent3/pilot_class.h:124:9`!];
1504
1505 for (index = 0; index < filecount; index++) {
1506 tPilot.set_filenamecxx . . $ pilot#set_filename(fda57c8427c60377).(flist[index]);
1507 PltReadFilecxx . . $ PltReadFile(7ff4d2ff4894147e).(&tPilot);
1508
1509 tPilot.get_namecxx . . $ pilot#get_name(fda57c8427c60377).(pname);
1510
1511 list->AddItemcxx . . $ newuiListBox#AddItem(85c52e162fed56f9).(pname);
1512 }
1513
1514 list->SetCurrentIndexcxx . . $ newuiListBox#SetCurrentIndex(d4f767463ce0a6b3).(selected);
1515
1516 if (filename && (cfexistcxx . . $ cfexist(293b0826c8d9cb54).(filenamecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).) != CFES_NOT_FOUNDcxx . . $ CFES_NOT_FOUND.)) {
1517 // get the selected pilot from the filename
1518 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Looking for Pilot: %s\n", filename);
1519 for (int d = 0; d < filecount; d++) {
1520 if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(flist[d], filename)) {
1521 // ok we found the filename that they want as the pilot
1522 list->SetCurrentIndexcxx . . $ newuiListBox#SetCurrentIndex(d4f767463ce0a6b3).(d);
1523 break;
1524 }
1525 }
1526 }
1527 }
1528 }
1529
1530 // updates the current pilot's information (level played, mission played, etc)
1531 // call after every successful mission completion
1532 void CurrentPilotUpdateMissionStatuscxx . . $ CurrentPilotUpdateMissionStatus(b45ddcbc8423892c).(bool just_add_data) {
1533 // Don't update if it's a multiplayer game
1534 if (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!)
1535 return;
1536 // look for the current mission in the player's data
1537 int index;
1538 tMissionDatacxx . . $ tMissionData# mission_to_use;
1539
1540 index = Current_pilotcxx . . $ Current_pilot..find_mission_datacxx . . $ pilot#find_mission_data(5c4306d8553b3696).(Current_missioncxx . . $ Current_mission..namecxx . . $ tMission#name.);
1541
1542 if (index == -1) {
1543
1544 // this mission doesn't exist for the pilot yet, so add the mission to the pilot
1545 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "PILOT: New Mission being added to mission data (%s)\n", Current_mission.name);
1546 mission_to_use.highest_levelcxx . . $ tMissionData#highest_level. = 0;
1547 mission_to_use.finishedcxx . . $ tMissionData#finished. = false;
1548 mission_to_use.num_restorescxx . . $ tMissionData#num_restores. = 0;
1549 mission_to_use.num_savescxx . . $ tMissionData#num_saves. = 0;
1550 mission_to_use.ship_permissionscxx . . $ tMissionData#ship_permissions. = Default_ship_permissioncxx . . $ Default_ship_permission.;
1551 strcpy(mission_to_use.mission_namecxx . . $ tMissionData#mission_name., Current_missioncxx . . $ Current_mission..namecxx . . $ tMission#name.);
1552
1553 Current_pilotcxx . . $ Current_pilot..add_mission_datacxx . . $ pilot#add_mission_data(df89f5652ec534f0).(&mission_to_use);
1554
1555 index = Current_pilotcxx . . $ Current_pilot..find_mission_datacxx . . $ pilot#find_mission_data(5c4306d8553b3696).(Current_missioncxx . . $ Current_mission..namecxx . . $ tMission#name.);
1556
1557 ASSERTcxx . . $ `misc/pserror.h:246:9`!(index != -1);
1558
1559 } else {
1560 // this pilot has flown this mission before, just update it
1561 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "PILOT: Updating previously flown mission data (%s)\n", Current_mission.name);
1562
1563 Current_pilotcxx . . $ Current_pilot..get_mission_datacxx . . $ pilot#get_mission_data(db29c71e02b5942a).(index, &mission_to_use);
1564 }
1565
1566 if (!just_add_data) {
1567 // bad place to do this, but this code was added at the last minute. a long term fix requires more files to fix.
1568 int max_level;
1569 for (max_level = 0; max_level < Current_missioncxx . . $ Current_mission..num_levelscxx . . $ tMission#num_levels.; max_level++) {
1570 if (Current_missioncxx . . $ Current_mission..levelscxx . . $ tMission#levels.[max_level].flagscxx . . $ tLevelNode#flags. & LVLFLAG_FINALcxx . . $ LVLFLAG_FINAL.) {
1571 max_level++;
1572 break;
1573 }
1574 }
1575
1576 if (Current_missioncxx . . $ Current_mission..cur_levelcxx . . $ tMission#cur_level. > mission_to_use.highest_levelcxx . . $ tMissionData#highest_level. && !IsCheatercxx . . $ IsCheater. &&
1577 Current_missioncxx . . $ Current_mission..cur_levelcxx . . $ tMission#cur_level. < max_level) { // cheaters don't win
1578 ASSERTcxx . . $ `misc/pserror.h:246:9`!(!(Game_mode & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!));
1579 mission_to_use.highest_levelcxx . . $ tMissionData#highest_level. = Current_missioncxx . . $ Current_mission..cur_levelcxx . . $ tMission#cur_level.;
1580 mission_to_use.ship_permissionscxx . . $ tMissionData#ship_permissions. = Playerscxx . . $ Players.[0].ship_permissionscxx . . $ player#ship_permissions.;
1581 }
1582
1583 // if we've reached end of mission, we've finished it.
1584 if (Current_missioncxx . . $ Current_mission..cur_levelcxx . . $ tMission#cur_level. == max_level) {
1585 mission_to_use.finishedcxx . . $ tMissionData#finished. = true;
1586 }
1587
1588 Current_pilotcxx . . $ Current_pilot..edit_mission_datacxx . . $ pilot#edit_mission_data(db29c71e02b5942a).(index, &mission_to_use);
1589 }
1590
1591 PltWriteFilecxx . . $ PltWriteFile(98d330f13870b5ba).(&Current_pilotcxx . . $ Current_pilot., false);
1592 }
1593
1594 // gets highest level flown for mission
1595 int PilotGetHighestLevelAchievedcxx . . $ PilotGetHighestLevelAchieved(6acfaa1c51e44e0a).(pilotcxx . . $ pilot# *Pilot, char *mission_name) {
1596 ASSERTcxx . . $ `misc/pserror.h:246:9`!(Pilot);
1597 if (!Pilot)
1598 return 1;
1599
1600 int index = Pilot->find_mission_datacxx . . $ pilot#find_mission_data(5c4306d8553b3696).(mission_name);
1601 if (index == -1)
1602 return 0;
1603
1604 tMissionDatacxx . . $ tMissionData# data;
1605 Pilot->get_mission_datacxx . . $ pilot#get_mission_data(db29c71e02b5942a).(index, &data);
1606
1607 return data.highest_levelcxx . . $ tMissionData#highest_level.;
1608 }
1609
1610 // just like it says
1611 bool HasPilotFinishedMissioncxx . . $ HasPilotFinishedMission(db35575a6822461b).(pilotcxx . . $ pilot# *Pilot, const char *mission_name) {
1612 ASSERTcxx . . $ `misc/pserror.h:246:9`!(Pilot);
1613 if (!Pilot)
1614 return false;
1615
1616 int index = Pilot->find_mission_datacxx . . $ pilot#find_mission_data(5c4306d8553b3696).((char *)mission_name);
1617 if (index == -1)
1618 return false;
1619
1620 tMissionDatacxx . . $ tMissionData# data;
1621 Pilot->get_mission_datacxx . . $ pilot#get_mission_data(db29c71e02b5942a).(index, &data);
1622 return data.finishedcxx . . $ tMissionData#finished.;
1623 }
1624
1625 bool HasPilotFlownMissioncxx . . $ HasPilotFlownMission(db35575a6822461b).(pilotcxx . . $ pilot# *Pilot, const char *mission_name) {
1626 ASSERTcxx . . $ `misc/pserror.h:246:9`!(Pilot);
1627 if (!Pilot)
1628 return false;
1629
1630 int index = Pilot->find_mission_datacxx . . $ pilot#find_mission_data(5c4306d8553b3696).((char *)mission_name);
1631 if (index == -1)
1632 return false;
1633 return true;
1634 }
1635
1636 int GetPilotNumSavedGamesForMissioncxx . . $ GetPilotNumSavedGamesForMission(c62af6f04980efe5).(pilotcxx . . $ pilot# *Pilot, const char *mission_name) {
1637 ASSERTcxx . . $ `misc/pserror.h:246:9`!(Pilot);
1638 if (!Pilot)
1639 return 0;
1640
1641 int index = Pilot->find_mission_datacxx . . $ pilot#find_mission_data(5c4306d8553b3696).((char *)mission_name);
1642 if (index == -1)
1643 return 0;
1644
1645 tMissionDatacxx . . $ tMissionData# data;
1646 Pilot->get_mission_datacxx . . $ pilot#get_mission_data(db29c71e02b5942a).(index, &data);
1647 return data.num_savescxx . . $ tMissionData#num_saves.;
1648 }
1649
1650 int GetPilotNumRestoredGamesForMissioncxx . . $ GetPilotNumRestoredGamesForMission(c62af6f04980efe5).(pilotcxx . . $ pilot# *Pilot, const char *mission_name) {
1651 ASSERTcxx . . $ `misc/pserror.h:246:9`!(Pilot);
1652 if (!Pilot)
1653 return 0;
1654
1655 int index = Pilot->find_mission_datacxx . . $ pilot#find_mission_data(5c4306d8553b3696).((char *)mission_name);
1656 if (index == -1)
1657 return 0;
1658
1659 tMissionDatacxx . . $ tMissionData# data;
1660 Pilot->get_mission_datacxx . . $ pilot#get_mission_data(db29c71e02b5942a).(index, &data);
1661 return data.num_restorescxx . . $ tMissionData#num_restores.;
1662 }
1663
1664 void IncrementPilotSavedGamesForMissioncxx . . $ IncrementPilotSavedGamesForMission(6dcf1a44d382ef6d).(pilotcxx . . $ pilot# *Pilot, const char *mission_name) {
1665 ASSERTcxx . . $ `misc/pserror.h:246:9`!(Pilot);
1666 if (!Pilot)
1667 return;
1668
1669 int index = Pilot->find_mission_datacxx . . $ pilot#find_mission_data(5c4306d8553b3696).((char *)mission_name);
1670 if (index == -1)
1671 return;
1672
1673 tMissionDatacxx . . $ tMissionData# data;
1674 Pilot->get_mission_datacxx . . $ pilot#get_mission_data(db29c71e02b5942a).(index, &data);
1675 data.num_savescxx . . $ tMissionData#num_saves.++;
1676 Pilot->edit_mission_datacxx . . $ pilot#edit_mission_data(db29c71e02b5942a).(index, &data);
1677
1678 PltWriteFilecxx . . $ PltWriteFile(98d330f13870b5ba).(Pilot, false);
1679 }
1680
1681 void IncrementPilotRestoredGamesForMissioncxx . . $ IncrementPilotRestoredGamesForMission(6dcf1a44d382ef6d).(pilotcxx . . $ pilot# *Pilot, const char *mission_name) {
1682 ASSERTcxx . . $ `misc/pserror.h:246:9`!(Pilot);
1683 if (!Pilot)
1684 return;
1685
1686 int index = Pilot->find_mission_datacxx . . $ pilot#find_mission_data(5c4306d8553b3696).((char *)mission_name);
1687 if (index == -1)
1688 return;
1689
1690 tMissionDatacxx . . $ tMissionData# data;
1691 Pilot->get_mission_datacxx . . $ pilot#get_mission_data(db29c71e02b5942a).(index, &data);
1692 data.num_restorescxx . . $ tMissionData#num_restores.++;
1693 Pilot->edit_mission_datacxx . . $ pilot#edit_mission_data(db29c71e02b5942a).(index, &data);
1694
1695 PltWriteFilecxx . . $ PltWriteFile(98d330f13870b5ba).(Pilot, false);
1696 }
1697
1698 int GetPilotShipPermissionscxx . . $ GetPilotShipPermissions(c62af6f04980efe5).(pilotcxx . . $ pilot# *Pilot, const char *mission_name) {
1699 ASSERTcxx . . $ `misc/pserror.h:246:9`!(!(Game_mode & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!));
1700 ASSERTcxx . . $ `misc/pserror.h:246:9`!(Pilot);
1701 if (!Pilot)
1702 return 1;
1703
1704 int index = Pilot->find_mission_datacxx . . $ pilot#find_mission_data(5c4306d8553b3696).((char *)mission_name);
1705 if (index == -1)
1706 return 0;
1707
1708 tMissionDatacxx . . $ tMissionData# data;
1709 Pilot->get_mission_datacxx . . $ pilot#get_mission_data(db29c71e02b5942a).(index, &data);
1710
1711 return data.ship_permissionscxx . . $ tMissionData#ship_permissions.;
1712 }
1713
1714 ////////////////////////////////////////////////////////////////////////
1715 // Pilot file functions
1716 ////////////////////////////////////////////////////////////////////////
1717 /////////////////////////////////////////////
1718 // deletes a pilot
1719 bool PltDeletecxx . . $ PltDelete(70381b455242efa3).(pilotcxx . . $ pilot# *Pilot) {
1720 char filename[_MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`!];
1721 char pfilename[_MAX_FNAMEcxx . . $ `linux/linux_fix.h:35:9`!];
1722 char pname[PILOT_STRING_SIZEcxx . . $ `Descent3/pilot_class.h:124:9`!];
1723
1724 Pilot->get_filenamecxx . . $ pilot#get_filename(fda57c8427c60377).(pfilename);
1725
1726 if (pfilename[0] != 0) {
1727 ddio_MakePathcxx . . $ ddio_MakePath(9ad4b0815420a85).(filename, Base_directory_writecxx . . $ Base_directory_write., pfilename, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
1728 return (ddio_DeleteFilecxx . . $ ddio_DeleteFile(5c4306d8553b3696).(pfilename) == 1);
1729 } else {
1730 Int3cxx . . $ `misc/pserror.h:247:9`!(); // this is odd
1731
1732 // it shouldn't get to here, but if for some reason filename didn't exist
1733 // then create the filename from the player name and delete the file
1734 Pilot->get_namecxx . . $ pilot#get_name(fda57c8427c60377).(pname);
1735
1736 if (pname[0] == 0)
1737 return false;
1738
1739 PltMakeFNValidcxx . . $ PltMakeFNValid(fda57c8427c60377).(pname);
1740
1741 strcpy(pfilename, pname);
1742 strcat(pfilename, PLTEXTENSIONcxx . . $ `Descent3/pilot.cpp:618:9`!);
1743 ddio_MakePathcxx . . $ ddio_MakePath(9ad4b0815420a85).(filename, Base_directory_writecxx . . $ Base_directory_write., pfilename, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
1744 return (ddio_DeleteFilecxx . . $ ddio_DeleteFile(5c4306d8553b3696).(filename) == 1);
1745 }
1746 }
1747
1748 void PltCreateDedicatedServerPilotcxx . . $ PltCreateDedicatedServerPilot(1794bc617d3f3266).(pilotcxx . . $ pilot# *Pilot) {
1749 Pilot->cleancxx . . $ pilot#clean(b45ddcbc8423892c).(true);
1750 Pilot->set_namecxx . . $ pilot#set_name(85c52e162fed56f9).("SERVER");
1751 }
1752
1753 //////////////////////////////////////////////
1754 // writes a pilot out to file
1755 // make sure Pilot->filename and Pilot->name are filled in correctly!!!!
1756 int PltWriteFilecxx . . $ PltWriteFile(98d330f13870b5ba).(pilotcxx . . $ pilot# *Pilot, bool newpilot) {
1757 if (Dedicated_servercxx . . $ Dedicated_server.)
1758 return PLTW_NO_ERRORcxx . . $ `Descent3/pilot_class.h:137:9`!;
1759
1760 Pilot->writecxx . . $ pilot#write(49f6e7a06ebc5aa8).();
1761 return Pilot->flushcxx . . $ pilot#flush(73da94e76e6bd037).(newpilot);
1762 }
1763
1764 ////////////////////////////////////////////////////
1765 // reads in a pilot file (fill in pilot name to read in the struct before calling)
1766 // Pilot->filename MUST be filled in (with .plt extension)
1767 void _ReadOldPilotFilecxx . . $ _ReadOldPilotFile(7ff4d2ff4894147e).(pilotcxx . . $ pilot# *Pilot, bool keyconfig, bool missiondata);
1768
1769 void PltReadFilecxx . . $ PltReadFile(7ff4d2ff4894147e).(pilotcxx . . $ pilot# *Pilot, bool keyconfig, bool missiondata) {
1770 if (Dedicated_servercxx . . $ Dedicated_server.) {
1771 PltCreateDedicatedServerPilotcxx . . $ PltCreateDedicatedServerPilot(1794bc617d3f3266).(Pilot);
1772 return;
1773 }
1774
1775 char filename[_MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`!];
1776 char pfilename[_MAX_FNAMEcxx . . $ `linux/linux_fix.h:35:9`!];
1777 CFILEcxx . . $ CFILE# *file;
1778 int filever;
1779
1780 Pilot->get_filenamecxx . . $ pilot#get_filename(fda57c8427c60377).(pfilename);
1781 if (pfilename[0] == 0)
1782 return;
1783
1784 // open and process file
1785 ddio_MakePathcxx . . $ ddio_MakePath(9ad4b0815420a85).(filename, Base_directory_writecxx . . $ Base_directory_write., pfilename, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
1786 try {
1787 file = cfopencxx . . $ cfopen(7c7b94e455f1ae56).(filenamecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., "rb");
1788 if (!file)
1789 return;
1790
1791 filever = cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(file);
1792 cfclosecxx . . $ cfclose(3639e799710acb68).(file);
1793 } catch (...) {
•1794 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "File exception has occurred\n");
1795 Int3cxx . . $ `misc/pserror.h:247:9`!();
1796 Errorcxx . . $ Error(326aeb464d16410c).(TXT_MAJORPLTERRORcxx . . $ `Descent3/stringtable.h:793:9`!);
1797 return;
1798 }
1799
1800 if (filever >= 0x20) {
1801 // new pilot files!
1802 int ret = Pilot->readcxx . . $ pilot#read(9f1afb2e1f195c72).(!keyconfig, !missiondata);
1803 switch (ret) {
1804 case PLTR_TOO_NEWcxx . . $ `Descent3/pilot_class.h:150:9`!:
1805 Errorcxx . . $ Error(326aeb464d16410c).(TXT_PLTFILETOONEWcxx . . $ `Descent3/stringtable.h:860:9`!, pfilename);
1806 break;
1807 }
1808
1809 return;
1810 } else {
1811 try {
1812 _ReadOldPilotFilecxx . . $ _ReadOldPilotFile(7ff4d2ff4894147e).(Pilot, keyconfig, missiondata);
1813 } catch (...) {
•1814 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "File exception has occurred\n");
1815 Int3cxx . . $ `misc/pserror.h:247:9`!();
1816 Errorcxx . . $ Error(326aeb464d16410c).(TXT_MAJORPLTERRORcxx . . $ `Descent3/stringtable.h:793:9`!);
1817 return;
1818 }
1819 }
1820 }
1821
1822 //////////////////////////////////////////////////////////////
1823 // returns the filelist of pilots available
1824 struct tPGetPilotStructcxx . . $ tPGetPilotStruct# {
1825 char *filenamecxx . . $ tPGetPilotStruct#filename.;
1826 tPGetPilotStructcxx . . $ tPGetPilotStruct# *nextcxx . . $ tPGetPilotStruct#next.;
1827 };
1828 static char **pltgetname_listcxx . . $ pltgetname_list. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1829 static int pltgetname_countcxx . . $ pltgetname_count. = 0;
1830
1831 void PltGetPilotsFreecxx . . $ PltGetPilotsFree(49f6e7a06ebc5aa8).(void) {
1832 if (pltgetname_listcxx . . $ pltgetname_list.) {
1833 mem_freecxx . . $ `mem/mem.h:80:9`!(pltgetname_list);
1834 pltgetname_listcxx . . $ pltgetname_list. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1835 }
1836 pltgetname_countcxx . . $ pltgetname_count. = 0;
1837 }
1838
1839 char **PltGetPilotscxx . . $ PltGetPilots(af3cb7eb7beac68c).(int *count, char *ignore_filename, int display_default_configs) {
1840 static char **pname_list = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1841
1842 char buffer[PLTFILELENcxx . . $ `Descent3/pilot.cpp:620:9`!];
1843 char search[256];
1844 tPGetPilotStructcxx . . $ tPGetPilotStruct# *root = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, *curr = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1845 int loop = 1;
1846
1847 if (display_default_configs == 1)
1848 loop = 2;
1849
1850 // clear list
1851 PltClearListcxx . . $ PltClearList(49f6e7a06ebc5aa8).();
1852 PltGetPilotsFreecxx . . $ PltGetPilotsFree(49f6e7a06ebc5aa8).();
1853 (*count) = 0;
1854 root = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1855
1856 for (int loop_count = 0; loop_count < loop; loop_count++) {
1857 switch (display_default_configs) {
1858 case 0:
1859 ASSERTcxx . . $ `misc/pserror.h:246:9`!(loop_count == 0);
1860 ddio_MakePathcxx . . $ ddio_MakePath(9ad4b0815420a85).(search, Base_directory_writecxx . . $ Base_directory_write., PLTWILDCARDcxx . . $ `Descent3/pilot.cpp:617:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
1861 break;
1862 case 1:
1863 ddio_MakePathcxx . . $ ddio_MakePath(9ad4b0815420a85).(search, Base_directory_writecxx . . $ Base_directory_write., (loop_count == 0) ? PLTWILDCARDcxx . . $ `Descent3/pilot.cpp:617:9`! : DPLTWILDCARDcxx . . $ `Descent3/pilot.cpp:619:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
1864 break;
1865 case 2:
1866 ASSERTcxx . . $ `misc/pserror.h:246:9`!(loop_count == 0);
1867 ddio_MakePathcxx . . $ ddio_MakePath(9ad4b0815420a85).(search, Base_directory_writecxx . . $ Base_directory_write., DPLTWILDCARDcxx . . $ `Descent3/pilot.cpp:619:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
1868 break;
1869 default:
1870 Int3cxx . . $ `misc/pserror.h:247:9`!();
1871 break;
1872 }
1873
1874 if (ddio_FindFileStartcxx . . $ ddio_FindFileStart(84e74a5521f49206).(search, buffer)) {
1875
1876 if (ignore_filename && !stricmpcxx . . $ `linux/linux_fix.h:43:9`!(ignore_filename, buffer)) {
1877 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Getting Pilots...found %s, but ignoring\n", buffer);
1878 } else {
1879 if (root == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) {
1880 root = curr = (tPGetPilotStructcxx . . $ tPGetPilotStruct# *)mem_malloccxx . . $ `mem/mem.h:79:9`!(sizeof(tPGetPilotStruct));
1881 curr->nextcxx . . $ tPGetPilotStruct#next. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1882 } else {
1883 curr->nextcxx . . $ tPGetPilotStruct#next. = (tPGetPilotStructcxx . . $ tPGetPilotStruct# *)mem_malloccxx . . $ `mem/mem.h:79:9`!(sizeof(tPGetPilotStruct));
1884 curr = curr->nextcxx . . $ tPGetPilotStruct#next.;
1885 curr->nextcxx . . $ tPGetPilotStruct#next. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1886 }
1887
1888 if (curr) {
1889 curr->filenamecxx . . $ tPGetPilotStruct#filename. = mem_strdupcxx . . $ `mem/mem.h:81:9`!(buffer);
1890
1891 if (curr->filenamecxx . . $ tPGetPilotStruct#filename.) {
1892 (*count)++;
1893 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Getting Pilots..found %s\n", buffer);
1894 } else {
1895 Errorcxx . . $ Error(326aeb464d16410c).(TXT_OUTOFMEMORYcxx . . $ `Descent3/stringtable.h:499:9`!);
1896 }
1897 }
1898 }
1899
1900 while (ddio_FindNextFilecxx . . $ ddio_FindNextFile(c6b7e35ff6de5671).(buffer)) {
1901 if (ignore_filename && !stricmpcxx . . $ `linux/linux_fix.h:43:9`!(ignore_filename, buffer)) {
1902 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Getting Pilots...found %s, but ignoring\n", buffer);
1903 } else {
1904 if (root == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) {
1905 root = curr = (tPGetPilotStructcxx . . $ tPGetPilotStruct# *)mem_malloccxx . . $ `mem/mem.h:79:9`!(sizeof(tPGetPilotStruct));
1906 curr->nextcxx . . $ tPGetPilotStruct#next. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1907 } else {
1908 curr->nextcxx . . $ tPGetPilotStruct#next. = (tPGetPilotStructcxx . . $ tPGetPilotStruct# *)mem_malloccxx . . $ `mem/mem.h:79:9`!(sizeof(tPGetPilotStruct));
1909 curr = curr->nextcxx . . $ tPGetPilotStruct#next.;
1910 curr->nextcxx . . $ tPGetPilotStruct#next. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1911 }
1912
1913 if (curr) {
1914 curr->filenamecxx . . $ tPGetPilotStruct#filename. = mem_strdupcxx . . $ `mem/mem.h:81:9`!(buffer);
1915
1916 if (curr->filenamecxx . . $ tPGetPilotStruct#filename.) {
1917 (*count)++;
1918 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Getting Pilots..found %s\n", buffer);
1919 } else {
1920 Errorcxx . . $ Error(326aeb464d16410c).(TXT_OUTOFMEMORYcxx . . $ `Descent3/stringtable.h:499:9`!);
1921 }
1922 }
1923 }
1924 }
1925 }
1926
1927 ddio_FindFileClosecxx . . $ ddio_FindFileClose(49f6e7a06ebc5aa8).();
1928 }
1929
1930 // now allocate for the real list of char * and move the linked list to that array
1931 if ((*count) > 0) {
1932 pltgetname_listcxx . . $ pltgetname_list. = (char **)mem_malloccxx . . $ `mem/mem.h:79:9`!((*count) * sizeof(char *));
1933 if (pltgetname_listcxx . . $ pltgetname_list.) {
1934 int end = (*count);
1935 curr = root;
1936 tPGetPilotStructcxx . . $ tPGetPilotStruct# *next;
1937
1938 for (int i = 0; i < end; i++) {
1939 // move all the allocated buffers to this list, than we can free the node
1940 next = curr->nextcxx . . $ tPGetPilotStruct#next.;
1941
1942 if (curr) {
1943 pltgetname_listcxx . . $ pltgetname_list.[i] = curr->filenamecxx . . $ tPGetPilotStruct#filename.;
1944 } else {
1945 pltgetname_listcxx . . $ pltgetname_list.[i] = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1946 }
1947
1948 mem_freecxx . . $ `mem/mem.h:80:9`!(curr);
1949 curr = next;
1950 }
1951 }
1952 }
1953 pltgetname_countcxx . . $ pltgetname_count. = (*count);
1954
1955 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Found %d pilots\n", (*count));
1956 return pltgetname_listcxx . . $ pltgetname_list.;
1957 }
1958
1959 ///////////////////////////////////////////////////////////
1960 // clears the file list (MUST CALL TO FREE MEMORY!!!!!!!!!)
1961 void PltClearListcxx . . $ PltClearList(49f6e7a06ebc5aa8).(void) {
1962 if (!pltgetname_listcxx . . $ pltgetname_list.)
1963 return;
1964
1965 int index;
1966
1967 for (index = 0; index < pltgetname_countcxx . . $ pltgetname_count.; index++) {
1968 if (pltgetname_listcxx . . $ pltgetname_list.[index]) {
1969 mem_freecxx . . $ `mem/mem.h:80:9`!(pltgetname_list[index]);
1970 pltgetname_listcxx . . $ pltgetname_list.[index] = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1971 }
1972 }
1973 }
1974
1975 ////////////////////////////////////////////////////////////
1976 // given a name, it will create a valid filename
1977 void PltMakeFNValidcxx . . $ PltMakeFNValid(fda57c8427c60377).(char *name) {
1978 int whiteindex;
1979 int end = strlen(name);
1980
1981 for (whiteindex = 0; whiteindex < end; whiteindex++) {
1982 // remove illegal character (sub _ in place)
1983 switch (name[whiteindex]) {
1984 case '?':
1985 case '*':
1986 case '\\':
1987 case '/':
1988 case '|':
1989 case '<':
1990 case '>':
1991 case ':':
1992 case '"':
1993 name[whiteindex] = '_';
1994 break;
1995 default:
1996 break;
1997 }
1998 }
1999
2000 // remove leading whitespace
2001 whiteindex = 0;
2002 while (name[whiteindex] == ' ')
2003 whiteindex++;
2004
2005 char temp[PLTFILELENcxx . . $ `Descent3/pilot.cpp:620:9`!];
2006 strcpy(temp, &name[whiteindex]);
2007 strcpy(name, temp);
2008 }
2009
2010 ////////////////////////////////////////////////////////
2011 // Copies the key/joy config of a pilot to another (src must exist!) (Keep up to date with Read/Write file)
2012 // this will also save out the dest, so make sure its filled in before calling function
2013 bool PltCopyKeyConfigcxx . . $ PltCopyKeyConfig(f7d02c5db1b5d721).(pilotcxx . . $ pilot# *src, pilotcxx . . $ pilot# *dest) {
2014 // check to make sure src exists
2015 ASSERTcxx . . $ `misc/pserror.h:246:9`!(src);
2016 ASSERTcxx . . $ `misc/pserror.h:246:9`!(dest);
2017
2018 char pname[PILOT_STRING_SIZEcxx . . $ `Descent3/pilot_class.h:124:9`!];
2019 src->get_namecxx . . $ pilot#get_name(fda57c8427c60377).(pname);
2020
2021 if ((pname[0] != 0) && (strlen(pname) > 0) && (strcmp(pname, " ") != 0)) {
2022 int i;
2023 for (i = 0; i < NUM_CONTROLLER_FUNCTIONScxx . . $ NUM_CONTROLLER_FUNCTIONS.; i++) {
2024 dest->controlscxx . . $ pilot#controls.[i].idcxx . . $ cntrldata#id. = src->controlscxx . . $ pilot#controls.[i].idcxx . . $ cntrldata#id.;
2025 dest->controlscxx . . $ pilot#controls.[i].typecxx . . $ cntrldata#type.[0] = src->controlscxx . . $ pilot#controls.[i].typecxx . . $ cntrldata#type.[0];
2026 dest->controlscxx . . $ pilot#controls.[i].typecxx . . $ cntrldata#type.[1] = src->controlscxx . . $ pilot#controls.[i].typecxx . . $ cntrldata#type.[1];
2027 dest->controlscxx . . $ pilot#controls.[i].valuecxx . . $ cntrldata#value. = src->controlscxx . . $ pilot#controls.[i].valuecxx . . $ cntrldata#value.;
2028 dest->controlscxx . . $ pilot#controls.[i].flagscxx . . $ cntrldata#flags.[0] = src->controlscxx . . $ pilot#controls.[i].flagscxx . . $ cntrldata#flags.[0];
2029 dest->controlscxx . . $ pilot#controls.[i].flagscxx . . $ cntrldata#flags.[1] = src->controlscxx . . $ pilot#controls.[i].flagscxx . . $ cntrldata#flags.[1];
2030 }
2031 for (i = 0; i < N_MOUSE_AXIScxx . . $ `Descent3/pilot_class.h:128:9`!; i++) {
2032 dest->mouse_sensitivitycxx . . $ pilot#mouse_sensitivity.[i] = src->mouse_sensitivitycxx . . $ pilot#mouse_sensitivity.[i];
2033 }
2034 for (i = 0; i < N_JOY_AXIScxx . . $ `Descent3/pilot_class.h:129:9`!; i++) {
2035 dest->joy_sensitivitycxx . . $ pilot#joy_sensitivity.[i] = src->joy_sensitivitycxx . . $ pilot#joy_sensitivity.[i];
2036 }
2037 dest->key_rampingcxx . . $ pilot#key_ramping. = src->key_rampingcxx . . $ pilot#key_ramping.;
2038 dest->read_controllercxx . . $ pilot#read_controller. = src->read_controllercxx . . $ pilot#read_controller.;
2039 dest->mouselook_controlcxx . . $ pilot#mouselook_control. = src->mouselook_controlcxx . . $ pilot#mouselook_control.;
2040
2041 return true;
2042 } else
2043 return false;
2044 }
2045
2046 /*
2047 ************************************************************************
2048 * The following section is for the multiplayer ship selection *
2049 * and configuration. *
2050 ************************************************************************
2051 *
2052 */
2053
2054 // UI3DWindow class
2055 //
2056 // UI class for displaying a polymodel on the UIWindow, rotating 30 deg/sec
2057 class UI3DWindowcxx . . $ UI3DWindow# : public UIStaticcxx . . $ UIStatic# {
2058 public:
2059 void OnDrawcxx . . $ UI3DWindow#OnDraw(49f6e7a06ebc5aa8).(void);
2060 };
2061
2062 // UIBmpWindow class
2063 //
2064 // UI class for displaying a bitmap on a UIWindow
2065 class UIBmpWindowcxx . . $ UIBmpWindow# : public UIStaticcxx . . $ UIStatic# {
2066 public:
2067 UIBmpWindowcxx . . $ UIBmpWindow#UIBmpWindow(49f6e7a06ebc5aa8).();
2068 ~cxx . . $ UIBmpWindow#`~UIBmpWindow`(ced63f7c635d850d).UIBmpWindowcxx . . $ UIBmpWindow#();
2069 void SetInfocxx . . $ UIBmpWindow#SetInfo(b994e01f1c45a386).(bool animated, int handle);
2070 void OnDrawcxx . . $ UIBmpWindow#OnDraw(49f6e7a06ebc5aa8).(void);
2071
2072 private:
2073 void DrawBordercxx . . $ UIBmpWindow#DrawBorder(49f6e7a06ebc5aa8).(void);
2074 bool animatedcxx . . $ UIBmpWindow#animated.;
2075 int bm_handlecxx . . $ UIBmpWindow#bm_handle.;
2076 float start_timecxx . . $ UIBmpWindow#start_time.;
2077 UITextcxx . . $ UIText# textcxx . . $ UIBmpWindow#text.;
2078 bool createdcxx . . $ UIBmpWindow#created.;
2079 };
2080
2081 // struct ship_pos
2082 //
2083 // contains information about the ship to be displayed in the ship configuration
2084 struct tShipPoscxx . . $ tShipPos# {
2085 matrixcxx . . $ matrix# last_framecxx . . $ tShipPos#last_frame.;
2086 float cam_distcxx . . $ tShipPos#cam_dist.;
2087 float last_timecxx . . $ tShipPos#last_time.;
2088 bool texture_changedcxx . . $ tShipPos#texture_changed.;
2089 int texture_typecxx . . $ tShipPos#texture_type.;
2090 int texture_idcxx . . $ tShipPos#texture_id.;
2091 int bm_handlecxx . . $ tShipPos#bm_handle.;
2092 void Initcxx . . $ tShipPos#Init(49f6e7a06ebc5aa8).() {
2093 vm_AnglesToMatrixcxx . . $ vm_AnglesToMatrix(654fa9e3c9c3be99).(&last_framecxx . . $ tShipPos#last_frame., 0, (65535 / 2), 0);
2094 last_timecxx . . $ tShipPos#last_time. = timer_GetTimecxx . . $ `ddio/ddio.h:236:9`!();
2095 texture_idcxx . . $ tShipPos#texture_id. = Playerscxx . . $ Players.[0].custom_texture_handlecxx . . $ player#custom_texture_handle.;
2096 bm_handlecxx . . $ tShipPos#bm_handle. = -1;
2097 }
2098 };
2099
2100 tShipPoscxx . . $ tShipPos# ship_poscxx . . $ ship_pos.;
2101 int ship_modelcxx . . $ ship_model. = -1;
2102 char custom_texturecxx . . $ custom_texture.[_MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`!];
2103 UIBmpWindowcxx . . $ UIBmpWindow# *bmpwindowcxx . . $ bmpwindow.;
2104
2105 struct tShipListInfocxx . . $ tShipListInfo# {
2106 int *idlistcxx . . $ tShipListInfo#idlist.; // array of remapping indicies (list index->ship index)
2107 void Initcxx . . $ tShipListInfo#Init(49f6e7a06ebc5aa8).() { idlistcxx . . $ tShipListInfo#idlist. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; }
2108 void Resetcxx . . $ tShipListInfo#Reset(49f6e7a06ebc5aa8).() {
2109 if (idlistcxx . . $ tShipListInfo#idlist.) {
2110 mem_freecxx . . $ `mem/mem.h:80:9`!(idlist);
2111 idlistcxx . . $ tShipListInfo#idlist. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
2112 }
2113 }
2114 };
2115
2116 tCustomListInfocxx . . $ tCustomListInfo# *lp_cust_bmpscxx . . $ lp_cust_bmps. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
2117 tShipListInfocxx . . $ tShipListInfo# *lp_ship_infocxx . . $ lp_ship_info. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
2118
2119 // axtoi
2120 //
2121 // Convert a string that represents a hex value into an int (like atoi)
2122 int axtoicxx . . $ axtoi(1ef8e6ec083aabb9).(char *p) {
2123 int value = 0;
2124
2125 while ((p) && (*p)) {
2126 *p = toupper(*p);
2127 if ((*p >= '0') && (*p <= '9'))
2128 value = (value * 16) + ((*p) - '0');
2129 else if ((*p >= 'A') && (*p <= 'F'))
2130 value = (value * 16) + (((*p) - 'A') + 10);
2131 else
2132 return 0;
2133 p++;
2134 }
2135 return value;
2136 }
2137
2138 // StripCRCFileName
2139 //
2140 // Given a filename that has the _<CRC> in it at the end of the name, it will fill
2141 // in dest with just the filename part (without the trailing _<CRC>).
2142 void StripCRCFileNamecxx . . $ StripCRCFileName(611124a97efc52dd).(const char *src, char *dest) {
2143 ASSERTcxx . . $ `misc/pserror.h:246:9`!(src);
2144 ASSERTcxx . . $ `misc/pserror.h:246:9`!(dest);
2145
2146 int full_strlen = strlen(src);
2147 char ext[256];
2148 ddio_SplitPathcxx . . $ ddio_SplitPath(b05ba7ab99603c07).(src, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, ext);
2149 int extstrlen = strlen(ext);
2150 int eon = full_strlen - 9 - extstrlen;
2151
2152 if (eon < 1) {
2153 // this filename doesn't have a trailing CRC
2154 strcpy(dest, src);
2155 return;
2156 }
2157
2158 // check to make sure the [eon] is '_'
2159 if (src[eon] != '_') {
2160 // it wasn't so it must not have a CRC at the end
2161 strcpy(dest, src);
2162 return;
2163 }
2164
2165 char hexstring[9];
2166 strncpy(hexstring, &src[eon + 1], 8);
2167 hexstring[8] = '\0';
2168 uint32_tcxx . . $ uint32_t# crc;
2169 crc = axtoicxx . . $ axtoi(1ef8e6ec083aabb9).(hexstring);
2170
2171 if (crc == 0) {
2172 // crc can't be 0?
2173 strcpy(dest, src);
2174 return;
2175 }
2176
2177 // strip the filename
2178 strncpy(dest, src, eon);
2179 dest[eon] = '\0';
2180 strcat(dest, ext); // put back the extension
2181 }
2182
2183 // CreateCRCFileName
2184 //
2185 // Given a filename, this function will open the file, make a CRC of the data
2186 // and then fill in dest buffer with <filename>_<CRC> where <filename> is the
2187 // original filename and <CRC> is the converted string of the CRC in hex.
2188 // returns true on success.
2189 // dest should be size of src + 9 (for the _ & CRC)
2190 bool CreateCRCFileNamecxx . . $ CreateCRCFileName(84e74a5521f49206).(const char *src, char *dest) {
2191 ASSERTcxx . . $ `misc/pserror.h:246:9`!(src);
2192 ASSERTcxx . . $ `misc/pserror.h:246:9`!(dest);
2193
2194 if (cfexistcxx . . $ cfexist(293b0826c8d9cb54).(srccxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).) != CFES_ON_DISKcxx . . $ CFES_ON_DISK.)
2195 return false;
2196
2197 uint32_tcxx . . $ uint32_t# crc_value = cf_GetfileCRCcxx . . $ cf_GetfileCRC(eb3222378d8a05e0).((cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).char *)src);
2198 if (crc_value == 0) {
2199 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "CRC WARNING: A CRC of 0 HAS BEEN GENERATED!\n");
2200 }
2201 char hex_string[10];
2202 snprintf(hex_string, sizeof(hex_string), "_%08X", crc_value);
2203
2204 char ext[256];
2205 ddio_SplitPathcxx . . $ ddio_SplitPath(b05ba7ab99603c07).(src, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, ext);
2206
2207 // now create the full filename
2208 // first strip any possible CRC on the file
2209 StripCRCFileNamecxx . . $ StripCRCFileName(611124a97efc52dd).(src, dest);
2210 dest[strlen(dest) - strlen(ext)] = '\0'; // lose the extension
2211 strcat(dest, hex_string);
2212 strcat(dest, ext); // put extension back
2213
2214 return true;
2215 }
2216
2217 // CreateCRCFileName
2218 //
2219 // Given a file, a new filename, it will take the src file, create a new filename, with base as the base
2220 bool CreateCRCFileNamecxx . . $ CreateCRCFileName(f9763021685d4f6a).(const char *src, char *base, char *newfilename) {
2221 ASSERTcxx . . $ `misc/pserror.h:246:9`!(src);
2222 ASSERTcxx . . $ `misc/pserror.h:246:9`!(base);
2223 ASSERTcxx . . $ `misc/pserror.h:246:9`!(newfilename);
2224
2225 if (cfexistcxx . . $ cfexist(293b0826c8d9cb54).(srccxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).) != CFES_ON_DISKcxx . . $ CFES_ON_DISK.)
2226 return false;
2227
2228 uint32_tcxx . . $ uint32_t# crc_value = cf_GetfileCRCcxx . . $ cf_GetfileCRC(eb3222378d8a05e0).((cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).char *)src);
2229 if (crc_value == 0) {
2230 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "CRC WARNING: A CRC of 0 HAS BEEN GENERATED!\n");
2231 }
2232 char hex_string[10];
2233 snprintf(hex_string, sizeof(hex_string), "_%08X", crc_value);
2234
2235 char ext[256];
2236 ddio_SplitPathcxx . . $ ddio_SplitPath(b05ba7ab99603c07).(base, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, ext);
2237
2238 // now create the full filename
2239 // first strip any possible CRC on the file
2240 strcpy(newfilename, base);
2241 newfilename[strlen(newfilename) - strlen(ext)] = '\0'; // lose the extension
2242 strcat(newfilename, hex_string);
2243 strcat(newfilename, ext); // put extension back
2244
2245 return true;
2246 }
2247
2248 // FindAllFiles
2249 //
2250 // Retrieves the files in the current directory that match the pattern given. Call FindAllFilesSize() to
2251 // determine how much memory will be needed for the buffer. pattern = wildcard pattern to use to match
2252 // list = buffer of memory that will be filled in with the filenames (each seperated by a \0)
2253 // size = size of memory allocated for list parm
2254 // filecount = filled in with the number of files it found
2255 int FindAllFilescxx . . $ FindAllFiles(a3bb94f7062cc346).(const char *pattern, char *list, int size, int *filecount) {
2256 int count = 0;
2257 char filename[_MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`!];
2258 *filecount = 0;
2259 int memory = 0;
2260
2261 if (size <= 0)
2262 return 0;
2263 if (!list)
2264 return 0;
2265 if (!pattern)
2266 return 0;
2267
2268 if (ddio_FindFileStartcxx . . $ ddio_FindFileStart(84e74a5521f49206).(pattern, filename)) {
2269 count++;
2270 strcpy(&list[memory], filename);
2271 memory += strlen(&list[memory]) + 1;
2272 while ((count < size) && (ddio_FindNextFilecxx . . $ ddio_FindNextFile(c6b7e35ff6de5671).(filename))) {
2273 strcpy(&list[memory], filename);
2274 memory += strlen(&list[memory]) + 1;
2275 count++;
2276 }
2277 }
2278 ddio_FindFileClosecxx . . $ ddio_FindFileClose(49f6e7a06ebc5aa8).();
2279 *filecount = count;
2280 return memory;
2281 }
2282
2283 // FindAllFilesSize
2284 //
2285 // Looks in the current directory and returns the number of bytes of memory that will be needed
2286 // for a buffer of filenames (see FindAllFiles()).
2287 // pattern = wildcard pattern to match
2288 // filecount = will be filled in with the number of files it finds
2289 int FindAllFilesSizecxx . . $ FindAllFilesSize(7436bf38bddd805d).(const char *pattern, int *filecount) {
2290 if (!pattern) {
2291 *filecount = 0;
2292 return 0;
2293 }
2294
2295 char filename[_MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`!];
2296 int size = 0;
2297 int count = 0;
2298
2299 if (ddio_FindFileStartcxx . . $ ddio_FindFileStart(84e74a5521f49206).(pattern, filename)) {
2300 count++;
2301 size += strlen(filename) + 1;
2302 while (ddio_FindNextFilecxx . . $ ddio_FindNextFile(c6b7e35ff6de5671).(filename)) {
2303 count++;
2304 size += strlen(filename) + 1;
2305 }
2306 ddio_FindFileClosecxx . . $ ddio_FindFileClose(49f6e7a06ebc5aa8).();
2307 }
2308 *filecount = count;
2309 return size;
2310 }
2311
2312 // returns the optimal distance to place the camera
2313 float getdistcxx . . $ getdist(3f5ede336672c4ec).(anglecxx . . $ angle# ang, float height) {
2314 float s, c, t;
2315 vm_SinCoscxx . . $ vm_SinCos(5f75934053e2a042).(ang, &s, &c);
2316 t = s / c;
2317 return (height / t);
2318 }
2319
2320 // ImportGraphic
2321 //
2322 // Takes the graphics file at the given location and imports it into the custom\graphics dir as an scaled ogf
2323 // pathname = full path to source bitmap
2324 // newfile = on return true is the filename of the new bitmap
2325 bool ImportGraphiccxx . . $ ImportGraphic(14223ed414283e68).(char *pathname, char *newfile) {
2326 ASSERTcxx . . $ `misc/pserror.h:246:9`!(pathname);
2327 if (cfexistcxx . . $ cfexist(293b0826c8d9cb54).(pathnamecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).) != CFES_ON_DISKcxx . . $ CFES_ON_DISK.) {
2328 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "'%s' not found\n", pathname);
2329 return false;
2330 }
2331
2332 int bm_handle = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).(IGNORE_TABLEcxx . . $ `lib/manage_external.h:54:9`!(pathname), 0);
2333 if (bm_handle <= BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!) {
2334 return false;
2335 }
2336
2337 bm_ChangeSizecxx . . $ bm_ChangeSize(b1146eedae1e1d0b).(bm_handle, 64, 64);
2338
2339 char p[_MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`!];
2340 char filename[_MAX_FNAMEcxx . . $ `linux/linux_fix.h:35:9`!], ext[_MAX_EXTcxx . . $ `linux/linux_fix.h:36:9`!];
2341 char tempfilename[_MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`!];
2342
2343 // Create a temporary filename, so that we can temporarily save the graphic to this file
2344 if (!ddio_GetTempFileNamecxx . . $ ddio_GetTempFileName(dfb34736e99ce5d).(Descent3_temp_directorycxx . . $ Descent3_temp_directory., "d3i", tempfilename)) {
2345 // there was an error trying to create a temporary filename
2346 bm_FreeBitmapcxx . . $ bm_FreeBitmap(d4f767463ce0a6b3).(bm_handle);
2347 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Error creating temp filename\n");
2348 return false;
2349 }
2350
2351 // save out the file
2352 if (bm_SaveFileBitmapcxx . . $ bm_SaveFileBitmap(220e687f58daa9be).(tempfilenamecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., bm_handle) == -1) {
2353 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Error importing\n");
2354 bm_FreeBitmapcxx . . $ bm_FreeBitmap(d4f767463ce0a6b3).(bm_handle);
2355 return false;
2356 }
2357
2358 bm_FreeBitmapcxx . . $ bm_FreeBitmap(d4f767463ce0a6b3).(bm_handle);
2359
2360 // when we get here we have an .ogf file saved out as tempfilename, we need to load it back up
2361 char blah[_MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`!];
2362 StripCRCFileNamecxx . . $ StripCRCFileName(611124a97efc52dd).(pathname, blah); // make sure all CRC are out of the filename
2363 ddio_SplitPathcxx . . $ ddio_SplitPath(b05ba7ab99603c07).(blah, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, filename, ext);
2364 if (!CreateCRCFileNamecxx . . $ CreateCRCFileName(f9763021685d4f6a).(tempfilename, filename, p)) {
2365 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Error creating CRC File\n");
2366 ddio_DeleteFilecxx . . $ ddio_DeleteFile(5c4306d8553b3696).(tempfilename);
2367 return false;
2368 }
2369
2370 strcpy(filename, p);
2371 strcat(filename, ".ogf");
2372
2373 ddio_MakePathcxx . . $ ddio_MakePath(9ad4b0815420a85).(p, LocalCustomGraphicsDircxx . . $ LocalCustomGraphicsDir., filename, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
2374
2375 // p contains the real filename
2376 // tempfilename contains old filename
2377 bm_handle = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).(IGNORE_TABLEcxx . . $ `lib/manage_external.h:54:9`!(tempfilename), 0);
2378 if (bm_handle <= BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!) {
2379 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Error reloading bitmap for rename\n");
2380 ddio_DeleteFilecxx . . $ ddio_DeleteFile(5c4306d8553b3696).(tempfilename);
2381 return false;
2382 }
2383
2384 if (bm_SaveFileBitmapcxx . . $ bm_SaveFileBitmap(220e687f58daa9be).(pcxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., bm_handle) == -1) {
2385 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Error importing\n");
2386 bm_FreeBitmapcxx . . $ bm_FreeBitmap(d4f767463ce0a6b3).(bm_handle);
2387 ddio_DeleteFilecxx . . $ ddio_DeleteFile(5c4306d8553b3696).(tempfilename);
2388 return false;
2389 }
2390
2391 bm_FreeBitmapcxx . . $ bm_FreeBitmap(d4f767463ce0a6b3).(bm_handle);
2392 ddio_DeleteFilecxx . . $ ddio_DeleteFile(5c4306d8553b3696).(tempfilename);
2393
2394 strcpy(newfile, p);
2395 return true;
2396 }
2397
2398 // UpdateGraphicsListbox
2399 //
2400 // Updates the listbox that contains the custom textures. Make sure all double-pointer arguments passes in
2401 // are set to NULL is they don't have memory allocated for them yet, because if they're not null this function
2402 // will try to free up their memory
2403 bool UpdateGraphicsListboxcxx . . $ UpdateGraphicsListbox(d8f747e86a7ef2e3).(tCustomListInfocxx . . $ tCustomListInfo# *cust_bmps, newuiListBoxcxx . . $ newuiListBox# *lb, char *selected_name) {
2404 ASSERTcxx . . $ `misc/pserror.h:246:9`!(lb);
2405 lb->RemoveAllcxx . . $ newuiListBox#RemoveAll(49f6e7a06ebc5aa8).();
2406
2407 cust_bmps->Resetcxx . . $ tCustomListInfo#Reset(49f6e7a06ebc5aa8).();
2408 cust_bmps->custom_bitmap_listcxx . . $ tCustomListInfo#custom_bitmap_list. = lb;
2409
2410 // get a list of custom textures
2411 int count = 0;
2412 bool ok_to_get_files;
2413 int total_files = 0;
2414
2415 // build list
2416 char oldpath[_MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`!];
2417
2418 ddio_GetWorkingDircxx . . $ ddio_GetWorkingDir(a07d8cccb7673f5a).(oldpath, _MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`!);
2419
2420 if (ddio_SetWorkingDircxx . . $ ddio_SetWorkingDir(c5f7da30cbc0f4e9).(LocalCustomGraphicsDircxx . . $ LocalCustomGraphicsDir.))
2421 ok_to_get_files = true;
2422 else
2423 ok_to_get_files = false;
2424
2425 if (ok_to_get_files) {
2426 // Get all the filenames
2427 int totalsize, size;
2428 int count, totalcount;
2429
2430 //.oaf
2431 //.ogf
2432 count = totalcount = totalsize = total_files = 0;
2433
2434 totalsize += FindAllFilesSizecxx . . $ FindAllFilesSize(7436bf38bddd805d).("*.oaf", &count);
2435 totalcount += count;
2436 totalsize += FindAllFilesSizecxx . . $ FindAllFilesSize(7436bf38bddd805d).("*.ogf", &count);
2437 totalcount += count;
2438
2439 if (totalsize) {
2440 cust_bmps->needed_sizecxx . . $ tCustomListInfo#needed_size. = totalsize;
2441 total_files = totalcount;
2442 cust_bmps->filescxx . . $ tCustomListInfo#files. = (char *)mem_malloccxx . . $ `mem/mem.h:79:9`!(totalsize);
2443 if (cust_bmps->filescxx . . $ tCustomListInfo#files.) {
2444 size = 0;
2445 count = 0;
2446
2447 size += FindAllFilescxx . . $ FindAllFiles(a3bb94f7062cc346).("*.oaf", &cust_bmps->filescxx . . $ tCustomListInfo#files.[size], totalcount, &count);
2448 totalcount -= count;
2449 size += FindAllFilescxx . . $ FindAllFiles(a3bb94f7062cc346).("*.ogf", &cust_bmps->filescxx . . $ tCustomListInfo#files.[size], totalcount, &count);
2450 totalcount -= count;
2451 } else
2452 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Unable to allocate memory for %d bytes\n", totalsize);
2453 }
2454 }
2455
2456 count = total_files + 1; // make room for "None"
2457
2458 char chosen_name[256], ext[256];
2459 if (selected_name) {
2460 ddio_SplitPathcxx . . $ ddio_SplitPath(b05ba7ab99603c07).(selected_name, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, chosen_name, ext);
2461 strcat(chosen_name, ext);
2462 } else {
2463 *chosen_name = '\0';
2464 }
2465
2466 // default "None"
2467 lb->AddItemcxx . . $ newuiListBox#AddItem(85c52e162fed56f9).(TXT_LBNONEcxx . . $ `Descent3/stringtable.h:399:9`!);
2468
2469 int memory_used;
2470 memory_used = 0;
2471 for (int i = 1; i < count; i++) {
2472 char tempf[_MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`!];
2473 StripCRCFileNamecxx . . $ StripCRCFileName(611124a97efc52dd).(&cust_bmps->filescxx . . $ tCustomListInfo#files.[memory_used], tempf);
2474 lb->AddItemcxx . . $ newuiListBox#AddItem(85c52e162fed56f9).(tempf);
2475 if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(&cust_bmps->files[memory_used], chosen_name)) {
2476 lb->SetCurrentIndexcxx . . $ newuiListBox#SetCurrentIndex(d4f767463ce0a6b3).(i);
2477 CustomCallBackcxx . . $ CustomCallBack(d4f767463ce0a6b3).(i);
2478 }
2479
2480 memory_used += strlen(&cust_bmps->filescxx . . $ tCustomListInfo#files.[memory_used]) + 1;
2481 }
2482
2483 // If we are not forcing a selection, choose none
2484 if (*chosen_name == '\0') {
2485 lb->SetCurrentIndexcxx . . $ newuiListBox#SetCurrentIndex(d4f767463ce0a6b3).(0);
2486 CustomCallBackcxx . . $ CustomCallBack(d4f767463ce0a6b3).(0);
2487 }
2488
2489 ddio_SetWorkingDircxx . . $ ddio_SetWorkingDir(c5f7da30cbc0f4e9).(oldpath);
2490 return true;
2491 }
2492
2493 // GetCustomSoundFiles
2494 //
2495 // Looks in the custom/sound directory and retrieves all the wav files in there. Returns the size of the buffer
2496 // needed to get all the needed files. The filenames are stored in the buffer, seperated by \0, use count to
2497 // determine how many were placed in the buffer
2498 //
2499 // buffer = Your buffer passed in, if this is NULL then it just returns a buffer size that is needed
2500 // size = Size of your buffer passed in
2501 // *count = filled in with the number of files that were placed into your buffer
2502 int GetCustomSoundFilescxx . . $ GetCustomSoundFiles(fa322d2ebdf80961).(char *buffer = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, int size = 0, int *count = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
2503 int GetCustomSoundFilescxx . . $ GetCustomSoundFiles(fa322d2ebdf80961).(char *buffer, int size, int *count) {
2504 int c = 0;
2505 int isize = 0;
2506 int len, overallsize = 0;
2507 char tempname[_MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`!];
2508 char oldpath[_MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`!];
2509 ddio_GetWorkingDircxx . . $ ddio_GetWorkingDir(a07d8cccb7673f5a).(oldpath, _MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`!);
2510 ddio_SetWorkingDircxx . . $ ddio_SetWorkingDir(c5f7da30cbc0f4e9).(LocalCustomSoundsDircxx . . $ LocalCustomSoundsDir.);
2511
2512 if (!buffer)
2513 size = 0;
2514
2515 if (count)
2516 *count = 0;
2517
2518 if (ddio_FindFileStartcxx . . $ ddio_FindFileStart(84e74a5521f49206).("*.osf", tempname)) {
2519 len = strlen(tempname);
2520 overallsize += len + 1;
2521 if (isize + len < size) {
2522 strcpy(buffer, tempname);
2523 isize += len + 1;
2524 c++;
2525 }
2526
2527 while (ddio_FindNextFilecxx . . $ ddio_FindNextFile(c6b7e35ff6de5671).(tempname)) {
2528 len = strlen(tempname);
2529 overallsize += len + 1;
2530 if (isize + len < size) {
2531 strcpy(&buffer[isize], tempname);
2532 isize += len + 1;
2533 c++;
2534 }
2535 }
2536 }
2537 ddio_FindFileClosecxx . . $ ddio_FindFileClose(49f6e7a06ebc5aa8).();
2538 ddio_SetWorkingDircxx . . $ ddio_SetWorkingDir(c5f7da30cbc0f4e9).(oldpath);
2539 if (count)
2540 *count = c;
2541 return overallsize;
2542 }
2543
2544 // GetStringInList
2545 //
2546 // Returns a pointer to the string in a string list (<string1>\0<string2>\0...). Be VERY careful that
2547 // the index you pass in is a valid string index
2548 // index = Index of string you want
2549 // list = string list (a bunch of strings, seperated by \0)
2550 // maxsize = size of string list buffer
2551 // returns NULL on error (if an error can be detected)
2552 char *GetStringInListcxx . . $ GetStringInList(22f5e0f8dc18650f).(int index, char *list, int maxsize) {
2553 int count = 0;
2554 int p = 0;
2555 char *pp;
2556 pp = list;
2557
2558 while (1) {
2559 if (count == index)
2560 return pp;
2561
2562 if (p < maxsize) {
2563 if (*pp == '\0')
2564 count++;
2565 } else
2566 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
2567 p++;
2568 pp++;
2569 }
2570 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
2571 }
2572
2573 // UpdateAudioTauntBoxes
2574 //
2575 // Resets and updates the list of audio taunt combo boxes
2576 void UpdateAudioTauntBoxescxx . . $ UpdateAudioTauntBoxes(79e8cd0b2cad2f2c).(tCustomListInfocxx . . $ tCustomListInfo# *cust_snds, newuiComboBoxcxx . . $ newuiComboBox# *audio1_list, newuiComboBoxcxx . . $ newuiComboBox# *audio2_list,
2577 newuiComboBoxcxx . . $ newuiComboBox# *audio3_list, newuiComboBoxcxx . . $ newuiComboBox# *audio4_list, pilotcxx . . $ pilot# *Pilot) {
2578 ASSERTcxx . . $ `misc/pserror.h:246:9`!(audio1_list);
2579 ASSERTcxx . . $ `misc/pserror.h:246:9`!(audio2_list);
2580
2581 audio1_list->RemoveAllcxx . . $ newuiComboBox#RemoveAll(49f6e7a06ebc5aa8).();
2582 audio2_list->RemoveAllcxx . . $ newuiComboBox#RemoveAll(49f6e7a06ebc5aa8).();
2583 audio3_list->RemoveAllcxx . . $ newuiComboBox#RemoveAll(49f6e7a06ebc5aa8).();
2584 audio4_list->RemoveAllcxx . . $ newuiComboBox#RemoveAll(49f6e7a06ebc5aa8).();
2585
2586 // free up allocated memory
2587 cust_snds->Resetcxx . . $ tCustomListInfo#Reset(49f6e7a06ebc5aa8).();
2588
2589 // Get all the audio files and put them into the lists
2590 cust_snds->needed_sizecxx . . $ tCustomListInfo#needed_size. = GetCustomSoundFilescxx . . $ GetCustomSoundFiles(fa322d2ebdf80961).();
2591 if (cust_snds->needed_sizecxx . . $ tCustomListInfo#needed_size.)
2592 cust_snds->filescxx . . $ tCustomListInfo#files. = (char *)mem_malloccxx . . $ `mem/mem.h:79:9`!(cust_snds->needed_size);
2593 else
2594 cust_snds->filescxx . . $ tCustomListInfo#files. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
2595
2596 int audio_count;
2597
2598 GetCustomSoundFilescxx . . $ GetCustomSoundFiles(fa322d2ebdf80961).(cust_snds->filescxx . . $ tCustomListInfo#files., cust_snds->needed_sizecxx . . $ tCustomListInfo#needed_size., &audio_count);
2599
2600 int len;
2601
2602 // Add <None> to both boxes
2603 audio1_list->AddItemcxx . . $ newuiComboBox#AddItem(85c52e162fed56f9).(TXT_LBNONEcxx . . $ `Descent3/stringtable.h:399:9`!);
2604 audio2_list->AddItemcxx . . $ newuiComboBox#AddItem(85c52e162fed56f9).(TXT_LBNONEcxx . . $ `Descent3/stringtable.h:399:9`!);
2605 audio3_list->AddItemcxx . . $ newuiComboBox#AddItem(85c52e162fed56f9).(TXT_LBNONEcxx . . $ `Descent3/stringtable.h:399:9`!);
2606 audio4_list->AddItemcxx . . $ newuiComboBox#AddItem(85c52e162fed56f9).(TXT_LBNONEcxx . . $ `Descent3/stringtable.h:399:9`!);
2607
2608 int count = 0;
2609
2610 char paudio1[PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!], paudio2[PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!];
2611 char paudio3[PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!], paudio4[PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!];
2612 Pilot->get_multiplayer_datacxx . . $ pilot#get_multiplayer_data(ea6e7aa10f4b80f5).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, paudio1, paudio2, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, paudio3, paudio4);
2613
2614 for (int i = 0; i < audio_count; i++) {
2615 char tfn[_MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`!];
2616 len = strlen(&cust_snds->filescxx . . $ tCustomListInfo#files.[count]);
2617 StripCRCFileNamecxx . . $ StripCRCFileName(611124a97efc52dd).(&cust_snds->filescxx . . $ tCustomListInfo#files.[count], tfn);
2618
2619 audio1_list->AddItemcxx . . $ newuiComboBox#AddItem(85c52e162fed56f9).((char *)(tfn));
2620 audio2_list->AddItemcxx . . $ newuiComboBox#AddItem(85c52e162fed56f9).((char *)(tfn));
2621 audio3_list->AddItemcxx . . $ newuiComboBox#AddItem(85c52e162fed56f9).((char *)(tfn));
2622 audio4_list->AddItemcxx . . $ newuiComboBox#AddItem(85c52e162fed56f9).((char *)(tfn));
2623
2624 if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(paudio1, &cust_snds->files[count])) {
2625 // set this as selected index for audio #1
2626 audio1_list->SetCurrentIndexcxx . . $ newuiComboBox#SetCurrentIndex(d4f767463ce0a6b3).(i + 1);
2627 }
2628 if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(paudio2, &cust_snds->files[count])) {
2629 // set this as selected index for audio #2
2630 audio2_list->SetCurrentIndexcxx . . $ newuiComboBox#SetCurrentIndex(d4f767463ce0a6b3).(i + 1);
2631 }
2632 if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(paudio3, &cust_snds->files[count])) {
2633 // set this as selected index for audio #1
2634 audio3_list->SetCurrentIndexcxx . . $ newuiComboBox#SetCurrentIndex(d4f767463ce0a6b3).(i + 1);
2635 }
2636 if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(paudio4, &cust_snds->files[count])) {
2637 // set this as selected index for audio #2
2638 audio4_list->SetCurrentIndexcxx . . $ newuiComboBox#SetCurrentIndex(d4f767463ce0a6b3).(i + 1);
2639 }
2640 count += len + 1;
2641 }
2642 }
2643
2644 pilotcxx . . $ pilot# *AudioTauntPilotcxx . . $ AudioTauntPilot.;
2645 tCustomListInfocxx . . $ tCustomListInfo# *AudioTauntPilotSndInfocxx . . $ AudioTauntPilotSndInfo.;
2646 void audio1changecallbackcxx . . $ audio1changecallback(d4f767463ce0a6b3).(int index) {
2647 if (index == 0) {
2648 AudioTauntPilotcxx . . $ AudioTauntPilot.->set_multiplayer_datacxx . . $ pilot#set_multiplayer_data(a7d02ca8b58088a9).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, "");
2649 return;
2650 } else {
2651 index--;
2652 char *p = GetStringInListcxx . . $ GetStringInList(22f5e0f8dc18650f).(index, AudioTauntPilotSndInfocxx . . $ AudioTauntPilotSndInfo.->filescxx . . $ tCustomListInfo#files., AudioTauntPilotSndInfocxx . . $ AudioTauntPilotSndInfo.->needed_sizecxx . . $ tCustomListInfo#needed_size.);
2653 if (p) {
2654 AudioTauntPilotcxx . . $ AudioTauntPilot.->set_multiplayer_datacxx . . $ pilot#set_multiplayer_data(a7d02ca8b58088a9).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, p);
2655 }
2656 }
2657 }
2658
2659 void audio2changecallbackcxx . . $ audio2changecallback(d4f767463ce0a6b3).(int index) {
2660 if (index == 0) {
2661 AudioTauntPilotcxx . . $ AudioTauntPilot.->set_multiplayer_datacxx . . $ pilot#set_multiplayer_data(a7d02ca8b58088a9).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, "");
2662 return;
2663 } else {
2664 index--;
2665 char *p = GetStringInListcxx . . $ GetStringInList(22f5e0f8dc18650f).(index, AudioTauntPilotSndInfocxx . . $ AudioTauntPilotSndInfo.->filescxx . . $ tCustomListInfo#files., AudioTauntPilotSndInfocxx . . $ AudioTauntPilotSndInfo.->needed_sizecxx . . $ tCustomListInfo#needed_size.);
2666 if (p) {
2667 AudioTauntPilotcxx . . $ AudioTauntPilot.->set_multiplayer_datacxx . . $ pilot#set_multiplayer_data(a7d02ca8b58088a9).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, p);
2668 }
2669 }
2670 }
2671
2672 void audio3changecallbackcxx . . $ audio3changecallback(d4f767463ce0a6b3).(int index) {
2673 if (index == 0) {
2674 AudioTauntPilotcxx . . $ AudioTauntPilot.->set_multiplayer_datacxx . . $ pilot#set_multiplayer_data(a7d02ca8b58088a9).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, "");
2675 return;
2676 } else {
2677 index--;
2678 char *p = GetStringInListcxx . . $ GetStringInList(22f5e0f8dc18650f).(index, AudioTauntPilotSndInfocxx . . $ AudioTauntPilotSndInfo.->filescxx . . $ tCustomListInfo#files., AudioTauntPilotSndInfocxx . . $ AudioTauntPilotSndInfo.->needed_sizecxx . . $ tCustomListInfo#needed_size.);
2679 if (p) {
2680 AudioTauntPilotcxx . . $ AudioTauntPilot.->set_multiplayer_datacxx . . $ pilot#set_multiplayer_data(a7d02ca8b58088a9).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, p);
2681 }
2682 }
2683 }
2684
2685 void audio4changecallbackcxx . . $ audio4changecallback(d4f767463ce0a6b3).(int index) {
2686 if (index == 0) {
2687 AudioTauntPilotcxx . . $ AudioTauntPilot.->set_multiplayer_datacxx . . $ pilot#set_multiplayer_data(a7d02ca8b58088a9).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, "");
2688 return;
2689 } else {
2690 index--;
2691 char *p = GetStringInListcxx . . $ GetStringInList(22f5e0f8dc18650f).(index, AudioTauntPilotSndInfocxx . . $ AudioTauntPilotSndInfo.->filescxx . . $ tCustomListInfo#files., AudioTauntPilotSndInfocxx . . $ AudioTauntPilotSndInfo.->needed_sizecxx . . $ tCustomListInfo#needed_size.);
2692 if (p) {
2693 AudioTauntPilotcxx . . $ AudioTauntPilot.->set_multiplayer_datacxx . . $ pilot#set_multiplayer_data(a7d02ca8b58088a9).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, p);
2694 }
2695 }
2696 }
2697
2698 #define TAUNT_MENU_Wcxx . . $ `Descent3/pilot.cpp:2698:9`! 512
2699 #define TAUNT_MENU_Hcxx . . $ `Descent3/pilot.cpp:2699:9`! 384
2700
2701 #define MAX_MULTIPLAYER_TAUNTScxx . . $ `Descent3/pilot.cpp:2701:9`! 8
2702 #define TAUNT_EDIT_WIDTHcxx . . $ `Descent3/pilot.cpp:2702:9`! 400
2703
2704 void DoPilotTauntScreencxx . . $ DoPilotTauntScreen(1794bc617d3f3266).(pilotcxx . . $ pilot# *plt) {
2705 newuiTiledWindowcxx . . $ newuiTiledWindow# taunt_wndcxx . . $ newuiTiledWindow#newuiTiledWindow(49f6e7a06ebc5aa8).;
2706 newuiSheetcxx . . $ newuiSheet# *sheet;
2707 char *taunt_edit[MAX_PILOT_TAUNTScxx . . $ `Descent3/pilot_class.h:132:9`!];
2708 int cury = 10;
2709 bool exit_menu = false;
2710 int i;
2711
2712 // create window
2713 taunt_wnd.Createcxx . . $ newuiTiledWindow#Create(9860cac3d762132).(TXT_MULTIPLAYER_TAUNTScxx . . $ `Descent3/stringtable.h:477:9`!, 0, 0, TAUNT_MENU_Wcxx . . $ `Descent3/pilot.cpp:2698:9`!, TAUNT_MENU_Hcxx . . $ `Descent3/pilot.cpp:2699:9`!);
2714 sheet = taunt_wnd.GetSheetcxx . . $ newuiTiledWindow#GetSheet(661381a276e5b628).();
2715
2716 // Ok/Cancel buttons
2717 for (i = 0; i < MAX_PILOT_TAUNTScxx . . $ `Descent3/pilot_class.h:132:9`!; i++) {
2718 char str[70];
2719
2720 snprintf(str, sizeof(str), "%s%d", TXT_TAUNT_NUMBERcxx . . $ `Descent3/stringtable.h:478:9`!, i + 1);
2721 sheet->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(str, 10, cury);
2722
2723 taunt_edit[i] = sheet->AddEditBoxcxx . . $ newuiSheet#AddEditBox(56493f8cd670630f).(str, PILOT_TAUNT_SIZEcxx . . $ `Descent3/pilot_class.h:134:9`!, TAUNT_EDIT_WIDTHcxx . . $ `Descent3/pilot.cpp:2702:9`!);
2724 strcpy(taunt_edit[i], plt->tauntscxx . . $ pilot#taunts.[i]);
2725 cury += 32;
2726 }
2727
2728 sheet->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, TAUNT_MENU_Wcxx . . $ `Descent3/pilot.cpp:2698:9`! - 210, TAUNT_MENU_Hcxx . . $ `Descent3/pilot.cpp:2699:9`! - 100, NEWUI_ALIGN_HORIZcxx . . $ NEWUI_ALIGN_HORIZ.);
2729 sheet->AddButtoncxx . . $ newuiSheet#AddButton(680bf41633375800).(TXT_OKcxx . . $ `Descent3/stringtable.h:34:9`!, UID_OKcxx . . $ `ui/ui.h:368:9`!);
2730 sheet->AddButtoncxx . . $ newuiSheet#AddButton(680bf41633375800).(TXT_CANCELcxx . . $ `Descent3/stringtable.h:35:9`!, UID_CANCELcxx . . $ `ui/ui.h:369:9`!);
2731
2732 taunt_wnd.Opencxx . . $ UIWindow#Open(49f6e7a06ebc5aa8).();
2733
2734 while (!exit_menu) {
2735 int res = taunt_wnd.DoUIcxx . . $ newuiTiledWindow#DoUI(b126dc7c1de90089).();
2736
2737 // handle all UI results.
2738 switch (res) {
2739 case UID_OKcxx . . $ `ui/ui.h:368:9`!:
2740 for (i = 0; i < MAX_PILOT_TAUNTScxx . . $ `Descent3/pilot_class.h:132:9`!; i++) {
2741 strcpy(plt->tauntscxx . . $ pilot#taunts.[i], taunt_edit[i]);
2742 // taunt_edit[i].GetText(plt->taunts[i],PILOT_TAUNT_SIZE);
2743 }
2744 exit_menu = true;
2745 break;
2746 case UID_CANCELcxx . . $ `ui/ui.h:369:9`!:
2747 exit_menu = true;
2748 break;
2749 default:
2750 break;
2751 }
2752 }
2753
2754 taunt_wnd.Closecxx . . $ UIWindow#Close(49f6e7a06ebc5aa8).();
2755 taunt_wnd.Destroycxx . . $ UIWindow#Destroy(49f6e7a06ebc5aa8).();
2756 }
2757
2758 bool PltSelectShipcxx . . $ PltSelectShip(70381b455242efa3).(pilotcxx . . $ pilot# *Pilot) {
2759 #define IDP_SHPLISTcxx . . $ `Descent3/pilot.cpp:2759:9`! 19
2760 #define ID_GETANIMcxx . . $ `Descent3/pilot.cpp:2760:9`! 20
2761 #define ID_IMPORTcxx . . $ `Descent3/pilot.cpp:2761:9`! 21
2762 #define ID_PLAY1cxx . . $ `Descent3/pilot.cpp:2762:9`! 22
2763 #define ID_PLAY2cxx . . $ `Descent3/pilot.cpp:2763:9`! 23
2764 #define ID_PLAY3cxx . . $ `Descent3/pilot.cpp:2764:9`! 24
2765 #define ID_PLAY4cxx . . $ `Descent3/pilot.cpp:2765:9`! 25
2766
2767 #define ID_IMPORTSOUNDcxx . . $ `Descent3/pilot.cpp:2767:9`! 26
2768 #define ID_TAUNTScxx . . $ `Descent3/pilot.cpp:2768:9`! 27
2769 #define ID_DEL_LOGOcxx . . $ `Descent3/pilot.cpp:2769:9`! 28
2770 #define ID_DEL_TAUNTAcxx . . $ `Descent3/pilot.cpp:2770:9`! 29
2771 #define ID_DEL_TAUNTBcxx . . $ `Descent3/pilot.cpp:2771:9`! 30
2772 #define ID_DEL_TAUNTCcxx . . $ `Descent3/pilot.cpp:2772:9`! 31
2773 #define ID_DEL_TAUNTDcxx . . $ `Descent3/pilot.cpp:2773:9`! 32
2774 #define PSSELECT_WND_Hcxx . . $ `Descent3/pilot.cpp:2774:9`! 384
2775 #define PSSELECT_WND_Wcxx . . $ `Descent3/pilot.cpp:2775:9`! 512
2776
2777 // variable declarations
2778 newuiTiledWindowcxx . . $ newuiTiledWindow# windowcxx . . $ newuiTiledWindow#newuiTiledWindow(49f6e7a06ebc5aa8).;
2779 newuiSheetcxx . . $ newuiSheet# *sheet;
2780 newuiListBoxcxx . . $ newuiListBox# *custom_list;
2781 newuiComboBoxcxx . . $ newuiComboBox# *ship_list;
2782
2783 int count;
2784 char oldt1[PILOT_TAUNT_SIZEcxx . . $ `Descent3/pilot_class.h:134:9`!], oldt2[PILOT_TAUNT_SIZEcxx . . $ `Descent3/pilot_class.h:134:9`!];
2785 char oldt3[PILOT_TAUNT_SIZEcxx . . $ `Descent3/pilot_class.h:134:9`!], oldt4[PILOT_TAUNT_SIZEcxx . . $ `Descent3/pilot_class.h:134:9`!];
2786
2787 DoWaitMessagecxx . . $ DoWaitMessage(ee90985596e8b4f9).(true);
2788
2789 Pilot->get_multiplayer_datacxx . . $ pilot#get_multiplayer_data(ea6e7aa10f4b80f5).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, oldt1, oldt2, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, oldt3, oldt4);
2790
2791 tCustomListInfocxx . . $ tCustomListInfo# cust_snds;
2792 tAudioTauntComboBoxescxx . . $ tAudioTauntComboBoxes# taunts_lists;
2793 AudioTauntPilotcxx . . $ AudioTauntPilot. = Pilot;
2794 AudioTauntPilotSndInfocxx . . $ AudioTauntPilotSndInfo. = &cust_snds;
2795
2796 UI3DWindowcxx . . $ UI3DWindow# ship_win;
2797 UIBmpWindowcxx . . $ UIBmpWindow# bmp_wincxx . . $ UIBmpWindow#UIBmpWindow(49f6e7a06ebc5aa8).;
2798 tCustomListInfocxx . . $ tCustomListInfo# cust_bmps;
2799 tShipListInfocxx . . $ tShipListInfo# ship_info;
2800
2801 int old_bmhandle;
2802 int old_flags;
2803 bool exit_menu = false;
2804 bool ret;
2805
2806 // pre-initialize all variables
2807 cust_bmps.Initcxx . . $ tCustomListInfo#Init(49f6e7a06ebc5aa8).();
2808 cust_snds.Initcxx . . $ tCustomListInfo#Init(49f6e7a06ebc5aa8).();
2809
2810 lp_cust_bmpscxx . . $ lp_cust_bmps. = &cust_bmps;
2811 lp_ship_infocxx . . $ lp_ship_info. = &ship_info;
2812
2813 ship_poscxx . . $ ship_pos..Initcxx . . $ tShipPos#Init(49f6e7a06ebc5aa8).();
2814 ship_info.Initcxx . . $ tShipListInfo#Init(49f6e7a06ebc5aa8).();
2815
2816 custom_texturecxx . . $ custom_texture.[0] = '\0';
2817 old_bmhandle = GameTexturescxx . . $ GameTextures.[ship_poscxx . . $ ship_pos..texture_idcxx . . $ tShipPos#texture_id.].bm_handlecxx . . $ texture#bm_handle.;
2818 old_flags = GameTexturescxx . . $ GameTextures.[ship_poscxx . . $ ship_pos..texture_idcxx . . $ tShipPos#texture_id.].flagscxx . . $ texture#flags.;
2819
2820 // create UIWindow
2821 window.Createcxx . . $ newuiTiledWindow#Create(9860cac3d762132).(TXT_MULTISELECTSHIPcxx . . $ `Descent3/stringtable.h:839:9`!, 0, 0, PSSELECT_WND_Wcxx . . $ `Descent3/pilot.cpp:2775:9`!, PSSELECT_WND_Hcxx . . $ `Descent3/pilot.cpp:2774:9`!);
2822 sheet = window.GetSheetcxx . . $ newuiTiledWindow#GetSheet(661381a276e5b628).();
2823
2824 sheet->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(TXT_DEFAULTMSHIPScxx . . $ `Descent3/stringtable.h:36:9`!, 0, 0);
2825 ship_list = sheet->AddComboBoxcxx . . $ newuiSheet#AddComboBox(b9251fbe6368b7af).(IDP_SHPLISTcxx . . $ `Descent3/pilot.cpp:2759:9`!, 0);
2826
2827 sheet->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(TXT_CUSTOMTEXTUREScxx . . $ `Descent3/stringtable.h:353:9`!, 0, 36);
2828 cust_bmps.custom_bitmap_listcxx . . $ tCustomListInfo#custom_bitmap_list. = custom_list = sheet->AddListBoxcxx . . $ newuiSheet#AddListBox(b890ce7adcd9a5ed).(200, 96, IDP_SHPLISTcxx . . $ `Descent3/pilot.cpp:2759:9`!, 0);
2829
2830 sheet->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, 230, 130);
2831 sheet->AddButtoncxx . . $ newuiSheet#AddButton(680bf41633375800).(TXT_DELETEcxx . . $ `Descent3/stringtable.h:32:9`!, ID_DEL_LOGOcxx . . $ `Descent3/pilot.cpp:2769:9`!);
2832
2833 sheet->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(TXT_AUDIOTAUNTAcxx . . $ `Descent3/stringtable.h:705:9`!, 0, 155);
2834 taunts_lists.taunt_acxx . . $ tAudioTauntComboBoxes#taunt_a. = sheet->AddComboBoxcxx . . $ newuiSheet#AddComboBox(b9251fbe6368b7af).(-5, 0);
2835
2836 sheet->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(TXT_AUDIOTAUNTBcxx . . $ `Descent3/stringtable.h:706:9`!, 0, 192);
2837 taunts_lists.taunt_bcxx . . $ tAudioTauntComboBoxes#taunt_b. = sheet->AddComboBoxcxx . . $ newuiSheet#AddComboBox(b9251fbe6368b7af).(-5, 0);
2838
2839 sheet->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(TXT_AUDIOTAUNTCcxx . . $ `Descent3/stringtable.h:72:9`!, 0, 229);
2840 taunts_lists.taunt_ccxx . . $ tAudioTauntComboBoxes#taunt_c. = sheet->AddComboBoxcxx . . $ newuiSheet#AddComboBox(b9251fbe6368b7af).(-5, 0);
2841
2842 sheet->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(TXT_AUDIOTAUNTDcxx . . $ `Descent3/stringtable.h:73:9`!, 0, 266);
2843 taunts_lists.taunt_dcxx . . $ tAudioTauntComboBoxes#taunt_d. = sheet->AddComboBoxcxx . . $ newuiSheet#AddComboBox(b9251fbe6368b7af).(-5, 0);
2844
2845 // Ship window
2846 UITextItemcxx . . $ UITextItem# itemShipWindowcxx . . $ UITextItem#UITextItem(5f8aa4f2725849c4).{""};
2847 ship_win.Createcxx . . $ UIStatic#Create(8745842b033f01b8).(&window, &itemShipWindow, 290, 50, 180, 140, 0);
2848
2849 // Bitmap display of selected logo
2850 bmpwindowcxx . . $ bmpwindow. = &bmp_win;
2851 UITextItemcxx . . $ UITextItem# itemLogocxx . . $ UITextItem#UITextItem(5f8aa4f2725849c4).{""};
2852 bmp_win.Createcxx . . $ UIStatic#Create(8745842b033f01b8).(&window, &itemLogo, UI_BORDERSIZEcxx . . $ `Descent3/pilot.cpp:644:9`! + 200, 53, 42, 42, 0);
2853
2854 // Get all the audio files and put them into the lists
2855 UpdateAudioTauntBoxescxx . . $ UpdateAudioTauntBoxes(79e8cd0b2cad2f2c).(&cust_snds, taunts_lists.taunt_acxx . . $ tAudioTauntComboBoxes#taunt_a., taunts_lists.taunt_bcxx . . $ tAudioTauntComboBoxes#taunt_b., taunts_lists.taunt_ccxx . . $ tAudioTauntComboBoxes#taunt_c.,
2856 taunts_lists.taunt_dcxx . . $ tAudioTauntComboBoxes#taunt_d., Pilot);
2857
2858 DoWaitMessagecxx . . $ DoWaitMessage(ee90985596e8b4f9).(true);
2859
2860 // Setup hotspots for audio taunt commands
2861 sheet->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, 170, 163);
2862 sheet->AddButtoncxx . . $ newuiSheet#AddButton(680bf41633375800).(TXT_PLAYSOUNDcxx . . $ `Descent3/stringtable.h:703:9`!, ID_PLAY1cxx . . $ `Descent3/pilot.cpp:2762:9`!);
2863 sheet->AddButtoncxx . . $ newuiSheet#AddButton(680bf41633375800).(TXT_DELETEcxx . . $ `Descent3/stringtable.h:32:9`!, ID_DEL_TAUNTAcxx . . $ `Descent3/pilot.cpp:2770:9`!);
2864
2865 sheet->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, 170, 200);
2866 sheet->AddButtoncxx . . $ newuiSheet#AddButton(680bf41633375800).(TXT_PLAYSOUNDcxx . . $ `Descent3/stringtable.h:703:9`!, ID_PLAY2cxx . . $ `Descent3/pilot.cpp:2763:9`!);
2867 sheet->AddButtoncxx . . $ newuiSheet#AddButton(680bf41633375800).(TXT_DELETEcxx . . $ `Descent3/stringtable.h:32:9`!, ID_DEL_TAUNTBcxx . . $ `Descent3/pilot.cpp:2771:9`!);
2868
2869 sheet->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, 170, 237);
2870 sheet->AddButtoncxx . . $ newuiSheet#AddButton(680bf41633375800).(TXT_PLAYSOUNDcxx . . $ `Descent3/stringtable.h:703:9`!, ID_PLAY3cxx . . $ `Descent3/pilot.cpp:2764:9`!);
2871 sheet->AddButtoncxx . . $ newuiSheet#AddButton(680bf41633375800).(TXT_DELETEcxx . . $ `Descent3/stringtable.h:32:9`!, ID_DEL_TAUNTCcxx . . $ `Descent3/pilot.cpp:2772:9`!);
2872
2873 sheet->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, 170, 274);
2874 sheet->AddButtoncxx . . $ newuiSheet#AddButton(680bf41633375800).(TXT_PLAYSOUNDcxx . . $ `Descent3/stringtable.h:703:9`!, ID_PLAY4cxx . . $ `Descent3/pilot.cpp:2765:9`!);
2875 sheet->AddButtoncxx . . $ newuiSheet#AddButton(680bf41633375800).(TXT_DELETEcxx . . $ `Descent3/stringtable.h:32:9`!, ID_DEL_TAUNTDcxx . . $ `Descent3/pilot.cpp:2773:9`!);
2876
2877 // setup callback function
2878 custom_list->SetSelectChangeCallbackcxx . . $ newuiListBox#SetSelectChangeCallback(94eb4457dc8d4d10).(CustomCallBackcxx . . $ CustomCallBack(d4f767463ce0a6b3).);
2879 ship_list->SetSelectChangeCallbackcxx . . $ newuiComboBox#SetSelectChangeCallback(94eb4457dc8d4d10).(ShipSelectCallBackcxx . . $ ShipSelectCallBack(d4f767463ce0a6b3).);
2880 taunts_lists.taunt_acxx . . $ tAudioTauntComboBoxes#taunt_a.->SetSelectChangeCallbackcxx . . $ newuiComboBox#SetSelectChangeCallback(94eb4457dc8d4d10).(audio1changecallbackcxx . . $ audio1changecallback(d4f767463ce0a6b3).);
2881 taunts_lists.taunt_bcxx . . $ tAudioTauntComboBoxes#taunt_b.->SetSelectChangeCallbackcxx . . $ newuiComboBox#SetSelectChangeCallback(94eb4457dc8d4d10).(audio2changecallbackcxx . . $ audio2changecallback(d4f767463ce0a6b3).);
2882 taunts_lists.taunt_ccxx . . $ tAudioTauntComboBoxes#taunt_c.->SetSelectChangeCallbackcxx . . $ newuiComboBox#SetSelectChangeCallback(94eb4457dc8d4d10).(audio3changecallbackcxx . . $ audio3changecallback(d4f767463ce0a6b3).);
2883 taunts_lists.taunt_dcxx . . $ tAudioTauntComboBoxes#taunt_d.->SetSelectChangeCallbackcxx . . $ newuiComboBox#SetSelectChangeCallback(94eb4457dc8d4d10).(audio4changecallbackcxx . . $ audio4changecallback(d4f767463ce0a6b3).);
2884
2885 int i;
2886 // get all the ship ids
2887 count = 0;
2888 for (i = 0; i < MAX_SHIPScxx . . $ `Descent3/ship.h:122:9`!; i++) {
2889 if (Shipscxx . . $ Ships.[i].usedcxx . . $ ship#used.)
2890 count++;
2891 }
2892 ship_info.idlistcxx . . $ tShipListInfo#idlist. = (int *)mem_malloccxx . . $ `mem/mem.h:79:9`!(sizeof(int) * count);
2893 if (!ship_info.idlistcxx . . $ tShipListInfo#idlist.)
2894 goto ship_id_err;
2895
2896 bool found_ship;
2897 bool shipoktoadd;
2898
2899 found_ship = false;
2900 count = 0;
2901 char pship[PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!];
2902 Pilot->get_shipcxx . . $ pilot#get_ship(fda57c8427c60377).(pship);
2903
2904 for (i = 0; i < MAX_SHIPScxx . . $ `Descent3/ship.h:122:9`!; i++) {
2905 if (Shipscxx . . $ Ships.[i].usedcxx . . $ ship#used.) {
2906 ship_info.idlistcxx . . $ tShipListInfo#idlist.[count] = i;
2907 #ifdef DEMO
2908 if (stricmp(Ships[i].name, DEFAULT_SHIP) == 0) {
2909 #endif
2910 // make sure they have mercenary in order to play with Black Pyro
2911 if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(Ships[i].name, "Black Pyro")) {
2912 shipoktoadd = false;
2913 extern bool MercInstalledcxx . . $ MercInstalled(c9857a73d68e59ba).();
2914 if (MercInstalledcxx . . $ MercInstalled(c9857a73d68e59ba).()) {
2915 shipoktoadd = true;
2916 }
2917 }
2918 else
2919 shipoktoadd = true;
2920 if (shipoktoadd)
2921 ship_list->AddItemcxx . . $ newuiComboBox#AddItem(85c52e162fed56f9).(Shipscxx . . $ Ships.[i].namecxx . . $ ship#name.);
2922 #ifdef DEMO
2923 }
2924 #endif
2925
2926 if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(pship, Ships[i].name)) {
2927 ship_list->SetCurrentIndexcxx . . $ newuiComboBox#SetCurrentIndex(d4f767463ce0a6b3).(count);
2928 found_ship = true;
2929 }
2930 count++;
2931 }
2932 }
2933
2934 // if we couldn't find the ship than that means that the ship in their pilot file no longer
2935 // exists and so we must set it to the default ship
2936 if (!found_ship) {
2937 DoMessageBoxcxx . . $ DoMessageBox(dcc99837539e9edc).(TXT_WARNINGcxx . . $ `Descent3/stringtable.h:707:9`!, TXT_SHIPSELECTERRcxx . . $ `Descent3/stringtable.h:708:9`!, MSGBOX_OKcxx . . $ `Descent3/newui_core.h:78:9`!);
2938 if (count > 0) {
2939 // find the ship in the page
2940 int index = FindShipNamecxx . . $ FindShipName(5c4306d8553b3696).(DEFAULT_SHIPcxx . . $ `Descent3/ship.h:127:9`!);
2941 if (index == -1) {
2942 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "WARNING: CAN'T FIND DEFAULT SHIP IN TABLE\n");
2943 } else {
2944 // go through all the id's of the ships we found and find the ship (if FindShipName found it,
2945 // then we'll have it here somewhere.
2946 for (int i = 0; i < count; i++) {
2947 if (ship_info.idlistcxx . . $ tShipListInfo#idlist.[i] == index) {
2948 // set this as the default ship
2949 ship_list->SetCurrentIndexcxx . . $ newuiComboBox#SetCurrentIndex(d4f767463ce0a6b3).(i);
2950
2951 } // endif
2952 } // endfor
2953 } // end else
2954 } else {
2955 // NO SHIPS IN THE TABLE!!!
2956 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "WARNING: NO SHIPS IN THE TABLE!?\n");
2957 }
2958 }
2959
2960 // get a list of custom textures
2961 char pshiplogo[PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!];
2962 Pilot->get_multiplayer_datacxx . . $ pilot#get_multiplayer_data(ea6e7aa10f4b80f5).(pshiplogo);
2963
2964 DoWaitMessagecxx . . $ DoWaitMessage(ee90985596e8b4f9).(true);
2965
2966 if (!UpdateGraphicsListboxcxx . . $ UpdateGraphicsListbox(d8f747e86a7ef2e3).(&cust_bmps, custom_list, pshiplogo))
2967 goto ship_id_err;
2968
2969 i = ship_list->GetCurrentIndexcxx . . $ newuiComboBox#GetCurrentIndex(b126dc7c1de90089).();
2970 ShipSelectCallBackcxx . . $ ShipSelectCallBack(d4f767463ce0a6b3).(i);
2971
2972 // setup hotspots
2973 sheet->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, 250, 170);
2974 sheet->AddLongButtoncxx . . $ newuiSheet#AddLongButton(680bf41633375800).(TXT_IMPORTGRAPHICcxx . . $ `Descent3/stringtable.h:702:9`!, ID_IMPORTcxx . . $ `Descent3/pilot.cpp:2761:9`!);
2975 sheet->AddLongButtoncxx . . $ newuiSheet#AddLongButton(680bf41633375800).(TXT_IMPORTIFLcxx . . $ `Descent3/stringtable.h:349:9`!, ID_GETANIMcxx . . $ `Descent3/pilot.cpp:2760:9`!);
2976 sheet->AddLongButtoncxx . . $ newuiSheet#AddLongButton(680bf41633375800).(TXT_MULTIPLAYER_TAUNTScxx . . $ `Descent3/stringtable.h:477:9`!, ID_TAUNTScxx . . $ `Descent3/pilot.cpp:2768:9`!);
2977 sheet->AddLongButtoncxx . . $ newuiSheet#AddLongButton(680bf41633375800).(TXT_IMPORTSOUNDcxx . . $ `Descent3/stringtable.h:704:9`!, ID_IMPORTSOUNDcxx . . $ `Descent3/pilot.cpp:2767:9`!);
2978 sheet->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, 260, 281, NEWUI_ALIGN_HORIZcxx . . $ NEWUI_ALIGN_HORIZ.);
2979 sheet->AddButtoncxx . . $ newuiSheet#AddButton(680bf41633375800).(TXT_OKcxx . . $ `Descent3/stringtable.h:34:9`!, UID_OKcxx . . $ `ui/ui.h:368:9`!);
2980 sheet->AddButtoncxx . . $ newuiSheet#AddButton(680bf41633375800).(TXT_CANCELcxx . . $ `Descent3/stringtable.h:35:9`!, UID_CANCELcxx . . $ `ui/ui.h:369:9`!);
2981
2982 // Ok, all initial setup is finally complete, time to display the window and process input
2983 ret = false;
2984
2985 DoWaitMessagecxx . . $ DoWaitMessage(ee90985596e8b4f9).(false);
2986
2987 window.Opencxx . . $ UIWindow#Open(49f6e7a06ebc5aa8).();
2988 while (!exit_menu) {
2989 int res = window.DoUIcxx . . $ newuiTiledWindow#DoUI(b126dc7c1de90089).();
2990
2991 // handle all UI results.
2992 switch (res) {
2993 case UID_OKcxx . . $ `ui/ui.h:368:9`!: {
2994 char tbuf[64];
2995 ship_list->GetCurrentItemcxx . . $ newuiComboBox#GetCurrentItem(37e8d18a243bba77).(tbuf, 64);
2996
2997 Pilot->set_shipcxx . . $ pilot#set_ship(85c52e162fed56f9).(tbuf);
2998 Pilot->set_multiplayer_datacxx . . $ pilot#set_multiplayer_data(a7d02ca8b58088a9).(custom_texturecxx . . $ custom_texture.);
2999
3000 // Retrieve Audio taunts
3001 Pilot->set_multiplayer_datacxx . . $ pilot#set_multiplayer_data(a7d02ca8b58088a9).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, "", "", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, "", "");
3002
3003 int index;
3004 index = taunts_lists.taunt_acxx . . $ tAudioTauntComboBoxes#taunt_a.->GetCurrentIndexcxx . . $ newuiComboBox#GetCurrentIndex(b126dc7c1de90089).();
3005 if (index > 0 && cust_snds.filescxx . . $ tCustomListInfo#files.) {
3006 char *p = GetStringInListcxx . . $ GetStringInList(22f5e0f8dc18650f).(index - 1, cust_snds.filescxx . . $ tCustomListInfo#files., cust_snds.needed_sizecxx . . $ tCustomListInfo#needed_size.);
3007 if (p) {
3008 Pilot->set_multiplayer_datacxx . . $ pilot#set_multiplayer_data(a7d02ca8b58088a9).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, p);
3009 }
3010 }
3011 index = taunts_lists.taunt_bcxx . . $ tAudioTauntComboBoxes#taunt_b.->GetCurrentIndexcxx . . $ newuiComboBox#GetCurrentIndex(b126dc7c1de90089).();
3012 if (index > 0 && cust_snds.filescxx . . $ tCustomListInfo#files.) {
3013 char *p = GetStringInListcxx . . $ GetStringInList(22f5e0f8dc18650f).(index - 1, cust_snds.filescxx . . $ tCustomListInfo#files., cust_snds.needed_sizecxx . . $ tCustomListInfo#needed_size.);
3014 if (p) {
3015 Pilot->set_multiplayer_datacxx . . $ pilot#set_multiplayer_data(a7d02ca8b58088a9).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, p);
3016 }
3017 }
3018
3019 index = taunts_lists.taunt_ccxx . . $ tAudioTauntComboBoxes#taunt_c.->GetCurrentIndexcxx . . $ newuiComboBox#GetCurrentIndex(b126dc7c1de90089).();
3020 if (index > 0 && cust_snds.filescxx . . $ tCustomListInfo#files.) {
3021 char *p = GetStringInListcxx . . $ GetStringInList(22f5e0f8dc18650f).(index - 1, cust_snds.filescxx . . $ tCustomListInfo#files., cust_snds.needed_sizecxx . . $ tCustomListInfo#needed_size.);
3022 if (p) {
3023 Pilot->set_multiplayer_datacxx . . $ pilot#set_multiplayer_data(a7d02ca8b58088a9).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, p);
3024 }
3025 }
3026
3027 index = taunts_lists.taunt_dcxx . . $ tAudioTauntComboBoxes#taunt_d.->GetCurrentIndexcxx . . $ newuiComboBox#GetCurrentIndex(b126dc7c1de90089).();
3028 if (index > 0 && cust_snds.filescxx . . $ tCustomListInfo#files.) {
3029 char *p = GetStringInListcxx . . $ GetStringInList(22f5e0f8dc18650f).(index - 1, cust_snds.filescxx . . $ tCustomListInfo#files., cust_snds.needed_sizecxx . . $ tCustomListInfo#needed_size.);
3030 if (p) {
3031 Pilot->set_multiplayer_datacxx . . $ pilot#set_multiplayer_data(a7d02ca8b58088a9).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, p);
3032 }
3033 }
3034
3035 char tempn[PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!];
3036
3037 Pilot->get_multiplayer_datacxx . . $ pilot#get_multiplayer_data(ea6e7aa10f4b80f5).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, tempn);
3038 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Audio #1: '%s'\n", tempn);
3039
3040 Pilot->get_multiplayer_datacxx . . $ pilot#get_multiplayer_data(ea6e7aa10f4b80f5).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, tempn);
3041 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Audio #2: '%s'\n", tempn);
3042
3043 Pilot->get_multiplayer_datacxx . . $ pilot#get_multiplayer_data(ea6e7aa10f4b80f5).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, tempn);
3044 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Audio #3: '%s'\n", tempn);
3045
3046 Pilot->get_multiplayer_datacxx . . $ pilot#get_multiplayer_data(ea6e7aa10f4b80f5).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, tempn);
3047 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Audio #4: '%s'\n", tempn);
3048
3049 ret = true;
3050 exit_menu = true;
3051 } break;
3052 case UID_CANCELcxx . . $ `ui/ui.h:369:9`!:
3053 ret = false;
3054 exit_menu = true;
3055 GameTexturescxx . . $ GameTextures.[ship_poscxx . . $ ship_pos..texture_idcxx . . $ tShipPos#texture_id.].bm_handlecxx . . $ texture#bm_handle. = old_bmhandle;
3056 GameTexturescxx . . $ GameTextures.[ship_poscxx . . $ ship_pos..texture_idcxx . . $ tShipPos#texture_id.].flagscxx . . $ texture#flags. = old_flags;
3057 Pilot->set_multiplayer_datacxx . . $ pilot#set_multiplayer_data(a7d02ca8b58088a9).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, oldt1, oldt2, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, oldt3, oldt4);
3058 break;
3059 case ID_IMPORTcxx . . $ `Descent3/pilot.cpp:2761:9`!: {
3060 char path[_MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`!];
3061 char newf[_MAX_FNAMEcxx . . $ `linux/linux_fix.h:35:9`!];
3062 char wildcards[100];
3063 path[0] = '\0';
3064 strcpy(wildcards, "*.ogf;*.tga;*.pcx;*.iff");
3065 if (DoPathFileDialogcxx . . $ DoPathFileDialog(5d8ce13d0347d7c1).(false, path, TXT_CHOOSEcxx . . $ `Descent3/stringtable.h:354:9`!, wildcards, PFDF_FILEMUSTEXISTcxx . . $ `Descent3/newui.h:351:9`!)) {
3066 if (ImportGraphiccxx . . $ ImportGraphic(14223ed414283e68).(path, newf)) {
3067 // update the listbox
3068 if (!UpdateGraphicsListboxcxx . . $ UpdateGraphicsListbox(d8f747e86a7ef2e3).(&cust_bmps, custom_list, newf))
3069 goto ship_id_err;
3070 } else {
3071 DoMessageBoxcxx . . $ DoMessageBox(dcc99837539e9edc).(TXT_ERRORcxx . . $ `Descent3/stringtable.h:165:9`!, TXT_ERRORIMPORTcxx . . $ `Descent3/stringtable.h:356:9`!, MSGBOX_OKcxx . . $ `Descent3/newui_core.h:78:9`!);
3072 }
3073 }
3074 ddio_SetWorkingDircxx . . $ ddio_SetWorkingDir(c5f7da30cbc0f4e9).(path);
3075 } break;
3076 case ID_GETANIMcxx . . $ `Descent3/pilot.cpp:2760:9`!: {
3077 char path[_MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`!];
3078 char opath[_MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`!];
3079 char wildcards[100];
3080 path[0] = '\0';
3081 strcpy(opath, path);
3082 strcpy(wildcards, "*.ifl");
3083 if (DoPathFileDialogcxx . . $ DoPathFileDialog(5d8ce13d0347d7c1).(false, path, TXT_CHOOSEcxx . . $ `Descent3/stringtable.h:354:9`!, wildcards, PFDF_FILEMUSTEXISTcxx . . $ `Descent3/newui.h:351:9`!)) {
3084 int handle = AllocLoadIFLVClipcxx . . $ AllocLoadIFLVClip(c0ca7c05705093b).(IGNORE_TABLEcxx . . $ `lib/manage_external.h:54:9`!(path), SMALL_TEXTUREcxx . . $ `Descent3/gametexture.h:240:9`!, 1);
3085
3086 if (handle != -1) {
3087 // change the file extension
3088 char f[_MAX_FNAMEcxx . . $ `linux/linux_fix.h:35:9`!], newf[_MAX_FNAMEcxx . . $ `linux/linux_fix.h:35:9`! + _MAX_EXTcxx . . $ `linux/linux_fix.h:36:9`!], tempf[_MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`!];
3089 if (!CreateCRCFileNamecxx . . $ CreateCRCFileName(84e74a5521f49206).(path, tempf)) {
3090 FreeVClipcxx . . $ FreeVClip(d4f767463ce0a6b3).(handle);
3091 break;
3092 }
3093 ddio_SplitPathcxx . . $ ddio_SplitPath(b05ba7ab99603c07).(tempf, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, f, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
3094 strcpy(newf, f);
3095 strcat(newf, ".oaf");
3096 ddio_MakePathcxx . . $ ddio_MakePath(9ad4b0815420a85).(path, LocalCustomGraphicsDircxx . . $ LocalCustomGraphicsDir., newf, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
3097
3098 if (SaveVClipcxx . . $ SaveVClip(220e687f58daa9be).(pathcxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., handle) == 0) {
3099 // error saving
3100 DoMessageBoxcxx . . $ DoMessageBox(dcc99837539e9edc).(TXT_ERRORcxx . . $ `Descent3/stringtable.h:165:9`!, TXT_ERRORIMPORTcxx . . $ `Descent3/stringtable.h:356:9`!, MSGBOX_OKcxx . . $ `Descent3/newui_core.h:78:9`!);
3101 } else {
3102 // all went ok!!!
3103 DoMessageBoxcxx . . $ DoMessageBox(dcc99837539e9edc).(TXT_SUCCESScxx . . $ `Descent3/stringtable.h:355:9`!, TXT_SUCCESSIMPORTcxx . . $ `Descent3/stringtable.h:357:9`!, MSGBOX_OKcxx . . $ `Descent3/newui_core.h:78:9`!);
3104 }
3105 FreeVClipcxx . . $ FreeVClip(d4f767463ce0a6b3).(handle);
3106
3107 // check file size...make sure it isn't too big
3108 CFILEcxx . . $ CFILE# *file = cfopencxx . . $ cfopen(7c7b94e455f1ae56).(pathcxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., "rb");
3109 if (file) {
3110 if (cfilelengthcxx . . $ cfilelength(e4541f75b25d0ae5).(file) > MAX_AUDIOTAUNTSIZEcxx . . $ `Descent3/pilot.cpp:622:9`!) {
3111 // file too big!!!!!!
3112 char message[256];
3113 snprintf(message, sizeof(message), TXT_COMPRESSTOOBIGcxx . . $ `Descent3/stringtable.h:709:9`!, MAX_AUDIOTAUNTSIZEcxx . . $ `Descent3/pilot.cpp:622:9`! / 1024);
3114 DoMessageBoxcxx . . $ DoMessageBox(dcc99837539e9edc).(TXT_WARNINGcxx . . $ `Descent3/stringtable.h:707:9`!, message, MSGBOX_OKcxx . . $ `Descent3/newui_core.h:78:9`!);
3115 }
3116 cfclosecxx . . $ cfclose(3639e799710acb68).(file);
3117 }
3118
3119 // update the listbox
3120 if (!UpdateGraphicsListboxcxx . . $ UpdateGraphicsListbox(d8f747e86a7ef2e3).(&cust_bmps, custom_list, newf))
3121 goto ship_id_err;
3122 }
3123 }
3124 ddio_SetWorkingDircxx . . $ ddio_SetWorkingDir(c5f7da30cbc0f4e9).(opath);
3125 } break;
3126 case ID_PLAY1cxx . . $ `Descent3/pilot.cpp:2762:9`!: {
3127 // Play audio taunt #1 if <None> isn't selected
3128 char path[_MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`!];
3129 int index = taunts_lists.taunt_acxx . . $ tAudioTauntComboBoxes#taunt_a.->GetCurrentIndexcxx . . $ newuiComboBox#GetCurrentIndex(b126dc7c1de90089).();
3130 if (index > 0 && cust_snds.filescxx . . $ tCustomListInfo#files.) {
3131 char *p = GetStringInListcxx . . $ GetStringInList(22f5e0f8dc18650f).(index - 1, cust_snds.filescxx . . $ tCustomListInfo#files., cust_snds.needed_sizecxx . . $ tCustomListInfo#needed_size.);
3132 if (p) {
3133 ddio_MakePathcxx . . $ ddio_MakePath(9ad4b0815420a85).(path, LocalCustomSoundsDircxx . . $ LocalCustomSoundsDir., p, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
3134 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Playing: %s\n", path);
3135 bool cenable = taunt_AreEnabledcxx . . $ taunt_AreEnabled(c9857a73d68e59ba).();
3136 taunt_Enablecxx . . $ taunt_Enable(b45ddcbc8423892c).(true);
3137 taunt_PlayTauntFilecxx . . $ taunt_PlayTauntFile(c5f7da30cbc0f4e9).(path);
3138 taunt_Enablecxx . . $ taunt_Enable(b45ddcbc8423892c).(cenable);
3139 }
3140 }
3141 } break;
3142 case ID_PLAY2cxx . . $ `Descent3/pilot.cpp:2763:9`!: {
3143 // Play audio taunt #2 if <None> isn't selected
3144 char path[_MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`!];
3145 int index = taunts_lists.taunt_bcxx . . $ tAudioTauntComboBoxes#taunt_b.->GetCurrentIndexcxx . . $ newuiComboBox#GetCurrentIndex(b126dc7c1de90089).();
3146 if (index > 0 && cust_snds.filescxx . . $ tCustomListInfo#files.) {
3147 char *p = GetStringInListcxx . . $ GetStringInList(22f5e0f8dc18650f).(index - 1, cust_snds.filescxx . . $ tCustomListInfo#files., cust_snds.needed_sizecxx . . $ tCustomListInfo#needed_size.);
3148 if (p) {
3149 ddio_MakePathcxx . . $ ddio_MakePath(9ad4b0815420a85).(path, LocalCustomSoundsDircxx . . $ LocalCustomSoundsDir., p, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
3150 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Playing: %s\n", path);
3151 bool cenable = taunt_AreEnabledcxx . . $ taunt_AreEnabled(c9857a73d68e59ba).();
3152 taunt_Enablecxx . . $ taunt_Enable(b45ddcbc8423892c).(true);
3153 taunt_PlayTauntFilecxx . . $ taunt_PlayTauntFile(c5f7da30cbc0f4e9).(path);
3154 taunt_Enablecxx . . $ taunt_Enable(b45ddcbc8423892c).(cenable);
3155 }
3156 }
3157 } break;
3158 case ID_PLAY3cxx . . $ `Descent3/pilot.cpp:2764:9`!: {
3159 // Play audio taunt #3 if <None> isn't selected
3160 char path[_MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`!];
3161 int index = taunts_lists.taunt_ccxx . . $ tAudioTauntComboBoxes#taunt_c.->GetCurrentIndexcxx . . $ newuiComboBox#GetCurrentIndex(b126dc7c1de90089).();
3162 if (index > 0 && cust_snds.filescxx . . $ tCustomListInfo#files.) {
3163 char *p = GetStringInListcxx . . $ GetStringInList(22f5e0f8dc18650f).(index - 1, cust_snds.filescxx . . $ tCustomListInfo#files., cust_snds.needed_sizecxx . . $ tCustomListInfo#needed_size.);
3164 if (p) {
3165 ddio_MakePathcxx . . $ ddio_MakePath(9ad4b0815420a85).(path, LocalCustomSoundsDircxx . . $ LocalCustomSoundsDir., p, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
3166 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Playing: %s\n", path);
3167 bool cenable = taunt_AreEnabledcxx . . $ taunt_AreEnabled(c9857a73d68e59ba).();
3168 taunt_Enablecxx . . $ taunt_Enable(b45ddcbc8423892c).(true);
3169 taunt_PlayTauntFilecxx . . $ taunt_PlayTauntFile(c5f7da30cbc0f4e9).(path);
3170 taunt_Enablecxx . . $ taunt_Enable(b45ddcbc8423892c).(cenable);
3171 }
3172 }
3173 } break;
3174
3175 case ID_PLAY4cxx . . $ `Descent3/pilot.cpp:2765:9`!: {
3176 // Play audio taunt #4 if <None> isn't selected
3177 char path[_MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`!];
3178 int index = taunts_lists.taunt_dcxx . . $ tAudioTauntComboBoxes#taunt_d.->GetCurrentIndexcxx . . $ newuiComboBox#GetCurrentIndex(b126dc7c1de90089).();
3179 if (index > 0 && cust_snds.filescxx . . $ tCustomListInfo#files.) {
3180 char *p = GetStringInListcxx . . $ GetStringInList(22f5e0f8dc18650f).(index - 1, cust_snds.filescxx . . $ tCustomListInfo#files., cust_snds.needed_sizecxx . . $ tCustomListInfo#needed_size.);
3181 if (p) {
3182 ddio_MakePathcxx . . $ ddio_MakePath(9ad4b0815420a85).(path, LocalCustomSoundsDircxx . . $ LocalCustomSoundsDir., p, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
3183 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Playing: %s\n", path);
3184 bool cenable = taunt_AreEnabledcxx . . $ taunt_AreEnabled(c9857a73d68e59ba).();
3185 taunt_Enablecxx . . $ taunt_Enable(b45ddcbc8423892c).(true);
3186 taunt_PlayTauntFilecxx . . $ taunt_PlayTauntFile(c5f7da30cbc0f4e9).(path);
3187 taunt_Enablecxx . . $ taunt_Enable(b45ddcbc8423892c).(cenable);
3188 }
3189 }
3190 } break;
3191
3192 case ID_TAUNTScxx . . $ `Descent3/pilot.cpp:2768:9`!: {
3193 DoPilotTauntScreencxx . . $ DoPilotTauntScreen(1794bc617d3f3266).(Pilot);
3194 break;
3195 }
3196 case ID_IMPORTSOUNDcxx . . $ `Descent3/pilot.cpp:2767:9`!: {
3197 // Import the sound, set it's sample to xx.xKhz and xbit depth, attach the CRC to the filename
3198 // and place in custom/sounds. Then update the audio taunt combo boxes
3199 char path[_MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`!];
3200 char wildcards[100];
3201 path[0] = '\0';
3202 strcpy(wildcards, "*.wav");
3203 if (DoPathFileDialogcxx . . $ DoPathFileDialog(5d8ce13d0347d7c1).(false, path, TXT_CHOOSEcxx . . $ `Descent3/stringtable.h:354:9`!, wildcards, PFDF_FILEMUSTEXISTcxx . . $ `Descent3/newui.h:351:9`!)) {
3204 char dpath[_MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`! * 2];
3205 char filename[_MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`!];
3206 char tempfile[_MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`!];
3207
3208 ddio_SplitPathcxx . . $ ddio_SplitPath(b05ba7ab99603c07).(path, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, filename, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
3209 strcat(filename, ".osf");
3210 ddio_MakePathcxx . . $ ddio_MakePath(9ad4b0815420a85).(tempfile, LocalCustomSoundsDircxx . . $ LocalCustomSoundsDir., filename, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
3211
3212 // import the sound
3213 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Importing: '%s'->'%s'\n", path, tempfile);
3214 if (taunt_ImportWavecxx . . $ taunt_ImportWave(14223ed414283e68).(path, tempfile)) {
3215 // success
3216
3217 // check file size...make sure it isn't too big
3218 CFILEcxx . . $ CFILE# *file = cfopencxx . . $ cfopen(7c7b94e455f1ae56).(tempfilecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., "rb");
3219
3220 if (file) {
3221
3222 if (cfilelengthcxx . . $ cfilelength(e4541f75b25d0ae5).(file) > MAX_AUDIOTAUNTSIZEcxx . . $ `Descent3/pilot.cpp:622:9`!) {
3223 // file too big!!!!!!
3224 char message[256];
3225 snprintf(message, sizeof(message), TXT_COMPRESSTOOBIGcxx . . $ `Descent3/stringtable.h:709:9`!, MAX_AUDIOTAUNTSIZEcxx . . $ `Descent3/pilot.cpp:622:9`! / 1024);
3226 DoMessageBoxcxx . . $ DoMessageBox(dcc99837539e9edc).(TXT_WARNINGcxx . . $ `Descent3/stringtable.h:707:9`!, message, MSGBOX_OKcxx . . $ `Descent3/newui_core.h:78:9`!);
3227 }
3228
3229 cfclosecxx . . $ cfclose(3639e799710acb68).(file);
3230
3231 if (CreateCRCFileNamecxx . . $ CreateCRCFileName(84e74a5521f49206).(tempfile, dpath)) {
3232 // dpath is destination file
3233 // tempfile is source file
3234 if (cf_CopyFilecxx . . $ cf_CopyFile(773c05b60430b9f6).(dpathcxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., tempfilecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., 0)) {
3235 // file copied...
3236 DoMessageBoxcxx . . $ DoMessageBox(dcc99837539e9edc).(TXT_SUCCESScxx . . $ `Descent3/stringtable.h:355:9`!, TXT_AUDIOIMPORTSUCcxx . . $ `Descent3/stringtable.h:710:9`!, MSGBOX_OKcxx . . $ `Descent3/newui_core.h:78:9`!);
3237 // delete temp file
3238 ddio_DeleteFilecxx . . $ ddio_DeleteFile(5c4306d8553b3696).(tempfile);
3239 // Put path in the custom\sounds as dpath (convert if needed)
3240 UpdateAudioTauntBoxescxx . . $ UpdateAudioTauntBoxes(79e8cd0b2cad2f2c).(&cust_snds, taunts_lists.taunt_acxx . . $ tAudioTauntComboBoxes#taunt_a., taunts_lists.taunt_bcxx . . $ tAudioTauntComboBoxes#taunt_b., taunts_lists.taunt_ccxx . . $ tAudioTauntComboBoxes#taunt_c.,
3241 taunts_lists.taunt_dcxx . . $ tAudioTauntComboBoxes#taunt_d., Pilot);
3242 } else {
3243 DoMessageBoxcxx . . $ DoMessageBox(dcc99837539e9edc).(TXT_ERRORcxx . . $ `Descent3/stringtable.h:165:9`!, TXT_COPYTEMPERRcxx . . $ `Descent3/stringtable.h:711:9`!, MSGBOX_OKcxx . . $ `Descent3/newui_core.h:78:9`!);
3244 // delete temp file
3245 ddio_DeleteFilecxx . . $ ddio_DeleteFile(5c4306d8553b3696).(tempfile);
3246 }
3247 } else {
3248 // couldn't generate a crc filename
3249 DoMessageBoxcxx . . $ DoMessageBox(dcc99837539e9edc).(TXT_ERRORcxx . . $ `Descent3/stringtable.h:165:9`!, TXT_CANTCREATECRCcxx . . $ `Descent3/stringtable.h:712:9`!, MSGBOX_OKcxx . . $ `Descent3/newui_core.h:78:9`!);
3250 // delete temp file
3251 ddio_DeleteFilecxx . . $ ddio_DeleteFile(5c4306d8553b3696).(tempfile);
3252 }
3253 } // end else (file size)
3254 } else {
3255 int imp_err = taunt_GetErrorcxx . . $ taunt_GetError(b126dc7c1de90089).();
3256 const char *err = taunt_GetErrorStringcxx . . $ taunt_GetErrorString(f7ae7e56280f18ae).(imp_err);
3257 // failure
3258 DoMessageBoxcxx . . $ DoMessageBox(dcc99837539e9edc).(TXT_ERRORcxx . . $ `Descent3/stringtable.h:165:9`!, err, MSGBOX_OKcxx . . $ `Descent3/newui_core.h:78:9`!);
3259 }
3260 }
3261 ddio_SetWorkingDircxx . . $ ddio_SetWorkingDir(c5f7da30cbc0f4e9).(path);
3262 } break;
3263
3264 case ID_DEL_LOGOcxx . . $ `Descent3/pilot.cpp:2769:9`!: {
3265 ShipSelectDeleteLogocxx . . $ ShipSelectDeleteLogo(1cadf8844d7abfa5).(&cust_bmps, custom_list);
3266 } break;
3267
3268 case ID_DEL_TAUNTAcxx . . $ `Descent3/pilot.cpp:2770:9`!: {
3269 ShipSelectDeleteTauntcxx . . $ ShipSelectDeleteTaunt(41f8fca03256e92d).(Pilot, &cust_snds, taunts_lists.taunt_acxx . . $ tAudioTauntComboBoxes#taunt_a., &taunts_lists);
3270 } break;
3271
3272 case ID_DEL_TAUNTBcxx . . $ `Descent3/pilot.cpp:2771:9`!: {
3273 ShipSelectDeleteTauntcxx . . $ ShipSelectDeleteTaunt(41f8fca03256e92d).(Pilot, &cust_snds, taunts_lists.taunt_bcxx . . $ tAudioTauntComboBoxes#taunt_b., &taunts_lists);
3274 } break;
3275
3276 case ID_DEL_TAUNTCcxx . . $ `Descent3/pilot.cpp:2772:9`!: {
3277 ShipSelectDeleteTauntcxx . . $ ShipSelectDeleteTaunt(41f8fca03256e92d).(Pilot, &cust_snds, taunts_lists.taunt_ccxx . . $ tAudioTauntComboBoxes#taunt_c., &taunts_lists);
3278 } break;
3279
3280 case ID_DEL_TAUNTDcxx . . $ `Descent3/pilot.cpp:2773:9`!: {
3281 ShipSelectDeleteTauntcxx . . $ ShipSelectDeleteTaunt(41f8fca03256e92d).(Pilot, &cust_snds, taunts_lists.taunt_dcxx . . $ tAudioTauntComboBoxes#taunt_d., &taunts_lists);
3282 } break;
3283 }
3284 }
3285
3286 ship_id_err:
3287
3288 // no use for this since stream files will stop
3289 // Sound_system.StopAllSounds();
3290
3291 taunts_lists.taunt_acxx . . $ tAudioTauntComboBoxes#taunt_a. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
3292 taunts_lists.taunt_bcxx . . $ tAudioTauntComboBoxes#taunt_b. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
3293 taunts_lists.taunt_ccxx . . $ tAudioTauntComboBoxes#taunt_c. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
3294 taunts_lists.taunt_dcxx . . $ tAudioTauntComboBoxes#taunt_d. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
3295
3296 cust_snds.Resetcxx . . $ tCustomListInfo#Reset(49f6e7a06ebc5aa8).();
3297
3298 cust_bmps.Resetcxx . . $ tCustomListInfo#Reset(49f6e7a06ebc5aa8).();
3299 ship_info.Resetcxx . . $ tShipListInfo#Reset(49f6e7a06ebc5aa8).();
3300
3301 if ((ret) && (ship_poscxx . . $ ship_pos..bm_handlecxx . . $ tShipPos#bm_handle. <= BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!)) {
3302 GameTexturescxx . . $ GameTextures.[ship_poscxx . . $ ship_pos..texture_idcxx . . $ tShipPos#texture_id.].flagscxx . . $ texture#flags. &= ~TF_ANIMATEDcxx . . $ `Descent3/gametexture.h:207:9`!;
3303 GameTexturescxx . . $ GameTextures.[ship_poscxx . . $ ship_pos..texture_idcxx . . $ tShipPos#texture_id.].flagscxx . . $ texture#flags. &= ~TF_TEXTURE_32cxx . . $ `Descent3/gametexture.h:216:9`!;
3304 GameTexturescxx . . $ GameTextures.[ship_poscxx . . $ ship_pos..texture_idcxx . . $ tShipPos#texture_id.].flagscxx . . $ texture#flags. |= TF_TEXTURE_64cxx . . $ `Descent3/gametexture.h:214:9`!;
3305 GameTexturescxx . . $ GameTextures.[ship_poscxx . . $ ship_pos..texture_idcxx . . $ tShipPos#texture_id.].bm_handlecxx . . $ texture#bm_handle. = BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!;
3306 }
3307
3308 if (ship_poscxx . . $ ship_pos..bm_handlecxx . . $ tShipPos#bm_handle. > BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!) {
3309 int handle;
3310 bool anim;
3311 if (ret) {
3312 handle = old_bmhandle;
3313 anim = (bool)((old_flags & TF_ANIMATEDcxx . . $ `Descent3/gametexture.h:207:9`!) != 0);
3314 } else {
3315 handle = ship_poscxx . . $ ship_pos..bm_handlecxx . . $ tShipPos#bm_handle.;
3316 anim = (bool)(ship_poscxx . . $ ship_pos..texture_typecxx . . $ tShipPos#texture_type. > 0);
3317 }
3318 if (handle > BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!) {
3319 if (anim)
3320 FreeVClipcxx . . $ FreeVClip(d4f767463ce0a6b3).(handle);
3321 else
3322 bm_FreeBitmapcxx . . $ bm_FreeBitmap(d4f767463ce0a6b3).(handle);
3323 }
3324 }
3325 ship_poscxx . . $ ship_pos..bm_handlecxx . . $ tShipPos#bm_handle. = -1;
3326
3327 window.Closecxx . . $ UIWindow#Close(49f6e7a06ebc5aa8).();
3328 window.Destroycxx . . $ UIWindow#Destroy(49f6e7a06ebc5aa8).();
3329
3330 return ret;
3331 }
3332
3333 void CustomCallBackcxx . . $ CustomCallBack(d4f767463ce0a6b3).(int c) {
3334 char select_bitmap[_MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`!];
3335 char *sbmp = GetStringInListcxx . . $ GetStringInList(22f5e0f8dc18650f).(c - 1, lp_cust_bmpscxx . . $ lp_cust_bmps.->filescxx . . $ tCustomListInfo#files., lp_cust_bmpscxx . . $ lp_cust_bmps.->needed_sizecxx . . $ tCustomListInfo#needed_size.);
3336 if (sbmp)
3337 strcpy(select_bitmap, sbmp);
3338 else
3339 select_bitmap[0] = '\0';
3340
3341 if (!strcmp(custom_texturecxx . . $ custom_texture., select_bitmap))
3342 return;
3343
3344 if (ship_poscxx . . $ ship_pos..bm_handlecxx . . $ tShipPos#bm_handle. > BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!) {
3345 if (ship_poscxx . . $ ship_pos..texture_typecxx . . $ tShipPos#texture_type.)
3346 FreeVClipcxx . . $ FreeVClip(d4f767463ce0a6b3).(ship_poscxx . . $ ship_pos..bm_handlecxx . . $ tShipPos#bm_handle.);
3347 else
3348 bm_FreeBitmapcxx . . $ bm_FreeBitmap(d4f767463ce0a6b3).(ship_poscxx . . $ ship_pos..bm_handlecxx . . $ tShipPos#bm_handle.);
3349 ship_poscxx . . $ ship_pos..bm_handlecxx . . $ tShipPos#bm_handle. = -1;
3350 }
3351 ship_poscxx . . $ ship_pos..texture_changedcxx . . $ tShipPos#texture_changed. = true;
3352
3353 if (c == 0) {
3354 // None selected
3355 custom_texturecxx . . $ custom_texture.[0] = '\0';
3356 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "None selected\n");
3357 bmpwindowcxx . . $ bmpwindow.->SetInfocxx . . $ UIBmpWindow#SetInfo(b994e01f1c45a386).(false, -1);
3358 GameTexturescxx . . $ GameTextures.[ship_poscxx . . $ ship_pos..texture_idcxx . . $ tShipPos#texture_id.].flagscxx . . $ texture#flags. &= ~TF_ANIMATEDcxx . . $ `Descent3/gametexture.h:207:9`!;
3359 GameTexturescxx . . $ GameTextures.[ship_poscxx . . $ ship_pos..texture_idcxx . . $ tShipPos#texture_id.].flagscxx . . $ texture#flags. &= ~TF_TEXTURE_32cxx . . $ `Descent3/gametexture.h:216:9`!;
3360 GameTexturescxx . . $ GameTextures.[ship_poscxx . . $ ship_pos..texture_idcxx . . $ tShipPos#texture_id.].flagscxx . . $ texture#flags. |= TF_TEXTURE_64cxx . . $ `Descent3/gametexture.h:214:9`!;
3361 GameTexturescxx . . $ GameTextures.[ship_poscxx . . $ ship_pos..texture_idcxx . . $ tShipPos#texture_id.].bm_handlecxx . . $ texture#bm_handle. = BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!;
3362 } else {
3363 // Get the filename
3364 char *p = GetStringInListcxx . . $ GetStringInList(22f5e0f8dc18650f).(c - 1, lp_cust_bmpscxx . . $ lp_cust_bmps.->filescxx . . $ tCustomListInfo#files., lp_cust_bmpscxx . . $ lp_cust_bmps.->needed_sizecxx . . $ tCustomListInfo#needed_size.);
3365 if (p)
3366 strcpy(custom_texturecxx . . $ custom_texture., p);
3367 else
3368 custom_texturecxx . . $ custom_texture.[0] = '\0';
3369 ship_poscxx . . $ ship_pos..bm_handlecxx . . $ tShipPos#bm_handle. = LoadTextureImagecxx . . $ LoadTextureImage(f997a6335c8241fb).(IGNORE_TABLEcxx . . $ `lib/manage_external.h:54:9`!(custom_texture), &ship_poscxx . . $ ship_pos..texture_typecxx . . $ tShipPos#texture_type., SMALL_TEXTUREcxx . . $ `Descent3/gametexture.h:240:9`!, 1);
3370 if (ship_poscxx . . $ ship_pos..bm_handlecxx . . $ tShipPos#bm_handle. > BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!) {
3371 if (ship_poscxx . . $ ship_pos..texture_typecxx . . $ tShipPos#texture_type.)
3372 GameTexturescxx . . $ GameTextures.[ship_poscxx . . $ ship_pos..texture_idcxx . . $ tShipPos#texture_id.].flagscxx . . $ texture#flags. |= TF_ANIMATEDcxx . . $ `Descent3/gametexture.h:207:9`!;
3373 else
3374 GameTexturescxx . . $ GameTextures.[ship_poscxx . . $ ship_pos..texture_idcxx . . $ tShipPos#texture_id.].flagscxx . . $ texture#flags. &= ~TF_ANIMATEDcxx . . $ `Descent3/gametexture.h:207:9`!;
3375
3376 GameTexturescxx . . $ GameTextures.[ship_poscxx . . $ ship_pos..texture_idcxx . . $ tShipPos#texture_id.].flagscxx . . $ texture#flags. &= ~TF_TEXTURE_32cxx . . $ `Descent3/gametexture.h:216:9`!;
3377 GameTexturescxx . . $ GameTextures.[ship_poscxx . . $ ship_pos..texture_idcxx . . $ tShipPos#texture_id.].flagscxx . . $ texture#flags. |= TF_TEXTURE_64cxx . . $ `Descent3/gametexture.h:214:9`!;
3378
3379 GameTexturescxx . . $ GameTextures.[ship_poscxx . . $ ship_pos..texture_idcxx . . $ tShipPos#texture_id.].bm_handlecxx . . $ texture#bm_handle. = ship_poscxx . . $ ship_pos..bm_handlecxx . . $ tShipPos#bm_handle.;
3380
3381 bmpwindowcxx . . $ bmpwindow.->SetInfocxx . . $ UIBmpWindow#SetInfo(b994e01f1c45a386).(ship_poscxx . . $ ship_pos..texture_typecxx . . $ tShipPos#texture_type. ? true : false, ship_poscxx . . $ ship_pos..bm_handlecxx . . $ tShipPos#bm_handle.);
3382
3383 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Loaded texture (%s). Type=%d, ID=%d\n", custom_texture, ship_pos.texture_type, ship_pos.texture_id);
3384 } else
3385 goto load_texture_err;
3386 }
3387
3388 return;
3389
3390 load_texture_err:
3391 ship_poscxx . . $ ship_pos..bm_handlecxx . . $ tShipPos#bm_handle. = BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!;
3392 GameTexturescxx . . $ GameTextures.[ship_poscxx . . $ ship_pos..texture_idcxx . . $ tShipPos#texture_id.].flagscxx . . $ texture#flags. &= ~TF_ANIMATEDcxx . . $ `Descent3/gametexture.h:207:9`!;
3393 GameTexturescxx . . $ GameTextures.[ship_poscxx . . $ ship_pos..texture_idcxx . . $ tShipPos#texture_id.].flagscxx . . $ texture#flags. &= ~TF_TEXTURE_32cxx . . $ `Descent3/gametexture.h:216:9`!;
3394 GameTexturescxx . . $ GameTextures.[ship_poscxx . . $ ship_pos..texture_idcxx . . $ tShipPos#texture_id.].flagscxx . . $ texture#flags. |= TF_TEXTURE_64cxx . . $ `Descent3/gametexture.h:214:9`!;
3395 GameTexturescxx . . $ GameTextures.[ship_poscxx . . $ ship_pos..texture_idcxx . . $ tShipPos#texture_id.].bm_handlecxx . . $ texture#bm_handle. = BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!;
3396 strcpy(custom_texturecxx . . $ custom_texture., "");
3397 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Unable to load texture\n");
3398 bmpwindowcxx . . $ bmpwindow.->SetInfocxx . . $ UIBmpWindow#SetInfo(b994e01f1c45a386).(false, -1);
3399 }
3400
3401 extern float Render_zoomcxx . . $ Render_zoom.;
3402 void ShipSelectCallBackcxx . . $ ShipSelectCallBack(d4f767463ce0a6b3).(int c) {
3403 if (!lp_ship_infocxx . . $ lp_ship_info.->idlistcxx . . $ tShipListInfo#idlist.)
3404 return;
3405
3406 float size;
3407 ship_modelcxx . . $ ship_model. = Shipscxx . . $ Ships.[lp_ship_infocxx . . $ lp_ship_info.->idlistcxx . . $ tShipListInfo#idlist.[c]].model_handlecxx . . $ ship#model_handle.;
3408 if (ship_modelcxx . . $ ship_model. == -1) {
3409 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "ship_model is -1\n");
3410 Int3cxx . . $ `misc/pserror.h:247:9`!();
3411 }
3412
3413 DoWaitMessagecxx . . $ DoWaitMessage(ee90985596e8b4f9).(true);
3414
3415 PageInPolymodelcxx . . $ PageInPolymodel(726816c99d57134).(ship_modelcxx . . $ ship_model., OBJ_PLAYERcxx . . $ `Descent3/object_external.h:164:9`!, &size);
3416 poly_modelcxx . . $ poly_model# *pm = GetPolymodelPointercxx . . $ GetPolymodelPointer(ac85e77c73ebf794).(ship_modelcxx . . $ ship_model.);
3417
3418 ship_poscxx . . $ ship_pos..cam_distcxx . . $ tShipPos#cam_dist. = pm->anim_sizecxx . . $ poly_model#anim_size. / Render_zoomcxx . . $ Render_zoom. + 5;
3419
3420 DoWaitMessagecxx . . $ DoWaitMessage(ee90985596e8b4f9).(false);
3421 }
3422
3423 extern char LocalCustomGraphicsDircxx . . $ LocalCustomGraphicsDir.[TABLE_NAME_LENcxx . . $ `lib/manage.h:43:9`!];
3424 extern char LocalCustomSoundsDircxx . . $ LocalCustomSoundsDir.[TABLE_NAME_LENcxx . . $ `lib/manage.h:43:9`!];
3425
3426 // Deletes the currently selected ship logo
3427 void ShipSelectDeleteLogocxx . . $ ShipSelectDeleteLogo(1cadf8844d7abfa5).(tCustomListInfocxx . . $ tCustomListInfo# *cust_bmps, newuiListBoxcxx . . $ newuiListBox# *lb) {
3428 ASSERTcxx . . $ `misc/pserror.h:246:9`!(lb);
3429 ASSERTcxx . . $ `misc/pserror.h:246:9`!(cust_bmps);
3430
3431 int selected_index = lb->GetCurrentIndexcxx . . $ newuiListBox#GetCurrentIndex(b126dc7c1de90089).();
3432 char custom_filename[384];
3433 char custom_logoname[384];
3434
3435 // check for None selected
3436 if (selected_index == 0) {
3437 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Listbox selected item is None\n");
3438 return;
3439 }
3440
3441 lb->GetItemcxx . . $ newuiListBox#GetItem(3f730e01d352290e).(selected_index, custom_logoname, 384);
3442
3443 // Get the filename
3444 char *p = GetStringInListcxx . . $ GetStringInList(22f5e0f8dc18650f).(selected_index - 1, cust_bmps->filescxx . . $ tCustomListInfo#files., cust_bmps->needed_sizecxx . . $ tCustomListInfo#needed_size.);
3445 if (p) {
3446 strncpy(custom_filename, p, 383);
3447 custom_filename[383] = '\0';
3448 } else {
3449 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Listbox selected item not found\n");
3450 Int3cxx . . $ `misc/pserror.h:247:9`!();
3451 return;
3452 }
3453
3454 // delete custom_filename, we don't want it....
3455 char buffer[512];
3456 snprintf(buffer, sizeof(buffer), TXT_PLTOKDELcxx . . $ `Descent3/stringtable.h:50:9`!, custom_logoname);
3457 if (DoMessageBoxcxx . . $ DoMessageBox(dcc99837539e9edc).(TXT_PLTDELCONFcxx . . $ `Descent3/stringtable.h:51:9`!, buffer, MSGBOX_YESNOcxx . . $ `Descent3/newui_core.h:80:9`!, UICOL_WINDOW_TITLEcxx . . $ `Descent3/newui.h:219:9`!, UICOL_TEXT_NORMALcxx . . $ `Descent3/newui.h:218:9`!)) {
3458 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Deleting pilot logo %s (%s)\n", custom_logoname, custom_filename);
3459
3460 char olddir[_MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`!];
3461 ddio_GetWorkingDircxx . . $ ddio_GetWorkingDir(a07d8cccb7673f5a).(olddir, _MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`!);
3462 ddio_SetWorkingDircxx . . $ ddio_SetWorkingDir(c5f7da30cbc0f4e9).(LocalCustomGraphicsDircxx . . $ LocalCustomGraphicsDir.);
3463 if (ddio_DeleteFilecxx . . $ ddio_DeleteFile(5c4306d8553b3696).(custom_filename)) {
3464 // Update the list box, select none
3465 UpdateGraphicsListboxcxx . . $ UpdateGraphicsListbox(d8f747e86a7ef2e3).(cust_bmps, lb, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
3466 } else {
3467 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Unable to delete file %s\n", custom_filename);
3468 Int3cxx . . $ `misc/pserror.h:247:9`!();
3469 }
3470 ddio_SetWorkingDircxx . . $ ddio_SetWorkingDir(c5f7da30cbc0f4e9).(olddir);
3471 }
3472 }
3473
3474 // Deletes the currently selected audio taunt
3475 void ShipSelectDeleteTauntcxx . . $ ShipSelectDeleteTaunt(41f8fca03256e92d).(pilotcxx . . $ pilot# *Pilot, tCustomListInfocxx . . $ tCustomListInfo# *cust_snds, newuiComboBoxcxx . . $ newuiComboBox# *lb,
3476 tAudioTauntComboBoxescxx . . $ tAudioTauntComboBoxes# *taunt_boxes) {
3477 ASSERTcxx . . $ `misc/pserror.h:246:9`!(Pilot);
3478 ASSERTcxx . . $ `misc/pserror.h:246:9`!(cust_snds);
3479 ASSERTcxx . . $ `misc/pserror.h:246:9`!(taunt_boxes);
3480
3481 int selected_index = lb->GetCurrentIndexcxx . . $ newuiComboBox#GetCurrentIndex(b126dc7c1de90089).();
3482 char custom_filename[384];
3483 char custom_logoname[384];
3484
3485 // check for None selected
3486 if (selected_index == 0) {
3487 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Listbox selected item is None\n");
3488 return;
3489 }
3490
3491 lb->GetItemcxx . . $ newuiComboBox#GetItem(3f730e01d352290e).(selected_index, custom_logoname, 384);
3492
3493 // Get the filename
3494 char *p = GetStringInListcxx . . $ GetStringInList(22f5e0f8dc18650f).(selected_index - 1, cust_snds->filescxx . . $ tCustomListInfo#files., cust_snds->needed_sizecxx . . $ tCustomListInfo#needed_size.);
3495 if (p) {
3496 strncpy(custom_filename, p, 383);
3497 custom_filename[383] = '\0';
3498 } else {
3499 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Listbox selected item not found\n");
3500 Int3cxx . . $ `misc/pserror.h:247:9`!();
3501 return;
3502 }
3503
3504 // delete custom_filename, we don't want it....
3505 char buffer[512];
3506 snprintf(buffer, sizeof(buffer), TXT_PLTOKDELcxx . . $ `Descent3/stringtable.h:50:9`!, custom_logoname);
3507 if (DoMessageBoxcxx . . $ DoMessageBox(dcc99837539e9edc).(TXT_PLTDELCONFcxx . . $ `Descent3/stringtable.h:51:9`!, buffer, MSGBOX_YESNOcxx . . $ `Descent3/newui_core.h:80:9`!, UICOL_WINDOW_TITLEcxx . . $ `Descent3/newui.h:219:9`!, UICOL_TEXT_NORMALcxx . . $ `Descent3/newui.h:218:9`!)) {
3508 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Deleting audio taunt %s (%s)\n", custom_logoname, custom_filename);
3509
3510 char olddir[_MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`!];
3511 ddio_GetWorkingDircxx . . $ ddio_GetWorkingDir(a07d8cccb7673f5a).(olddir, _MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`!);
3512 ddio_SetWorkingDircxx . . $ ddio_SetWorkingDir(c5f7da30cbc0f4e9).(LocalCustomSoundsDircxx . . $ LocalCustomSoundsDir.);
3513 if (ddio_DeleteFilecxx . . $ ddio_DeleteFile(5c4306d8553b3696).(custom_filename)) {
3514 // Update the list boxes, select none
3515 UpdateAudioTauntBoxescxx . . $ UpdateAudioTauntBoxes(79e8cd0b2cad2f2c).(cust_snds, taunt_boxes->taunt_acxx . . $ tAudioTauntComboBoxes#taunt_a., taunt_boxes->taunt_bcxx . . $ tAudioTauntComboBoxes#taunt_b., taunt_boxes->taunt_ccxx . . $ tAudioTauntComboBoxes#taunt_c.,
3516 taunt_boxes->taunt_dcxx . . $ tAudioTauntComboBoxes#taunt_d., Pilot);
3517 } else {
3518 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Unable to delete file %s\n", custom_filename);
3519 Int3cxx . . $ `misc/pserror.h:247:9`!();
3520 }
3521 ddio_SetWorkingDircxx . . $ ddio_SetWorkingDir(c5f7da30cbc0f4e9).(olddir);
3522 }
3523 }
3524
3525 void UI3DWindowcxx . . $ UI3DWindow#::OnDrawcxx . . $ UI3DWindow#OnDraw(49f6e7a06ebc5aa8).() {
3526 AudioStreamcxx . . $ AudioStream#::Framecxx . . $ AudioStream#Frame(49f6e7a06ebc5aa8).();
3527
3528 static polymodel_effectcxx . . $ polymodel_effect# pefx;
3529
3530 vectorcxx . . $ vector# viewer_eye = {0, 0, 0};
3531 matrixcxx . . $ matrix# viewer_orient = IDENTITY_MATRIXcxx . . $ `lib/vecmat_external.h:55:9`!;
3532 viewer_eye.zcxx . . $ vector#z. = -ship_poscxx . . $ ship_pos..cam_distcxx . . $ tShipPos#cam_dist.;
3533
3534 // 3d start frame
3535 //@@@@@StartFrame(m_X,m_Y,m_X+m_W-1,m_Y+m_H-1);
3536 g3_StartFramecxx . . $ g3_StartFrame(e35d136ceab5c8a2).(&viewer_eye, &viewer_orient, D3_DEFAULT_ZOOMcxx . . $ `Descent3/descent.h:178:9`!);
3537 rend_SetFlatColorcxx . . $ rend_SetFlatColor(cb2f890c2fdad230).(0);
3538
3539 if (ship_modelcxx . . $ ship_model. == -1) {
3540 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Shipmodel is -1\n");
3541 return;
3542 }
3543
3544 float normalized_time[MAX_SUBOBJECTScxx . . $ `lib/polymodel_external.h:76:9`!];
3545 float light_scalar, size;
3546 PageInPolymodelcxx . . $ PageInPolymodel(726816c99d57134).(ship_modelcxx . . $ ship_model., OBJ_PLAYERcxx . . $ `Descent3/object_external.h:164:9`!, &size);
3547 poly_modelcxx . . $ poly_model# *pm = GetPolymodelPointercxx . . $ GetPolymodelPointer(ac85e77c73ebf794).(ship_modelcxx . . $ ship_model.);
3548 vectorcxx . . $ vector# view_pos;
3549 vectorcxx . . $ vector# light_vec;
3550 matrixcxx . . $ matrix# view_orient = IDENTITY_MATRIXcxx . . $ `lib/vecmat_external.h:55:9`!;
3551 matrixcxx . . $ matrix# rot_mat = IDENTITY_MATRIXcxx . . $ `lib/vecmat_external.h:55:9`!;
3552 matrixcxx . . $ matrix# final_mat = IDENTITY_MATRIXcxx . . $ `lib/vecmat_external.h:55:9`!;
3553
3554 // draw model.
3555 SetNormalizedTimeAnimcxx . . $ SetNormalizedTimeAnim(40d1f0252a152310).(0, normalized_time, pm);
3556
3557 view_pos =cxx . . $ vector#`operator=`(a48bc7e93a8dae5e). pm->anim_size_offsetcxx . . $ poly_model#anim_size_offset.;
3558
3559 // move 30 degrees a sec
3560 float new_time = timer_GetTimecxx . . $ `ddio/ddio.h:236:9`!();
3561
3562 vm_AnglesToMatrixcxx . . $ vm_AnglesToMatrix(654fa9e3c9c3be99).(&rot_mat, 0, (new_time - ship_poscxx . . $ ship_pos..last_timecxx . . $ tShipPos#last_time.) * (65535 / 360) * 30, 0);
3563 vm_MatrixMulcxx . . $ vm_MatrixMul(3d6e518f7ec8c77c).(&view_orient, &rot_mat, &ship_poscxx . . $ ship_pos..last_framecxx . . $ tShipPos#last_frame.);
3564 vm_Orthogonalizecxx . . $ vm_Orthogonalize(dca75c48c9ab5b54).(&view_orient);
3565 ship_poscxx . . $ ship_pos..last_framecxx . . $ tShipPos#last_frame. =cxx . . $ matrix#`operator=`(4c6f8b29806742). view_orient;
3566
3567 light_vec.xcxx . . $ vector#x. = 0.0f;
3568 light_vec.ycxx . . $ vector#y. = -1.0f;
3569 light_vec.zcxx . . $ vector#z. = -1.0f;
3570 light_scalar = 0.8f;
3571 vm_NormalizeVectorcxx . . $ vm_NormalizeVector(4939a7e530383cd4).(&light_vec);
3572
3573 rend_SetZBufferStatecxx . . $ rend_SetZBufferState(4af4fd0e2b26c4ac).(1);
3574 rend_SetAlphaTypecxx . . $ rend_SetAlphaType(4af4fd0e2b26c4ac).(AT_CONSTANT_TEXTUREcxx . . $ `lib/renderer.h:402:9`!);
3575 rend_SetAlphaValuecxx . . $ rend_SetAlphaValue(ac50b47256ae7414).(255);
3576 rend_SetLightingcxx . . $ rend_SetLighting(e55526c9d3dd1656).(LS_NONEcxx . . $ LS_NONE.);
3577 rend_SetColorModelcxx . . $ rend_SetColorModel(e3c5062d5af601c7).(CM_MONOcxx . . $ CM_MONO.);
3578 rend_SetOverlayTypecxx . . $ rend_SetOverlayType(ac50b47256ae7414).(OT_NONEcxx . . $ `lib/renderer.h:333:9`!);
3579
3580 if (ship_poscxx . . $ ship_pos..bm_handlecxx . . $ tShipPos#bm_handle. > BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!) {
3581 if (ship_poscxx . . $ ship_pos..texture_changedcxx . . $ tShipPos#texture_changed.) {
3582 memset(&pefx, 0, sizeof(pefx));
3583 pefx.custom_texturecxx . . $ polymodel_effect#custom_texture. = ship_poscxx . . $ ship_pos..texture_idcxx . . $ tShipPos#texture_id.;
3584 pefx.typecxx . . $ polymodel_effect#type. = PEF_CUSTOM_TEXTUREcxx . . $ `lib/polymodel_external.h:294:9`!;
3585 ship_poscxx . . $ ship_pos..texture_changedcxx . . $ tShipPos#texture_changed. = false;
3586 }
3587
3588 SetPolymodelEffectcxx . . $ SetPolymodelEffect(c6aad29469640daf).(&pefx);
3589
3590 DrawPolygonModelcxx . . $ DrawPolygonModel(af314eb3da32d535).(&view_pos, &view_orient, ship_modelcxx . . $ ship_model., normalized_time, 0, &light_vec, light_scalar, light_scalar,
3591 light_scalar, 0xFFFFFFFF, 1);
3592 } else {
3593 DrawPolygonModelcxx . . $ DrawPolygonModel(af314eb3da32d535).(&view_pos, &view_orient, ship_modelcxx . . $ ship_model., normalized_time, 0, &light_vec, light_scalar, light_scalar,
3594 light_scalar);
3595 }
3596
3597 g3_EndFramecxx . . $ g3_EndFrame(49f6e7a06ebc5aa8).();
3598 //@@@@@@@@@@@EndFrame();
3599
3600 UIStaticcxx . . $ UIStatic#::OnDrawcxx . . $ UIStatic#OnDraw(49f6e7a06ebc5aa8).();
3601
3602 ship_poscxx . . $ ship_pos..last_timecxx . . $ tShipPos#last_time. = new_time;
3603 }
3604
3605 UIBmpWindowcxx . . $ UIBmpWindow#::UIBmpWindowcxx . . $ UIBmpWindow#UIBmpWindow(49f6e7a06ebc5aa8).() {
3606 animatedcxx . . $ UIBmpWindow#animated. = false;
3607 bm_handlecxx . . $ UIBmpWindow#bm_handle. = -1;
3608 start_timecxx . . $ UIBmpWindow#start_time. = timer_GetTimecxx . . $ `ddio/ddio.h:236:9`!();
3609 createdcxx . . $ UIBmpWindow#created. = false;
3610 }
3611
3612 UIBmpWindowcxx . . $ UIBmpWindow#::~cxx . . $ UIBmpWindow#`~UIBmpWindow`(ced63f7c635d850d).UIBmpWindowcxx . . $ UIBmpWindow#() {}
3613
3614 void UIBmpWindowcxx . . $ UIBmpWindow#::SetInfocxx . . $ UIBmpWindow#SetInfo(b994e01f1c45a386).(bool anim, int handle) {
3615 animatedcxx . . $ UIBmpWindow#animated. = anim;
3616 bm_handlecxx . . $ UIBmpWindow#bm_handle. = handle;
3617 start_timecxx . . $ UIBmpWindow#start_time. = timer_GetTimecxx . . $ `ddio/ddio.h:236:9`!();
3618 }
3619
3620 void UIBmpWindowcxx . . $ UIBmpWindow#::DrawBordercxx . . $ UIBmpWindow#DrawBorder(49f6e7a06ebc5aa8).(void) {
3621 int minx, maxx, miny, maxy;
3622
3623 minx = 0;
3624 maxx = m_Wcxx . . $ UIObject#m_W. - 1;
3625 miny = 0;
3626 maxy = m_Hcxx . . $ UIObject#m_H. - 1;
3627
3628 rend_SetZBufferStatecxx . . $ rend_SetZBufferState(4af4fd0e2b26c4ac).(0);
3629 rend_SetFlatColorcxx . . $ rend_SetFlatColor(cb2f890c2fdad230).(GR_RGBcxx . . $ GR_RGB(530956271a9518a5).(40, 255, 40));
3630
3631 rend_DrawLinecxx . . $ rend_DrawLine(748afa4755bc9595).(minx, miny, maxx, miny);
3632 rend_DrawLinecxx . . $ rend_DrawLine(748afa4755bc9595).(minx, maxy, maxx, maxy);
3633 rend_DrawLinecxx . . $ rend_DrawLine(748afa4755bc9595).(minx, miny, minx, maxy);
3634 rend_DrawLinecxx . . $ rend_DrawLine(748afa4755bc9595).(maxx, miny, maxx, maxy);
3635
3636 rend_SetZBufferStatecxx . . $ rend_SetZBufferState(4af4fd0e2b26c4ac).(1);
3637 }
3638
3639 void UIBmpWindowcxx . . $ UIBmpWindow#::OnDrawcxx . . $ UIBmpWindow#OnDraw(49f6e7a06ebc5aa8).(void) {
3640 int bmh = -1;
3641
3642 //@@@@@StartFrame(m_Wnd->X(),m_Wnd->Y(),m_Wnd->X()+m_Wnd->W(),m_Wnd->Y()+m_Wnd->H());
3643
3644 if (bm_handlecxx . . $ UIBmpWindow#bm_handle. == -1) {
3645 UIStaticcxx . . $ UIStatic#::OnDrawcxx . . $ UIStatic#OnDraw(49f6e7a06ebc5aa8).();
3646 DrawBordercxx . . $ UIBmpWindow#DrawBorder(49f6e7a06ebc5aa8).();
3647 //@@@@@@@@@@@EndFrame();
3648 return;
3649 }
3650
3651 if (animatedcxx . . $ UIBmpWindow#animated.) {
3652 vclipcxx . . $ vclip# *vc = &GameVClipscxx . . $ GameVClips.[bm_handlecxx . . $ UIBmpWindow#bm_handle.];
3653
3654 float elapsed_time = timer_GetTimecxx . . $ `ddio/ddio.h:236:9`!() - start_timecxx . . $ UIBmpWindow#start_time.;
3655 float interval = 1.0f / 10.0f;
3656 int frames_elapsed = (int)(elapsed_time / interval);
3657
3658 int frame = frames_elapsed % vc->num_framescxx . . $ vclip#num_frames.;
3659 bmh = vc->framescxx . . $ vclip#frames.[frame];
3660 } else {
3661 bmh = bm_handlecxx . . $ UIBmpWindow#bm_handle.;
3662 }
3663
3664 // draw the bitmap
3665 rend_SetAlphaTypecxx . . $ rend_SetAlphaType(4af4fd0e2b26c4ac).(AT_CONSTANT_TEXTUREcxx . . $ `lib/renderer.h:402:9`!);
3666 rend_SetAlphaValuecxx . . $ rend_SetAlphaValue(ac50b47256ae7414).(255);
3667 rend_SetLightingcxx . . $ rend_SetLighting(e55526c9d3dd1656).(LS_NONEcxx . . $ LS_NONE.);
3668 rend_SetColorModelcxx . . $ rend_SetColorModel(e3c5062d5af601c7).(CM_MONOcxx . . $ CM_MONO.);
3669 rend_SetOverlayTypecxx . . $ rend_SetOverlayType(ac50b47256ae7414).(OT_NONEcxx . . $ `lib/renderer.h:333:9`!);
3670 rend_SetFilteringcxx . . $ rend_SetFiltering(4af4fd0e2b26c4ac).(0);
3671
3672 int real_x, real_y;
3673
3674 real_x = 5;
3675 real_y = 5;
3676
3677 rend_DrawScaledBitmapcxx . . $ rend_DrawScaledBitmap(bffd21ce5f93b71b).(real_x, real_y, real_x + 31, real_y + 31, bmh, 0, 0, 1, 1);
3678
3679 rend_SetFilteringcxx . . $ rend_SetFiltering(4af4fd0e2b26c4ac).(1);
3680
3681 UIStaticcxx . . $ UIStatic#::OnDrawcxx . . $ UIStatic#OnDraw(49f6e7a06ebc5aa8).();
3682
3683 DrawBordercxx . . $ UIBmpWindow#DrawBorder(49f6e7a06ebc5aa8).();
3684 //@@@@@@@EndFrame();
3685 }
3686
3687 structcxx . . $ $anonymous_type_cbc8563ea5ce22a0_1# {
3688 int blank_bmpcxx . . $ $anonymous_type_cbc8563ea5ce22a0_1#blank_bmp.;
3689 int curr_bmpcxx . . $ $anonymous_type_cbc8563ea5ce22a0_1#curr_bmp.;
3690 int curr_indexcxx . . $ $anonymous_type_cbc8563ea5ce22a0_1#curr_index.;
3691 uint16_tcxx . . $ uint16_t# sizecxx . . $ $anonymous_type_cbc8563ea5ce22a0_1#size.;
3692 uint16_tcxx . . $ uint16_t# *id_listcxx . . $ $anonymous_type_cbc8563ea5ce22a0_1#id_list.;
3693 newuiListBoxcxx . . $ newuiListBox# *listboxcxx . . $ $anonymous_type_cbc8563ea5ce22a0_1#listbox.;
3694 UIStaticcxx . . $ UIStatic# *bmp_dispcxx . . $ $anonymous_type_cbc8563ea5ce22a0_1#bmp_disp.;
3695 } PPicDlgInfocxx . . $ PPicDlgInfo.;
3696
3697 void ShowPilotPicDialogListCallbackcxx . . $ ShowPilotPicDialogListCallback(d4f767463ce0a6b3).(int index) {
3698 if (index == PPicDlgInfocxx . . $ PPicDlgInfo..curr_indexcxx . . $ $anonymous_type_cbc8563ea5ce22a0_1#curr_index.)
3699 return;
3700
3701 int new_idx = index;
3702
3703 if (PPicDlgInfocxx . . $ PPicDlgInfo..blank_bmpcxx . . $ $anonymous_type_cbc8563ea5ce22a0_1#blank_bmp. != PPicDlgInfocxx . . $ PPicDlgInfo..curr_bmpcxx . . $ $anonymous_type_cbc8563ea5ce22a0_1#curr_bmp.) {
3704 bm_FreeBitmapcxx . . $ bm_FreeBitmap(d4f767463ce0a6b3).(PPicDlgInfocxx . . $ PPicDlgInfo..curr_bmpcxx . . $ $anonymous_type_cbc8563ea5ce22a0_1#curr_bmp.);
3705 PPicDlgInfocxx . . $ PPicDlgInfo..curr_bmpcxx . . $ $anonymous_type_cbc8563ea5ce22a0_1#curr_bmp. = -1;
3706 }
3707
3708 if (index == 0) {
3709 //<none> is selected
3710 PPicDlgInfocxx . . $ PPicDlgInfo..curr_bmpcxx . . $ $anonymous_type_cbc8563ea5ce22a0_1#curr_bmp. = PPicDlgInfocxx . . $ PPicDlgInfo..blank_bmpcxx . . $ $anonymous_type_cbc8563ea5ce22a0_1#blank_bmp.;
3711 } else {
3712 if (index <= PPicDlgInfocxx . . $ PPicDlgInfo..sizecxx . . $ $anonymous_type_cbc8563ea5ce22a0_1#size.) {
3713 int handle = PPic_GetBitmapHandlecxx . . $ PPic_GetBitmapHandle(377f6a3136964dac).(PPicDlgInfocxx . . $ PPicDlgInfo..id_listcxx . . $ $anonymous_type_cbc8563ea5ce22a0_1#id_list.[index - 1]);
3714 if (handle <= BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!) {
3715 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Couldn't get ID#%d's bitmap\n", PPicDlgInfo.id_list[index - 1]);
3716 Int3cxx . . $ `misc/pserror.h:247:9`!();
3717 PPicDlgInfocxx . . $ PPicDlgInfo..curr_bmpcxx . . $ $anonymous_type_cbc8563ea5ce22a0_1#curr_bmp. = PPicDlgInfocxx . . $ PPicDlgInfo..blank_bmpcxx . . $ $anonymous_type_cbc8563ea5ce22a0_1#blank_bmp.;
3718 new_idx = 0;
3719 } else {
3720 PPicDlgInfocxx . . $ PPicDlgInfo..curr_bmpcxx . . $ $anonymous_type_cbc8563ea5ce22a0_1#curr_bmp. = handle;
3721 }
3722 } else {
3723 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Invalid index\n");
3724 Int3cxx . . $ `misc/pserror.h:247:9`!();
3725 PPicDlgInfocxx . . $ PPicDlgInfo..curr_bmpcxx . . $ $anonymous_type_cbc8563ea5ce22a0_1#curr_bmp. = PPicDlgInfocxx . . $ PPicDlgInfo..blank_bmpcxx . . $ $anonymous_type_cbc8563ea5ce22a0_1#blank_bmp.;
3726 new_idx = 0;
3727 }
3728 }
3729
3730 // change the bitmap
3731 UIBitmapItemcxx . . $ UIBitmapItem# bmp_itemcxx . . $ UIBitmapItem#UIBitmapItem(9633529ce3c4ff50).(PPicDlgInfocxx . . $ PPicDlgInfo..curr_bmpcxx . . $ $anonymous_type_cbc8563ea5ce22a0_1#curr_bmp.);
3732 PPicDlgInfocxx . . $ PPicDlgInfo..bmp_dispcxx . . $ $anonymous_type_cbc8563ea5ce22a0_1#bmp_disp.->SetTitlecxx . . $ UIStatic#SetTitle(52afca12b6cce14a).(&bmp_item);
3733
3734 PPicDlgInfocxx . . $ PPicDlgInfo..curr_indexcxx . . $ $anonymous_type_cbc8563ea5ce22a0_1#curr_index. = new_idx;
3735 PPicDlgInfocxx . . $ PPicDlgInfo..listboxcxx . . $ $anonymous_type_cbc8563ea5ce22a0_1#listbox.->SetCurrentIndexcxx . . $ newuiListBox#SetCurrentIndex(d4f767463ce0a6b3).(new_idx);
3736 }
3737
3738 // -------------------------------------------------------
3739 // ShowPilotPicDialog
3740 // Purpose:
3741 // Displays the dialog to choose a pilot picture for
3742 // the given pilot.
3743 // -------------------------------------------------------
3744 void ShowPilotPicDialogcxx . . $ ShowPilotPicDialog(1794bc617d3f3266).(pilotcxx . . $ pilot# *Pilot) {
3745 ASSERTcxx . . $ `misc/pserror.h:246:9`!(Pilot);
3746 if (!Pilot)
3747 return;
3748
3749 char pname[PILOT_STRING_SIZEcxx . . $ `Descent3/pilot_class.h:124:9`!];
3750
3751 Pilot->get_namecxx . . $ pilot#get_name(fda57c8427c60377).(pname);
3752
3753 uint16_tcxx . . $ uint16_t# num_pilots = PPic_QueryPilotcxx . . $ PPic_QueryPilot(1c09e5b692edaacb).(pname);
3754 int blank_bmp_handle;
3755
3756 // only display the dialog if there is a pilot to choose from
3757 if (num_pilots == 0) {
3758 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "No Pilot Pics available for %s\n", pname);
3759 uint16_tcxx . . $ uint16_t# pid;
3760 pid = PPIC_INVALID_IDcxx . . $ `Descent3/pilot_class.h:126:9`!;
3761 Pilot->set_multiplayer_datacxx . . $ pilot#set_multiplayer_data(a7d02ca8b58088a9).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, &pid);
3762
3763 DoMessageBoxcxx . . $ DoMessageBox(dcc99837539e9edc).(TXT_ERRORcxx . . $ `Descent3/stringtable.h:165:9`!, TXT_NOPICSAVAILcxx . . $ `Descent3/stringtable.h:713:9`!, MSGBOX_OKcxx . . $ `Descent3/newui_core.h:78:9`!, UICOL_WINDOW_TITLEcxx . . $ `Descent3/newui.h:219:9`!, UICOL_TEXT_NORMALcxx . . $ `Descent3/newui.h:218:9`!);
3764 return;
3765 }
3766
3767 blank_bmp_handle = bm_AllocBitmapcxx . . $ bm_AllocBitmap(2326284602b0bb2d).(64, 64, 0);
3768 if (blank_bmp_handle <= BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!) {
3769 uint16_tcxx . . $ uint16_t# pid;
3770 pid = PPIC_INVALID_IDcxx . . $ `Descent3/pilot_class.h:126:9`!;
3771 Pilot->set_multiplayer_datacxx . . $ pilot#set_multiplayer_data(a7d02ca8b58088a9).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, &pid);
3772
3773 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Couldn't alloc bitmap\n");
3774 DoMessageBoxcxx . . $ DoMessageBox(dcc99837539e9edc).(TXT_ERRORcxx . . $ `Descent3/stringtable.h:165:9`!, TXT_ERRCREATINGDIALOGcxx . . $ `Descent3/stringtable.h:714:9`!, MSGBOX_OKcxx . . $ `Descent3/newui_core.h:78:9`!, UICOL_WINDOW_TITLEcxx . . $ `Descent3/newui.h:219:9`!, UICOL_TEXT_NORMALcxx . . $ `Descent3/newui.h:218:9`!);
3775 return;
3776 }
3777 uint16_tcxx . . $ uint16_t# *data = bm_datacxx . . $ bm_data(501e1bc9f482c6bd).(blank_bmp_handle, 0);
3778 for (int i = 0; i < 64 * 64; i++) {
3779 data[i] = GR_RGB16cxx . . $ GR_RGB16(6461fafb79bad5b9).(0, 0, 0) | OPAQUE_FLAGcxx . . $ `lib/grdefs.h:72:9`!;
3780 }
3781
3782 // create the dialog
3783 // -----------------
3784 #define DLG_PPIC_Wcxx . . $ `Descent3/pilot.cpp:3784:9`! 320
3785 #define DLG_PPIC_Hcxx . . $ `Descent3/pilot.cpp:3785:9`! 256
3786 newuiTiledWindowcxx . . $ newuiTiledWindow# hwndcxx . . $ newuiTiledWindow#newuiTiledWindow(49f6e7a06ebc5aa8).;
3787 newuiSheetcxx . . $ newuiSheet# *sheet;
3788 newuiListBoxcxx . . $ newuiListBox# *list;
3789
3790 UIBitmapItemcxx . . $ UIBitmapItem# bmp_itemcxx . . $ UIBitmapItem#UIBitmapItem(9633529ce3c4ff50).(blank_bmp_handle);
3791 UIStaticcxx . . $ UIStatic# bmp_dispcxx . . $ UIStatic#UIStatic(49f6e7a06ebc5aa8).;
3792 bool exit_menu = false;
3793
3794 hwnd.Createcxx . . $ newuiTiledWindow#Create(9860cac3d762132).(TXT_PILOTPICTUREcxx . . $ `Descent3/stringtable.h:715:9`!, 0, 0, DLG_PPIC_Wcxx . . $ `Descent3/pilot.cpp:3784:9`!, DLG_PPIC_Hcxx . . $ `Descent3/pilot.cpp:3785:9`!);
3795 sheet = hwnd.GetSheetcxx . . $ newuiTiledWindow#GetSheet(661381a276e5b628).();
3796
3797 sheet->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, 0, 0);
3798 list = sheet->AddListBoxcxx . . $ newuiSheet#AddListBox(b890ce7adcd9a5ed).(150, 150, IDP_SAVEcxx . . $ `Descent3/pilot.cpp:612:9`!, UILB_NOSORTcxx . . $ `ui/ui.h:356:9`!);
3799 list->SetSelectChangeCallbackcxx . . $ newuiListBox#SetSelectChangeCallback(94eb4457dc8d4d10).(ShowPilotPicDialogListCallbackcxx . . $ ShowPilotPicDialogListCallback(d4f767463ce0a6b3).);
3800
3801 sheet->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(TXT_DISPLAYcxx . . $ `Descent3/stringtable.h:717:9`!, 175, 0);
3802 bmp_disp.Createcxx . . $ UIStatic#Create(8745842b033f01b8).(&hwnd, &bmp_item, 215, 65, bmp_item.widthcxx . . $ UIBitmapItem#width(b126dc7c1de90089).(), bmp_item.heightcxx . . $ UIBitmapItem#height(b126dc7c1de90089).(), UIF_FITcxx . . $ `ui/ui.h:343:9`!);
3803
3804 sheet->NewGroupcxx . . $ newuiSheet#NewGroup(465b27e37ce794b1).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, 170, 145);
3805 sheet->AddButtoncxx . . $ newuiSheet#AddButton(680bf41633375800).(TXT_OKcxx . . $ `Descent3/stringtable.h:34:9`!, UID_OKcxx . . $ `ui/ui.h:368:9`!);
3806
3807 // Initialize PPicDlgInfo data
3808 // ---------------------------
3809 uint16_tcxx . . $ uint16_t# *id_list;
3810 id_list = (uint16_tcxx . . $ uint16_t# *)mem_malloccxx . . $ `mem/mem.h:79:9`!(num_pilots * sizeof(uint16_t));
3811
3812 if (!id_list) {
3813 // out of memory
3814 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Out of memory\n");
3815 goto clean_up;
3816 }
3817
3818 PPicDlgInfocxx . . $ PPicDlgInfo..curr_bmpcxx . . $ $anonymous_type_cbc8563ea5ce22a0_1#curr_bmp. = PPicDlgInfocxx . . $ PPicDlgInfo..blank_bmpcxx . . $ $anonymous_type_cbc8563ea5ce22a0_1#blank_bmp. = blank_bmp_handle;
3819 PPicDlgInfocxx . . $ PPicDlgInfo..curr_indexcxx . . $ $anonymous_type_cbc8563ea5ce22a0_1#curr_index. = 0;
3820 PPicDlgInfocxx . . $ PPicDlgInfo..listboxcxx . . $ $anonymous_type_cbc8563ea5ce22a0_1#listbox. = list;
3821 PPicDlgInfocxx . . $ PPicDlgInfo..bmp_dispcxx . . $ $anonymous_type_cbc8563ea5ce22a0_1#bmp_disp. = &bmp_disp;
3822 PPicDlgInfocxx . . $ PPicDlgInfo..sizecxx . . $ $anonymous_type_cbc8563ea5ce22a0_1#size. = num_pilots;
3823 PPicDlgInfocxx . . $ PPicDlgInfo..id_listcxx . . $ $anonymous_type_cbc8563ea5ce22a0_1#id_list. = id_list;
3824
3825 // fill in dialog data
3826 // -------------------
3827 uint16_tcxx . . $ uint16_t# temp_id;
3828 int idx;
3829 idx = 0;
3830
3831 Pilot->get_namecxx . . $ pilot#get_name(fda57c8427c60377).(pname);
3832
3833 if (PPic_FindFirstcxx . . $ PPic_FindFirst(b345e33955ddca6f).(pname, &temp_id)) {
3834 id_list[idx] = temp_id;
3835 idx++;
3836 while (PPic_FindNextcxx . . $ PPic_FindNext(6bd48caf83be88b2).(&temp_id)) {
3837 id_list[idx] = temp_id;
3838 idx++;
3839 }
3840 }
3841 PPic_FindClosecxx . . $ PPic_FindClose(49f6e7a06ebc5aa8).();
3842
3843 int selected_index;
3844 selected_index = 0;
3845 list->AddItemcxx . . $ newuiListBox#AddItem(85c52e162fed56f9).(TXT_NONEcxx . . $ `Descent3/stringtable.h:102:9`!);
3846
3847 char temp_buffer[PILOT_STRING_SIZEcxx . . $ `Descent3/pilot_class.h:124:9`! + 6];
3848 uint16_tcxx . . $ uint16_t# ppic_id;
3849 Pilot->get_multiplayer_datacxx . . $ pilot#get_multiplayer_data(ea6e7aa10f4b80f5).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, &ppic_id);
3850
3851 Pilot->get_namecxx . . $ pilot#get_name(fda57c8427c60377).(pname);
3852
3853 if (num_pilots > 1) {
3854 for (idx = 0; idx < num_pilots; idx++) {
3855
3856 if (ppic_id == id_list[idx])
3857 selected_index = idx + 1;
3858
3859 std::snprintfcxx . . $ std/snprintf(416d90c494a2998e).(temp_buffer, PILOT_STRING_SIZEcxx . . $ `Descent3/pilot_class.h:124:9`! + 6, "%s%d", pname, idx);
3860 list->AddItemcxx . . $ newuiListBox#AddItem(85c52e162fed56f9).(temp_buffer);
3861 }
3862 } else {
3863 if (ppic_id == id_list[idx])
3864 selected_index = idx + 1;
3865
3866 std::snprintfcxx . . $ std/snprintf(416d90c494a2998e).(temp_buffer, PILOT_STRING_SIZEcxx . . $ `Descent3/pilot_class.h:124:9`! + 6, "%s", pname);
3867 list->AddItemcxx . . $ newuiListBox#AddItem(85c52e162fed56f9).(temp_buffer);
3868 }
3869
3870 ShowPilotPicDialogListCallbackcxx . . $ ShowPilotPicDialogListCallback(d4f767463ce0a6b3).(selected_index);
3871
3872 // display dialog
3873 // --------------
3874 hwnd.Opencxx . . $ UIWindow#Open(49f6e7a06ebc5aa8).();
3875 while (!exit_menu) {
3876 int res = hwnd.DoUIcxx . . $ newuiTiledWindow#DoUI(b126dc7c1de90089).();
3877
3878 // handle all UI results.
3879 switch (res) {
3880 case UID_OKcxx . . $ `ui/ui.h:368:9`!:
3881 exit_menu = true;
3882 break;
3883 };
3884 }
3885
3886 selected_index = list->GetCurrentIndexcxx . . $ newuiListBox#GetCurrentIndex(b126dc7c1de90089).();
3887 uint16_tcxx . . $ uint16_t# pid;
3888 if (selected_index == 0) {
3889 pid = PPIC_INVALID_IDcxx . . $ `Descent3/pilot_class.h:126:9`!;
3890 } else {
3891 pid = id_list[selected_index - 1];
3892 }
3893 Pilot->set_multiplayer_datacxx . . $ pilot#set_multiplayer_data(a7d02ca8b58088a9).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, &pid);
3894
3895 hwnd.Closecxx . . $ UIWindow#Close(49f6e7a06ebc5aa8).();
3896 hwnd.Destroycxx . . $ UIWindow#Destroy(49f6e7a06ebc5aa8).();
3897
3898 clean_up:
3899 // free data
3900 // ---------
3901 if ((PPicDlgInfocxx . . $ PPicDlgInfo..curr_bmpcxx . . $ $anonymous_type_cbc8563ea5ce22a0_1#curr_bmp. != PPicDlgInfocxx . . $ PPicDlgInfo..blank_bmpcxx . . $ $anonymous_type_cbc8563ea5ce22a0_1#blank_bmp.) && (PPicDlgInfocxx . . $ PPicDlgInfo..curr_bmpcxx . . $ $anonymous_type_cbc8563ea5ce22a0_1#curr_bmp. > BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!))
3902 bm_FreeBitmapcxx . . $ bm_FreeBitmap(d4f767463ce0a6b3).(PPicDlgInfocxx . . $ PPicDlgInfo..curr_bmpcxx . . $ $anonymous_type_cbc8563ea5ce22a0_1#curr_bmp.);
3903
3904 bm_FreeBitmapcxx . . $ bm_FreeBitmap(d4f767463ce0a6b3).(blank_bmp_handle);
3905
3906 if (id_list) {
3907 mem_freecxx . . $ `mem/mem.h:80:9`!(id_list);
3908 }
3909 }
3910
3911 // "Current Pilot" access functions
3912 void dCurrentPilotNamecxx . . $ dCurrentPilotName(fda57c8427c60377).(char *buffer) { Current_pilotcxx . . $ Current_pilot..get_namecxx . . $ pilot#get_name(fda57c8427c60377).(buffer); }
3913 uint8_tcxx . . $ uint8_t# dCurrentPilotDifficultycxx . . $ dCurrentPilotDifficulty(7c4be072098b358f).(void) {
3914 uint8_tcxx . . $ uint8_t# d;
3915 Current_pilotcxx . . $ Current_pilot..get_difficultycxx . . $ pilot#get_difficulty(f25546b61a629de7).(&d);
3916 return d;
3917 }
3918
3919 /////////////////////////////////////////////////////////////////////
3920 void _ReadOldPilotFilecxx . . $ _ReadOldPilotFile(7ff4d2ff4894147e).(pilotcxx . . $ pilot# *Pilot, bool keyconfig, bool missiondata) {
3921 char filename[_MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`!];
3922 char pfilename[_MAX_FNAMEcxx . . $ `linux/linux_fix.h:35:9`!];
3923 char buffer[256];
3924 uint8_tcxx . . $ uint8_t# temp_b;
3925 uint16_tcxx . . $ uint16_t# temp_s;
3926 int temp_i;
3927 int filever, i, nctlfuncs;
3928
3929 Pilot->get_filenamecxx . . $ pilot#get_filename(fda57c8427c60377).(pfilename);
3930
3931 // open and process file
3932 ddio_MakePathcxx . . $ ddio_MakePath(9ad4b0815420a85).(filename, Base_directory_writecxx . . $ Base_directory_write., pfilename, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
3933 CFILEcxx . . $ CFILE# *file = cfopencxx . . $ cfopen(7c7b94e455f1ae56).(filenamecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., "rb");
3934 if (!file)
3935 return;
3936
3937 filever = cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(file);
3938
3939 if (filever < 0x12) {
3940 cfclosecxx . . $ cfclose(3639e799710acb68).(file);
3941 Errorcxx . . $ Error(326aeb464d16410c).(TXT_PLTTOOOLDcxx . . $ `Descent3/stringtable.h:794:9`!);
3942 return;
3943 }
3944
3945 if (filever > PLTFILEVERSIONcxx . . $ `Descent3/pilot.cpp:641:9`!) {
3946 // we're reading in a version that's newer than we have
3947 cfclosecxx . . $ cfclose(3639e799710acb68).(file);
3948 Errorcxx . . $ Error(326aeb464d16410c).(TXT_PLTTOONEWcxx . . $ `Descent3/stringtable.h:795:9`!, pfilename);
3949 return;
3950 }
3951
3952 Pilot->cleancxx . . $ pilot#clean(b45ddcbc8423892c).(true);
3953 Pilot->set_filenamecxx . . $ pilot#set_filename(fda57c8427c60377).(pfilename);
3954
3955 cf_ReadStringcxx . . $ cf_ReadString(38cd788e4423eff6).(buffer, PILOT_STRING_SIZEcxx . . $ `Descent3/pilot_class.h:124:9`! + 1, file);
3956 Pilot->set_namecxx . . $ pilot#set_name(85c52e162fed56f9).(buffer);
3957
3958 cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(file);
3959 cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(file);
3960
3961 cf_ReadStringcxx . . $ cf_ReadString(38cd788e4423eff6).(buffer, PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`! + 1, file);
3962 Pilot->set_shipcxx . . $ pilot#set_ship(85c52e162fed56f9).(buffer);
3963
3964 cf_ReadStringcxx . . $ cf_ReadString(38cd788e4423eff6).(buffer, PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`! + 1, file);
3965 Pilot->set_multiplayer_datacxx . . $ pilot#set_multiplayer_data(a7d02ca8b58088a9).(buffer);
3966
3967 temp_b = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(file);
3968 Pilot->set_difficultycxx . . $ pilot#set_difficulty(ac50b47256ae7414).(temp_b);
3969
3970 // load hud info
3971 temp_b = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(file);
3972 Pilot->set_hud_datacxx . . $ pilot#set_hud_data(c4a38c24677fe9fd).(&temp_b);
3973
3974 temp_s = cf_ReadShortcxx . . $ cf_ReadShort(30b00389b433b379).(file);
3975 Pilot->set_hud_datacxx . . $ pilot#set_hud_data(c4a38c24677fe9fd).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, &temp_s);
3976
3977 temp_s = cf_ReadShortcxx . . $ cf_ReadShort(30b00389b433b379).(file);
3978 Pilot->set_hud_datacxx . . $ pilot#set_hud_data(c4a38c24677fe9fd).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, &temp_s);
3979
3980 // read in audio taunts
3981 cf_ReadStringcxx . . $ cf_ReadString(38cd788e4423eff6).(buffer, PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`! + 1, file);
3982 Pilot->set_multiplayer_datacxx . . $ pilot#set_multiplayer_data(a7d02ca8b58088a9).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, buffer);
3983
3984 cf_ReadStringcxx . . $ cf_ReadString(38cd788e4423eff6).(buffer, PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`! + 1, file);
3985 Pilot->set_multiplayer_datacxx . . $ pilot#set_multiplayer_data(a7d02ca8b58088a9).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, buffer);
3986
3987 // added in version 0x9
3988 int n;
3989 uint16_tcxx . . $ uint16_t# widx;
3990 n = (int)cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(file);
3991 for (i = 0; i < n; i++) {
3992 widx = (uint16_tcxx . . $ uint16_t#)cf_ReadShortcxx . . $ cf_ReadShort(30b00389b433b379).(file);
3993 SetAutoSelectPrimaryWpnIdxcxx . . $ SetAutoSelectPrimaryWpnIdx(a7050f1a4cb56049).(i, widx);
3994 }
3995 n = (int)cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(file);
3996 for (i = 0; i < n; i++) {
3997 widx = (uint16_tcxx . . $ uint16_t#)cf_ReadShortcxx . . $ cf_ReadShort(30b00389b433b379).(file);
3998 SetAutoSelectSecondaryWpnIdxcxx . . $ SetAutoSelectSecondaryWpnIdx(a7050f1a4cb56049).(i, widx);
3999 }
4000
4001 temp_i = cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(file);
4002 Pilot->set_hud_datacxx . . $ pilot#set_hud_data(c4a38c24677fe9fd).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, &temp_i);
4003 temp_i = cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(file);
4004 Pilot->set_hud_datacxx . . $ pilot#set_hud_data(c4a38c24677fe9fd).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, &temp_i);
4005
4006 for (i = 0; i < N_MOUSE_AXIScxx . . $ `Descent3/pilot_class.h:128:9`!; i++)
4007 Pilot->mouse_sensitivitycxx . . $ pilot#mouse_sensitivity.[i] = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(file);
4008 for (i = 0; i < N_JOY_AXIScxx . . $ `Descent3/pilot_class.h:129:9`!; i++)
4009 Pilot->joy_sensitivitycxx . . $ pilot#joy_sensitivity.[i] = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(file);
4010
4011 temp_s = cf_ReadShortcxx . . $ cf_ReadShort(30b00389b433b379).(file);
4012 Pilot->set_multiplayer_datacxx . . $ pilot#set_multiplayer_data(a7d02ca8b58088a9).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, &temp_s);
4013
4014 // skip over mission data
4015 int count = cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(file);
4016 if (count > 0) {
4017 for (i = 0; i < count; i++) {
4018 char dummy[256];
4019 int length;
4020 cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(file);
4021 if (filever >= 0x11) {
4022 cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(file);
4023 }
4024 length = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(file);
4025 if (length) {
4026 cf_ReadBytescxx . . $ cf_ReadBytes(de6325ef3380a744).((uint8_tcxx . . $ uint8_t# *)dummy, length, file);
4027 }
4028 }
4029 }
4030
4031 // key/joy config MUST stay at the end of the file
4032 Pilot->read_controllercxx . . $ pilot#read_controller. = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(file);
4033
4034 // needed to properly map functions between pilot versions
4035 nctlfuncs = (filever >= 0xe) ? cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(file) : NUM_CTLFUNCS_DEMOv1_0cxx . . $ NUM_CTLFUNCS_DEMOv1_0.;
4036
4037 for (i = 0; i < nctlfuncs; i++) {
4038 int id = cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(file);
4039 ct_typecxx . . $ ct_type# type[2];
4040 ct_config_datacxx . . $ ct_config_data# value;
4041 int y;
4042
4043 type[0] = (ct_typecxx . . $ ct_type#)cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(file);
4044 type[1] = (ct_typecxx . . $ ct_type#)cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(file);
4045 value = (ct_config_datacxx . . $ ct_config_data#)cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(file);
4046 for (y = 0; y < nctlfuncs; y++)
4047 if (Controller_needscxx . . $ Controller_needs.[y].idcxx . . $ ct_function#id. == id) {
4048 if (type[0] == ctNonecxx . . $ ctNone.) // do this if there are new functions that don't have ctNone.
4049 type[0] = Controller_needscxx . . $ Controller_needs.[y].ctypecxx . . $ ct_function#ctype.[0];
4050 if (type[1] == ctNonecxx . . $ ctNone.) // do this if there are new functions that don't have ctNone.
4051 type[1] = Controller_needscxx . . $ Controller_needs.[y].ctypecxx . . $ ct_function#ctype.[1];
4052 break;
4053 }
4054
4055 Pilot->controlscxx . . $ pilot#controls.[y].idcxx . . $ cntrldata#id. = id;
4056 Pilot->controlscxx . . $ pilot#controls.[y].typecxx . . $ cntrldata#type.[0] = type[0];
4057 Pilot->controlscxx . . $ pilot#controls.[y].typecxx . . $ cntrldata#type.[1] = type[1];
4058 Pilot->controlscxx . . $ pilot#controls.[y].valuecxx . . $ cntrldata#value. = value;
4059
4060 // new flags for each controller item.
4061 if (filever >= 0xb) {
4062 Pilot->controlscxx . . $ pilot#controls.[y].flagscxx . . $ cntrldata#flags.[0] = (uint8_tcxx . . $ uint8_t#)cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(file);
4063 Pilot->controlscxx . . $ pilot#controls.[y].flagscxx . . $ cntrldata#flags.[1] = (uint8_tcxx . . $ uint8_t#)cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(file);
4064 }
4065
4066 if (keyconfig)
4067 Controllercxx . . $ Controller.->set_controller_functioncxx . . $ gameController#set_controller_function(a87bf4975f40b925).(Pilot->controlscxx . . $ pilot#controls.[y].idcxx . . $ cntrldata#id., Pilot->controlscxx . . $ pilot#controls.[y].typecxx . . $ cntrldata#type., Pilot->controlscxx . . $ pilot#controls.[y].valuecxx . . $ cntrldata#value.,
4068 Pilot->controlscxx . . $ pilot#controls.[y].flagscxx . . $ cntrldata#flags.);
4069 }
4070
4071 // fill in remainder of pilot controls array.
4072 for (; i < NUM_CONTROLLER_FUNCTIONScxx . . $ NUM_CONTROLLER_FUNCTIONS.; i++) {
4073 Controllercxx . . $ Controller.->get_controller_functioncxx . . $ gameController#get_controller_function(c004c324aa6068e0).(Controller_needscxx . . $ Controller_needs.[i].idcxx . . $ ct_function#id., Pilot->controlscxx . . $ pilot#controls.[i].typecxx . . $ cntrldata#type., &Pilot->controlscxx . . $ pilot#controls.[i].valuecxx . . $ cntrldata#value.,
4074 Pilot->controlscxx . . $ pilot#controls.[i].flagscxx . . $ cntrldata#flags.);
4075 }
4076
4077 if (Controllercxx . . $ Controller.) {
4078 Controllercxx . . $ Controller.->mask_controllerscxx . . $ gameController#mask_controllers(b0b38cda41d4ede4).((Current_pilotcxx . . $ Current_pilot..read_controllercxx . . $ pilot#read_controller. & READF_JOYcxx . . $ `Descent3/controls.h:178:9`!) ? true : false,
4079 (Current_pilotcxx . . $ Current_pilot..read_controllercxx . . $ pilot#read_controller. & READF_MOUSEcxx . . $ `Descent3/controls.h:177:9`!) ? true : false);
4080 }
4081
4082 // Read taunts if there
4083 for (i = 0; i < MAX_PILOT_TAUNTScxx . . $ `Descent3/pilot_class.h:132:9`!; i++)
4084 cf_ReadStringcxx . . $ cf_ReadString(38cd788e4423eff6).(Pilot->tauntscxx . . $ pilot#taunts.[i], PILOT_TAUNT_SIZEcxx . . $ `Descent3/pilot_class.h:134:9`!, file);
4085
4086 cfclosecxx . . $ cfclose(3639e799710acb68).(file);
4087 }