Debian Codegraph @

Descent3/hud.cpp

raw symbols SCIP
1 /*
2 * Descent 3
3 * Copyright (C) 2024 Parallax Software
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 --- HISTORICAL COMMENTS FOLLOW ---
19
20 * $Logfile: /DescentIII/main/hud.cpp $
21 * $Revision: 143 $
22 * $Date: 4/19/00 5:07p $
23 * $Author: Matt $
24 *
25 * $Log: /DescentIII/main/hud.cpp $
26 *
27 * 143 4/19/00 5:07p Matt
28 * From Duane for 1.4
29 * Added checks, asserts, and fixes for bad return values
30 *
31 * 142 4/06/00 9:25a Matt
32 * Fixed a screen clear problem on at ATI Rage Fury Maxx in dual-chip mode
33 * by forcing the screen to clear four times (instead of three).
34 *
35 * 141 3/20/00 12:10p Matt
36 * Merge of Duane's post-1.3 changes.
37 * Endian/enum fix.
38 *
39 * 140 10/21/99 4:28p Matt
40 * Mac merge
41 *
42 * 139 7/08/99 6:20p Jason
43 * fixed reticle bug
44 *
45 * 138 5/23/99 9:07p Matt
46 * Changed the customtext2 multisafe functions to create the item when
47 * it's updated, instead of having a separate create and update functions.
48 * This deals with players who join a netgame after the level has started
49 * (i.e., everyone but the server).
50 *
51 * 137 5/21/99 11:15p Samir
52 * savegames save hud timer and special text states. restore too.
53 *
54 * 136 5/21/99 4:06p Matt
55 * For customtext2 HUD items, store the buffer length in the HUD item.
56 *
57 * 135 5/21/99 3:06p Matt
58 * Changed customtext2 HUD items so that the HUD system keeps the text
59 * buffer an no one else references it directly.
60 *
61 * 134 5/20/99 5:48p Matt
62 * Added a HUD item flag, for use by Dallas-created items, that makes a
63 * HUD item persisitent for the duration of one level, but get cleared
64 * between levels.
65 *
66 * 133 5/20/99 2:12a Matt
67 * Don't blow away custom HUD items when resetting the HUD. This fixes
68 * one probem, but means that custom HUD items will never go away. I'll
69 * deal with that tomorrow.
70 *
71 * 132 5/19/99 11:25a Matt
72 * Added multisafe functions & Dallas actions for showing a timer on the
73 * screen and adding custom HUD messages.
74 *
75 * 131 5/17/99 6:04p Kevin
76 * new training mission localized text
77 *
78 * 130 5/17/99 5:27p Kevin
79 * changed enabled controls display for training mission
80 *
81 * 129 5/14/99 10:30a Kevin
82 * fixed misplaced #endif
83 *
84 * 128 5/13/99 12:24p Kevin
85 * added code for "Beta version"
86 *
87 * 127 5/05/99 5:45p Samir
88 * initialize reticle in cockpit code now.
89 *
90 * 126 5/01/99 5:52p Samir
91 * removed RenderHudMessages, and redid RenderHUDMessages so it did what
92 * RenderHudMessages did, resets on screen hud messages. The HUD message
93 * console is resetted in ResetGameMessages.
94 *
95 * 125 5/01/99 1:56a Samir
96 * timer always in debug builds, SCORE is off when dead.
97 *
98 * 124 4/26/99 5:51p Jason
99 * fixed guided bug
100 *
101 * 123 4/24/99 10:38p Samir
102 * cleaned up hud text problems in 'small mode'
103 *
104 * 122 4/24/99 8:43p Samir
105 * when shrinking screen hud messages get rendered in black region.
106 *
107 * 121 4/22/99 3:43p Kevin
108 * Training missions show controls on screen
109 *
110 * 120 4/21/99 9:29p Samir
111 * don't draw score in multiplayer.
112 *
113 * 119 4/21/99 4:17p Matt
114 * Added comments for table file filter
115 *
116 * 118 4/20/99 11:47a Samir
117 * shrinking hud fixes.
118 *
119 * 117 4/08/99 4:08p Samir
120 * moved timer below score and don't compile timer in release builds.
121 *
122 * 116 4/06/99 6:02p Matt
123 * Added score system
124 *
125 * 115 4/06/99 2:00p Samir
126 * added function to initialize hud items that don't go through config
127 * file.
128 *
129 * 114 4/06/99 11:39a Samir
130 * added more formatting options for hud items (added two other full
131 * screen hud infs for different ships)
132 *
133 * 113 4/01/99 4:50p Matt
134 * Took out Warning() function, chaning those calls to mprintf()
135 *
136 * 112 3/30/99 5:26p Samir
137 * fixed quad weapon reticle problem.
138 *
139 * 111 3/30/99 2:39p Samir
140 * added custom config file for fullscreen hud and hacked mass driver
141 * reticle in special reticle code.
142 *
143 * 110 3/29/99 10:50a Samir
144 * added command to move reticle in hud inf file.
145 *
146 * 109 3/26/99 12:46p Samir
147 * configurable reticle.
148 *
149 * 108 3/22/99 4:26p Samir
150 * added toggles for guided missile view and reticle.
151 *
152 * 107 3/09/99 12:20p Samir
153 * do quick close of cockpit if entering letterbox or observer mode from
154 * cockpit.
155 *
156 * 106 3/05/99 3:01p Jeff
157 * fixed crash when a persistant message is displayed during a IGC
158 *
159 * 105 3/04/99 8:11p Samir
160 * Don't assert if screen mode != SM_GAME in SetHUDMode, just Int3 and
161 * allow user to return.
162 *
163 * 104 3/03/99 5:34p Matt
164 * Added fade-out for goal complete messages
165 *
166 * 103 3/03/99 3:43a Samir
167 * fixed font aspect ratio problem in hires screens.
168 *
169 * 102 3/02/99 6:26p Samir
170 * hires font madness.
171 *
172 * 101 2/28/99 3:25a Samir
173 * stream name debug out.
174 *
175 * 100 2/27/99 5:07p Jason
176 * clear screen 3 times for triple buffer
177 *
178 * 99 2/24/99 12:25p Jeff
179 * fixed guided missile/mass driver reticle/view problems when going into
180 * a cinematic
181 *
182 * 98 2/18/99 4:02p Jeff
183 * only save hud mode to pilot file if fullscreen->cockpit or vice-versa
184 *
185 * 97 2/17/99 2:45p Kevin
186 * Adde movie making capabilities to the demo playback system
187 *
188 * 96 2/15/99 7:49p Jeff
189 * new pilot file class and read/write system checked in...should be more
190 * robust than old
191 *
192 * 95 2/10/99 3:03p Samir
193 * table file parse changes.
194 *
195 * 94 1/31/99 9:05p Jeff
196 * handle HUD_OBSERVER in render
197 *
198 * 93 1/31/99 7:26p Matt
199 * Renamed a bunch of functions to have HUD capitalized
200 *
201 * 92 1/29/99 6:29p Samir
202 * implemented hud scrollback for hud messages.
203 *
204 * 91 1/29/99 2:08p Jeff
205 * localization
206 *
207 * 90 1/28/99 2:22p Samir
208 * simplified music system for D3.
209 *
210 * 89 1/27/99 6:05p Samir
211 * added scrollback for game messages on HUD.
212 *
213 * 88 1/08/99 2:55p Samir
214 * Ripped out OSIRIS1.
215 *
216 * 87 12/16/98 1:57p Samir
217 * Replaced CleanupString2 with CleanupStr
218 *
219 * 86 12/03/98 12:52p Samir
220 * added hud music debug info timers.
221 *
222 * 85 12/01/98 3:34p Matt
223 * Got rear view working.
224 *
225 * 84 11/23/98 4:52p Kevin
226 * Demo system enhancments
227 *
228 * 83 11/19/98 5:40p Kevin
229 * Demo system
230 *
231 * 82 11/13/98 4:25p Jason
232 * changes for better weapon effects
233 *
234 * 81 11/13/98 2:28p Samir
235 * added debug code for music.
236 *
237 * 80 10/30/98 1:13p Samir
238 * dont' do SetHUDMode if in dedicated server mode.
239 *
240 * 79 10/22/98 2:40p Samir
241 * redid HUD sequencing so multiplayer hud stuff works.
242 *
243 * 78 10/20/98 1:46p Samir
244 * don't close cockpit if it's already open.
245 *
246 * 77 10/19/98 11:22p Samir
247 * added hud observer mode and fixed problems with hud switching and
248 * screen size.
249 *
250 * 76 10/14/98 4:27p Samir
251 * improved HUD_ITEM_CUSTOMTEXT
252 *
253 * 75 10/07/98 5:52p Samir
254 * fixed small bug in hud stat masks.
255 *
256 * 74 10/02/98 5:47p Samir
257 * moved reticle down a bit.
258 *
259 * 73 9/28/98 11:00a Samir
260 * fixed stupid bug.
261 *
262 * 72 9/18/98 4:33p Samir
263 * added dummy code for New Inf format hud files.
264 *
265 * 71 8/31/98 3:39p Samir
266 * if no energy or ammo, reticle will reflect this.
267 *
268 * 70 8/25/98 3:07p Samir
269 * when cockpit fails redo hud switch to fullscreen.
270 *
271 * 69 8/18/98 1:11a Samir
272 * fixed some stuff for multi cockpit configs.
273 *
274 * 68 8/15/98 10:51p Matt
275 * Added function ToggleHUDMode(), and made StartHudInputMessage() public.
276 *
277 * 67 7/06/98 7:34p Samir
278 * added countermeasures.
279 *
280 * 66 6/25/98 12:52p Samir
281 * draw afterburner hud in cockpit (special version)
282 *
283 * 65 6/24/98 7:38p Samir
284 * redid graphical/text/cockpit hud item management.
285 *
286 * 64 6/19/98 5:39p Samir
287 * use pilot information to get hud layout.
288 *
289 * 63 6/17/98 6:31p Samir
290 * Added anti-grav warning when dying.
291 *
292 * 62 6/15/98 6:54p Samir
293 * added invulnerability and cloak effect.
294 *
295 * 61 6/05/98 5:34p Samir
296 * if cockpit already up, when setting cockpit mode, do quick open.
297 *
298 * 60 5/26/98 10:49p Samir
299 * default to cockpit.
300 *
301 * 59 5/26/98 5:05p Samir
302 * cockpit and hud config file now 'unified'. cockpit adds to hudconfig
303 * load's funtionality, so cockpit info files can contain same syntax as
304 * hud file.
305 *
306 * 58 5/25/98 8:30p Samir
307 * guided missile reticle and added a hud timer.
308 *
309 * 57 5/22/98 1:36p Samir
310 * implemented a lot of hud items.
311 *
312 * 56 5/15/98 5:36p Samir
313 * use correct font scale for lores screens.
314 *
315 * 55 5/15/98 3:39p Samir
316 * reticle alphaed.
317 *
318 * 54 5/07/98 6:01p Samir
319 * allow for certain hud items to not be resettable.
320 *
321 * 53 5/07/98 2:51p Samir
322 * took out extern functions.
323 *
324 * 52 5/05/98 6:27p Samir
325 * added hud aspect ratio values and reticle is scaled correctly.
326 *
327 * 51 4/28/98 4:25p Samir
328 * scale font with hud shrink.
329 *
330 * 50 4/27/98 1:14p Jason
331 * cleaned up afterburner stuff
332 *
333 * 49 4/24/98 5:32p Samir
334 * new reticle implemented.
335 *
336 * 48 4/24/98 8:01a Samir
337 * don't pass zoom argument to Render functions.
338 *
339 * 47 4/23/98 4:13a Samir
340 * new hud system.
341 *
342 * 46 4/19/98 5:00p Jason
343 * added cool napalm effect, plus made object effects dynamically
344 * allocated
345 *
346 * 45 4/17/98 1:59p Jason
347 * added cool object effects
348 *
349 * 44 4/16/98 6:52a Samir
350 * initialize bitmap handle to -1 always when initializing hud item.
351 *
352 * 43 4/14/98 9:19p Samir
353 * made hacked good looking reticle for mag demo.
354 *
355 * 42 4/13/98 7:02p Samir
356 * beginning reticle code.
357 *
358 * 41 4/01/98 6:23p Jason
359 * added a slew of stuff for multiplayer
360 *
361 * 40 3/25/98 11:59a Samir
362 * implemented energy analog fully.
363 *
364 * 39 3/24/98 4:27p Samir
365 * modified energy gauges.
366 *
367 * 38 3/22/98 5:03p Samir
368 * updated cockpit.
369 *
370 * 37 3/20/98 8:23p Samir
371 * new hud and cockpit customization system.
372 *
373 * 36 3/19/98 9:19p Samir
374 * removed dependency of hud.h on game.h.
375 *
376 * 35 3/18/98 6:25p Samir
377 * Added new STAT_ constants/
378 *
379 * 34 3/17/98 2:40p Samir
380 * reorg of cockpit/gauges and hud systems.
381 *
382 * 33 3/16/98 3:30p Samir
383 * incremental checkin.
384 *
385 * 32 3/13/98 12:09p Samir
386 * made changes to reflect new cockpit.cpp and cockpit.h
387 *
388 * 31 2/17/98 2:22p Jason
389 * fixed some potential z sorting problems
390 *
391 * 30 2/14/98 10:48p Jason
392 * got preferred rendering working
393 *
394 * 29 2/12/98 4:20p Matt
395 * Made letterbox window shorter.
396 *
397 * 28 1/28/98 10:34a Samir
398 * Reticle.
399 *
400 * 27 1/13/98 4:27p Samir
401 * Fixed clear screen strangeness.
402 *
403 * 26 12/29/97 5:44p Samir
404 * Took out references to grViewport and old 2d library.
405 *
406 *
407 * 1 5/14/97 11:12a Jason
408 * file rendering stuff on the hud
409 *
410 * $NoKeywords: $
411 */
412
413 #include "hud.h"cxx . . $ `<file>/Descent3/hud.h`/
414 #include "gauges.h"cxx . . $ `<file>/Descent3/gauges.h`/
415 #include "grdefs.h"cxx . . $ `<file>/lib/grdefs.h`/
416 #include "game.h"cxx . . $ `<file>/Descent3/game.h`/
417 #include "ddio.h"cxx . . $ `<file>/ddio/ddio.h`/
418 #include "player.h"cxx . . $ `<file>/Descent3/player.h`/
419 #include "renderer.h"cxx . . $ `<file>/lib/renderer.h`/
420 #include "descent.h"cxx . . $ `<file>/Descent3/descent.h`/
421 #include "object.h"cxx . . $ `<file>/Descent3/object.h`/
422 #include "gamefont.h"cxx . . $ `<file>/Descent3/gamefont.h`/
423 #include "polymodel.h"cxx . . $ `<file>/model/polymodel.h`/
424 #include "cockpit.h"cxx . . $ `<file>/Descent3/cockpit.h`/
425 #include "game2dll.h"cxx . . $ `<file>/lib/game2dll.h`/
426 #include "ship.h"cxx . . $ `<file>/Descent3/ship.h`/
427 #include "pilot.h"cxx . . $ `<file>/Descent3/pilot.h`/
428 #include "mem.h"cxx . . $ `<file>/mem/mem.h`/
429 #include "d3music.h"cxx . . $ `<file>/Descent3/d3music.h`/
430 #include "demofile.h"cxx . . $ `<file>/lib/demofile.h`/
431 #include "stringtable.h"cxx . . $ `<file>/Descent3/stringtable.h`/
432 #include "pstring.h"cxx . . $ `<file>/misc/pstring.h`/
433 #include "config.h"cxx . . $ `<file>/Descent3/config.h`/
434
435 #include <stdio.h>
436 #include <stdlib.h>
437 #include <stdarg.h>
438 #include <string.h>
439 #include "gamecinematics.h"cxx . . $ `<file>/Descent3/gamecinematics.h`/
440 #include "CtlCfgElem.h"cxx . . $ `<file>/Descent3/CtlCfgElem.h`/
441 #include "ctlconfig.h"cxx . . $ `<file>/Descent3/ctlconfig.h`/
442
443 //////////////////////////////////////////////////////////////////////////////
444 // constants
445
446 #define FRAMERATE_TIME_DELAYcxx . . $ `Descent3/hud.cpp:446:9`! 0.25 // update every quarter second
447
448 //////////////////////////////////////////////////////////////////////////////
449
450 // PLAYER SAVEGAME PREFERENCES START
451 // determines what's displayable on the hud
452 #ifdef E3_DEMO
453 tStatMask Hud_stat_mask = STAT_TIMER;
454 #else
455 tStatMaskcxx . . $ tStatMask# Hud_stat_maskcxx . . $ Hud_stat_mask. = 0;
456 #endif
457
458 #define STAT_SCOREcxx . . $ `Descent3/hud.cpp:458:9`! STAT_TIMERcxx . . $ `Descent3/hud.h:286:9`!
459
460 // PLAYER SAVEGAME PREFERENCES END
461
462 // hud aspect
463 float Hud_aspect_xcxx . . $ Hud_aspect_x. = 1.0f;
464 float Hud_aspect_ycxx . . $ Hud_aspect_y. = 1.0f;
465 bool Small_hud_flagcxx . . $ Small_hud_flag. = false; // changes how hud items are drawn in small huds.
466
467 // used by reticle system.
468 static int16_t Ret_x_offcxx . . $ Ret_x_off., Ret_y_offcxx . . $ Ret_y_off.;
469 static char Reticle_prefixcxx . . $ Reticle_prefix.[PSFILENAME_LENcxx . . $ `lib/pstypes.h:31:9`! + 1];
470
471 // Hud mode of display
472 static tHUDModecxx . . $ tHUDMode# Hud_modecxx . . $ Hud_mode. = HUD_COCKPITcxx . . $ HUD_COCKPIT.;
473
474 // hud item array.
475 static tHUDItemcxx . . $ tHUDItem# HUD_arraycxx . . $ HUD_array.[MAX_HUD_ITEMScxx . . $ `Descent3/hud.h:306:9`!];
476
477 #define HUDITEMUSEDcxx . . $ `Descent3/hud.cpp:477:9`!(_c) (HUD_array[_c].stat ? true : false)
478
479 // hud resource structure
480 struct sHUDResourcescxx . . $ sHUDResources# HUD_resourcescxx . . $ HUD_resources.;
481
482 // initializes non configurable hud items.
483 static void InitDefaultHUDItemscxx . . $ InitDefaultHUDItems(49f6e7a06ebc5aa8).();
484
485 // initializes items based off their type (information, etc.)
486 static void InitHUDItemcxx . . $ InitHUDItem(6f8b289b64501713).(int new_item, tHUDItemcxx . . $ tHUDItem# *item);
487
488 // iterate through entire hud item list to draw.
489 static void RenderHUDItemscxx . . $ RenderHUDItems(ed53e3bbd3fa2f69).(tStatMaskcxx . . $ tStatMask# stat_mask);
490
491 // renders the reticle
492 static void RenderReticlecxx . . $ RenderReticle(49f6e7a06ebc5aa8).();
493
494 // renders missile reticle
495 static void RenderMissileReticlecxx . . $ RenderMissileReticle(49f6e7a06ebc5aa8).();
496
497 // renders zoom reticle
498 static void RenderZoomReticlecxx . . $ RenderZoomReticle(49f6e7a06ebc5aa8).();
499
500 // hack!
501
502 // functions in HudDisplay.cpp
503 extern void HudDisplayRoutercxx . . $ HudDisplayRouter(c7a20e4e05358911).(tHUDItemcxx . . $ tHUDItem# *item);
504
505 bool Hud_show_controlscxx . . $ Hud_show_controls. = false;
506
507 //////////////////////////////////////////////////////////////////////////////
508
509 // initializes hud.
510 void InitHUDcxx . . $ InitHUD(49f6e7a06ebc5aa8).() {
511 int i;
512 extern bool HUD_disabledcxx . . $ HUD_disabled.; // from gameloop.cpp
513
514 for (i = 0; i < MAX_HUD_ITEMScxx . . $ `Descent3/hud.h:306:9`!; i++) {
515 HUD_arraycxx . . $ HUD_array.[i].statcxx . . $ tHUDItem#stat. = 0;
516 HUD_arraycxx . . $ HUD_array.[i].flagscxx . . $ tHUDItem#flags. = 0;
517 HUD_arraycxx . . $ HUD_array.[i].idcxx . . $ tHUDItem#id. = HUD_INVALID_IDcxx . . $ `Descent3/hud.h:453:9`!;
518 }
519
520 // load static hud image resources to be used by HudDisplay.cpp
521 HUD_resourcescxx . . $ HUD_resources..arrow_bmpcxx . . $ sHUDResources#arrow_bmp. = -1;
522 HUD_resourcescxx . . $ HUD_resources..goal_bmpcxx . . $ sHUDResources#goal_bmp. = -1;
523 HUD_resourcescxx . . $ HUD_resources..goal_complete_bmpcxx . . $ sHUDResources#goal_complete_bmp. = -1;
524 HUD_resourcescxx . . $ HUD_resources..lock_bmpcxx . . $ sHUDResources#lock_bmp.[0] = -1;
525 HUD_resourcescxx . . $ HUD_resources..lock_bmpcxx . . $ sHUDResources#lock_bmp.[1] = -1;
526 HUD_resourcescxx . . $ HUD_resources..wpn_bmpcxx . . $ sHUDResources#wpn_bmp. = -1;
527 HUD_resourcescxx . . $ HUD_resources..dot_bmpcxx . . $ sHUDResources#dot_bmp. = -1;
528 HUD_resourcescxx . . $ HUD_resources..antigrav_bmpcxx . . $ sHUDResources#antigrav_bmp.[0] = -1;
529 HUD_resourcescxx . . $ HUD_resources..antigrav_bmpcxx . . $ sHUDResources#antigrav_bmp.[1] = -1;
530 strcpy(HUD_resourcescxx . . $ HUD_resources..hud_inf_namecxx . . $ sHUDResources#hud_inf_name., "hud.inf");
531
532 strcpy(Reticle_prefixcxx . . $ Reticle_prefix., "ret");
533 Ret_x_offcxx . . $ Ret_x_off. = 0;
534 Ret_y_offcxx . . $ Ret_y_off. = 0;
535
536 for (i = 0; i < NUM_SHIELD_GAUGE_FRAMEScxx . . $ `Descent3/hud.h:342:9`!; i++)
537 HUD_resourcescxx . . $ HUD_resources..shield_bmpcxx . . $ sHUDResources#shield_bmp.[i] = -1;
538 HUD_resourcescxx . . $ HUD_resources..energy_bmpcxx . . $ sHUDResources#energy_bmp. = -1;
539 HUD_resourcescxx . . $ HUD_resources..afterburn_bmpcxx . . $ sHUDResources#afterburn_bmp. = -1;
540 HUD_resourcescxx . . $ HUD_resources..invpulse_bmpcxx . . $ sHUDResources#invpulse_bmp. = -1;
541
542 // this call may be unnecessary since it's called again in InitCockpit.
543 // InitReticle(-1,-1); // initialize reticle system
544
545 // scrollback windows
546 ResetGameMessagescxx . . $ ResetGameMessages(49f6e7a06ebc5aa8).(); // resets game message rollback screen.
547 ResetHUDMessagescxx . . $ ResetHUDMessages(49f6e7a06ebc5aa8).();
548 HUD_disabledcxx . . $ HUD_disabled. = 0;
549 }
550
551 // closes hud.
552 void CloseHUDcxx . . $ CloseHUD(49f6e7a06ebc5aa8).() {
553 int i;
554
555 CloseHUDMessageConsolecxx . . $ CloseHUDMessageConsole(49f6e7a06ebc5aa8).(); // closes down rollback console
556 CloseGameMessageConsolecxx . . $ CloseGameMessageConsole(49f6e7a06ebc5aa8).(); // closes game journal rollback
557 ResetGameMessagescxx . . $ ResetGameMessages(49f6e7a06ebc5aa8).(); // reset game message system.
558 ResetHUDMessagescxx . . $ ResetHUDMessages(49f6e7a06ebc5aa8).();
559
560 // free hud items.
561 for (i = 0; i < MAX_HUD_ITEMScxx . . $ `Descent3/hud.h:306:9`!; i++) {
562 if (HUD_arraycxx . . $ HUD_array.[i].statcxx . . $ tHUDItem#stat.) {
563 FreeHUDItemcxx . . $ FreeHUDItem(d4f767463ce0a6b3).(i);
564 }
565 }
566 }
567
568 tHUDItemcxx . . $ tHUDItem# *GetHUDItemcxx . . $ GetHUDItem(59e21a775e1fa362).(int id) { return &HUD_arraycxx . . $ HUD_array.[id]; }
569
570 // initializes hud.
571 void InitShipHUDcxx . . $ InitShipHUD(d4f767463ce0a6b3).(int ship) {
572 int i;
573
574 // load static hud image resources to be used by HudDisplay.cpp
575 HUD_resourcescxx . . $ HUD_resources..arrow_bmpcxx . . $ sHUDResources#arrow_bmp. = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("hudarrow.ogf", 0);
576 HUD_resourcescxx . . $ HUD_resources..goal_bmpcxx . . $ sHUDResources#goal_bmp. = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("hudgoal.ogf", 0);
577 HUD_resourcescxx . . $ HUD_resources..goal_complete_bmpcxx . . $ sHUDResources#goal_complete_bmp. = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("hudgoalon.ogf", 0);
578 HUD_resourcescxx . . $ HUD_resources..lock_bmpcxx . . $ sHUDResources#lock_bmp.[0] = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("hudlockl.ogf", 0);
579 HUD_resourcescxx . . $ HUD_resources..lock_bmpcxx . . $ sHUDResources#lock_bmp.[1] = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("hudlockr.ogf", 0);
580 HUD_resourcescxx . . $ HUD_resources..wpn_bmpcxx . . $ sHUDResources#wpn_bmp. = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("hudicon.ogf", 0);
581 HUD_resourcescxx . . $ HUD_resources..dot_bmpcxx . . $ sHUDResources#dot_bmp. = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("huddot.ogf", 0);
582 HUD_resourcescxx . . $ HUD_resources..antigrav_bmpcxx . . $ sHUDResources#antigrav_bmp.[0] = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("hudantigravl.ogf", 0);
583 HUD_resourcescxx . . $ HUD_resources..antigrav_bmpcxx . . $ sHUDResources#antigrav_bmp.[1] = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("hudantigravr.ogf", 0);
584
585 for (i = 0; i < NUM_SHIELD_GAUGE_FRAMEScxx . . $ `Descent3/hud.h:342:9`!; i++)
586 HUD_resourcescxx . . $ HUD_resources..shield_bmpcxx . . $ sHUDResources#shield_bmp.[i] = -1;
587 HUD_resourcescxx . . $ HUD_resources..energy_bmpcxx . . $ sHUDResources#energy_bmp. = -1;
588 HUD_resourcescxx . . $ HUD_resources..afterburn_bmpcxx . . $ sHUDResources#afterburn_bmp. = -1;
589 HUD_resourcescxx . . $ HUD_resources..invpulse_bmpcxx . . $ sHUDResources#invpulse_bmp. = -1;
590
591 // sets current hud mode static global
592 // DAJ Current_pilot.get_hud_data((uint8_t *)&Hud_mode);
593 uint8_tcxx . . $ uint8_t# hud_tmp;
594 Current_pilotcxx . . $ Current_pilot..get_hud_datacxx . . $ pilot#get_hud_data(c4a38c24677fe9fd).(&hud_tmp);
595 Hud_modecxx . . $ Hud_mode. = (tHUDModecxx . . $ tHUDMode#)hud_tmp;
596 }
597
598 // closes hud for current ship
599 void CloseShipHUDcxx . . $ CloseShipHUD(49f6e7a06ebc5aa8).() {
600 FreeReticlecxx . . $ FreeReticle(49f6e7a06ebc5aa8).();
601
602 // free hud resources
603 bm_FreeBitmapcxx . . $ bm_FreeBitmap(d4f767463ce0a6b3).(HUD_resourcescxx . . $ HUD_resources..antigrav_bmpcxx . . $ sHUDResources#antigrav_bmp.[1]);
604 bm_FreeBitmapcxx . . $ bm_FreeBitmap(d4f767463ce0a6b3).(HUD_resourcescxx . . $ HUD_resources..antigrav_bmpcxx . . $ sHUDResources#antigrav_bmp.[0]);
605 bm_FreeBitmapcxx . . $ bm_FreeBitmap(d4f767463ce0a6b3).(HUD_resourcescxx . . $ HUD_resources..dot_bmpcxx . . $ sHUDResources#dot_bmp.);
606 bm_FreeBitmapcxx . . $ bm_FreeBitmap(d4f767463ce0a6b3).(HUD_resourcescxx . . $ HUD_resources..wpn_bmpcxx . . $ sHUDResources#wpn_bmp.);
607 bm_FreeBitmapcxx . . $ bm_FreeBitmap(d4f767463ce0a6b3).(HUD_resourcescxx . . $ HUD_resources..lock_bmpcxx . . $ sHUDResources#lock_bmp.[1]);
608 bm_FreeBitmapcxx . . $ bm_FreeBitmap(d4f767463ce0a6b3).(HUD_resourcescxx . . $ HUD_resources..lock_bmpcxx . . $ sHUDResources#lock_bmp.[0]);
609 bm_FreeBitmapcxx . . $ bm_FreeBitmap(d4f767463ce0a6b3).(HUD_resourcescxx . . $ HUD_resources..goal_complete_bmpcxx . . $ sHUDResources#goal_complete_bmp.);
610 bm_FreeBitmapcxx . . $ bm_FreeBitmap(d4f767463ce0a6b3).(HUD_resourcescxx . . $ HUD_resources..goal_bmpcxx . . $ sHUDResources#goal_bmp.);
611 bm_FreeBitmapcxx . . $ bm_FreeBitmap(d4f767463ce0a6b3).(HUD_resourcescxx . . $ HUD_resources..arrow_bmpcxx . . $ sHUDResources#arrow_bmp.);
612 }
613
614 // places an item on the hud
615 void AddHUDItemcxx . . $ AddHUDItem(c7a20e4e05358911).(tHUDItemcxx . . $ tHUDItem# *item) {
616 // find free hud slot.
617 int i;
618
619 for (i = 0; i < MAX_HUD_ITEMScxx . . $ `Descent3/hud.h:306:9`!; i++) {
620 if (!HUD_arraycxx . . $ HUD_array.[i].statcxx . . $ tHUDItem#stat.) {
621 // we will initialize the hud item.
622 InitHUDItemcxx . . $ InitHUDItem(6f8b289b64501713).(i, item);
623 break;
624 }
625 }
626
627 if (i == MAX_HUD_ITEMScxx . . $ `Descent3/hud.h:306:9`!) {
628 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Unable to add hud item (type=%d).\n", item->type);
629 }
630 }
631
632 // resets hud
633 void ResetHUDcxx . . $ ResetHUD(49f6e7a06ebc5aa8).() {
634 int i;
635
636 for (i = 0; i < MAX_HUD_ITEMScxx . . $ `Descent3/hud.h:306:9`!; i++) {
637 if (HUD_arraycxx . . $ HUD_array.[i].statcxx . . $ tHUDItem#stat. && !(HUD_arraycxx . . $ HUD_array.[i].flagscxx . . $ tHUDItem#flags. & HUD_FLAG_LEVELcxx . . $ `Descent3/hud.h:451:9`!) && !(HUD_arraycxx . . $ HUD_array.[i].flagscxx . . $ tHUDItem#flags. & HUD_FLAG_PERSISTANTcxx . . $ `Descent3/hud.h:449:9`!)) {
638 FreeHUDItemcxx . . $ FreeHUDItem(d4f767463ce0a6b3).(i);
639 }
640 }
641 }
642
643 // clears out HUD level items
644 void ResetHUDLevelItemscxx . . $ ResetHUDLevelItems(49f6e7a06ebc5aa8).() {
645 int i;
646 for (i = 0; i < MAX_HUD_ITEMScxx . . $ `Descent3/hud.h:306:9`!; i++) {
647 if (HUD_arraycxx . . $ HUD_array.[i].statcxx . . $ tHUDItem#stat. && (HUD_arraycxx . . $ HUD_array.[i].flagscxx . . $ tHUDItem#flags. & HUD_FLAG_LEVELcxx . . $ `Descent3/hud.h:451:9`!)) {
648 FreeHUDItemcxx . . $ FreeHUDItem(d4f767463ce0a6b3).(i);
649 }
650 }
651 }
652
653 // from game.cpp
654 extern void InitGameScreencxx . . $ InitGameScreen(3e454b8ccf442868).(int, int);
655 extern bool Dedicated_servercxx . . $ Dedicated_server.;
656
657 // manually sets the cockpit display.
658 void SetHUDModecxx . . $ SetHUDMode(1efe68d6753032ab).(tHUDModecxx . . $ tHUDMode# mode) {
659 static int saved_window_w = 0, saved_window_h = 0;
660
661 if (Dedicated_servercxx . . $ Dedicated_server.)
662 return;
663
664 if (GetScreenModecxx . . $ GetScreenMode(b126dc7c1de90089).() != SM_GAMEcxx . . $ SM_GAME.) {
665 #ifdef _DEBUGcxx . . $ `<built-in>:482:9`!
666 Int3cxx . . $ `misc/pserror.h:247:9`!();
667 #endif
668 return;
669 }
670
671 // clear the screen.
672 Clear_screencxx . . $ Clear_screen. = 4;
673
674 // free poly model of cockpit if we're not switching to a cockpit mode.
675 if (Hud_modecxx . . $ Hud_mode. == HUD_COCKPITcxx . . $ HUD_COCKPIT. && IsValidCockpitcxx . . $ IsValidCockpit(c9857a73d68e59ba).()) {
676 if (mode == HUD_LETTERBOXcxx . . $ HUD_LETTERBOX. || mode == HUD_OBSERVERcxx . . $ HUD_OBSERVER.) {
677 QuickCloseCockpitcxx . . $ QuickCloseCockpit(49f6e7a06ebc5aa8).();
678 } else if (mode != HUD_COCKPITcxx . . $ HUD_COCKPIT.) {
679 CloseCockpitcxx . . $ CloseCockpit(49f6e7a06ebc5aa8).();
680 }
681 }
682
683 // do cockpit specific thing.
684 redo_hud_switch:
685 switch (mode) {
686 uint16_tcxx . . $ uint16_t# cp_hud_stat, cp_hud_graphical_stat;
687
688 case HUD_LETTERBOXcxx . . $ HUD_LETTERBOX.:
689 // our objective here is to display a letterbox screen for the cockpit.
690 // we save the old width and height of the windows.
691 saved_window_w = Game_window_wcxx . . $ Game_window_w.;
692 saved_window_h = Game_window_hcxx . . $ Game_window_h.;
693
694 Game_window_wcxx . . $ Game_window_w. = Max_window_wcxx . . $ Max_window_w.;
695 Game_window_hcxx . . $ Game_window_h. = Max_window_hcxx . . $ Max_window_h. - (Max_window_hcxx . . $ Max_window_h. / 3);
696
697 if (Game_window_hcxx . . $ Game_window_h. > Max_window_hcxx . . $ Max_window_h.)
698 Game_window_hcxx . . $ Game_window_h. = Max_window_hcxx . . $ Max_window_h.;
699
700 if (Game_window_wcxx . . $ Game_window_w. > Max_window_wcxx . . $ Max_window_w.)
701 Game_window_wcxx . . $ Game_window_w. = Max_window_wcxx . . $ Max_window_w.;
702
703 Game_window_xcxx . . $ Game_window_x. = (Max_window_wcxx . . $ Max_window_w. - Game_window_wcxx . . $ Game_window_w.) / 2;
704 Game_window_ycxx . . $ Game_window_y. = (Max_window_hcxx . . $ Max_window_h. - Game_window_hcxx . . $ Game_window_h.) / 2;
705
706 SetHUDStatecxx . . $ SetHUDState(161476d40f03fa8c).(STAT_MESSAGEScxx . . $ `Descent3/hud.h:280:9`! | (Hud_stat_maskcxx . . $ Hud_stat_mask. & STAT_FPScxx . . $ `Descent3/hud.h:275:9`!), 0);
707 break;
708
709 case HUD_FULLSCREENcxx . . $ HUD_FULLSCREEN.:
710 // our objective here is to display a fullscreen box that is resizable.
711 LoadHUDConfigcxx . . $ LoadHUDConfig(7fb9cb4cf7d8fbd3).(HUD_resourcescxx . . $ HUD_resources..hud_inf_namecxx . . $ sHUDResources#hud_inf_name.);
712
713 InitGameScreencxx . . $ InitGameScreen(3e454b8ccf442868).(saved_window_w ? saved_window_w : Game_window_wcxx . . $ Game_window_w., saved_window_h ? saved_window_h : Game_window_hcxx . . $ Game_window_h.);
714 saved_window_w = 0;
715 saved_window_h = 0;
716
717 Current_pilotcxx . . $ Current_pilot..get_hud_datacxx . . $ pilot#get_hud_data(c4a38c24677fe9fd).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, &cp_hud_stat, &cp_hud_graphical_stat);
718
719 SetHUDStatecxx . . $ SetHUDState(161476d40f03fa8c).(cp_hud_stat | STAT_SCOREcxx . . $ `Descent3/hud.cpp:458:9`! | (Hud_stat_maskcxx . . $ Hud_stat_mask. & STAT_FPScxx . . $ `Descent3/hud.h:275:9`!), cp_hud_graphical_stat);
720
721 break;
722
723 case HUD_COCKPITcxx . . $ HUD_COCKPIT.:
724 if (!IsValidCockpitcxx . . $ IsValidCockpit(c9857a73d68e59ba).()) {
725 mode = HUD_FULLSCREENcxx . . $ HUD_FULLSCREEN.;
726 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).(TXT_NOCOCKPITcxx . . $ `Descent3/stringtable.h:577:9`!);
727 goto redo_hud_switch;
728 }
729 if (Hud_modecxx . . $ Hud_mode. == HUD_COCKPITcxx . . $ HUD_COCKPIT. || Hud_modecxx . . $ Hud_mode. == HUD_LETTERBOXcxx . . $ HUD_LETTERBOX. || Hud_modecxx . . $ Hud_mode. == HUD_OBSERVERcxx . . $ HUD_OBSERVER.)
730 QuickOpenCockpitcxx . . $ QuickOpenCockpit(49f6e7a06ebc5aa8).();
731 else
732 OpenCockpitcxx . . $ OpenCockpit(49f6e7a06ebc5aa8).();
733
734 InitGameScreencxx . . $ InitGameScreen(3e454b8ccf442868).(saved_window_w ? saved_window_w : Game_window_wcxx . . $ Game_window_w., saved_window_h ? saved_window_h : Game_window_hcxx . . $ Game_window_h.);
735
736 saved_window_w = 0;
737 saved_window_h = 0;
738
739 Current_pilotcxx . . $ Current_pilot..get_hud_datacxx . . $ pilot#get_hud_data(c4a38c24677fe9fd).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, &cp_hud_stat, &cp_hud_graphical_stat);
740
741 SetHUDStatecxx . . $ SetHUDState(161476d40f03fa8c).(STAT_MESSAGEScxx . . $ `Descent3/hud.h:280:9`! | STAT_SHIELDScxx . . $ `Descent3/hud.h:276:9`! | STAT_ENERGYcxx . . $ `Descent3/hud.h:277:9`! | STAT_GOALScxx . . $ `Descent3/hud.h:285:9`! | STAT_CUSTOMcxx . . $ `Descent3/hud.h:287:9`! | STAT_AFTERBURNcxx . . $ `Descent3/hud.h:283:9`! |
742 STAT_INVENTORYcxx . . $ `Descent3/hud.h:281:9`! | STAT_CNTRMEASUREcxx . . $ `Descent3/hud.h:288:9`! | STAT_SCOREcxx . . $ `Descent3/hud.cpp:458:9`! | (Hud_stat_maskcxx . . $ Hud_stat_mask. & STAT_WARNINGcxx . . $ `Descent3/hud.h:284:9`!) |
743 (Hud_stat_maskcxx . . $ Hud_stat_mask. & STAT_FPScxx . . $ `Descent3/hud.h:275:9`!) | (Hud_stat_maskcxx . . $ Hud_stat_mask. & STAT_SCOREcxx . . $ `Descent3/hud.cpp:458:9`!),
744 (cp_hud_graphical_stat & STAT_WARNINGcxx . . $ `Descent3/hud.h:284:9`!));
745 break;
746
747 case HUD_OBSERVERcxx . . $ HUD_OBSERVER.:
748 InitGameScreencxx . . $ InitGameScreen(3e454b8ccf442868).(saved_window_w ? saved_window_w : Game_window_wcxx . . $ Game_window_w., saved_window_h ? saved_window_h : Game_window_hcxx . . $ Game_window_h.);
749 saved_window_w = 0;
750 saved_window_h = 0;
751
752 SetHUDStatecxx . . $ SetHUDState(161476d40f03fa8c).(STAT_MESSAGEScxx . . $ `Descent3/hud.h:280:9`! | (Hud_stat_maskcxx . . $ Hud_stat_mask. & STAT_FPScxx . . $ `Descent3/hud.h:275:9`!), 0);
753 break;
754
755 default:
756 Int3cxx . . $ `misc/pserror.h:247:9`!();
757 }
758
759 // save out current hud mode
760 // JEFF: (only if going from HUD_FULLSCREEN->HUD_COCKPIT or vice-versa)
761 if ((Hud_modecxx . . $ Hud_mode. == HUD_FULLSCREENcxx . . $ HUD_FULLSCREEN. && mode == HUD_COCKPITcxx . . $ HUD_COCKPIT.) || (Hud_modecxx . . $ Hud_mode. == HUD_COCKPITcxx . . $ HUD_COCKPIT. && mode == HUD_FULLSCREENcxx . . $ HUD_FULLSCREEN.)) {
762 uint8_tcxx . . $ uint8_t# bmode = mode; // DAJ MAC using enums always int
763 Current_pilotcxx . . $ Current_pilot..set_hud_datacxx . . $ pilot#set_hud_data(c4a38c24677fe9fd).((uint8_tcxx . . $ uint8_t# *)&bmode);
764 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Saving new hud mode to pilot\n");
765 PltWriteFilecxx . . $ PltWriteFile(98d330f13870b5ba).(&Current_pilotcxx . . $ Current_pilot.);
766 }
767
768 Hud_modecxx . . $ Hud_mode. = mode;
769 }
770
771 // the current cockpit mode;
772 tHUDModecxx . . $ tHUDMode# GetHUDModecxx . . $ GetHUDMode(d2d05048dda10524).() { return Hud_modecxx . . $ Hud_mode.; }
773
774 // toggle the hud between cockput & fullscreen modes
775 void ToggleHUDModecxx . . $ ToggleHUDMode(49f6e7a06ebc5aa8).() {
776 if (GetHUDModecxx . . $ GetHUDMode(d2d05048dda10524).() == HUD_COCKPITcxx . . $ HUD_COCKPIT.)
777 SetHUDModecxx . . $ SetHUDMode(1efe68d6753032ab).(HUD_FULLSCREENcxx . . $ HUD_FULLSCREEN.);
778 else if (GetHUDModecxx . . $ GetHUDMode(d2d05048dda10524).() == HUD_FULLSCREENcxx . . $ HUD_FULLSCREEN.)
779 SetHUDModecxx . . $ SetHUDMode(1efe68d6753032ab).(HUD_COCKPITcxx . . $ HUD_COCKPIT.);
780 }
781
782 // sets the hud item state(what's visible, how it's drawn, etc)
783 void SetHUDStatecxx . . $ SetHUDState(161476d40f03fa8c).(uint16_tcxx . . $ uint16_t# hud_mask, uint16_tcxx . . $ uint16_t# hud_gr_mask) {
784 int i;
785
786 Hud_stat_maskcxx . . $ Hud_stat_mask. = (hud_mask | hud_gr_mask);
787
788 // now go through each hud item, check if it's hud stat mask includes the requested hud_gr_mask
789 // if it does, then set hud mask to graphical
790 for (i = 0; i < MAX_HUD_ITEMScxx . . $ `Descent3/hud.h:306:9`!; i++) {
791 HUD_arraycxx . . $ HUD_array.[i].statcxx . . $ tHUDItem#stat. &= ~(STAT_GRAPHICALcxx . . $ `Descent3/hud.h:295:9`!);
792 if (HUD_arraycxx . . $ HUD_array.[i].statcxx . . $ tHUDItem#stat. & hud_gr_mask)
793 HUD_arraycxx . . $ HUD_array.[i].statcxx . . $ tHUDItem#stat. |= STAT_GRAPHICALcxx . . $ `Descent3/hud.h:295:9`!;
794 }
795 }
796
797 // initializes items based off their type (information, etc.)
798 void InitHUDItemcxx . . $ InitHUDItem(6f8b289b64501713).(int new_item, tHUDItemcxx . . $ tHUDItem# *item) {
799 ASSERTcxx . . $ `misc/pserror.h:246:9`!(new_item < MAX_HUD_ITEMScxx . . $ `Descent3/hud.h:306:9`!);
800 uint16_tcxx . . $ uint16_t# stat = 0x0000;
801
802 item->idcxx . . $ tHUDItem#id. = new_item;
803
804 switch (item->typecxx . . $ tHUDItem#type.) {
805 case HUD_ITEM_PRIMARYcxx . . $ `Descent3/hud.h:432:9`!:
806 stat = STAT_PRIMARYLOADcxx . . $ `Descent3/hud.h:278:9`!;
807 break;
808
809 case HUD_ITEM_SECONDARYcxx . . $ `Descent3/hud.h:433:9`!:
810 stat = STAT_SECONDARYLOADcxx . . $ `Descent3/hud.h:279:9`!;
811 break;
812
813 case HUD_ITEM_SHIELDcxx . . $ `Descent3/hud.h:434:9`!:
814 stat = STAT_SHIELDScxx . . $ `Descent3/hud.h:276:9`!;
815 break;
816
817 case HUD_ITEM_ENERGYcxx . . $ `Descent3/hud.h:435:9`!:
818 stat = STAT_ENERGYcxx . . $ `Descent3/hud.h:277:9`!;
819 break;
820
821 case HUD_ITEM_AFTERBURNERcxx . . $ `Descent3/hud.h:436:9`!:
822 stat = STAT_AFTERBURNcxx . . $ `Descent3/hud.h:283:9`!;
823 break;
824
825 case HUD_ITEM_INVENTORYcxx . . $ `Descent3/hud.h:437:9`!:
826 stat = STAT_INVENTORYcxx . . $ `Descent3/hud.h:281:9`!;
827 break;
828
829 case HUD_ITEM_SHIPSTATUScxx . . $ `Descent3/hud.h:438:9`!:
830 stat = STAT_SHIPcxx . . $ `Descent3/hud.h:282:9`!;
831 break;
832
833 case HUD_ITEM_CNTRMEASUREcxx . . $ `Descent3/hud.h:442:9`!:
834 stat = STAT_CNTRMEASUREcxx . . $ `Descent3/hud.h:288:9`!;
835 break;
836
837 case HUD_ITEM_CUSTOMTEXTcxx . . $ `Descent3/hud.h:444:9`!:
838 if (item->datacxx . . $ tHUDItem#data..textcxx . . $ tHUDItem#$anonymous_type_1#text.) {
839 char *text = mem_strdupcxx . . $ `mem/mem.h:81:9`!(item->data.text);
840 HUD_arraycxx . . $ HUD_array.[new_item].datacxx . . $ tHUDItem#data..textcxx . . $ tHUDItem#$anonymous_type_1#text. = text;
841 }
842 stat = STAT_CUSTOMcxx . . $ `Descent3/hud.h:287:9`!;
843 break;
844
845 case HUD_ITEM_CUSTOMTEXT2cxx . . $ `Descent3/hud.h:447:9`!: // malloc buffer to be updated later
846 HUD_arraycxx . . $ HUD_array.[new_item].datacxx . . $ tHUDItem#data..textcxx . . $ tHUDItem#$anonymous_type_1#text. = (char *)mem_malloccxx . . $ `mem/mem.h:79:9`!(item->buffer_size);
847 HUD_arraycxx . . $ HUD_array.[new_item].datacxx . . $ tHUDItem#data..textcxx . . $ tHUDItem#$anonymous_type_1#text.[0] = 0;
848 HUD_arraycxx . . $ HUD_array.[new_item].buffer_sizecxx . . $ tHUDItem#buffer_size. = item->buffer_sizecxx . . $ tHUDItem#buffer_size.;
849 stat = STAT_CUSTOMcxx . . $ `Descent3/hud.h:287:9`!;
850 break;
851
852 case HUD_ITEM_CUSTOMIMAGEcxx . . $ `Descent3/hud.h:445:9`!:
853 stat = STAT_CUSTOMcxx . . $ `Descent3/hud.h:287:9`!;
854 break;
855
856 case HUD_ITEM_WARNINGScxx . . $ `Descent3/hud.h:439:9`!:
857 stat = STAT_WARNINGcxx . . $ `Descent3/hud.h:284:9`!;
858 break;
859
860 case HUD_ITEM_GOALScxx . . $ `Descent3/hud.h:440:9`!:
861 case HUD_ITEM_GOALSTATEScxx . . $ `Descent3/hud.h:441:9`!:
862 stat = STAT_GOALScxx . . $ `Descent3/hud.h:285:9`!;
863 break;
864
865 case HUD_ITEM_SCOREcxx . . $ `Descent3/hud.h:443:9`!:
866 stat = STAT_SCOREcxx . . $ `Descent3/hud.cpp:458:9`!;
867 break;
868
869 case HUD_ITEM_TIMERcxx . . $ `Descent3/hud.h:446:9`!:
870 HUD_arraycxx . . $ HUD_array.[new_item].datacxx . . $ tHUDItem#data..timer_handlecxx . . $ tHUDItem#$anonymous_type_1#timer_handle. = item->datacxx . . $ tHUDItem#data..timer_handlecxx . . $ tHUDItem#$anonymous_type_1#timer_handle.;
871 stat = STAT_CUSTOMcxx . . $ `Descent3/hud.h:287:9`!;
872 break;
873
874 default:
875 Int3cxx . . $ `misc/pserror.h:247:9`!();
876 }
877
878 // copy hud item structure.
879 HUD_arraycxx . . $ HUD_array.[new_item].xcxx . . $ tHUDItem#x. = item->xcxx . . $ tHUDItem#x.;
880 HUD_arraycxx . . $ HUD_array.[new_item].ycxx . . $ tHUDItem#y. = item->ycxx . . $ tHUDItem#y.;
881 HUD_arraycxx . . $ HUD_array.[new_item].xacxx . . $ tHUDItem#xa. = item->xacxx . . $ tHUDItem#xa.;
882 HUD_arraycxx . . $ HUD_array.[new_item].yacxx . . $ tHUDItem#ya. = item->yacxx . . $ tHUDItem#ya.;
883 HUD_arraycxx . . $ HUD_array.[new_item].xbcxx . . $ tHUDItem#xb. = item->xbcxx . . $ tHUDItem#xb.;
884 HUD_arraycxx . . $ HUD_array.[new_item].ybcxx . . $ tHUDItem#yb. = item->ybcxx . . $ tHUDItem#yb.;
885 HUD_arraycxx . . $ HUD_array.[new_item].txcxx . . $ tHUDItem#tx. = item->txcxx . . $ tHUDItem#tx.;
886 HUD_arraycxx . . $ HUD_array.[new_item].tycxx . . $ tHUDItem#ty. = item->tycxx . . $ tHUDItem#ty.;
887 HUD_arraycxx . . $ HUD_array.[new_item].grscalexcxx . . $ tHUDItem#grscalex. = item->grscalexcxx . . $ tHUDItem#grscalex.;
888 HUD_arraycxx . . $ HUD_array.[new_item].grscaleycxx . . $ tHUDItem#grscaley. = item->grscaleycxx . . $ tHUDItem#grscaley.;
889 HUD_arraycxx . . $ HUD_array.[new_item].typecxx . . $ tHUDItem#type. = item->typecxx . . $ tHUDItem#type.;
890 HUD_arraycxx . . $ HUD_array.[new_item].statcxx . . $ tHUDItem#stat. = item->statcxx . . $ tHUDItem#stat. | stat;
891 HUD_arraycxx . . $ HUD_array.[new_item].flagscxx . . $ tHUDItem#flags. = item->flagscxx . . $ tHUDItem#flags.;
892 HUD_arraycxx . . $ HUD_array.[new_item].alphacxx . . $ tHUDItem#alpha. = item->alphacxx . . $ tHUDItem#alpha.;
893 HUD_arraycxx . . $ HUD_array.[new_item].colorcxx . . $ tHUDItem#color. = item->colorcxx . . $ tHUDItem#color.;
894 HUD_arraycxx . . $ HUD_array.[new_item].tcolorcxx . . $ tHUDItem#tcolor. = item->tcolorcxx . . $ tHUDItem#tcolor.;
895 HUD_arraycxx . . $ HUD_array.[new_item].saturation_countcxx . . $ tHUDItem#saturation_count. = item->saturation_countcxx . . $ tHUDItem#saturation_count.;
896 HUD_arraycxx . . $ HUD_array.[new_item].render_fncxx . . $ tHUDItem#render_fn. = item->render_fncxx . . $ tHUDItem#render_fn.;
897 HUD_arraycxx . . $ HUD_array.[new_item].idcxx . . $ tHUDItem#id. = item->idcxx . . $ tHUDItem#id.;
898 HUD_arraycxx . . $ HUD_array.[new_item].dirty_rectcxx . . $ tHUDItem#dirty_rect..resetcxx . . $ t_dirty_rect#reset(49f6e7a06ebc5aa8).();
899 }
900
901 // Returns the item number if there's a customtext2 item, else -1
902 int FindCustomtext2HUDItemcxx . . $ FindCustomtext2HUDItem(b126dc7c1de90089).() {
903 int i;
904 for (i = 0; i < MAX_HUD_ITEMScxx . . $ `Descent3/hud.h:306:9`!; i++) {
905 if (HUD_arraycxx . . $ HUD_array.[i].statcxx . . $ tHUDItem#stat. && (HUD_arraycxx . . $ HUD_array.[i].typecxx . . $ tHUDItem#type. == HUD_ITEM_CUSTOMTEXT2cxx . . $ `Descent3/hud.h:447:9`!))
906 return i;
907 }
908
909 return -1;
910 }
911
912 // Updates the customtext2 item, if there is one
913 void UpdateCustomtext2HUDItemcxx . . $ UpdateCustomtext2HUDItem(fda57c8427c60377).(char *text) {
914 int i;
915
916 for (i = 0; i < MAX_HUD_ITEMScxx . . $ `Descent3/hud.h:306:9`!; i++) {
917 if (HUD_arraycxx . . $ HUD_array.[i].statcxx . . $ tHUDItem#stat. && (HUD_arraycxx . . $ HUD_array.[i].typecxx . . $ tHUDItem#type. == HUD_ITEM_CUSTOMTEXT2cxx . . $ `Descent3/hud.h:447:9`!)) {
918 ASSERTcxx . . $ `misc/pserror.h:246:9`!(HUD_array[i].data.text != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
919 strncpy(HUD_arraycxx . . $ HUD_array.[i].datacxx . . $ tHUDItem#data..textcxx . . $ tHUDItem#$anonymous_type_1#text., text, HUD_arraycxx . . $ HUD_array.[i].buffer_sizecxx . . $ tHUDItem#buffer_size.);
920 HUD_arraycxx . . $ HUD_array.[i].datacxx . . $ tHUDItem#data..textcxx . . $ tHUDItem#$anonymous_type_1#text.[HUD_arraycxx . . $ HUD_array.[i].buffer_sizecxx . . $ tHUDItem#buffer_size. - 1];
921 break;
922 }
923 }
924 }
925
926 // savegame system hooks
927 void SGSHudStatecxx . . $ SGSHudState(3639e799710acb68).(CFILEcxx . . $ CFILE# *fp) {
928 int i;
929 tHUDItemcxx . . $ tHUDItem# *huditem;
930
931 for (i = 0; i < MAX_HUD_ITEMScxx . . $ `Descent3/hud.h:306:9`!; i++) {
932 // save custom text2 and timer hud items
933 huditem = &HUD_arraycxx . . $ HUD_array.[i];
934 if (huditem->statcxx . . $ tHUDItem#stat.) {
935 if (huditem->typecxx . . $ tHUDItem#type. == HUD_ITEM_CUSTOMTEXT2cxx . . $ `Descent3/hud.h:447:9`!) {
936 cf_WriteShortcxx . . $ cf_WriteShort(d7cf1a05aca96fe5).(fp, (int16_t)huditem->statcxx . . $ tHUDItem#stat.);
937 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(fp, (int8_t)huditem->typecxx . . $ tHUDItem#type.);
938 cf_WriteShortcxx . . $ cf_WriteShort(d7cf1a05aca96fe5).(fp, huditem->xcxx . . $ tHUDItem#x.);
939 cf_WriteShortcxx . . $ cf_WriteShort(d7cf1a05aca96fe5).(fp, huditem->ycxx . . $ tHUDItem#y.);
940 cf_WriteIntcxx . . $ cf_WriteInt(966989f25543eb13).(fp, huditem->colorcxx . . $ tHUDItem#color.);
941 cf_WriteShortcxx . . $ cf_WriteShort(d7cf1a05aca96fe5).(fp, (int16_t)huditem->flagscxx . . $ tHUDItem#flags.);
942 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(fp, (int8_t)huditem->alphacxx . . $ tHUDItem#alpha.);
943
944 cf_WriteShortcxx . . $ cf_WriteShort(d7cf1a05aca96fe5).(fp, (int16_t)huditem->buffer_sizecxx . . $ tHUDItem#buffer_size.);
945 cf_WriteStringcxx . . $ cf_WriteString(643e1411966bd56c).(fp, huditem->datacxx . . $ tHUDItem#data..textcxx . . $ tHUDItem#$anonymous_type_1#text.);
946 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "sg: saved customtext2 (%x,%x,bufsize=%d)\n", huditem->x, huditem->y, huditem->buffer_size);
947 } else if (huditem->typecxx . . $ tHUDItem#type. == HUD_ITEM_TIMERcxx . . $ `Descent3/hud.h:446:9`!) {
948 cf_WriteShortcxx . . $ cf_WriteShort(d7cf1a05aca96fe5).(fp, (int16_t)huditem->statcxx . . $ tHUDItem#stat.);
949 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(fp, (int8_t)huditem->typecxx . . $ tHUDItem#type.);
950 cf_WriteShortcxx . . $ cf_WriteShort(d7cf1a05aca96fe5).(fp, huditem->xcxx . . $ tHUDItem#x.);
951 cf_WriteShortcxx . . $ cf_WriteShort(d7cf1a05aca96fe5).(fp, huditem->ycxx . . $ tHUDItem#y.);
952 cf_WriteIntcxx . . $ cf_WriteInt(966989f25543eb13).(fp, huditem->colorcxx . . $ tHUDItem#color.);
953 cf_WriteShortcxx . . $ cf_WriteShort(d7cf1a05aca96fe5).(fp, (int16_t)huditem->flagscxx . . $ tHUDItem#flags.);
954 cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(fp, (int8_t)huditem->alphacxx . . $ tHUDItem#alpha.);
955
956 cf_WriteIntcxx . . $ cf_WriteInt(966989f25543eb13).(fp, huditem->datacxx . . $ tHUDItem#data..timer_handlecxx . . $ tHUDItem#$anonymous_type_1#timer_handle.);
957 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "sg: restored timer (%x,%x,timer_hndl=%d)\n", huditem->x, huditem->y, huditem->data.timer_handle);
958 } else if (huditem->typecxx . . $ tHUDItem#type. == HUD_ITEM_CUSTOMTEXTcxx . . $ `Descent3/hud.h:444:9`!) {
959 // commented out because persistent hud messages are custom text, and its a mess to save the current
960 // state of hud persistent messages.
961 // cf_WriteShort(fp, (int16_t)huditem->stat);
962 // cf_WriteByte(fp, (int8_t)huditem->type);
963 // cf_WriteShort(fp, huditem->x);
964 // cf_WriteShort(fp, huditem->y);
965 // cf_WriteInt(fp, huditem->color);
966 // cf_WriteShort(fp, (int16_t)huditem->flags);
967 // cf_WriteByte(fp, (int8_t)huditem->alpha);
968 //
969 // cf_WriteString(fp, huditem->data.timer_handle);
970 }
971 }
972 }
973
974 cf_WriteShortcxx . . $ cf_WriteShort(d7cf1a05aca96fe5).(fp, 0); // mark end of saved hud items.
975 }
976
977 bool LGSHudStatecxx . . $ LGSHudState(254217fab7598d49).(CFILEcxx . . $ CFILE# *fp) {
978 // restore hud items
979 uint16_tcxx . . $ uint16_t# stat_mask = 0;
980
981 while ((stat_mask = (uint16_tcxx . . $ uint16_t#)cf_ReadShortcxx . . $ cf_ReadShort(30b00389b433b379).(fp)) != 0) {
982 tHUDItemcxx . . $ tHUDItem# huditem;
983 uint8_tcxx . . $ uint8_t# item_type = (uint8_tcxx . . $ uint8_t#)cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(fp);
984
985 memset(&huditem, 0, sizeof(huditem));
986 huditem.typecxx . . $ tHUDItem#type. = item_type;
987 huditem.statcxx . . $ tHUDItem#stat. = stat_mask;
988
989 switch (item_type) {
990 char *buffer;
991 extern void RenderHUDTimercxx . . $ RenderHUDTimer(c7a20e4e05358911).(tHUDItemcxx . . $ tHUDItem# * item);
992
993 case HUD_ITEM_CUSTOMTEXT2cxx . . $ `Descent3/hud.h:447:9`!:
994 huditem.xcxx . . $ tHUDItem#x. = cf_ReadShortcxx . . $ cf_ReadShort(30b00389b433b379).(fp);
995 huditem.ycxx . . $ tHUDItem#y. = cf_ReadShortcxx . . $ cf_ReadShort(30b00389b433b379).(fp);
996 huditem.colorcxx . . $ tHUDItem#color. = (ddgr_colorcxx . . $ ddgr_color#)cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(fp);
997 huditem.flagscxx . . $ tHUDItem#flags. = (uint16_tcxx . . $ uint16_t#)cf_ReadShortcxx . . $ cf_ReadShort(30b00389b433b379).(fp);
998 huditem.alphacxx . . $ tHUDItem#alpha. = (uint8_tcxx . . $ uint8_t#)cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(fp);
999
1000 huditem.buffer_sizecxx . . $ tHUDItem#buffer_size. = (int)cf_ReadShortcxx . . $ cf_ReadShort(30b00389b433b379).(fp);
1001 huditem.render_fncxx . . $ tHUDItem#render_fn. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; // use pointer to function void (*fn)(struct tHUDItem *)
1002 AddHUDItemcxx . . $ AddHUDItem(c7a20e4e05358911).(&huditem);
1003
1004 buffer = (char *)mem_malloccxx . . $ `mem/mem.h:79:9`!(huditem.buffer_size);
1005 cf_ReadStringcxx . . $ cf_ReadString(38cd788e4423eff6).(buffer, huditem.buffer_sizecxx . . $ tHUDItem#buffer_size., fp);
1006 UpdateCustomtext2HUDItemcxx . . $ UpdateCustomtext2HUDItem(fda57c8427c60377).(buffer);
1007 mem_freecxx . . $ `mem/mem.h:80:9`!(buffer);
1008 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "lg: restored customtext2 (%x,%x,bufsize=%d)\n", huditem.x, huditem.y, huditem.buffer_size);
1009 break;
1010
1011 case HUD_ITEM_TIMERcxx . . $ `Descent3/hud.h:446:9`!:
1012 huditem.xcxx . . $ tHUDItem#x. = cf_ReadShortcxx . . $ cf_ReadShort(30b00389b433b379).(fp);
1013 huditem.ycxx . . $ tHUDItem#y. = cf_ReadShortcxx . . $ cf_ReadShort(30b00389b433b379).(fp);
1014 huditem.colorcxx . . $ tHUDItem#color. = (ddgr_colorcxx . . $ ddgr_color#)cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(fp);
1015 huditem.flagscxx . . $ tHUDItem#flags. = (uint16_tcxx . . $ uint16_t#)cf_ReadShortcxx . . $ cf_ReadShort(30b00389b433b379).(fp);
1016 huditem.alphacxx . . $ tHUDItem#alpha. = (uint8_tcxx . . $ uint8_t#)cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(fp);
1017
1018 huditem.datacxx . . $ tHUDItem#data..timer_handlecxx . . $ tHUDItem#$anonymous_type_1#timer_handle. = cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(fp);
1019 huditem.render_fncxx . . $ tHUDItem#render_fn. = RenderHUDTimercxx . . $ RenderHUDTimer(c7a20e4e05358911).; // use pointer to function void (*fn)(struct tHUDItem *)
1020 AddHUDItemcxx . . $ AddHUDItem(c7a20e4e05358911).(&huditem);
1021 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "lg: restored timer (%x,%x,timer_hndl=%d)\n", huditem.x, huditem.y, huditem.data.timer_handle);
1022 break;
1023
1024 // case HUD_ITEM_CUSTOMTEXT:
1025 // break;
1026 default:
1027 return false;
1028 }
1029 }
1030
1031 return true;
1032 }
1033
1034 // frees hud items based off their type class.
1035 void FreeHUDItemcxx . . $ FreeHUDItem(d4f767463ce0a6b3).(int item) {
1036 ASSERTcxx . . $ `misc/pserror.h:246:9`!(item < MAX_HUD_ITEMScxx . . $ `Descent3/hud.h:306:9`!);
1037
1038 HUD_arraycxx . . $ HUD_array.[item].statcxx . . $ tHUDItem#stat. = 0;
1039 HUD_arraycxx . . $ HUD_array.[item].flagscxx . . $ tHUDItem#flags. = 0;
1040 HUD_arraycxx . . $ HUD_array.[item].idcxx . . $ tHUDItem#id. = HUD_INVALID_IDcxx . . $ `Descent3/hud.h:453:9`!;
1041 if (((HUD_arraycxx . . $ HUD_array.[item].typecxx . . $ tHUDItem#type. == HUD_ITEM_CUSTOMTEXTcxx . . $ `Descent3/hud.h:444:9`!) || (HUD_arraycxx . . $ HUD_array.[item].typecxx . . $ tHUDItem#type. == HUD_ITEM_CUSTOMTEXT2cxx . . $ `Descent3/hud.h:447:9`!)) &&
1042 HUD_arraycxx . . $ HUD_array.[item].datacxx . . $ tHUDItem#data..textcxx . . $ tHUDItem#$anonymous_type_1#text.) {
1043 mem_freecxx . . $ `mem/mem.h:80:9`!(HUD_array[item].data.text);
1044 HUD_arraycxx . . $ HUD_array.[item].datacxx . . $ tHUDItem#data..textcxx . . $ tHUDItem#$anonymous_type_1#text. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1045 }
1046 }
1047
1048 extern void RenderHUDScorecxx . . $ RenderHUDScore(c7a20e4e05358911).(tHUDItemcxx . . $ tHUDItem# *item);
1049
1050 // initializes non configurable hud items.
1051 void InitDefaultHUDItemscxx . . $ InitDefaultHUDItems(49f6e7a06ebc5aa8).() {
1052 tHUDItemcxx . . $ tHUDItem# huditem;
1053
1054 memset(&huditem, 0, sizeof(huditem));
1055 huditem.typecxx . . $ tHUDItem#type. = HUD_ITEM_SCOREcxx . . $ `Descent3/hud.h:443:9`!; // KEEP THIS
1056 huditem.statcxx . . $ tHUDItem#stat. = STAT_SCOREcxx . . $ `Descent3/hud.cpp:458:9`!; // This is bound to timer. in release builds, no timer code but just score
1057 huditem.xcxx . . $ tHUDItem#x. = 640; // position on HUD in 640,480 coordinates
1058 huditem.ycxx . . $ tHUDItem#y. = 5;
1059 huditem.colorcxx . . $ tHUDItem#color. = HUD_COLORcxx . . $ `Descent3/hud.h:307:9`!; // you can ignore this if you dont use this value passed into your render function
1060 huditem.render_fncxx . . $ tHUDItem#render_fn. = RenderHUDScorecxx . . $ RenderHUDScore(c7a20e4e05358911).; // use pointer to function void (*fn)(struct tHUDItem *)
1061 AddHUDItemcxx . . $ AddHUDItem(c7a20e4e05358911).(&huditem);
1062 }
1063
1064 // loads in hud configuration file, adds hud items.
1065 void LoadHUDConfigcxx . . $ LoadHUDConfig(7fb9cb4cf7d8fbd3).(const char *filename, bool (*fn)(const char *, const char *, void *), void *ext_data) {
1066 CFILEcxx . . $ CFILE# *fp;
1067 char srcline[128]; // One line of mission source
1068 bool text_pos = false; // text position defined?
1069
1070 // start over.
1071 ResetHUDcxx . . $ ResetHUD(49f6e7a06ebc5aa8).();
1072 InitDefaultHUDItemscxx . . $ InitDefaultHUDItems(49f6e7a06ebc5aa8).();
1073
1074 // open file
1075 fp = cfopencxx . . $ cfopen(7c7b94e455f1ae56).(filenamecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., "rt");
1076 if (!fp) {
1077 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Unable to find hud.inf file.\n");
1078 return;
1079 }
1080
1081 // check if valid cockpit file
1082 cf_ReadStringcxx . . $ cf_ReadString(38cd788e4423eff6).(srcline, sizeof(srcline), fp);
1083
1084 if (stricmpcxx . . $ `linux/linux_fix.h:43:9`!(srcline, "[hud file]") == 0) {
1085 tHUDItemcxx . . $ tHUDItem# hud_item;
1086
1087 memset(&hud_item, 0, sizeof(hud_item));
1088 hud_item.alphacxx . . $ tHUDItem#alpha. = HUD_ALPHAcxx . . $ `Descent3/hud.h:308:9`!;
1089 hud_item.colorcxx . . $ tHUDItem#color. = HUD_COLORcxx . . $ `Descent3/hud.h:307:9`!;
1090 hud_item.tcolorcxx . . $ tHUDItem#tcolor. = HUD_COLORcxx . . $ `Descent3/hud.h:307:9`!;
1091
1092 while (!cfeofcxx . . $ cfeof(413716a422df0036).(fp)) {
1093 char command[32]; // Command read from line.
1094 char operand[96]; // operand read from line
1095 char *keyword; // parsed keyword
1096 int readcount; // read-in count
1097
1098 readcount = cf_ReadStringcxx . . $ cf_ReadString(38cd788e4423eff6).(srcline, sizeof(srcline), fp);
1099 if (readcount) {
1100 // we have a line of source. parse out primary keyword
1101 // then parse out remainder.
1102 keyword = strtok(srcline, " \t=");
1103 CleanupStrcxx . . $ CleanupStr(55abe9014c6d0e39).(command, srcline, sizeof(command));
1104 CleanupStrcxx . . $ CleanupStr(55abe9014c6d0e39).(operand, srcline + strlen(command) + 1, sizeof(operand));
1105
1106 // skip comments
1107 if (command[0] == '@')
1108 continue;
1109
1110 // find command,
1111 if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(command, "type")) {
1112 // get operand.
1113 hud_item.typecxx . . $ tHUDItem#type. = atoi(operand);
1114 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(command, "pos")) {
1115 // get two numbers from line
1116 int ix, iy;
1117 sscanf(operand, "%d,%d", &ix, &iy);
1118 hud_item.xcxx . . $ tHUDItem#x. = ix;
1119 hud_item.ycxx . . $ tHUDItem#y. = iy;
1120 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(command, "posA")) {
1121 // get two numbers from line
1122 int ix, iy;
1123 sscanf(operand, "%d,%d", &ix, &iy);
1124 hud_item.xacxx . . $ tHUDItem#xa. = ix;
1125 hud_item.yacxx . . $ tHUDItem#ya. = iy;
1126 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(command, "posB")) {
1127 // get two numbers from line
1128 int ix, iy;
1129 sscanf(operand, "%d,%d", &ix, &iy);
1130 hud_item.xbcxx . . $ tHUDItem#xb. = ix;
1131 hud_item.ybcxx . . $ tHUDItem#yb. = iy;
1132 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(command, "grscale")) {
1133 sscanf(operand, "%f,%f", &hud_item.grscalexcxx . . $ tHUDItem#grscalex., &hud_item.grscaleycxx . . $ tHUDItem#grscaley.);
1134 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(command, "textpos")) {
1135 // get two numbers from line
1136 int ix, iy;
1137 sscanf(operand, "%d,%d", &ix, &iy);
1138 hud_item.txcxx . . $ tHUDItem#tx. = ix;
1139 hud_item.tycxx . . $ tHUDItem#ty. = iy;
1140 text_pos = true;
1141 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(command, "alpha")) {
1142 // get alpha value.
1143 hud_item.alphacxx . . $ tHUDItem#alpha. = atoi(operand);
1144 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(command, "sat")) {
1145 // saturation count
1146 hud_item.saturation_countcxx . . $ tHUDItem#saturation_count. = atoi(operand);
1147 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(command, "rgb")) {
1148 // saturation count
1149 int r, g, b;
1150 sscanf(operand, "%d,%d,%d", &r, &g, &b);
1151 hud_item.colorcxx . . $ tHUDItem#color. = GR_RGBcxx . . $ GR_RGB(530956271a9518a5).(r, g, b);
1152 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(command, "textrgb")) {
1153 int r, g, b;
1154 sscanf(operand, "%d,%d,%d", &r, &g, &b);
1155 hud_item.tcolorcxx . . $ tHUDItem#tcolor. = GR_RGBcxx . . $ GR_RGB(530956271a9518a5).(r, g, b);
1156 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(command, "special")) {
1157 hud_item.statcxx . . $ tHUDItem#stat. |= STAT_SPECIALcxx . . $ `Descent3/hud.h:293:9`!;
1158 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(command, "create")) {
1159 // create hud item.
1160 if (!text_pos) {
1161 hud_item.txcxx . . $ tHUDItem#tx. = hud_item.xcxx . . $ tHUDItem#x.;
1162 hud_item.tycxx . . $ tHUDItem#ty. = hud_item.ycxx . . $ tHUDItem#y.;
1163 }
1164 hud_item.render_fncxx . . $ tHUDItem#render_fn. = HudDisplayRoutercxx . . $ HudDisplayRouter(c7a20e4e05358911).;
1165 AddHUDItemcxx . . $ AddHUDItem(c7a20e4e05358911).(&hud_item);
1166
1167 // reset hud item.
1168 memset(&hud_item, 0, sizeof(hud_item));
1169 hud_item.alphacxx . . $ tHUDItem#alpha. = HUD_ALPHAcxx . . $ `Descent3/hud.h:308:9`!;
1170 hud_item.colorcxx . . $ tHUDItem#color. = HUD_COLORcxx . . $ `Descent3/hud.h:307:9`!;
1171 hud_item.tcolorcxx . . $ tHUDItem#tcolor. = HUD_COLORcxx . . $ `Descent3/hud.h:307:9`!;
1172 text_pos = false;
1173 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(command, "reticleprefix")) {
1174 // copy prefix of reticle bitmaps.
1175 strcpy(Reticle_prefixcxx . . $ Reticle_prefix., operand);
1176 } else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(command, "reticleoffset")) {
1177 int x, y;
1178 sscanf(operand, "%d,%d", &x, &y);
1179 Ret_x_offcxx . . $ Ret_x_off. = (int16_t)x;
1180 Ret_y_offcxx . . $ Ret_y_off. = (int16_t)y;
1181 } else if (fn && (*fn)(command, operand, ext_data)) {
1182 continue;
1183 } else {
1184 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Error reading hud file.\n");
1185 Int3cxx . . $ `misc/pserror.h:247:9`!(); // contact samir.
1186 break;
1187 }
1188 }
1189 }
1190 } else {
1191 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Not a valid hud file.\n");
1192 }
1193
1194 // use any reticle specified.
1195 FreeReticlecxx . . $ FreeReticle(49f6e7a06ebc5aa8).();
1196 InitReticlecxx . . $ InitReticle(3e454b8ccf442868).(0, 0);
1197
1198 cfclosecxx . . $ cfclose(3639e799710acb68).(fp);
1199 }
1200
1201 //////////////////////////////////////////////////////////////////////////////
1202 // render cockpit and gauges frame
1203 // checks to see what cockpit mode we are in.
1204 // draws stuff accordingly.
1205 // render internal gauges too.
1206
1207 void RenderHUDFramecxx . . $ RenderHUDFrame(49f6e7a06ebc5aa8).() {
1208 extern bool Guided_missile_smallviewcxx . . $ Guided_missile_smallview.; // from smallviews.cpp
1209
1210 rend_SetOverlayTypecxx . . $ rend_SetOverlayType(ac50b47256ae7414).(OT_NONEcxx . . $ `lib/renderer.h:333:9`!);
1211
1212 // determine hud rendering properties.
1213 Hud_aspect_xcxx . . $ Hud_aspect_x. = (float)Game_window_wcxx . . $ Game_window_w. / DEFAULT_HUD_WIDTHcxx . . $ `Descent3/hud.h:261:9`!;
1214 Hud_aspect_ycxx . . $ Hud_aspect_y. = (float)Game_window_hcxx . . $ Game_window_h. / DEFAULT_HUD_HEIGHTcxx . . $ `Descent3/hud.h:262:9`!;
1215 Small_hud_flagcxx . . $ Small_hud_flag. = (((float)Game_window_wcxx . . $ Game_window_w. / (float)Max_window_wcxx . . $ Max_window_w.) <= 0.80f) ? true : false;
1216
1217 // render special missile hud if available
1218 if (Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].guided_objcxx . . $ player#guided_obj. && !Guided_missile_smallviewcxx . . $ Guided_missile_smallview.) {
1219 if (!Cinematic_inusecxx . . $ Cinematic_inuse.)
1220 RenderMissileReticlecxx . . $ RenderMissileReticle(49f6e7a06ebc5aa8).();
1221 } else if (Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].flagscxx . . $ player#flags. & PLAYER_FLAGS_ZOOMEDcxx . . $ `Descent3/player_external.h:96:9`!) {
1222 if (!Cinematic_inusecxx . . $ Cinematic_inuse.)
1223 RenderZoomReticlecxx . . $ RenderZoomReticle(49f6e7a06ebc5aa8).();
1224 } else if (!(Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].flagscxx . . $ player#flags. & PLAYER_FLAGS_REARVIEWcxx . . $ `Descent3/player_external.h:97:9`!)) {
1225 switch (GetHUDModecxx . . $ GetHUDMode(d2d05048dda10524).()) {
1226 case HUD_FULLSCREENcxx . . $ HUD_FULLSCREEN.:
1227 RenderHUDItemscxx . . $ RenderHUDItems(ed53e3bbd3fa2f69).(Hud_stat_maskcxx . . $ Hud_stat_mask.);
1228 RenderCockpitcxx . . $ RenderCockpit(49f6e7a06ebc5aa8).(); // needed to render animated deactivation sequence and should be dormant
1229 if (Game_togglescxx . . $ Game_toggles..show_reticlecxx . . $ tGameToggles#show_reticle.) {
1230 RenderReticlecxx . . $ RenderReticle(49f6e7a06ebc5aa8).();
1231 }
1232 break;
1233
1234 case HUD_COCKPITcxx . . $ HUD_COCKPIT.:
1235 RenderHUDItemscxx . . $ RenderHUDItems(ed53e3bbd3fa2f69).(Hud_stat_maskcxx . . $ Hud_stat_mask.);
1236 RenderCockpitcxx . . $ RenderCockpit(49f6e7a06ebc5aa8).(); // called when cockpit is activating and functioning.
1237 if (Game_togglescxx . . $ Game_toggles..show_reticlecxx . . $ tGameToggles#show_reticle.) {
1238 RenderReticlecxx . . $ RenderReticle(49f6e7a06ebc5aa8).();
1239 }
1240 break;
1241
1242 case HUD_LETTERBOXcxx . . $ HUD_LETTERBOX.:
1243 if (!Cinematic_inusecxx . . $ Cinematic_inuse.)
1244 RenderHUDItemscxx . . $ RenderHUDItems(ed53e3bbd3fa2f69).(Hud_stat_maskcxx . . $ Hud_stat_mask.);
1245 break;
1246
1247 case HUD_OBSERVERcxx . . $ HUD_OBSERVER.:
1248 if (!Cinematic_inusecxx . . $ Cinematic_inuse.)
1249 RenderHUDItemscxx . . $ RenderHUDItems(ed53e3bbd3fa2f69).(Hud_stat_maskcxx . . $ Hud_stat_mask.);
1250 break;
1251
1252 default:
1253 Int3cxx . . $ `misc/pserror.h:247:9`!();
1254 }
1255 }
1256
1257 // Do dll stuff
1258 CallGameDLLcxx . . $ CallGameDLL(32ca0c0c7dbc2fcf).(EVT_CLIENT_HUD_INTERVALcxx . . $ `lib/d3events.h:104:9`!, &DLLInfocxx . . $ DLLInfo.);
1259
1260 rend_SetZBufferStatecxx . . $ rend_SetZBufferState(4af4fd0e2b26c4ac).(1);
1261 mprintf_atcxx . . $ `ddebug/mono.h:83:9`!(2, 0, 0, "FPS: %f", GetFPS());
1262 }
1263
1264 // renders hud frame before any graphics are drawn
1265 void RenderPreHUDFramecxx . . $ RenderPreHUDFrame(49f6e7a06ebc5aa8).() {
1266 extern void RenderHUDMsgDirtyRectscxx . . $ RenderHUDMsgDirtyRects(49f6e7a06ebc5aa8).();
1267
1268 // render any dirty rectangles if small hud flag is set
1269 if (Small_hud_flagcxx . . $ Small_hud_flag.) {
1270 int i;
1271
1272 for (i = 0; i < MAX_HUD_ITEMScxx . . $ `Descent3/hud.h:306:9`!; i++) {
1273 if ((Hud_stat_maskcxx . . $ Hud_stat_mask. & HUD_arraycxx . . $ HUD_array.[i].statcxx . . $ tHUDItem#stat.) && (HUD_arraycxx . . $ HUD_array.[i].flagscxx . . $ tHUDItem#flags. & HUD_FLAG_SMALLcxx . . $ `Descent3/hud.h:450:9`!)) {
1274 HUD_arraycxx . . $ HUD_array.[i].dirty_rectcxx . . $ tHUDItem#dirty_rect..fillcxx . . $ t_dirty_rect#fill(cb2f890c2fdad230).(GR_BLACKcxx . . $ GR_BLACK.);
1275 }
1276 }
1277
1278 // messages.
1279 if ((Hud_stat_maskcxx . . $ Hud_stat_mask. & STAT_MESSAGEScxx . . $ `Descent3/hud.h:280:9`!)) {
1280 RenderHUDMsgDirtyRectscxx . . $ RenderHUDMsgDirtyRects(49f6e7a06ebc5aa8).();
1281 }
1282 }
1283 }
1284
1285 extern MsgListConsolecxx . . $ MsgListConsole# Game_msg_concxx . . $ Game_msg_con.;
1286 extern MsgListConsolecxx . . $ MsgListConsole# HUD_msg_concxx . . $ HUD_msg_con.;
1287
1288 // render auxillary hud
1289 void RenderAuxHUDFramecxx . . $ RenderAuxHUDFrame(49f6e7a06ebc5aa8).() {
1290 // take care of any 'small hud' stuff
1291 // render hud array list for items drawn differently on a smaller hud.
1292 if (Small_hud_flagcxx . . $ Small_hud_flag.) {
1293 int cur_game_win_w = Game_window_wcxx . . $ Game_window_w.;
1294 int cur_game_win_h = Game_window_hcxx . . $ Game_window_h.;
1295 int cur_game_win_x = Game_window_xcxx . . $ Game_window_x.;
1296 int cur_game_win_y = Game_window_ycxx . . $ Game_window_y.;
1297 int i;
1298 uint16_tcxx . . $ uint16_t# stat_mask = Hud_stat_maskcxx . . $ Hud_stat_mask.;
1299
1300 // emulating hud that takes up entire screen
1301 Game_window_wcxx . . $ Game_window_w. = Max_window_wcxx . . $ Max_window_w.;
1302 Game_window_hcxx . . $ Game_window_h. = Max_window_hcxx . . $ Max_window_h.;
1303 Game_window_xcxx . . $ Game_window_x. = 0;
1304 Game_window_ycxx . . $ Game_window_y. = 0;
1305
1306 // determine hud rendering properties.
1307 Hud_aspect_xcxx . . $ Hud_aspect_x. = (float)Game_window_wcxx . . $ Game_window_w. / DEFAULT_HUD_WIDTHcxx . . $ `Descent3/hud.h:261:9`!;
1308 Hud_aspect_ycxx . . $ Hud_aspect_y. = (float)Game_window_hcxx . . $ Game_window_h. / DEFAULT_HUD_HEIGHTcxx . . $ `Descent3/hud.h:262:9`!;
1309
1310 for (i = 0; i < MAX_HUD_ITEMScxx . . $ `Descent3/hud.h:306:9`!; i++) {
1311 if ((stat_mask & HUD_arraycxx . . $ HUD_array.[i].statcxx . . $ tHUDItem#stat.) && (HUD_arraycxx . . $ HUD_array.[i].flagscxx . . $ tHUDItem#flags. & HUD_FLAG_SMALLcxx . . $ `Descent3/hud.h:450:9`!)) {
1312 if (!HUD_arraycxx . . $ HUD_array.[i].render_fncxx . . $ tHUDItem#render_fn.) {
1313 HudDisplayRoutercxx . . $ HudDisplayRouter(c7a20e4e05358911).(&HUD_arraycxx . . $ HUD_array.[i]);
1314 } else {
1315 (*HUD_arraycxx . . $ HUD_array.[i].render_fncxx . . $ tHUDItem#render_fn.)(&HUD_arraycxx . . $ HUD_array.[i]);
1316 }
1317 }
1318 }
1319
1320 // messages.
1321 if ((stat_mask & STAT_MESSAGEScxx . . $ `Descent3/hud.h:280:9`!)) {
1322 RenderHUDMessagescxx . . $ RenderHUDMessages(49f6e7a06ebc5aa8).();
1323 }
1324
1325 grtext_Flushcxx . . $ grtext_Flush(49f6e7a06ebc5aa8).();
1326
1327 Game_window_wcxx . . $ Game_window_w. = cur_game_win_w;
1328 Game_window_hcxx . . $ Game_window_h. = cur_game_win_h;
1329 Game_window_xcxx . . $ Game_window_x. = cur_game_win_x;
1330 Game_window_ycxx . . $ Game_window_y. = cur_game_win_y;
1331 }
1332
1333 // render game and hud message consoles.
1334 Game_msg_concxx . . $ Game_msg_con..DoInputcxx . . $ MsgListConsole#DoInput(49f6e7a06ebc5aa8).();
1335 Game_msg_concxx . . $ Game_msg_con..Drawcxx . . $ MsgListConsole#Draw(49f6e7a06ebc5aa8).();
1336 HUD_msg_concxx . . $ HUD_msg_con..DoInputcxx . . $ MsgListConsole#DoInput(49f6e7a06ebc5aa8).();
1337 HUD_msg_concxx . . $ HUD_msg_con..Drawcxx . . $ MsgListConsole#Draw(49f6e7a06ebc5aa8).();
1338 }
1339
1340 char *GetControllerBindingTextcxx . . $ GetControllerBindingText(ff224f080444ee45).(int fidcont) {
1341 static char *cont_bind_txt;
1342 ct_typecxx . . $ ct_type# ctype[CTLBINDS_PER_FUNCcxx . . $ `lib/Controller.h:200:9`!];
1343 uint8_tcxx . . $ uint8_t# cfgflags[CTLBINDS_PER_FUNCcxx . . $ `lib/Controller.h:200:9`!];
1344 ct_config_datacxx . . $ ct_config_data# cfgdata;
1345 tCfgDataPartscxx . . $ tCfgDataParts# cfgparts;
1346 if (-1 == fidcont)
1347 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1348 cont_bind_txt = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1349 fidcont = CtlFindBindingcxx . . $ CtlFindBinding(d455ce14f374a3ab).(fidcont, false);
1350 if (fidcont == -1) // DAJ -1FIX
1351 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1352
1353 Controllercxx . . $ Controller.->get_controller_functioncxx . . $ gameController#get_controller_function(c004c324aa6068e0).(Cfg_joy_elementscxx . . $ Cfg_joy_elements.[fidcont].fn_idcxx . . $ t_cfg_element#fn_id., ctype, &cfgdata, cfgflags);
1354 parse_config_datacxx . . $ parse_config_data(7e428e3458f6a03b).(&cfgparts, ctype[0], ctype[1], cfgdata);
1355 uint8_tcxx . . $ uint8_t# one_binding = cfgparts.bind_0cxx . . $ tCfgDataParts#bind_0.;
1356 uint8_tcxx . . $ uint8_t# one_ctrlbind = cfgparts.ctrl_0cxx . . $ tCfgDataParts#ctrl_0.;
1357
1358 cont_bind_txt = (char *)cfg_binding_textcxx . . $ cfg_binding_text(c156078267dcf458).(ctype[0], one_ctrlbind, one_binding);
1359 return cont_bind_txt;
1360 }
1361
1362 char *GetKeyBindingTextcxx . . $ GetKeyBindingText(ff224f080444ee45).(int fidkey) {
1363 static char *key_bind_txt;
1364 ct_typecxx . . $ ct_type# ctype[CTLBINDS_PER_FUNCcxx . . $ `lib/Controller.h:200:9`!];
1365 uint8_tcxx . . $ uint8_t# cfgflags[CTLBINDS_PER_FUNCcxx . . $ `lib/Controller.h:200:9`!];
1366 ct_config_datacxx . . $ ct_config_data# cfgdata;
1367 tCfgDataPartscxx . . $ tCfgDataParts# cfgparts;
1368 if (-1 == fidkey)
1369 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1370 key_bind_txt = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1371 fidkey = CtlFindBindingcxx . . $ CtlFindBinding(d455ce14f374a3ab).(fidkey, true);
1372 if (fidkey == -1) // DAJ -1FIX
1373 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1374
1375 Controllercxx . . $ Controller.->get_controller_functioncxx . . $ gameController#get_controller_function(c004c324aa6068e0).(Cfg_key_elementscxx . . $ Cfg_key_elements.[fidkey].fn_idcxx . . $ t_cfg_element#fn_id., ctype, &cfgdata, cfgflags);
1376 parse_config_datacxx . . $ parse_config_data(7e428e3458f6a03b).(&cfgparts, ctype[0], ctype[1], cfgdata);
1377 uint8_tcxx . . $ uint8_t# one_binding = cfgparts.bind_0cxx . . $ tCfgDataParts#bind_0.;
1378 uint8_tcxx . . $ uint8_t# one_ctrlbind = cfgparts.ctrl_0cxx . . $ tCfgDataParts#ctrl_0.;
1379
1380 key_bind_txt = (char *)cfg_binding_textcxx . . $ cfg_binding_text(c156078267dcf458).(ctype[0], one_ctrlbind, one_binding);
1381 return key_bind_txt;
1382 }
1383
1384 void DoEnabledControlsLinecxx . . $ DoEnabledControlsLine(6208d14389fc5e08).(const char *controlp, const char *keyp, const char *label, int y, const char *axis = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) {
1385 char control_text[200] = "";
1386
1387 strcpy(control_text, label);
1388 strcat(control_text, " : ");
1389 if (keyp)
1390 strcat(control_text, keyp);
1391 if (keyp && (controlp || axis))
1392 strcat(control_text, " / ");
1393 if (controlp)
1394 strcat(control_text, controlp);
1395 if (controlp && axis)
1396 strcat(control_text, " / ");
1397 if (axis)
1398 strcat(control_text, axis);
1399
1400 if (keyp || controlp || axis)
1401 RenderHUDTextFlagscxx . . $ RenderHUDTextFlags(15b906afa0252220).(0, GR_GREENcxx . . $ GR_GREEN., HUD_ALPHAcxx . . $ `Descent3/hud.h:308:9`!, 0, 30, y, control_text);
1402 }
1403
1404 extern bool Demo_make_moviecxx . . $ Demo_make_movie.;
1405
1406 #define HUD_KEYS_NEXT_LINEcxx . . $ `Descent3/hud.cpp:1406:9`! hudconty += 14
1407
1408 // iterate through entire hud item list to draw.
1409 void RenderHUDItemscxx . . $ RenderHUDItems(ed53e3bbd3fa2f69).(tStatMaskcxx . . $ tStatMask# stat_mask) {
1410 static float framerate_timer = 0;
1411 static float last_fps;
1412 float font_aspect_x, font_aspect_y;
1413 int i;
1414
1415 grtext_Resetcxx . . $ grtext_Reset(49f6e7a06ebc5aa8).();
1416 grtext_SetFontcxx . . $ grtext_SetFont(d4f767463ce0a6b3).(HUD_FONTcxx . . $ `Descent3/gamefont.h:105:9`!);
1417
1418 // for lores screens, we use different fonts, so DONT SCALE.
1419 font_aspect_x = (float)Game_window_wcxx . . $ Game_window_w. / Max_window_wcxx . . $ Max_window_w.;
1420 font_aspect_y = (float)Game_window_hcxx . . $ Game_window_h. / Max_window_hcxx . . $ Max_window_h.;
1421
1422 if (font_aspect_x <= 0.60f) {
1423 grtext_SetFontScalecxx . . $ grtext_SetFontScale(9364e6e7bff7660).(0.60f);
1424 } else if (font_aspect_x <= 0.80f) {
1425 grtext_SetFontScalecxx . . $ grtext_SetFontScale(9364e6e7bff7660).(0.80f);
1426 } else {
1427 grtext_SetFontScalecxx . . $ grtext_SetFontScale(9364e6e7bff7660).(1.0f);
1428 }
1429
1430 // do framerate calculations
1431 framerate_timer -= Frametimecxx . . $ Frametime.;
1432 while (framerate_timer < 0) {
1433 framerate_timer += FRAMERATE_TIME_DELAYcxx . . $ `Descent3/hud.cpp:446:9`!;
1434 last_fps = GetFPScxx . . $ GetFPS(9b8c9e39889c762c).();
1435 }
1436
1437 // show framerate text gauge
1438 if (stat_mask & STAT_FPScxx . . $ `Descent3/hud.h:275:9`!) {
1439 RenderHUDTextcxx . . $ RenderHUDText(e69f8330415a42f1).(HUD_COLORcxx . . $ `Descent3/hud.h:307:9`!, HUD_ALPHAcxx . . $ `Descent3/hud.h:308:9`!, 0, 10, 10, "FPS: %.1f", last_fps);
1440 }
1441
1442 // show music spew
1443
1444 #ifdef _DEBUGcxx . . $ `<built-in>:482:9`!
1445 if (Music_debug_verbosecxx . . $ Music_debug_verbose.) {
1446 int min, sec;
1447 RenderHUDTextcxx . . $ RenderHUDText(e69f8330415a42f1).(HUD_COLORcxx . . $ `Descent3/hud.h:307:9`!, HUD_ALPHAcxx . . $ `Descent3/hud.h:308:9`!, 0, 10, 60, "Music: %s", IsD3MusicOncxx . . $ IsD3MusicOn(c9857a73d68e59ba).() ? "ON" : "OFF");
1448 RenderHUDTextcxx . . $ RenderHUDText(e69f8330415a42f1).(HUD_COLORcxx . . $ `Descent3/hud.h:307:9`!, HUD_ALPHAcxx . . $ `Descent3/hud.h:308:9`!, 0, 10, 72, "Region: %d", D3MusicGetRegioncxx . . $ D3MusicGetRegion(4c3706f7850cf040).());
1449 RenderHUDTextcxx . . $ RenderHUDText(e69f8330415a42f1).(HUD_COLORcxx . . $ `Descent3/hud.h:307:9`!, HUD_ALPHAcxx . . $ `Descent3/hud.h:308:9`!, 0, 10, 84, "Song: %s", Music_type_namescxx . . $ Music_type_names.[Game_music_infocxx . . $ Game_music_info..cur_songcxx . . $ tMusicSeqInfo#cur_song.]);
1450 min = (int)(Game_music_infocxx . . $ Game_music_info..peace_timercxx . . $ tMusicSeqInfo#peace_timer. / 60);
1451 sec = (int)((Game_music_infocxx . . $ Game_music_info..peace_timercxx . . $ tMusicSeqInfo#peace_timer. / 60.0f - (float)min) * 60.0f);
1452 RenderHUDTextcxx . . $ RenderHUDText(e69f8330415a42f1).(HUD_COLORcxx . . $ `Descent3/hud.h:307:9`!, HUD_ALPHAcxx . . $ `Descent3/hud.h:308:9`!, 0, 10, 96, "Peace time: %d:%.2d", min, sec);
1453
1454 if (Game_music_infocxx . . $ Game_music_info..cur_loop_namecxx . . $ tMusicSeqInfo#cur_loop_name.) {
1455 RenderHUDTextcxx . . $ RenderHUDText(e69f8330415a42f1).(HUD_COLORcxx . . $ `Descent3/hud.h:307:9`!, HUD_ALPHAcxx . . $ `Descent3/hud.h:308:9`!, 0, 10, 108, "Loop: %s", Game_music_infocxx . . $ Game_music_info..cur_loop_namecxx . . $ tMusicSeqInfo#cur_loop_name.);
1456 }
1457 }
1458
1459 // show timer
1460 if (1) {
1461 // timer always displayed in debug builds.
1462 int min, sec, y;
1463
1464 min = (int)(Gametimecxx . . $ Gametime. / 60);
1465 sec = (int)((Gametimecxx . . $ Gametime. / 60.0f - (float)min) * 60.0f);
1466
1467 y = (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!) ? 10 : 40;
1468
1469 RenderHUDTextcxx . . $ RenderHUDText(e69f8330415a42f1).(HUD_COLORcxx . . $ `Descent3/hud.h:307:9`!, HUD_ALPHAcxx . . $ `Descent3/hud.h:308:9`!, 0, 605, y, "%d:%.2d", min, sec);
1470 }
1471 #endif
1472
1473 // render hud array list.
1474 for (i = 0; i < MAX_HUD_ITEMScxx . . $ `Descent3/hud.h:306:9`!; i++) {
1475 if ((HUD_arraycxx . . $ HUD_array.[i].flagscxx . . $ tHUDItem#flags. & HUD_FLAG_SMALLcxx . . $ `Descent3/hud.h:450:9`!) && Small_hud_flagcxx . . $ Small_hud_flag.) {
1476 continue; // skip items renderered differently on a small hud if we are in a small hud (see RenderAUXHUDFrame)
1477 }
1478 if ((stat_mask & HUD_arraycxx . . $ HUD_array.[i].statcxx . . $ tHUDItem#stat.)) {
1479 if (!HUD_arraycxx . . $ HUD_array.[i].render_fncxx . . $ tHUDItem#render_fn.) {
1480 HudDisplayRoutercxx . . $ HudDisplayRouter(c7a20e4e05358911).(&HUD_arraycxx . . $ HUD_array.[i]);
1481 } else {
1482 (*HUD_arraycxx . . $ HUD_array.[i].render_fncxx . . $ tHUDItem#render_fn.)(&HUD_arraycxx . . $ HUD_array.[i]);
1483 }
1484 }
1485 }
1486 if (Demo_flagscxx . . $ Demo_flags. == DF_RECORDINGcxx . . $ `lib/demofile.h:122:9`!) {
1487 RenderHUDTextFlagscxx . . $ RenderHUDTextFlags(15b906afa0252220).(HUDTEXT_CENTEREDcxx . . $ `Descent3/hud.h:604:9`!, GR_BLUEcxx . . $ GR_BLUE., HUD_ALPHAcxx . . $ `Descent3/hud.h:308:9`!, 0, 10, 300, TXT_RECORDINGDEMOcxx . . $ `Descent3/stringtable.h:431:9`!);
1488 } else if (Demo_flagscxx . . $ Demo_flags. == DF_PLAYBACKcxx . . $ `lib/demofile.h:123:9`!) {
1489 if (!Demo_make_moviecxx . . $ Demo_make_movie.) {
1490 if (Demo_pausedcxx . . $ Demo_paused.) {
1491 RenderHUDTextFlagscxx . . $ RenderHUDTextFlags(15b906afa0252220).(HUDTEXT_CENTEREDcxx . . $ `Descent3/hud.h:604:9`!, GR_BLUEcxx . . $ GR_BLUE., HUD_ALPHAcxx . . $ `Descent3/hud.h:308:9`!, 0, 10, 300, TXT_DEMOPAUSEDcxx . . $ `Descent3/stringtable.h:444:9`!);
1492 } else {
1493 RenderHUDTextFlagscxx . . $ RenderHUDTextFlags(15b906afa0252220).(HUDTEXT_CENTEREDcxx . . $ `Descent3/hud.h:604:9`!, GR_BLUEcxx . . $ GR_BLUE., HUD_ALPHAcxx . . $ `Descent3/hud.h:308:9`!, 0, 10, 300, TXT_PLAYINGDEMOcxx . . $ `Descent3/stringtable.h:432:9`!);
1494 }
1495 }
1496 }
1497
1498 // This is a big pain in the butt. It's for the training mission.
1499 if (Hud_show_controlscxx . . $ Hud_show_controls. && (Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].controller_bitflagscxx . . $ player#controller_bitflags. != 0xffffffff)) {
1500 char *controlp = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1501 char *keyp = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1502 char *axis = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1503 playercxx . . $ player# *pp = &Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.];
1504 int fidkey = -1, fidcont = -1;
1505 int hudconty = 130;
1506
1507 RenderHUDTextFlagscxx . . $ RenderHUDTextFlags(15b906afa0252220).(0, GR_GREENcxx . . $ GR_GREEN., HUD_ALPHAcxx . . $ `Descent3/hud.h:308:9`!, 0, 15, hudconty, TXT_ENABLED_CONTROLScxx . . $ `Descent3/stringtable.h:905:9`!);
1508 HUD_KEYS_NEXT_LINEcxx . . $ `Descent3/hud.cpp:1406:9`!;
1509
1510 if (pp->controller_bitflagscxx . . $ player#controller_bitflags. & PCBF_FORWARDcxx . . $ `Descent3/player_external.h:112:9`!) {
1511 keyp = GetKeyBindingTextcxx . . $ GetKeyBindingText(ff224f080444ee45).(ctfFORWARD_THRUSTKEYcxx . . $ ctfFORWARD_THRUSTKEY.);
1512 controlp = GetControllerBindingTextcxx . . $ GetControllerBindingText(ff224f080444ee45).(ctfFORWARD_BUTTONcxx . . $ ctfFORWARD_BUTTON.);
1513 if (keyp || controlp) {
1514 DoEnabledControlsLinecxx . . $ DoEnabledControlsLine(6208d14389fc5e08).(controlp, keyp, TXT_ENABLED_CONT_FORWARDcxx . . $ `Descent3/stringtable.h:906:9`!, hudconty);
1515 HUD_KEYS_NEXT_LINEcxx . . $ `Descent3/hud.cpp:1406:9`!;
1516 }
1517 }
1518 if (pp->controller_bitflagscxx . . $ player#controller_bitflags. & PCBF_REVERSEcxx . . $ `Descent3/player_external.h:113:9`!) {
1519 keyp = GetKeyBindingTextcxx . . $ GetKeyBindingText(ff224f080444ee45).(ctfREVERSE_THRUSTKEYcxx . . $ ctfREVERSE_THRUSTKEY.);
1520
1521 controlp = GetControllerBindingTextcxx . . $ GetControllerBindingText(ff224f080444ee45).(ctfREVERSE_BUTTONcxx . . $ ctfREVERSE_BUTTON.);
1522 if (keyp || controlp) {
1523 DoEnabledControlsLinecxx . . $ DoEnabledControlsLine(6208d14389fc5e08).(controlp, keyp, TXT_ENABLED_CONT_REVERSEcxx . . $ `Descent3/stringtable.h:907:9`!, hudconty);
1524 HUD_KEYS_NEXT_LINEcxx . . $ `Descent3/hud.cpp:1406:9`!;
1525 }
1526 }
1527 if (pp->controller_bitflagscxx . . $ player#controller_bitflags. & PCBF_LEFTcxx . . $ `Descent3/player_external.h:114:9`!) {
1528 keyp = GetKeyBindingTextcxx . . $ GetKeyBindingText(ff224f080444ee45).(ctfLEFT_THRUSTKEYcxx . . $ ctfLEFT_THRUSTKEY.);
1529 controlp = GetControllerBindingTextcxx . . $ GetControllerBindingText(ff224f080444ee45).(ctfLEFT_BUTTONcxx . . $ ctfLEFT_BUTTON.);
1530 if (keyp || controlp) {
1531 DoEnabledControlsLinecxx . . $ DoEnabledControlsLine(6208d14389fc5e08).(controlp, keyp, TXT_ENABLED_CONT_SLIDELEFTcxx . . $ `Descent3/stringtable.h:908:9`!, hudconty);
1532 HUD_KEYS_NEXT_LINEcxx . . $ `Descent3/hud.cpp:1406:9`!;
1533 }
1534 }
1535 if (pp->controller_bitflagscxx . . $ player#controller_bitflags. & PCBF_RIGHTcxx . . $ `Descent3/player_external.h:115:9`!) {
1536 keyp = GetKeyBindingTextcxx . . $ GetKeyBindingText(ff224f080444ee45).(ctfRIGHT_THRUSTKEYcxx . . $ ctfRIGHT_THRUSTKEY.);
1537 controlp = GetControllerBindingTextcxx . . $ GetControllerBindingText(ff224f080444ee45).(ctfRIGHT_BUTTONcxx . . $ ctfRIGHT_BUTTON.);
1538 if (keyp || controlp) {
1539 DoEnabledControlsLinecxx . . $ DoEnabledControlsLine(6208d14389fc5e08).(controlp, keyp, TXT_ENABLED_CONT_SLIDERIGHTcxx . . $ `Descent3/stringtable.h:909:9`!, hudconty);
1540 HUD_KEYS_NEXT_LINEcxx . . $ `Descent3/hud.cpp:1406:9`!;
1541 }
1542 }
1543 if (pp->controller_bitflagscxx . . $ player#controller_bitflags. & PCBF_UPcxx . . $ `Descent3/player_external.h:116:9`!) {
1544 keyp = GetKeyBindingTextcxx . . $ GetKeyBindingText(ff224f080444ee45).(ctfUP_THRUSTKEYcxx . . $ ctfUP_THRUSTKEY.);
1545 controlp = GetControllerBindingTextcxx . . $ GetControllerBindingText(ff224f080444ee45).(ctfUP_BUTTONcxx . . $ ctfUP_BUTTON.);
1546 if (keyp || controlp) {
1547 DoEnabledControlsLinecxx . . $ DoEnabledControlsLine(6208d14389fc5e08).(controlp, keyp, TXT_ENABLED_CONT_SLIDEUPcxx . . $ `Descent3/stringtable.h:910:9`!, hudconty);
1548 HUD_KEYS_NEXT_LINEcxx . . $ `Descent3/hud.cpp:1406:9`!;
1549 }
1550 }
1551 if (pp->controller_bitflagscxx . . $ player#controller_bitflags. & PCBF_DOWNcxx . . $ `Descent3/player_external.h:117:9`!) {
1552 keyp = GetKeyBindingTextcxx . . $ GetKeyBindingText(ff224f080444ee45).(ctfDOWN_THRUSTKEYcxx . . $ ctfDOWN_THRUSTKEY.);
1553 controlp = GetControllerBindingTextcxx . . $ GetControllerBindingText(ff224f080444ee45).(ctfDOWN_BUTTONcxx . . $ ctfDOWN_BUTTON.);
1554 if (keyp || controlp) {
1555 DoEnabledControlsLinecxx . . $ DoEnabledControlsLine(6208d14389fc5e08).(controlp, keyp, TXT_ENABLED_CONT_SLIDEDOWNcxx . . $ `Descent3/stringtable.h:911:9`!, hudconty);
1556 HUD_KEYS_NEXT_LINEcxx . . $ `Descent3/hud.cpp:1406:9`!;
1557 }
1558 }
1559 if (pp->controller_bitflagscxx . . $ player#controller_bitflags. & PCBF_PITCHUPcxx . . $ `Descent3/player_external.h:118:9`!) {
1560 axis = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1561 if ((pp->controller_bitflagscxx . . $ player#controller_bitflags. & PCBF_PITCHUPcxx . . $ `Descent3/player_external.h:118:9`!) && (pp->controller_bitflagscxx . . $ player#controller_bitflags. & PCBF_PITCHDOWNcxx . . $ `Descent3/player_external.h:119:9`!)) {
1562 axis = GetControllerBindingTextcxx . . $ GetControllerBindingText(ff224f080444ee45).(ctfPITCH_DOWNAXIScxx . . $ ctfPITCH_DOWNAXIS.);
1563 }
1564 keyp = GetKeyBindingTextcxx . . $ GetKeyBindingText(ff224f080444ee45).(ctfPITCH_UPKEYcxx . . $ ctfPITCH_UPKEY.);
1565 controlp = GetControllerBindingTextcxx . . $ GetControllerBindingText(ff224f080444ee45).(ctfPITCH_UPBUTTONcxx . . $ ctfPITCH_UPBUTTON.);
1566 if (keyp || controlp || axis) {
1567 DoEnabledControlsLinecxx . . $ DoEnabledControlsLine(6208d14389fc5e08).(controlp, keyp, TXT_ENABLED_CONT_PITCHUPcxx . . $ `Descent3/stringtable.h:912:9`!, hudconty, axis);
1568 HUD_KEYS_NEXT_LINEcxx . . $ `Descent3/hud.cpp:1406:9`!;
1569 }
1570 }
1571 if (pp->controller_bitflagscxx . . $ player#controller_bitflags. & PCBF_PITCHDOWNcxx . . $ `Descent3/player_external.h:119:9`!) {
1572 axis = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1573 if ((pp->controller_bitflagscxx . . $ player#controller_bitflags. & PCBF_PITCHUPcxx . . $ `Descent3/player_external.h:118:9`!) && (pp->controller_bitflagscxx . . $ player#controller_bitflags. & PCBF_PITCHDOWNcxx . . $ `Descent3/player_external.h:119:9`!)) {
1574 axis = GetControllerBindingTextcxx . . $ GetControllerBindingText(ff224f080444ee45).(ctfPITCH_DOWNAXIScxx . . $ ctfPITCH_DOWNAXIS.);
1575 }
1576 keyp = GetKeyBindingTextcxx . . $ GetKeyBindingText(ff224f080444ee45).(ctfPITCH_DOWNKEYcxx . . $ ctfPITCH_DOWNKEY.);
1577 controlp = GetControllerBindingTextcxx . . $ GetControllerBindingText(ff224f080444ee45).(ctfPITCH_DOWNBUTTONcxx . . $ ctfPITCH_DOWNBUTTON.);
1578 if (keyp || controlp || axis) {
1579 DoEnabledControlsLinecxx . . $ DoEnabledControlsLine(6208d14389fc5e08).(controlp, keyp, TXT_ENABLED_CONT_PITCHDOWNcxx . . $ `Descent3/stringtable.h:913:9`!, hudconty, axis);
1580 HUD_KEYS_NEXT_LINEcxx . . $ `Descent3/hud.cpp:1406:9`!;
1581 }
1582 }
1583 /*
1584 else if((pp->controller_bitflags & PCBF_HEADINGLEFT) && (pp->controller_bitflags & PCBF_HEADINGRIGHT))
1585 {
1586 axis = GetControllerBindingText(ctfHEADING_RIGHTAXIS);
1587 DoEnabledControlsLine(NULL,NULL,"Pitch",hudconty);
1588 HUD_KEYS_NEXT_LINE;
1589
1590 }
1591 */
1592 if (pp->controller_bitflagscxx . . $ player#controller_bitflags. & PCBF_HEADINGLEFTcxx . . $ `Descent3/player_external.h:120:9`!) {
1593 axis = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1594 if ((pp->controller_bitflagscxx . . $ player#controller_bitflags. & PCBF_HEADINGLEFTcxx . . $ `Descent3/player_external.h:120:9`!) && (pp->controller_bitflagscxx . . $ player#controller_bitflags. & PCBF_HEADINGRIGHTcxx . . $ `Descent3/player_external.h:121:9`!)) {
1595 axis = GetControllerBindingTextcxx . . $ GetControllerBindingText(ff224f080444ee45).(ctfHEADING_RIGHTAXIScxx . . $ ctfHEADING_RIGHTAXIS.);
1596 }
1597 keyp = GetKeyBindingTextcxx . . $ GetKeyBindingText(ff224f080444ee45).(ctfHEADING_LEFTKEYcxx . . $ ctfHEADING_LEFTKEY.);
1598 controlp = GetControllerBindingTextcxx . . $ GetControllerBindingText(ff224f080444ee45).(ctfHEADING_LEFTBUTTONcxx . . $ ctfHEADING_LEFTBUTTON.);
1599 if (keyp || controlp || axis) {
1600 DoEnabledControlsLinecxx . . $ DoEnabledControlsLine(6208d14389fc5e08).(controlp, keyp, TXT_ENABLED_CONT_HEADLEFTcxx . . $ `Descent3/stringtable.h:914:9`!, hudconty, axis);
1601 HUD_KEYS_NEXT_LINEcxx . . $ `Descent3/hud.cpp:1406:9`!;
1602 }
1603 }
1604 if (pp->controller_bitflagscxx . . $ player#controller_bitflags. & PCBF_HEADINGRIGHTcxx . . $ `Descent3/player_external.h:121:9`!) {
1605 axis = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1606 if ((pp->controller_bitflagscxx . . $ player#controller_bitflags. & PCBF_HEADINGLEFTcxx . . $ `Descent3/player_external.h:120:9`!) && (pp->controller_bitflagscxx . . $ player#controller_bitflags. & PCBF_HEADINGRIGHTcxx . . $ `Descent3/player_external.h:121:9`!)) {
1607 axis = GetControllerBindingTextcxx . . $ GetControllerBindingText(ff224f080444ee45).(ctfHEADING_RIGHTAXIScxx . . $ ctfHEADING_RIGHTAXIS.);
1608 }
1609 keyp = GetKeyBindingTextcxx . . $ GetKeyBindingText(ff224f080444ee45).(ctfHEADING_RIGHTKEYcxx . . $ ctfHEADING_RIGHTKEY.);
1610 controlp = GetControllerBindingTextcxx . . $ GetControllerBindingText(ff224f080444ee45).(ctfHEADING_RIGHTBUTTONcxx . . $ ctfHEADING_RIGHTBUTTON.);
1611 if (keyp || controlp || axis) {
1612 DoEnabledControlsLinecxx . . $ DoEnabledControlsLine(6208d14389fc5e08).(controlp, keyp, TXT_ENABLED_CONT_HEADRIGHTcxx . . $ `Descent3/stringtable.h:915:9`!, hudconty, axis);
1613 HUD_KEYS_NEXT_LINEcxx . . $ `Descent3/hud.cpp:1406:9`!;
1614 }
1615 }
1616 if (pp->controller_bitflagscxx . . $ player#controller_bitflags. & PCBF_BANKLEFTcxx . . $ `Descent3/player_external.h:122:9`!) {
1617 axis = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1618 if ((pp->controller_bitflagscxx . . $ player#controller_bitflags. & PCBF_BANKLEFTcxx . . $ `Descent3/player_external.h:122:9`!) && (pp->controller_bitflagscxx . . $ player#controller_bitflags. & PCBF_BANKLEFTcxx . . $ `Descent3/player_external.h:122:9`!)) {
1619 axis = GetControllerBindingTextcxx . . $ GetControllerBindingText(ff224f080444ee45).(ctfBANK_RIGHTAXIScxx . . $ ctfBANK_RIGHTAXIS.);
1620 }
1621 keyp = GetKeyBindingTextcxx . . $ GetKeyBindingText(ff224f080444ee45).(ctfBANK_LEFTKEYcxx . . $ ctfBANK_LEFTKEY.);
1622 controlp = GetControllerBindingTextcxx . . $ GetControllerBindingText(ff224f080444ee45).(ctfBANK_LEFTBUTTONcxx . . $ ctfBANK_LEFTBUTTON.);
1623 if (keyp || controlp || axis) {
1624 DoEnabledControlsLinecxx . . $ DoEnabledControlsLine(6208d14389fc5e08).(controlp, keyp, TXT_ENABLED_CONT_BANKLEFTcxx . . $ `Descent3/stringtable.h:916:9`!, hudconty, axis);
1625 HUD_KEYS_NEXT_LINEcxx . . $ `Descent3/hud.cpp:1406:9`!;
1626 }
1627 }
1628 if (pp->controller_bitflagscxx . . $ player#controller_bitflags. & PCBF_BANKRIGHTcxx . . $ `Descent3/player_external.h:123:9`!) {
1629 axis = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1630 if ((pp->controller_bitflagscxx . . $ player#controller_bitflags. & PCBF_BANKLEFTcxx . . $ `Descent3/player_external.h:122:9`!) && (pp->controller_bitflagscxx . . $ player#controller_bitflags. & PCBF_BANKLEFTcxx . . $ `Descent3/player_external.h:122:9`!)) {
1631 axis = GetControllerBindingTextcxx . . $ GetControllerBindingText(ff224f080444ee45).(ctfBANK_RIGHTAXIScxx . . $ ctfBANK_RIGHTAXIS.);
1632 }
1633 keyp = GetKeyBindingTextcxx . . $ GetKeyBindingText(ff224f080444ee45).(ctfBANK_RIGHTKEYcxx . . $ ctfBANK_RIGHTKEY.);
1634 controlp = GetControllerBindingTextcxx . . $ GetControllerBindingText(ff224f080444ee45).(ctfBANK_RIGHTBUTTONcxx . . $ ctfBANK_RIGHTBUTTON.);
1635 if (keyp || controlp || axis) {
1636 DoEnabledControlsLinecxx . . $ DoEnabledControlsLine(6208d14389fc5e08).(controlp, keyp, TXT_ENABLED_CONT_BANKRIGHTcxx . . $ `Descent3/stringtable.h:917:9`!, hudconty, axis);
1637 HUD_KEYS_NEXT_LINEcxx . . $ `Descent3/hud.cpp:1406:9`!;
1638 }
1639 }
1640 if (pp->controller_bitflagscxx . . $ player#controller_bitflags. & PCBF_PRIMARYcxx . . $ `Descent3/player_external.h:124:9`!) {
1641 keyp = GetKeyBindingTextcxx . . $ GetKeyBindingText(ff224f080444ee45).(ctfFIREPRIMARY_KEYcxx . . $ ctfFIREPRIMARY_KEY.);
1642 controlp = GetControllerBindingTextcxx . . $ GetControllerBindingText(ff224f080444ee45).(ctfFIREPRIMARY_BUTTONcxx . . $ ctfFIREPRIMARY_BUTTON.);
1643 if (keyp || controlp) {
1644 DoEnabledControlsLinecxx . . $ DoEnabledControlsLine(6208d14389fc5e08).(controlp, keyp, TXT_ENABLED_CONT_PRIMWEAPcxx . . $ `Descent3/stringtable.h:918:9`!, hudconty);
1645 HUD_KEYS_NEXT_LINEcxx . . $ `Descent3/hud.cpp:1406:9`!;
1646 }
1647 }
1648 if (pp->controller_bitflagscxx . . $ player#controller_bitflags. & PCBF_SECONDARYcxx . . $ `Descent3/player_external.h:125:9`!) {
1649 keyp = GetKeyBindingTextcxx . . $ GetKeyBindingText(ff224f080444ee45).(ctfFIRESECONDARY_KEYcxx . . $ ctfFIRESECONDARY_KEY.);
1650 controlp = GetControllerBindingTextcxx . . $ GetControllerBindingText(ff224f080444ee45).(ctfFIRESECONDARY_BUTTONcxx . . $ ctfFIRESECONDARY_BUTTON.);
1651 if (keyp || controlp) {
1652 DoEnabledControlsLinecxx . . $ DoEnabledControlsLine(6208d14389fc5e08).(controlp, keyp, TXT_ENABLED_CONT_SECWEAPcxx . . $ `Descent3/stringtable.h:919:9`!, hudconty);
1653 HUD_KEYS_NEXT_LINEcxx . . $ `Descent3/hud.cpp:1406:9`!;
1654 }
1655 }
1656 if (pp->controller_bitflagscxx . . $ player#controller_bitflags. & PCBF_AFTERBURNERcxx . . $ `Descent3/player_external.h:126:9`!) {
1657 keyp = GetKeyBindingTextcxx . . $ GetKeyBindingText(ff224f080444ee45).(ctfAFTERBURN_KEYcxx . . $ ctfAFTERBURN_KEY.);
1658 controlp = GetControllerBindingTextcxx . . $ GetControllerBindingText(ff224f080444ee45).(ctfAFTERBURN_BUTTONcxx . . $ ctfAFTERBURN_BUTTON.);
1659 if (keyp || controlp) {
1660 DoEnabledControlsLinecxx . . $ DoEnabledControlsLine(6208d14389fc5e08).(controlp, keyp, TXT_ENABLED_CONT_AFTERBURNcxx . . $ `Descent3/stringtable.h:920:9`!, hudconty);
1661 HUD_KEYS_NEXT_LINEcxx . . $ `Descent3/hud.cpp:1406:9`!;
1662 }
1663 }
1664 }
1665
1666 // render hud messages. if in a small hud, don't do it now but inside RenderAuxHUDFrame
1667 if ((stat_mask & STAT_MESSAGEScxx . . $ `Descent3/hud.h:280:9`!) && !Small_hud_flagcxx . . $ Small_hud_flag.) {
1668 RenderHUDMessagescxx . . $ RenderHUDMessages(49f6e7a06ebc5aa8).();
1669 }
1670 #if 0
1671 grtext_SetColor(GR_GREEN);
1672 grtext_SetAlpha(128);
1673 grtext_SetFont(BIG_BRIEFING_FONT);
1674 grtext_CenteredPrintf(0,300,"Beta Version");
1675 #endif
1676 grtext_Flushcxx . . $ grtext_Flush(49f6e7a06ebc5aa8).();
1677 }
1678
1679 //////////////////////////////////////////////////////////////////////////////
1680 // RETICLE SYSTEM
1681
1682 #include "robotfire.h"cxx . . $ `<file>/Descent3/robotfire.h`/
1683
1684 #define RET_IMAGE_WIDTHcxx . . $ `Descent3/hud.cpp:1684:9`! 32
1685 #define RET_IMAGE_HEIGHTcxx . . $ `Descent3/hud.cpp:1685:9`! 32
1686
1687 #define MAX_RETICLE_ELEMScxx . . $ `Descent3/hud.cpp:1687:9`! 18
1688 #define RET_CPRIMARYcxx . . $ `Descent3/hud.cpp:1688:9`! 0
1689 #define RET_L1PRIMARYcxx . . $ `Descent3/hud.cpp:1689:9`! 1
1690 #define RET_R1PRIMARYcxx . . $ `Descent3/hud.cpp:1690:9`! 2
1691 #define RET_L2PRIMARYcxx . . $ `Descent3/hud.cpp:1691:9`! 3
1692 #define RET_R2PRIMARYcxx . . $ `Descent3/hud.cpp:1692:9`! 4
1693 #define RET_CPRIMARY2cxx . . $ `Descent3/hud.cpp:1693:9`! 5
1694 #define RET_CSECONDARYcxx . . $ `Descent3/hud.cpp:1694:9`! 8
1695 #define RET_L1SECONDARYcxx . . $ `Descent3/hud.cpp:1695:9`! 9
1696 #define RET_R1SECONDARYcxx . . $ `Descent3/hud.cpp:1696:9`! 10
1697 #define RET_L2SECONDARYcxx . . $ `Descent3/hud.cpp:1697:9`! 11
1698 #define RET_R2SECONDARYcxx . . $ `Descent3/hud.cpp:1698:9`! 12
1699 #define RET_LGUNSIGHTcxx . . $ `Descent3/hud.cpp:1699:9`! 16
1700 #define RET_RGUNSIGHTcxx . . $ `Descent3/hud.cpp:1700:9`! 17
1701
1702 /*
1703 $$TABLE_GAMEFILE "ret_pr0a.ogf"
1704 $$TABLE_GAMEFILE "ret_pr0b.ogf"
1705 $$TABLE_GAMEFILE "ret_pr1b.ogf"
1706 $$TABLE_GAMEFILE "ret_pr2b.ogf"
1707 $$TABLE_GAMEFILE "ret_pr3b.ogf"
1708 $$TABLE_GAMEFILE "ret_pr4b.ogf"
1709 $$TABLE_GAMEFILE "ret_pr13a.ogf"
1710 $$TABLE_GAMEFILE "ret_pr24a.ogf"
1711 $$TABLE_GAMEFILE "ret_se0a.ogf"
1712 $$TABLE_GAMEFILE "ret_se1a.ogf"
1713 $$TABLE_GAMEFILE "ret_se2a.ogf"
1714 $$TABLE_GAMEFILE "ret_se3a.ogf"
1715 $$TABLE_GAMEFILE "ret_se4a.ogf"
1716 $$TABLE_GAMEFILE "ret_se0b.ogf"
1717 $$TABLE_GAMEFILE "ret_se1b.ogf"
1718 $$TABLE_GAMEFILE "ret_se2b.ogf"
1719 $$TABLE_GAMEFILE "ret_se3b.ogf"
1720 $$TABLE_GAMEFILE "ret_se4b.ogf"
1721 $$TABLE_GAMEFILE "ret_lguna.ogf"
1722 $$TABLE_GAMEFILE "ret_rguna.ogf"
1723 $$TABLE_GAMEFILE "ret_pr5a.ogf"
1724 $$TABLE_GAMEFILE "ret_pr5b.ogf"
1725
1726 $$TABLE_GAMEFILE "phx_pr0a.ogf"
1727 $$TABLE_GAMEFILE "phx_pr0b.ogf"
1728 $$TABLE_GAMEFILE "phx_pr1b.ogf"
1729 $$TABLE_GAMEFILE "phx_pr2b.ogf"
1730 $$TABLE_GAMEFILE "phx_pr3b.ogf"
1731 $$TABLE_GAMEFILE "phx_pr4b.ogf"
1732 $$TABLE_GAMEFILE "phx_pr13a.ogf"
1733 $$TABLE_GAMEFILE "phx_pr24a.ogf"
1734 $$TABLE_GAMEFILE "phx_se0a.ogf"
1735 $$TABLE_GAMEFILE "phx_se1a.ogf"
1736 $$TABLE_GAMEFILE "phx_se2a.ogf"
1737 $$TABLE_GAMEFILE "phx_se3a.ogf"
1738 $$TABLE_GAMEFILE "phx_se4a.ogf"
1739 $$TABLE_GAMEFILE "phx_se0b.ogf"
1740 $$TABLE_GAMEFILE "phx_se1b.ogf"
1741 $$TABLE_GAMEFILE "phx_se2b.ogf"
1742 $$TABLE_GAMEFILE "phx_se3b.ogf"
1743 $$TABLE_GAMEFILE "phx_se4b.ogf"
1744 $$TABLE_GAMEFILE "phx_lguna.ogf"
1745 $$TABLE_GAMEFILE "phx_rguna.ogf"
1746 $$TABLE_GAMEFILE "phx_pr5a.ogf"
1747 $$TABLE_GAMEFILE "phx_pr5b.ogf"
1748
1749 $$TABLE_GAMEFILE "mag_pr0a.ogf"
1750 $$TABLE_GAMEFILE "mag_pr0b.ogf"
1751 $$TABLE_GAMEFILE "mag_pr1b.ogf"
1752 $$TABLE_GAMEFILE "mag_pr2b.ogf"
1753 $$TABLE_GAMEFILE "mag_pr3b.ogf"
1754 $$TABLE_GAMEFILE "mag_pr4b.ogf"
1755 $$TABLE_GAMEFILE "mag_pr13a.ogf"
1756 $$TABLE_GAMEFILE "mag_pr24a.ogf"
1757 $$TABLE_GAMEFILE "mag_se0a.ogf"
1758 $$TABLE_GAMEFILE "mag_se1a.ogf"
1759 $$TABLE_GAMEFILE "mag_se2a.ogf"
1760 $$TABLE_GAMEFILE "mag_se3a.ogf"
1761 $$TABLE_GAMEFILE "mag_se4a.ogf"
1762 $$TABLE_GAMEFILE "mag_se0b.ogf"
1763 $$TABLE_GAMEFILE "mag_se1b.ogf"
1764 $$TABLE_GAMEFILE "mag_se2b.ogf"
1765 $$TABLE_GAMEFILE "mag_se3b.ogf"
1766 $$TABLE_GAMEFILE "mag_se4b.ogf"
1767 $$TABLE_GAMEFILE "mag_lguna.ogf"
1768 $$TABLE_GAMEFILE "mag_rguna.ogf"
1769 $$TABLE_GAMEFILE "mag_pr5a.ogf"
1770 $$TABLE_GAMEFILE "mag_pr5b.ogf"
1771 */
1772
1773 // this should map to the reticle element defines
1774 // column 0 = off bitmap
1775 // column 1 = on bitmap (if any).
1776 // column 2 = left, center or right aligned bitmap.
1777 const char *Reticle_image_namescxx . . $ Reticle_image_names.[MAX_RETICLE_ELEMScxx . . $ `Descent3/hud.cpp:1687:9`!][3] = {
1778 {"_pr0a.ogf", "_pr0b.ogf", "c"},
1779 {"_pr13a.ogf", "_pr1b.ogf", "l"}, // gp1
1780 {"_pr24a.ogf", "_pr2b.ogf", "r"}, // gp2
1781 {"_pr13a.ogf", "_pr3b.ogf", "l"}, // since off version is same as gp1
1782 {"_pr24a.ogf", "_pr4b.ogf", "r"}, // since off version is same as gp2
1783 {"_pr5a.ogf", "_pr5b.ogf", "c"}, // center gunpoint version of gp0 (ammo based, single gp)
1784 {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`!, "l"},
1785 {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`!, "l"},
1786 {"_se0a.ogf", "_se0b.ogf", "c"},
1787 {"_se1a.ogf", "_se1b.ogf", "l"},
1788 {"_se2a.ogf", "_se2b.ogf", "r"},
1789 {"_se3a.ogf", "_se3b.ogf", "l"},
1790 {"_se4a.ogf", "_se4b.ogf", "r"},
1791 {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`!, "l"},
1792 {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`!, "l"},
1793 {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`!, "l"},
1794 {"_lguna.ogf", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, "l"},
1795 {"_rguna.ogf", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, "r"}};
1796
1797 // reticle slot element array
1798 static structcxx . . $ $anonymous_type_184791f3f8540df3_0# {
1799 int bmp_offcxx . . $ $anonymous_type_184791f3f8540df3_0#bmp_off.;
1800 int bmp_oncxx . . $ $anonymous_type_184791f3f8540df3_0#bmp_on.;
1801 char aligncxx . . $ $anonymous_type_184791f3f8540df3_0#align.; // 'l', 'r', or 'c' (clever, huh?)
1802 } Reticle_elem_arraycxx . . $ Reticle_elem_array.[MAX_RETICLE_ELEMScxx . . $ `Descent3/hud.cpp:1687:9`!];
1803
1804 const int Ret_prim_wbcxx . . $ Ret_prim_wb.[MAX_WB_GUNPOINTScxx . . $ `lib/robotfirestruct_external.h:22:9`! + 1] = {
1805 RET_CPRIMARYcxx . . $ `Descent3/hud.cpp:1688:9`!, // reserved for NON mass driver
1806 RET_R1PRIMARYcxx . . $ `Descent3/hud.cpp:1690:9`!, RET_L1PRIMARYcxx . . $ `Descent3/hud.cpp:1689:9`!, RET_R2PRIMARYcxx . . $ `Descent3/hud.cpp:1692:9`!, RET_L2PRIMARYcxx . . $ `Descent3/hud.cpp:1691:9`!, -1, -1, -1,
1807 RET_CPRIMARY2cxx . . $ `Descent3/hud.cpp:1693:9`! // reserved for mass driver slot weapons.
1808 };
1809
1810 const int Ret_sec_wbcxx . . $ Ret_sec_wb.[MAX_WB_GUNPOINTScxx . . $ `lib/robotfirestruct_external.h:22:9`! + 1] = {
1811 RET_CSECONDARYcxx . . $ `Descent3/hud.cpp:1694:9`!, RET_R1SECONDARYcxx . . $ `Descent3/hud.cpp:1696:9`!, RET_L1SECONDARYcxx . . $ `Descent3/hud.cpp:1695:9`!, RET_R2SECONDARYcxx . . $ `Descent3/hud.cpp:1698:9`!, RET_L2SECONDARYcxx . . $ `Descent3/hud.cpp:1697:9`!, -1, -1, -1, -1};
1812
1813 #define RETMASK_FLAG_AUXPRIMARY0cxx . . $ `Descent3/hud.cpp:1813:9`! (1 << 8) // matches 9th bit (bit 8) of reticle mask
1814
1815 static uint16_tcxx . . $ uint16_t# Ret_prim_maskcxx . . $ Ret_prim_mask. = 0;
1816 static uint16_tcxx . . $ uint16_t# Ret_sec_maskcxx . . $ Ret_sec_mask. = 0;
1817
1818 // Initializes Reticle on Hud. Usually called when weapon changes.
1819 void InitReticlecxx . . $ InitReticle(3e454b8ccf442868).(int primary_slots, int secondary_slots) {
1820 int i;
1821
1822 for (i = 0; i < MAX_RETICLE_ELEMScxx . . $ `Descent3/hud.cpp:1687:9`!; i++) {
1823 char filename[PSFILENAME_LENcxx . . $ `lib/pstypes.h:31:9`! + 1];
1824
1825 if (Reticle_image_namescxx . . $ Reticle_image_names.[i][0] && primary_slots >= 0) {
1826 snprintf(filename, sizeof(filename), "%s%s", Reticle_prefixcxx . . $ Reticle_prefix., Reticle_image_namescxx . . $ Reticle_image_names.[i][0]);
1827 Reticle_elem_arraycxx . . $ Reticle_elem_array.[i].bmp_offcxx . . $ $anonymous_type_184791f3f8540df3_0#bmp_off. = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).(IGNORE_TABLEcxx . . $ `lib/manage_external.h:54:9`!(filename), 0);
1828 if (Reticle_elem_arraycxx . . $ Reticle_elem_array.[i].bmp_offcxx . . $ $anonymous_type_184791f3f8540df3_0#bmp_off. <= BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!) {
1829 Reticle_elem_arraycxx . . $ Reticle_elem_array.[i].bmp_offcxx . . $ $anonymous_type_184791f3f8540df3_0#bmp_off. = -1;
1830 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Unable to load %s reticle image.\n", filename);
1831 }
1832 } else {
1833 Reticle_elem_arraycxx . . $ Reticle_elem_array.[i].bmp_offcxx . . $ $anonymous_type_184791f3f8540df3_0#bmp_off. = -1;
1834 }
1835
1836 if (Reticle_image_namescxx . . $ Reticle_image_names.[i][1] && primary_slots >= 0) {
1837 snprintf(filename, sizeof(filename), "%s%s", Reticle_prefixcxx . . $ Reticle_prefix., Reticle_image_namescxx . . $ Reticle_image_names.[i][1]);
1838 Reticle_elem_arraycxx . . $ Reticle_elem_array.[i].bmp_oncxx . . $ $anonymous_type_184791f3f8540df3_0#bmp_on. = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).(IGNORE_TABLEcxx . . $ `lib/manage_external.h:54:9`!(filename), 0);
1839 if (Reticle_elem_arraycxx . . $ Reticle_elem_array.[i].bmp_oncxx . . $ $anonymous_type_184791f3f8540df3_0#bmp_on. <= BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!) {
1840 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Unable to load %s reticle image.\n", filename);
1841 Reticle_elem_arraycxx . . $ Reticle_elem_array.[i].bmp_oncxx . . $ $anonymous_type_184791f3f8540df3_0#bmp_on. = -1;
1842 }
1843 } else {
1844 Reticle_elem_arraycxx . . $ Reticle_elem_array.[i].bmp_oncxx . . $ $anonymous_type_184791f3f8540df3_0#bmp_on. = -1;
1845 }
1846
1847 Reticle_elem_arraycxx . . $ Reticle_elem_array.[i].aligncxx . . $ $anonymous_type_184791f3f8540df3_0#align. = Reticle_image_namescxx . . $ Reticle_image_names.[i][2][0];
1848 }
1849 }
1850
1851 // frees up bitmaps associated with reticle.
1852 void FreeReticlecxx . . $ FreeReticle(49f6e7a06ebc5aa8).() {
1853 int i;
1854
1855 for (i = 0; i < MAX_RETICLE_ELEMScxx . . $ `Descent3/hud.cpp:1687:9`!; i++) {
1856 if (Reticle_elem_arraycxx . . $ Reticle_elem_array.[i].bmp_offcxx . . $ $anonymous_type_184791f3f8540df3_0#bmp_off. > BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!)
1857 bm_FreeBitmapcxx . . $ bm_FreeBitmap(d4f767463ce0a6b3).(Reticle_elem_arraycxx . . $ Reticle_elem_array.[i].bmp_offcxx . . $ $anonymous_type_184791f3f8540df3_0#bmp_off.);
1858 Reticle_elem_arraycxx . . $ Reticle_elem_array.[i].bmp_offcxx . . $ $anonymous_type_184791f3f8540df3_0#bmp_off. = -1;
1859 if (Reticle_elem_arraycxx . . $ Reticle_elem_array.[i].bmp_oncxx . . $ $anonymous_type_184791f3f8540df3_0#bmp_on. > BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!)
1860 bm_FreeBitmapcxx . . $ bm_FreeBitmap(d4f767463ce0a6b3).(Reticle_elem_arraycxx . . $ Reticle_elem_array.[i].bmp_oncxx . . $ $anonymous_type_184791f3f8540df3_0#bmp_on.);
1861 Reticle_elem_arraycxx . . $ Reticle_elem_array.[i].bmp_oncxx . . $ $anonymous_type_184791f3f8540df3_0#bmp_on. = -1;
1862 }
1863 }
1864
1865 // resets reticle based off current player object.
1866 // and the ship's weapon configuration
1867 void ResetReticlecxx . . $ ResetReticle(49f6e7a06ebc5aa8).() {
1868 playercxx . . $ player# *player = &Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.];
1869 objectcxx . . $ object# *pobj = &Objectscxx . . $ Objects.[player->objnumcxx . . $ player#objnum.];
1870
1871 ASSERTcxx . . $ `misc/pserror.h:246:9`!(player->objnum >= 0);
1872
1873 // Make sure we're not resetting a non-existent object
1874 if (!pobj || (pobj->typecxx . . $ object#type. != OBJ_PLAYERcxx . . $ `Descent3/object_external.h:164:9`! && pobj->typecxx . . $ object#type. != OBJ_GHOSTcxx . . $ `Descent3/object_external.h:172:9`! && pobj->typecxx . . $ object#type. != OBJ_OBSERVERcxx . . $ `Descent3/object_external.h:182:9`!))
1875 return;
1876
1877 poly_modelcxx . . $ poly_model# *pm = &Poly_modelscxx . . $ Poly_models.[Objectscxx . . $ Objects.[player->objnumcxx . . $ player#objnum.].rtypecxx . . $ object#rtype..pobj_infocxx . . $ object#$anonymous_type_10#pobj_info..model_numcxx . . $ polyobj_info#model_num.];
1878 otype_wb_infocxx . . $ otype_wb_info# *prim_wb = &Shipscxx . . $ Ships.[player->ship_indexcxx . . $ player#ship_index.].static_wbcxx . . $ ship#static_wb.[player->weaponcxx . . $ player#weapon.[PW_PRIMARYcxx . . $ `Descent3/player_external.h:108:9`!].indexcxx . . $ player_weapon#index.];
1879 otype_wb_infocxx . . $ otype_wb_info# *sec_wb = &Shipscxx . . $ Ships.[player->ship_indexcxx . . $ player#ship_index.].static_wbcxx . . $ ship#static_wb.[player->weaponcxx . . $ player#weapon.[PW_SECONDARYcxx . . $ `Descent3/player_external.h:109:9`!].indexcxx . . $ player_weapon#index.];
1880 dynamic_wb_infocxx . . $ dynamic_wb_info# *prim_dyn_wb = &pobj->dynamic_wbcxx . . $ object#dynamic_wb.[player->weaponcxx . . $ player#weapon.[PW_PRIMARYcxx . . $ `Descent3/player_external.h:108:9`!].indexcxx . . $ player_weapon#index.];
1881
1882 int i, j;
1883
1884 // assign reticle elements to the Ret_prim_xx array.
1885 // create battery mask
1886 Ret_prim_maskcxx . . $ Ret_prim_mask. = 0;
1887
1888 // iterate through all battery masks to determine which gun points occupy the primary weapon
1889 // on the player ship!
1890 for (j = 0; j < prim_wb->num_maskscxx . . $ otype_wb_info#num_masks.; j++) {
1891 for (i = 0; i < pm->poly_wbcxx . . $ poly_model#poly_wb.[0].num_gpscxx . . $ poly_wb_info#num_gps.; i++) {
1892 if (prim_wb->gp_fire_maskscxx . . $ otype_wb_info#gp_fire_masks.[j] & (1 << i)) {
1893 Ret_prim_maskcxx . . $ Ret_prim_mask. |= (1 << i);
1894 } else if ((prim_dyn_wb->flagscxx . . $ dynamic_wb_info#flags. & DWBF_QUADcxx . . $ `lib/robotfirestruct_external.h:47:9`!) && (prim_wb->gp_quad_fire_maskcxx . . $ otype_wb_info#gp_quad_fire_mask. & (1 << i))) {
1895 Ret_prim_maskcxx . . $ Ret_prim_mask. |= (1 << i);
1896 }
1897 }
1898 }
1899
1900 if (player->weaponcxx . . $ player#weapon.[PW_PRIMARYcxx . . $ `Descent3/player_external.h:108:9`!].indexcxx . . $ player_weapon#index. == MASSDRIVER_INDEXcxx . . $ `Descent3/weapon_external.h:28:9`! && (Ret_prim_maskcxx . . $ Ret_prim_mask. & (1 << 0))) {
1901 // special hack for mass driver weapons
1902 Ret_prim_maskcxx . . $ Ret_prim_mask. &= (~(1 << 0));
1903 Ret_prim_maskcxx . . $ Ret_prim_mask. |= RETMASK_FLAG_AUXPRIMARY0cxx . . $ `Descent3/hud.cpp:1813:9`!;
1904 }
1905
1906 // iterate through all battery masks to determine which gun points occupy the secondary weapon
1907 // on the player ship!
1908 Ret_sec_maskcxx . . $ Ret_sec_mask. = 0;
1909
1910 for (j = 0; j < sec_wb->num_maskscxx . . $ otype_wb_info#num_masks.; j++) {
1911 for (i = 0; i < pm->poly_wbcxx . . $ poly_model#poly_wb.[0].num_gpscxx . . $ poly_wb_info#num_gps.; i++) {
1912 if (sec_wb->gp_fire_maskscxx . . $ otype_wb_info#gp_fire_masks.[j] & (1 << i))
1913 Ret_sec_maskcxx . . $ Ret_sec_mask. |= (1 << i);
1914 }
1915 }
1916 }
1917
1918 // creates the reticle display bitmap mask to be used by the reticle renderer.
1919 static inline uint16_tcxx . . $ uint16_t# reticle_maskcxx . . $ reticle_mask(6f1de5d660daf15d).(objectcxx . . $ object# *pobj, otype_wb_infocxx . . $ otype_wb_info# *static_wb, int wb_index) {
1920 poly_modelcxx . . $ poly_model# *pm = &Poly_modelscxx . . $ Poly_models.[pobj->rtypecxx . . $ object#rtype..pobj_infocxx . . $ object#$anonymous_type_10#pobj_info..model_numcxx . . $ polyobj_info#model_num.];
1921 dynamic_wb_infocxx . . $ dynamic_wb_info# *dyn_wb = &pobj->dynamic_wbcxx . . $ object#dynamic_wb.[wb_index];
1922 unsigned mask = 0;
1923 int i;
1924
1925 // determine if weapon battery is charged, if not, then return 0, indicating no 'on' weapon baterries
1926 if (!WBIsBatteryReadycxx . . $ WBIsBatteryReady(ad7a19887510094c).(pobj, static_wb, wb_index))
1927 return 0;
1928
1929 if (static_wb->ammo_usagecxx . . $ otype_wb_info#ammo_usage.) {
1930 if (Playerscxx . . $ Players.[pobj->idcxx . . $ object#id.].weapon_ammocxx . . $ player#weapon_ammo.[wb_index] == 0)
1931 return 0;
1932 } else if (static_wb->energy_usagecxx . . $ otype_wb_info#energy_usage.) {
1933 if (Playerscxx . . $ Players.[pobj->idcxx . . $ object#id.].energycxx . . $ player#energy. < static_wb->energy_usagecxx . . $ otype_wb_info#energy_usage.)
1934 return 0;
1935 }
1936
1937 // create battery mask
1938 for (i = 0; i < pm->poly_wbcxx . . $ poly_model#poly_wb.[0].num_gpscxx . . $ poly_wb_info#num_gps.; i++) {
1939 if (static_wb->gp_fire_maskscxx . . $ otype_wb_info#gp_fire_masks.[dyn_wb->cur_firing_maskcxx . . $ dynamic_wb_info#cur_firing_mask.] & (1 << i)) {
1940 mask |= (1 << i);
1941 } else if ((dyn_wb->flagscxx . . $ dynamic_wb_info#flags. & DWBF_QUADcxx . . $ `lib/robotfirestruct_external.h:47:9`!) && (static_wb->gp_quad_fire_maskcxx . . $ otype_wb_info#gp_quad_fire_mask. & (1 << i))) {
1942 mask |= (1 << i);
1943 }
1944 }
1945
1946 if (wb_index == MASSDRIVER_INDEXcxx . . $ `Descent3/weapon_external.h:28:9`! && (mask & (1 << 0))) {
1947 // special hack for mass driver weapons
1948 mask &= (~(1 << 0));
1949 mask |= RETMASK_FLAG_AUXPRIMARY0cxx . . $ `Descent3/hud.cpp:1813:9`!;
1950 }
1951
1952 return mask;
1953 }
1954
1955 static inline void draw_reticle_subcxx . . $ draw_reticle_sub(c18106eab1ee9b1d).(int cx, int cy, int rw, int rh, uint16_tcxx . . $ uint16_t# on_mask, uint16_tcxx . . $ uint16_t# gp_mask, const int *wb_elem_array) {
1956 int i, x, y;
1957 int bmp_handle;
1958 char align;
1959
1960 for (i = 0; i < (MAX_WB_GUNPOINTScxx . . $ `lib/robotfirestruct_external.h:22:9`! + 1); i++) {
1961 if (gp_mask & (1 << i)) {
1962 // we can definitely draw a reticle image, which one is the question now.
1963 ASSERTcxx . . $ `misc/pserror.h:246:9`!(wb_elem_array[i] > -1);
1964 if (on_mask & (1 << i))
1965 bmp_handle = Reticle_elem_arraycxx . . $ Reticle_elem_array.[wb_elem_array[i]].bmp_oncxx . . $ $anonymous_type_184791f3f8540df3_0#bmp_on.;
1966 else
1967 bmp_handle = Reticle_elem_arraycxx . . $ Reticle_elem_array.[wb_elem_array[i]].bmp_offcxx . . $ $anonymous_type_184791f3f8540df3_0#bmp_off.;
1968 align = Reticle_elem_arraycxx . . $ Reticle_elem_array.[wb_elem_array[i]].aligncxx . . $ $anonymous_type_184791f3f8540df3_0#align.;
1969
1970 if (bmp_handle > -1) {
1971 // draw on image based off of alignment to cx,cy and 'align'
1972 switch (align) {
1973 case 'l':
1974 x = cx - rw;
1975 y = cy - rh / 2;
1976 break;
1977 case 'r':
1978 x = cx;
1979 y = cy - rh / 2;
1980 break;
1981 case 'c':
1982 x = cx - rw / 2;
1983 y = cy - rh / 2;
1984 break;
1985 default:
1986 x = cx;
1987 y = cy;
1988 Int3cxx . . $ `misc/pserror.h:247:9`!();
1989 }
1990
1991 RenderHUDQuadcxx . . $ RenderHUDQuad(fc69324a5ac6b910).(x, y, rw, rh, 0, 0, 1, 1, bmp_handle, 192);
1992 }
1993 }
1994 }
1995 }
1996
1997 // renders the reticle
1998 void RenderReticlecxx . . $ RenderReticle(49f6e7a06ebc5aa8).() {
1999 static uint16_tcxx . . $ uint16_t# primary_index_last_frame = 0xffff;
2000 static bool quad_primary_last_frame = false;
2001 playercxx . . $ player# *player = &Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.];
2002 objectcxx . . $ object# *pobj = &Objectscxx . . $ Objects.[player->objnumcxx . . $ player#objnum.];
2003 shipcxx . . $ ship# *ship = &Shipscxx . . $ Ships.[player->ship_indexcxx . . $ player#ship_index.];
2004 player_weaponcxx . . $ player_weapon# *prim_pw = &player->weaponcxx . . $ player#weapon.[PW_PRIMARYcxx . . $ `Descent3/player_external.h:108:9`!];
2005 player_weaponcxx . . $ player_weapon# *sec_pw = &player->weaponcxx . . $ player#weapon.[PW_SECONDARYcxx . . $ `Descent3/player_external.h:109:9`!];
2006 int prim_wb_index = prim_pw->indexcxx . . $ player_weapon#index.;
2007 int sec_wb_index = sec_pw->indexcxx . . $ player_weapon#index.;
2008 otype_wb_infocxx . . $ otype_wb_info# *prim_wb = &ship->static_wbcxx . . $ ship#static_wb.[prim_wb_index];
2009 otype_wb_infocxx . . $ otype_wb_info# *sec_wb = &ship->static_wbcxx . . $ ship#static_wb.[sec_wb_index];
2010 dynamic_wb_infocxx . . $ dynamic_wb_info# *prim_dyn_wb = &pobj->dynamic_wbcxx . . $ object#dynamic_wb.[prim_wb_index];
2011
2012 int cx = Ret_x_offcxx . . $ Ret_x_off. + (FIXED_SCREEN_WIDTHcxx . . $ `lib/grdefs.h:65:9`! >> 1);
2013 int cy = Ret_y_offcxx . . $ Ret_y_off. + (FIXED_SCREEN_HEIGHTcxx . . $ `lib/grdefs.h:66:9`! >> 1) + 6;
2014 int rw = RET_IMAGE_WIDTHcxx . . $ `Descent3/hud.cpp:1684:9`!;
2015 int rh = RET_IMAGE_HEIGHTcxx . . $ `Descent3/hud.cpp:1685:9`!;
2016
2017 // quad weapon check hack (any weapon states that change should be noted here.)
2018 if (prim_dyn_wb->flagscxx . . $ dynamic_wb_info#flags. & DWBF_QUADcxx . . $ `lib/robotfirestruct_external.h:47:9`!) {
2019 if (!quad_primary_last_frame || primary_index_last_frame != prim_wb_index) {
2020 ResetReticlecxx . . $ ResetReticle(49f6e7a06ebc5aa8).();
2021 }
2022 quad_primary_last_frame = true;
2023 } else {
2024 if (quad_primary_last_frame) {
2025 ResetReticlecxx . . $ ResetReticle(49f6e7a06ebc5aa8).();
2026 }
2027 quad_primary_last_frame = false;
2028 }
2029
2030 primary_index_last_frame = prim_wb_index;
2031
2032 // determine which primary batteries are open.
2033 draw_reticle_subcxx . . $ draw_reticle_sub(c18106eab1ee9b1d).(cx, cy, rw, rh, reticle_maskcxx . . $ reticle_mask(6f1de5d660daf15d).(pobj, prim_wb, prim_wb_index), Ret_prim_maskcxx . . $ Ret_prim_mask., Ret_prim_wbcxx . . $ Ret_prim_wb.);
2034 draw_reticle_subcxx . . $ draw_reticle_sub(c18106eab1ee9b1d).(cx, cy, rw, rh, reticle_maskcxx . . $ reticle_mask(6f1de5d660daf15d).(pobj, sec_wb, sec_wb_index), Ret_sec_maskcxx . . $ Ret_sec_mask., Ret_sec_wbcxx . . $ Ret_sec_wb.);
2035
2036 if (Reticle_elem_arraycxx . . $ Reticle_elem_array.[RET_LGUNSIGHTcxx . . $ `Descent3/hud.cpp:1699:9`!].bmp_offcxx . . $ $anonymous_type_184791f3f8540df3_0#bmp_off. > -1)
2037 RenderHUDQuadcxx . . $ RenderHUDQuad(fc69324a5ac6b910).(cx - rw, cy - rh / 2, rw, rh, 0, 0, 1, 1, Reticle_elem_arraycxx . . $ Reticle_elem_array.[RET_LGUNSIGHTcxx . . $ `Descent3/hud.cpp:1699:9`!].bmp_offcxx . . $ $anonymous_type_184791f3f8540df3_0#bmp_off., 192);
2038
2039 if (Reticle_elem_arraycxx . . $ Reticle_elem_array.[RET_RGUNSIGHTcxx . . $ `Descent3/hud.cpp:1700:9`!].bmp_offcxx . . $ $anonymous_type_184791f3f8540df3_0#bmp_off. > -1)
2040 RenderHUDQuadcxx . . $ RenderHUDQuad(fc69324a5ac6b910).(cx, cy - rh / 2, rw, rh, 0, 0, 1, 1, Reticle_elem_arraycxx . . $ Reticle_elem_array.[RET_RGUNSIGHTcxx . . $ `Descent3/hud.cpp:1700:9`!].bmp_offcxx . . $ $anonymous_type_184791f3f8540df3_0#bmp_off., 192);
2041 }
2042
2043 // renders missile reticle
2044 void RenderMissileReticlecxx . . $ RenderMissileReticle(49f6e7a06ebc5aa8).() {
2045 // Crosshair reticle
2046 int cx = Game_window_wcxx . . $ Game_window_w. / 2;
2047 int cy = Game_window_hcxx . . $ Game_window_h. / 2;
2048
2049 RenderHUDTextFlagscxx . . $ RenderHUDTextFlags(15b906afa0252220).(HUDTEXT_CENTEREDcxx . . $ `Descent3/hud.h:604:9`!, GR_REDcxx . . $ GR_RED., HUD_ALPHAcxx . . $ `Descent3/hud.h:308:9`!, 0, 10, cy - 50, TXT_HUD_GUIDEDcxx . . $ `Descent3/stringtable.h:578:9`!);
2050 grtext_Flushcxx . . $ grtext_Flush(49f6e7a06ebc5aa8).();
2051
2052 rend_SetZBufferStatecxx . . $ rend_SetZBufferState(4af4fd0e2b26c4ac).(0);
2053 rend_SetFlatColorcxx . . $ rend_SetFlatColor(cb2f890c2fdad230).(GR_GREENcxx . . $ GR_GREEN.);
2054
2055 rend_DrawLinecxx . . $ rend_DrawLine(748afa4755bc9595).(cx - 6, cy, cx + 6, cy);
2056 rend_DrawLinecxx . . $ rend_DrawLine(748afa4755bc9595).(cx, cy - 6, cx, cy + 6);
2057 rend_SetZBufferStatecxx . . $ rend_SetZBufferState(4af4fd0e2b26c4ac).(1);
2058 }
2059
2060 // renders missile reticle
2061 void RenderZoomReticlecxx . . $ RenderZoomReticle(49f6e7a06ebc5aa8).() {
2062 // Crosshair reticle
2063 int cx = Game_window_wcxx . . $ Game_window_w. / 2;
2064 int cy = Game_window_hcxx . . $ Game_window_h. / 2;
2065 int text_height = grfont_GetHeightcxx . . $ grfont_GetHeight(7864480464b09eea).(HUD_FONTcxx . . $ `Descent3/gamefont.h:105:9`!);
2066 char str[255];
2067
2068 RenderHUDTextFlagscxx . . $ RenderHUDTextFlags(15b906afa0252220).(HUDTEXT_CENTEREDcxx . . $ `Descent3/hud.h:604:9`!, GR_REDcxx . . $ GR_RED., HUD_ALPHAcxx . . $ `Descent3/hud.h:308:9`!, 0, 10, cy - 50, TXT_HUD_ZOOMcxx . . $ `Descent3/stringtable.h:579:9`!);
2069
2070 snprintf(str, sizeof(str), TXT_HUD_ZOOM_UNITScxx . . $ `Descent3/stringtable.h:580:9`!, Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].zoom_distancecxx . . $ player#zoom_distance.);
2071
2072 RenderHUDTextFlagscxx . . $ RenderHUDTextFlags(15b906afa0252220).(HUDTEXT_CENTEREDcxx . . $ `Descent3/hud.h:604:9`!, GR_REDcxx . . $ GR_RED., HUD_ALPHAcxx . . $ `Descent3/hud.h:308:9`!, 0, 10, cy - 50 + text_height, str);
2073 grtext_Flushcxx . . $ grtext_Flush(49f6e7a06ebc5aa8).();
2074
2075 rend_SetZBufferStatecxx . . $ rend_SetZBufferState(4af4fd0e2b26c4ac).(0);
2076
2077 if (Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].flagscxx . . $ player#flags. & PLAYER_FLAGS_BULLSEYEcxx . . $ `Descent3/player_external.h:95:9`!)
2078 rend_SetFlatColorcxx . . $ rend_SetFlatColor(cb2f890c2fdad230).(GR_REDcxx . . $ GR_RED.);
2079 else
2080 rend_SetFlatColorcxx . . $ rend_SetFlatColor(cb2f890c2fdad230).(GR_GREENcxx . . $ GR_GREEN.);
2081
2082 rend_DrawLinecxx . . $ rend_DrawLine(748afa4755bc9595).(cx - 8, cy, cx + 8, cy);
2083 rend_DrawLinecxx . . $ rend_DrawLine(748afa4755bc9595).(cx, cy - 8, cx, cy + 8);
2084 }
2085
2086 /*
2087 // HUD FILE FUNCTIONS
2088 #define HUDCMD_NUM 22
2089 #define HUDCMD_TYPE 0
2090 #define HUDCMD_RED 1
2091 #define HUDCMD_GREEN 2
2092 #define HUDCMD_BLUE 3
2093 #define HUDCMD_X 4
2094 #define HUDCMD_Y 5
2095 #define HUDCMD_TX 6
2096 #define HUDCMD_TY 7
2097 #define HUDCMD_CREATE 8
2098 #define HUDCMD_SAT 9
2099 #define HUDCMD_SPECIAL 10
2100 #define HUDCMD_CKPTMODEL 11
2101 #define HUDCMD_AFTERBURN 12
2102 #define HUDCMD_ENERGY 13
2103 #define HUDCMD_INVPULSE 14
2104 #define HUDCMD_SHIP 15
2105 #define HUDCMD_SHIELDIMG0 16
2106 #define HUDCMD_SHIELDIMG1 17
2107 #define HUDCMD_SHIELDIMG2 18
2108 #define HUDCMD_SHIELDIMG3 19
2109 #define HUDCMD_SHIELDIMG4 20
2110 #define HUDCMD_ALPHA 21
2111
2112 const char *HUDCommands[HUDCMD_NUM] = {
2113 "type",
2114 "r",
2115 "g",
2116 "b",
2117 "x",
2118 "y",
2119 "tx",
2120 "ty",
2121 "create",
2122 "sat",
2123 "special",
2124 "ckptmodel",
2125 "afterburnimg",
2126 "energyimg",
2127 "invpulseimg",
2128 "shipimg",
2129 "shieldimg0",
2130 "shieldimg1",
2131 "shieldimg2",
2132 "shieldimg3",
2133 "shieldimg4",
2134 "alpha"
2135 };
2136
2137
2138 int HUDLex(const char *command)
2139 {
2140 for (int i = 0; i < HUDCMD_NUM; i++)
2141 if (strcmp(HUDCommands[i], command) == 0)
2142 return i;
2143
2144 return INFFILE_ERROR;
2145 }
2146
2147
2148 // takes a filename containing oms data.
2149 void LoadHudConfig(const char *filename, bool (*fn)(const char*, const char *, void*), void *ext_data)
2150 {
2151 InfFile inf;
2152 tHUDItem hud_item;
2153 char operand[INFFILE_LINELEN]; // operand
2154 bool txpos = false, typos = false;
2155 uint8_t r=GR_COLOR_RED(HUD_COLOR);
2156 uint8_t g=GR_COLOR_GREEN(HUD_COLOR);
2157 uint8_t b=GR_COLOR_BLUE(HUD_COLOR);
2158
2159 // start over.
2160 ResetHud();
2161
2162 memset(&hud_item, 0, sizeof(hud_item));
2163 hud_item.alpha = HUD_ALPHA;
2164
2165 // open file
2166 if (!inf.Open(file, "[hud file]", HUDLex)) {
2167 Warning("Unable to find requested theme %s or bad file.\n", file);
2168 return false;
2169 }
2170
2171 // check if valid cockpit file
2172 while (inf.ReadLine())
2173 {
2174 int cmd;
2175
2176 while ((cmd = inf.ParseLine(operand, INFFILE_LINELEN)) > INFFILE_ERROR)
2177 {
2178 switch (cmd)
2179 {
2180 case HUDCMD_TYPE: hud_item.type = atoi(operand); break;
2181 case HUDCMD_RED: r=(uint8_t)atoi(operand); break;
2182 case HUDCMD_GREEN: g=(uint8_t)atoi(operand); break;
2183 case HUDCMD_BLUE: b=(uint8_t)atoi(operand); break;
2184 case HUDCMD_X: hud_item.x = atoi(operand); break;
2185 case HUDCMD_Y: hud_item.y = atoi(operand); break;
2186 case HUDCMD_TX: hud_item.tx = atoi(operand); txpos = true; break;
2187 case HUDCMD_TY: hud_item.ty = atoi(operand); typos = true; break;
2188 case HUDCMD_SAT: hud_item.saturation_count = atoi(operand); break;
2189 case HUDCMD_SPECIAL: hud_item.stat |= STAT_SPECIAL; break;
2190 case HUDCMD_ALPHA: hud_item.alpha = atoi(operand); break;
2191 case HUDCMD_CREATE:
2192 hud_item.color = GR_RGB(r,g,b);
2193 if (!txpos) hud_item.tx = hud_item.x;
2194 if (!typos) hud_item.ty = hud_item.y;
2195 hud_item.render_fn = HudDisplayRouter;
2196 AddHudItem(&hud_item);
2197
2198 memset(&hud_item, 0, sizeof(hud_item));
2199 hud_item.alpha = HUD_ALPHA;
2200 r=GR_COLOR_RED(HUD_COLOR);
2201 g=GR_COLOR_GREEN(HUD_COLOR);
2202 b=GR_COLOR_BLUE(HUD_COLOR);
2203 txpos = false;
2204 typos = false;
2205 break;
2206 case HUDCMD_AFTERBURN:
2207 case HUDCMD_ENERGY:
2208 case HUDCMD_INVPULSE:
2209 case HUDCMD_SHIP:
2210 case HUDCMD_SHIELDIMG0:
2211 case HUDCMD_SHIELDIMG1:
2212 case HUDCMD_SHIELDIMG2:
2213 case HUDCMD_SHIELDIMG3:
2214 case HUDCMD_SHIELDIMG4:
2215 case HUDCMD_CKPTMODEL:
2216 default:
2217 if (fn && !(*fn)(HUDCommands[cmd], operand, ext_data)) {
2218 goto force_error;
2219 }
2220 }
2221 }
2222
2223 force_error:
2224 if (cmd == INFFILE_ERROR)
2225 Warning("Error in hud file %s line %d.\n", file, inf.line());
2226 }
2227
2228 inf.Close();
2229
2230 return true;
2231 }
2232
2233 */