Debian Codegraph @

Descent3/GameLoop.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/GameLoop.cpp $
21 * $Revision: 400 $
22 * $Date: 4/19/00 5:10p $
23 * $Author: Matt $
24 *
25 * Main loop for Descent 3
26 *
27 * $Log: /DescentIII/main/GameLoop.cpp $
28 *
29 * 400 4/19/00 5:10p Matt
30 * From Duane for 1.4
31 * Added checks, asserts, and fixes for bad return values
32 * Mac key code change (KEY_PAGEDOWN)
33 *
34 * 399 4/06/00 9:25a Matt
35 * Fixed a screen clear problem on at ATI Rage Fury Maxx in dual-chip mode
36 * by forcing the screen to clear four times (instead of three).
37 *
38 * 398 3/30/00 11:48a Jeff
39 * an ivibe call was nestled in a DEBUG block
40 *
41 * 397 3/29/00 2:24p Jeff
42 * moved call to vibe_quarterframe before rendering
43 *
44 * 396 3/20/00 12:08p Matt
45 * Merge of Duane's post-1.3 changes.
46 * Made PageDown key pause on Mac (Mac only)
47 *
48 * 395 1/27/00 12:04p Jeff
49 * updated IntelliVIBE to match new specs
50 *
51 * 394 1/26/00 9:20p Jeff
52 * added support for IntelliVIBE DLL
53 *
54 * 393 10/24/99 9:34a Chris
55 *
56 * 392 10/22/99 6:04p Jeff
57 * fixed bugs and compiler errors resulting from mac code merge
58 *
59 * 391 10/22/99 1:26p Matt
60 * Mac merge
61 *
62 * 390 10/15/99 5:56p 3dsmax
63 * In terrain sound system, treat heights above 255 as 255.
64 *
65 * 389 9/20/99 5:30p Jeff
66 * added pretty powerup particles for Katmai systems
67 *
68 * 388 8/31/99 5:30p Jason
69 * network statistics code
70 *
71 * 387 7/26/99 1:17p Jeff
72 * need to call startframe/endframe for renderstats
73 *
74 * 386 7/22/99 8:59p Jeff
75 * added texture upload for render stats
76 *
77 * 385 7/20/99 1:18p Samir
78 * save state of rearviews between game through the pilot file.
79 *
80 * 384 7/15/99 6:39p Jeff
81 * added outlinemode cheat code and rendering stats cheat
82 *
83 * 383 7/13/99 10:02a Jeff
84 * call mulitplayer event to translate text taunts
85 *
86 * 382 5/23/99 3:04a Jason
87 * fixed bug with player rankings not being updated correctly
88 *
89 * 381 5/23/99 12:35a Chris
90 * FVI check now ignores rendered portals
91 *
92 * 380 5/21/99 5:08a Chris
93 * Corrected the Region Vis mprintf
94 *
95 * 379 5/20/99 10:10p Samir
96 * don't allow certain keys for death (like savegame, guidebot, markers).
97 *
98 * 378 5/17/99 6:06p Chris
99 * Adding robot debug code
100 *
101 * 377 5/12/99 1:18p Samir
102 * play music during game too when in menus.
103 *
104 * 376 5/11/99 10:58a Kevin
105 * Added del-PAD_7 to kill off all robots of a certain type (the first
106 * type found)
107 *
108 * 375 5/10/99 10:22p Ardussi
109 * changes to compile on Mac
110 *
111 * 374 5/10/99 5:40p Jeff
112 * no saving during a cinematic
113 *
114 * 373 5/09/99 10:07p Jeff
115 * added guidebot shortcuts
116 *
117 * 372 5/09/99 3:07p Jason
118 * added a way to track FVI rays
119 *
120 * 371 5/07/99 6:21p Jeff
121 * hooked up fvi to debug graph
122 *
123 * 370 5/05/99 5:45p Samir
124 * fixed DEL-F10 player ship change.
125 *
126 * 369 5/04/99 9:26p Jeff
127 * debug key to turn off spewers
128 *
129 * 368 5/01/99 4:59p Jason
130 * made rearview work correctly
131 *
132 * 367 4/30/99 12:02p Matt
133 * Keep the rear view up between levels, but close the other camera views.
134 *
135 * 366 4/25/99 6:14p Kevin
136 * added "-timetest file.dem" to behave like gamegauge does
137 *
138 * 365 4/24/99 8:43p Samir
139 * when shrinking screen hud messages get rendered in black region.
140 *
141 * 364 4/24/99 7:22p Jason
142 * fixed respawn problem
143 *
144 * 363 4/21/99 11:05a Kevin
145 * new ps_rand and ps_srand to replace rand & srand
146 *
147 * 362 4/20/99 11:45a Samir
148 * added autosave
149 *
150 * 361 4/16/99 6:02p Jason
151 * fixed crash bugs with dev release
152 *
153 * 360 4/16/99 6:00p Kevin
154 * Bunches of Demo stuff
155 *
156 * 359 4/16/99 12:04p Jason
157 * fixed players respawning too fast
158 *
159 * 358 4/15/99 11:58p Jeff
160 * include soar.h to make Linux happy
161 *
162 * 357 4/15/99 1:39a Jeff
163 * changes for linux compile
164 *
165 * 356 4/14/99 2:50a Jeff
166 * fixed some case mismatched #includes
167 *
168 * 355 4/12/99 7:14p Samir
169 * added multiple pages per mono window.
170 *
171 * 354 4/12/99 1:13a Matt
172 * Added guidebot view to small windows (& simplified code to set marker
173 * views).
174 *
175 * 353 4/10/99 5:56p Matt
176 * Cleaned up object initialization code, including create object & load
177 * object.
178 *
179 * 352 4/07/99 12:30p Matt
180 * Added code for failed missions.
181 *
182 * 351 4/04/99 8:15p Jeff
183 * added debug graph stuff
184 *
185 * 350 4/02/99 11:33p Jeff
186 * able to turn off IGC in debug mode. Better handling of cinematics
187 * quick exit if playing via alt-p
188 *
189 * 349 3/27/99 4:45p Samir
190 * reinstate pause music when pausing game.
191 *
192 * 348 3/23/99 9:07p Samir
193 * turn on and off music when pausing and resuming game, if appropriate.
194 *
195 * 347 3/23/99 2:50p Samir
196 * made HUD_disabled available to all builds.
197 *
198 * 346 3/22/99 4:26p Samir
199 * added toggles for guided missile view and reticle.
200 *
201 * 345 3/08/99 9:07p Samir
202 * dont flush controller if object doesn't exist.
203 *
204 * 344 3/08/99 5:13p Jason
205 * added delay to player respawn after death
206 *
207 * 343 3/05/99 5:23p Jason
208 * fixed text taunts to actually work
209 *
210 * 342 3/05/99 1:34p Jeff
211 * don't allow saving/loading of games during cinematics
212 *
213 * 341 3/04/99 4:56p Jason
214 * moved function call to correct spot
215 *
216 * 340 3/04/99 4:53p Jason
217 * added LOD manipulation function calls
218 *
219 * 339 3/02/99 9:37p Matt
220 * In all-weapons cheat, give the player the max ammo for each weapon,
221 * instead of 5000. This means that non-ammo weapons won't get ammo.
222 *
223 * 338 3/02/99 6:39p Jeff
224 * level goals working in save/load game
225 *
226 * 337 3/02/99 2:50p Samir
227 * hud observer mode works with rest of hud.
228 *
229 * 336 3/01/99 4:17p Jeff
230 * added net flag whether buddy bot allowed
231 *
232 * 335 3/01/99 12:23a Samir
233 * reset return value for DLL upon going into CallGameDLL with key event
234 * (at the request of Jeff).
235 *
236 * 334 2/24/99 12:25p Jeff
237 * fixed guided missile/mass driver reticle/view problems when going into
238 * a cinematic
239 *
240 * 333 2/21/99 12:28p Matt
241 * Added terrain sound system
242 *
243 * 332 2/18/99 10:29a Jason
244 * fixed zbuffer problem
245 *
246 * 331 2/17/99 12:38p Kevin
247 * Added -framecap <fps> to limit frame and fixed timer bug and old
248 * framerate limiter code.
249 *
250 * 330 2/16/99 5:24p Kevin
251 * Converted timer to use 64bit int.
252 *
253 * 329 2/15/99 7:49p Jeff
254 * new pilot file class and read/write system checked in...should be more
255 * robust than old
256 *
257 * 328 2/13/99 12:31a Jeff
258 * debug key fixups (now in alphabetical order)
259 *
260 * 327 2/12/99 6:47p Jeff
261 * removed tilde as telcom key
262 *
263 * 326 2/12/99 3:54a Jeff
264 * added function to restart a level, and a cheat key to do so (del-alt-e)
265 *
266 * 325 2/10/99 6:55p Jeff
267 * added proxmines to the game
268 *
269 * 324 2/10/99 2:41p Chris
270 * Added debug info
271 *
272 * 323 2/09/99 12:09p Jason
273 * rewriting indoor engine...
274 *
275 * 322 2/09/99 9:58a Chris
276 * Massive BOA update :) Terrain happy now. Vis happy now. Sound happy
277 * now.
278 *
279 * 321 2/09/99 1:29a Jeff
280 * added code to let D3 process multiplayer games in the background if
281 * game is not in focus.
282 *
283 * 320 2/08/99 6:39p Jason
284 * first pass at new indoor engine
285 *
286 * 319 2/05/99 7:23p Kevin
287 * OEM Changes
288 *
289 * 318 1/31/99 8:48p Jeff
290 * new in game cinematics system finished
291 *
292 * 317 1/31/99 7:25p Matt
293 * Renamed a bunch of functions to have HUD capitalized
294 *
295 * 316 1/31/99 3:44p Matt
296 * Streamlined game sequencing
297 *
298 * 315 1/30/99 4:42p Jeff
299 * changed keys for telcom
300 *
301 * 314 1/29/99 6:29p Jason
302 * first pass at adding bumpmaps
303 *
304 * 313 1/29/99 6:29p Samir
305 * implemented hud scrollback for hud messages.
306 *
307 * 312 1/28/99 6:17p Jason
308 * added markers
309 *
310 * 311 1/28/99 2:22p Samir
311 * simplified music system for D3.
312 *
313 * 310 1/28/99 11:32a Jason
314 * added marker cameras
315 *
316 * 309 1/27/99 6:54p Keneta
317 * fixed merge problwm
318 *
319 * 308 1/27/99 6:08p Jason
320 * first pass at markers
321 *
322 * 307 1/27/99 6:05p Samir
323 * added scrollback for game messages on HUD.
324 *
325 * 306 1/27/99 6:02p Jeff
326 * test keys for audio taunts
327 *
328 * 305 1/22/99 5:15p Jeff
329 * added a key to toggle osiris debug messages
330 *
331 * 304 1/22/99 4:06p Jeff
332 * added hud messages that can be sent to just teammates or individual
333 * people
334 *
335 * 303 1/21/99 7:02p Jason
336 * took out liquid effect from key c
337 *
338 * 302 1/21/99 3:34p Jason
339 * added liquid code
340 *
341 * 301 1/20/99 3:45a Jeff
342 * added call to update any in-game cinematics (boss introduction
343 * cinematics)
344 *
345 * 300 1/19/99 11:25a Jason
346 * added room (fog and wind) changing functions
347 *
348 * 299 1/15/99 7:52p Chris
349 * Updated ObjSetPos() to include a f_update_attach_children flag
350 *
351 * 298 1/15/99 7:16p Kevin
352 * Added GameGauge Configuration & code
353 *
354 * 297 1/13/99 12:43p Jason
355 * fixed flickering exit menu screen
356 *
357 * 296 1/11/99 4:08p Jason
358 * added multiplayer taunt macros
359 *
360 * 295 1/08/99 2:55p Samir
361 * Ripped out OSIRIS1.
362 *
363 * 294 1/04/99 12:48p Jason
364 * fixed clear screen problems with triple buffer
365 *
366 * 293 12/21/98 9:44a Chris
367 * Ambient life stuff is all tied in to game sequencing
368 *
369 * 292 12/18/98 10:42a Jeff
370 * call to process osiris's timers added in GameFrame
371 *
372 * 291 12/17/98 12:08p Jeff
373 * first checkin of new implementation of OSIRIS (old OSIRIS no longer
374 * works)
375 *
376 * 290 12/16/98 12:04p Kevin
377 * GameSpy!
378 *
379 * 289 12/15/98 6:41p Jason
380 * took out mprintf
381 *
382 * 288 12/07/98 11:30a Kevin
383 * Added some features from the 1.1 demo patch
384 *
385 * 287 12/07/98 10:35a Jason
386 * added adjustable FOV
387 *
388 * 286 12/01/98 3:34p Matt
389 * Got rear view working.
390 *
391 * 285 11/24/98 3:57p Kevin
392 * Demo system immprovements
393 *
394 * 284 11/24/98 10:41a Kevin
395 * Demo system
396 *
397 * 283 11/23/98 4:52p Kevin
398 * Demo system enhancments
399 *
400 * 282 11/19/98 5:40p Kevin
401 * Demo system
402 *
403 * 281 11/19/98 12:43p Samir
404 * added functions to start ui menu immediately without using
405 * Game_interface_mode
406 *
407 * 280 11/18/98 2:54p Jason
408 * added snow effect
409 *
410 * 279 11/16/98 4:15p Samir
411 * added death.
412 *
413 * 278 11/13/98 2:28p Samir
414 * new music system.
415 *
416 * 276 11/10/98 5:18p Jeff
417 * removed force feedback test keys
418 *
419 * 275 11/09/98 3:08p Kevin
420 * Added demo code
421 *
422 * 274 11/06/98 7:00p Jeff
423 * first round of new force feedback installed
424 *
425 * 273 11/05/98 7:35p Samir
426 * StartTime function altered to return if timer paused == 0;.
427 *
428 * 272 11/05/98 5:54p Kevin
429 * Demo system work
430 *
431 * 271 11/03/98 6:43p Jeff
432 * new low-level & high level Force Feedback system implemented, handles
433 * window losing focus, etc.
434 *
435 * 270 10/29/98 11:08a Samir
436 * don't allow sizing of letterbox screens.
437 *
438 * 269 10/24/98 2:16p Samir
439 * processbuttons doesn't call lowlevel input code anymore.
440 *
441 * 268 10/21/98 11:14a Samir
442 * added generic code to skip rendering while in game controller config or
443 * telcom.
444 *
445 * 267 10/20/98 12:42p Matt
446 * Made the small views work on the cockpit.
447 *
448 * 266 10/19/98 7:51p Kevin
449 * performance testing
450 *
451 * 265 10/19/98 7:18p Matt
452 * Added system to support different types of damage to the player and
453 * have these different types make different sounds.
454 *
455 * 264 10/19/98 2:48p Jeff
456 * changed define for rtp performance...just define USE_RTP in
457 * rtperformance.h in order to enable it
458 *
459 * 263 10/19/98 1:10p Kevin
460 * Took demo recording out of demo build
461 *
462 * 262 10/19/98 11:57a Chris
463 * Update the sound system to use the import volume
464 *
465 * 261 10/18/98 7:26p Samir
466 * added ability to poll mouse and joystick for input in death screen.
467 * clear screen when toggling console screen.
468 *
469 * 260 10/17/98 5:50p Jeff
470 * hooked in rtperformance (run time performance) library
471 *
472 * 259 10/17/98 12:46p Kevin
473 * Beta 4 fixes
474 *
475 * 258 10/16/98 3:39p Chris
476 * Improved the object linking system and AI and physics
477 *
478 * 257 10/16/98 2:44p Kevin
479 * working on getting demo compiling
480 *
481 * 256 10/16/98 2:24p Jason
482 * changes for the demo
483 *
484 * 255 10/16/98 12:44a Jeff
485 * created frametime info log stuff
486 *
487 * 254 10/15/98 8:19p Samir
488 * damn stupid bug when growing window.
489 *
490 * 253 10/14/98 6:41p Samir
491 * if in UI system, clear screen every frame to prevent hall of mirrors.
492 *
493 * 252 10/14/98 4:27p Samir
494 * must press spacebar to quit death.
495 *
496 * 251 10/12/98 10:16a Matt
497 * Took out D3XDebugIO() call. which didn't really do anything, so I could
498 * use the backquote key elsewhere.
499 *
500 * 250 10/11/98 3:00a Jeff
501 * TelCom now calls GameFrame() if it's being run in multiplayer, so calls
502 * were put into GameFrame to handle certain cases when it's in TelCom
503 *
504 * 249 10/09/98 12:22p Jeff
505 * DemoCheats()
506 *
507 * 248 10/08/98 3:38p Jeff
508 * DEL-E doesn't work in multiplayer games
509 *
510 * 247 10/08/98 3:12p Matt
511 * Fixed toggle outline key, and added key to turn on all outline options.
512 *
513 * 246 10/06/98 5:45p Kevin
514 * Added new configuration for demo
515 *
516 * 245 10/06/98 3:07p Jeff
517 * fixed del-x cheat code so it adds counter measures right
518 *
519 * 244 10/06/98 2:59p Jason
520 * added timedemo function
521 *
522 * 243 10/05/98 7:23p Jason
523 * implemented destroyable lights (first draft)
524 *
525 * 242 10/05/98 12:09p Kevin
526 * Converted projects to VC6 and demo file stuff added
527 *
528 * 241 10/05/98 11:08a Jason
529 * implemented player message log
530 *
531 * 238 9/29/98 10:44a Jeff
532 * renamed gunbouy to gunboy
533 *
534 * 237 9/25/98 4:50p Jeff
535 *
536 * 236 9/24/98 12:57p Jason
537 * more state limited optimizations
538 *
539 * 235 9/22/98 12:40p Matt
540 * Cleaned up the object per-frame processing code.
541 *
542 * 234 9/21/98 11:10a Jeff
543 * Calls to init/close forcefeedback
544 *
545 * 233 9/18/98 7:38p Jeff
546 *
547 * 232 9/18/98 1:27p Jason
548 * cleaned up renderer initting
549 *
550 * 231 9/17/98 3:03p Jason
551 * added lightning and invul hit effects
552 *
553 * 229 9/16/98 5:38p Jason
554 * made dedicated server bail on key events
555 *
556 * 228 9/16/98 5:10p Jason
557 * added first pass at thrid-person camera system
558 *
559 * 227 9/14/98 6:28p Jason
560 * first pass at getting dedicated server working
561 *
562 * 226 9/10/98 12:01p Chris
563 * Made matcen:DoRenderFrame() functional
564 *
565 * 225 9/08/98 4:56p Chris
566 * Matcens rev.5 almost functional
567 *
568 * 224 9/03/98 12:11p Chris
569 * Adding matcen support
570 *
571 * 223 9/01/98 4:11p Samir
572 * moved screenshot code from gameloop to game.cpp
573 *
574 * 222 8/31/98 6:50p Jeff
575 * made inventory and countermeasure keys customizable
576 *
577 * 221 8/31/98 5:44p Matt
578 * Added a key (Del-N) to restart a level
579 *
580 * 220 8/26/98 4:30p Jason
581 * added directional lights (headlight for player)
582 *
583 * 219 8/25/98 11:27p Matt
584 * Added key to toggle fog.
585 *
586 * 218 8/25/98 3:08p Samir
587 * Del-F10 does ship (and cockpit) transitions.
588 *
589 * 217 8/25/98 1:40p Jason
590 * fixed message bug
591 *
592 * 216 8/25/98 12:36p Jason
593 * added specular debug key
594 *
595 * 215 8/24/98 6:07p Samir
596 * change cockpits with ships.
597 *
598 * 214 8/24/98 10:40a Jason
599 * fixed some rendering problems
600 *
601 * 213 8/18/98 5:54p Jeff
602 * added countermeasures and afterburner when you DEL-X
603 *
604 * 212 8/18/98 3:02p Samir
605 * added game saving and loading.
606 *
607 * 211 8/17/98 6:40p Matt
608 * Added ambient sound system
609 *
610 * 210 8/16/98 12:20a Jeff
611 * moved out actual energy->shields to player function...keypress still
612 * handled here though
613 *
614 * 209 8/15/98 11:23p Matt
615 * Re-added keyboard flush when the game dll is swallowing keys.
616 *
617 * 208 8/15/98 10:53p Matt
618 * Rewrote key handling routines to deal with keys pressed while dead, and
619 * to generally clean things up a bit.
620 *
621 * 207 8/15/98 5:16p Matt
622 * Added new Base_directory variable. Got rid of D3_LOCAL check and
623 * 'local directory' registry variable.
624 *
625 * 206 8/14/98 5:28p Jeff
626 * test key added
627 *
628 * 205 8/14/98 4:57p Jeff
629 *
630 * 204 8/13/98 7:23p Jeff
631 * moved in UI system
632 *
633 * 203 8/13/98 3:10p Jeff
634 * keyflush if multiplayer dll requests so
635 *
636 * 202 8/12/98 2:54p Matt
637 * Renamed the slash and backslash key constants.
638 *
639 * 201 8/10/98 5:51p Samir
640 * new keys for music system.
641 *
642 * 200 8/10/98 12:16p Chris
643 * Added AI_NumHostileAlert
644 *
645 * 199 8/07/98 7:12p Samir
646 * changed d3xexecscript.
647 *
648 * 198 8/04/98 10:26a Kevin
649 * Custom sound and bmp exchange system
650 *
651 * 197 7/28/98 5:40p Samir
652 * added call to music system per frame.
653 *
654 * 196 7/27/98 5:59p Jason
655 * added piggyback mode plus multiplayer colors
656 *
657 * 195 7/24/98 5:30p Samir
658 * took out extranneous stream cheats.
659 *
660 * 194 7/24/98 4:45p Jason
661 * added notification if any subsystem takes more than .2 seconds to
662 * execute
663 *
664 * 193 7/23/98 11:43a Jeff
665 * fixed observer mode bug
666 *
667 * 192 7/22/98 3:16p Jason
668 * added observer mode
669 *
670 * 191 7/21/98 10:25a Kevin
671 * commented out heapcheck
672 *
673 * 190 7/20/98 7:00p Sean
674 * SOMEONE: Added a heapcheck call
675 *
676 * 189 7/09/98 8:33p Samir
677 * changes for new streaming interface.
678 *
679 * 188 7/08/98 6:00p Jeff
680 * handles inventory use in a multiplayer game
681 *
682 * 187 7/06/98 7:17p Jeff
683 * added keys for countermeasures (temporary...probably want these
684 * configurable)
685 *
686 * 186 6/30/98 6:36p Chris
687 * Added rev .1 of multiplayer animations - BTW It is totally not done.
688 *
689 * 185 6/30/98 6:14p Samir
690 * Call DoUIFrameWithoutInput instead of DoUIFrame.
691 *
692 * 184 6/25/98 5:22p Kevin
693 * Req/Send gametime to clients
694 *
695 * 183 6/25/98 12:42p Jeff
696 * Added exit game confirmation
697 *
698 * 182 6/24/98 5:59p Chris
699 *
700 * 181 6/24/98 5:55p Chris
701 * Added simple support for on the fly mixer/quality switching - Kills all
702 * sounds (which is incorrect).
703 *
704 * 180 6/24/98 5:20p Matt
705 * Added key for pause; Cleaned up key handling; ripped out some E3 demo
706 * code.
707 *
708 * 179 6/24/98 4:39p Chris
709 * Improved the multiple mixer support
710 *
711 * 178 6/24/98 12:09p Chris
712 * Update
713 *
714 * 177 6/24/98 11:12a Jeff
715 * fixed accidental checkin
716 *
717 * 176 6/24/98 11:14a Chris
718 * Added more support and bug fixes
719 *
720 * 175 6/22/98 12:00p Chris
721 * Working on sound system to make it in a nice shape.
722 *
723 * 174 6/19/98 6:42p Jason
724 * made specular mapping a config detail item
725 *
726 * 173 6/19/98 6:21p Chris
727 * Moved Del+F5 to DEL+F6 and F6 to Del+F11
728 *
729 * 172 6/19/98 6:05p Jeff
730 * call to update voices to handle the voice queue
731 *
732 * 171 6/19/98 3:03p Chris
733 * Made CheckAndForceSoundDataAlloc a SoundSystem function - useful for
734 * multiple mixers. Added IsSoundPlaying to the high level sound lib.
735 *
736 * 170 6/18/98 5:21p Jeff
737 * put in call to update streaming audio buffers in the game loop
738 *
739 * 169 6/18/98 1:09p Chris
740 *
741 * 168 6/16/98 5:27p Chris
742 * Revision version 1.0 (should all be functional for 16 bit mono samples)
743 *
744 * 167 6/16/98 3:48p Chris
745 * Updated the sound system and added the start of sound streaming
746 *
747 * 166 6/16/98 10:38a Jeff
748 * localization, strings pulled out to stringtable.h and d3.str
749 *
750 * 165 6/04/98 4:52p Jeff
751 * Added a suspend/resume controls call on return from EVT_CLIENT_KEYPRESS
752 * if the DLL requests it
753 *
754 * 164 6/02/98 11:01a Jason
755 * Post E3 Checkin
756 *
757 * 163 6/01/98 11:00a Jeff
758 * Moved the call to the multiplayer EVT_CLIENT_KEYPRESS up in the
759 * function
760 *
761 * 162 5/27/98 12:35a Samir
762 * level restart for E3 by default on, this time.
763 *
764 * 161 5/26/98 10:51p Samir
765 * ability to activate/deactivate restart level sequence timer.
766 *
767 *
768 * 159 5/26/98 5:03p Samir
769 * Set E3 time limit for level to 15 minutes.
770 *
771 * 158 5/26/98 1:20p Samir
772 * added special weapons key for E3!
773 *
774 * 157 5/26/98 11:36a Matt
775 * Changed small view system to allow the popup window in any of the three
776 * positions, to allow any window to be the "bigger" size, and to restore
777 * the old view when a popup view goes away.
778 *
779 * 156 5/25/98 8:29p Samir
780 * Added E3_DEMO define for E3 stuff like game time limits and special
781 * keys.
782 *
783 * 155 5/25/98 3:46p Jason
784 * added better light glows
785 *
786 * 154 5/22/98 8:36p Samir
787 * added E3 keyboard lock to hide the not so cool looking stuff in D3
788 *
789 * 153 5/22/98 3:27p Jason
790 * added specular lighting
791 *
792 * 152 5/19/98 10:44a Jeff
793 * changed D3_QUICK to D3_FAST
794 *
795 * 151 5/18/98 4:36p Jeff
796 * TelCom uses Game_interface_mode variable now
797 *
798 * $NoKeywords: $
799 */
800
801 #include <stdlib.h>
802 #include <string.h>
803 #include <stdio.h>
804 #include "gameloop.h"cxx . . $ `<file>/Descent3/gameloop.h`/
805 #include "game.h"cxx . . $ `<file>/Descent3/game.h`/
806 #include "render.h"cxx . . $ `<file>/Descent3/render.h`/
807 #include "descent.h"cxx . . $ `<file>/Descent3/descent.h`/
808 #include "slew.h"cxx . . $ `<file>/Descent3/slew.h`/
809 #include "mono.h"cxx . . $ `<file>/ddebug/mono.h`/
810 #include "doorway.h"cxx . . $ `<file>/Descent3/doorway.h`/
811 #include "weapon.h"cxx . . $ `<file>/Descent3/weapon.h`/
812 #include "hlsoundlib.h"cxx . . $ `<file>/sndlib/hlsoundlib.h`/
813 #include "multi.h"cxx . . $ `<file>/Descent3/multi.h`/
814 #include "player.h"cxx . . $ `<file>/Descent3/player.h`/
815 #include "damage.h"cxx . . $ `<file>/Descent3/damage.h`/
816 #include "ship.h"cxx . . $ `<file>/Descent3/ship.h`/
817 #include "objinit.h"cxx . . $ `<file>/Descent3/objinit.h`/
818 #include "gameevent.h"cxx . . $ `<file>/Descent3/gameevent.h`/
819 #include "gametexture.h"cxx . . $ `<file>/Descent3/gametexture.h`/
820 #include "AIMain.h"cxx . . $ `<file>/Descent3/AIMain.h`/
821 #include "ddvid.h"cxx . . $ `<file>/lib/ddvid.h`/
822 #include "ddio.h"cxx . . $ `<file>/ddio/ddio.h`/
823 #include "hud.h"cxx . . $ `<file>/Descent3/hud.h`/
824 #include "terrain.h"cxx . . $ `<file>/Descent3/terrain.h`/
825 #include "BOA.h"cxx . . $ `<file>/Descent3/BOA.h`/
826 #include "lighting.h"cxx . . $ `<file>/Descent3/lighting.h`/
827 #include "findintersection.h"cxx . . $ `<file>/physics/findintersection.h`/
828 #include "soar.h"cxx . . $ `<file>/Descent3/soar.h`/
829 #include "multi.h"cxx . . $ `<file>/Descent3/multi.h`/
830 #include "hud.h"cxx . . $ `<file>/Descent3/hud.h`/
831 #include "bsp.h"cxx . . $ `<file>/Descent3/bsp.h`/
832 #include "gauges.h"cxx . . $ `<file>/Descent3/gauges.h`/
833 #include "SmallViews.h"cxx . . $ `<file>/Descent3/SmallViews.h`/
834 #include "newui.h"cxx . . $ `<file>/Descent3/newui.h`/
835 #include "Inventory.h"cxx . . $ `<file>/Descent3/Inventory.h`/
836 #include "physics.h"cxx . . $ `<file>/physics/physics.h`/
837 #include "Controller.h"cxx . . $ `<file>/lib/Controller.h`/
838 #include "controls.h"cxx . . $ `<file>/Descent3/controls.h`/
839 #include "gamesequence.h"cxx . . $ `<file>/Descent3/gamesequence.h`/
840 #include "cockpit.h"cxx . . $ `<file>/Descent3/cockpit.h`/
841 #include "help.h"cxx . . $ `<file>/Descent3/help.h`/
842 #include "game.h"cxx . . $ `<file>/Descent3/game.h`/
843 #include "aipath.h"cxx . . $ `<file>/Descent3/aipath.h`/
844 #include "game2dll.h"cxx . . $ `<file>/lib/game2dll.h`/
845 #include "Mission.h"cxx . . $ `<file>/Descent3/Mission.h`/
846 #include "object_lighting.h"cxx . . $ `<file>/Descent3/object_lighting.h`/
847 #include "fireball.h"cxx . . $ `<file>/Descent3/fireball.h`/
848 #include "weather.h"cxx . . $ `<file>/Descent3/weather.h`/
849 #include "stringtable.h"cxx . . $ `<file>/Descent3/stringtable.h`/
850 #include "streamaudio.h"cxx . . $ `<file>/stream_audio/streamaudio.h`/
851 #include "voice.h"cxx . . $ `<file>/Descent3/voice.h`/
852 #include "soundload.h"cxx . . $ `<file>/sndlib/soundload.h`/
853 #include "sounds.h"cxx . . $ `<file>/Descent3/sounds.h`/
854 #include "ambient.h"cxx . . $ `<file>/Descent3/ambient.h`/
855 #include "ship.h"cxx . . $ `<file>/Descent3/ship.h`/
856 #include "config.h"cxx . . $ `<file>/Descent3/config.h`/
857 #include "matcen.h"cxx . . $ `<file>/Descent3/matcen.h`/
858 #include "dedicated_server.h"cxx . . $ `<file>/lib/dedicated_server.h`/
859 #include "D3ForceFeedback.h"cxx . . $ `<file>/Descent3/D3ForceFeedback.h`/
860 #include "levelgoal.h"cxx . . $ `<file>/Descent3/levelgoal.h`/
861 #include "demofile.h"cxx . . $ `<file>/lib/demofile.h`/
862 #include "pilot.h"cxx . . $ `<file>/Descent3/pilot.h`/
863 #include "rtperformance.h"cxx . . $ `<file>/rtperformance/rtperformance.h`/
864 #include "demofile.h"cxx . . $ `<file>/lib/demofile.h`/
865 #include "d3music.h"cxx . . $ `<file>/Descent3/d3music.h`/
866 // #include "gamespy.h"
867 #include "osiris_dll.h"cxx . . $ `<file>/Descent3/osiris_dll.h`/
868 #include "aiambient.h"cxx . . $ `<file>/Descent3/aiambient.h`/
869 #include "marker.h"cxx . . $ `<file>/Descent3/marker.h`/
870 #include "gamecinematics.h"cxx . . $ `<file>/Descent3/gamecinematics.h`/
871 #include "postrender.h"cxx . . $ `<file>/Descent3/postrender.h`/
872 #include "debuggraph.h"cxx . . $ `<file>/Descent3/debuggraph.h`/
873 #include "gamesave.h"cxx . . $ `<file>/Descent3/gamesave.h`/
874 #include "psrand.h"cxx . . $ `<file>/misc/psrand.h`/
875 #include "spew.h"cxx . . $ `<file>/Descent3/spew.h`/
876 #include "grtext.h"cxx . . $ `<file>/grtext/grtext.h`/
877 #include "gamefont.h"cxx . . $ `<file>/Descent3/gamefont.h`/
878 #include "renderobject.h"cxx . . $ `<file>/Descent3/renderobject.h`/
879 #include "buddymenu.h"cxx . . $ `<file>/Descent3/buddymenu.h`/
880
881 #ifdef EDITOR
882 #include "editor\d3edit.h"
883 #endif
884
885 extern bool Display_renderer_statscxx . . $ Display_renderer_stats.;
886
887 // Current zoom factor (this is the tan of 29.25, which is half our FOV of 58.5)
888 float Render_FOVcxx . . $ Render_FOV. = D3_DEFAULT_FOVcxx . . $ `Descent3/descent.h:176:9`!;
889 float Render_zoomcxx . . $ Render_zoom. = D3_DEFAULT_ZOOMcxx . . $ `Descent3/descent.h:178:9`!;
890
891 // How long (in seconds) the last frame took
892 float Frametimecxx . . $ Frametime. = .1f;
893
894 // How long (in seconds) since the game started
895 float Gametimecxx . . $ Gametime.;
896
897 int Timedemo_framecxx . . $ Timedemo_frame. = -1;
898
899 // How many frames have been renered.
900 // NOTE: this is a count of 3d frames, not game frames
901 int FrameCountcxx . . $ FrameCount. = 0;
902
903 bool HUD_disabledcxx . . $ HUD_disabled. = 0;
904 #ifdef _DEBUGcxx . . $ `<built-in>:482:9`!
905 int DoAIcxx . . $ DoAI. = 1;
906 bool System_lockedcxx . . $ System_locked. = false;
907 int Stream_typecxx . . $ Stream_type. = 0;
908 #else
909 int Stream_type = 0;
910 #define DoAI 1
911 #endif
912
913 bool Tracking_FVIcxx . . $ Tracking_FVI. = false;
914
915 // Set this to force window clear
916 int Clear_screencxx . . $ Clear_screen. = 0;
917
918 // determines if game is paused.
919 bool Game_pausedcxx . . $ Game_paused. = false;
920
921 // Used for limiting the framerate
922 int Min_allowed_frametimecxx . . $ Min_allowed_frametime. = 0;
923
924 // determines if we're rendering the main view
925 bool Rendering_main_viewcxx . . $ Rendering_main_view. = false;
926 bool Skip_render_game_framecxx . . $ Skip_render_game_frame. = false;
927 bool Menu_interface_modecxx . . $ Menu_interface_mode. = false;
928
929 int frames_one_secondcxx . . $ frames_one_second. = 0;
930 int min_one_secondcxx . . $ min_one_second. = 0x7fffffff;
931 int max_one_secondcxx . . $ max_one_second. = 0;
932
933 int64_t last_timercxx . . $ last_timer. = 0;
934
935 // contains information for the music system.
936 tMusicSeqInfocxx . . $ tMusicSeqInfo# Game_music_infocxx . . $ Game_music_info.;
937
938 // Defines for changing the window size
939 #define WINDOW_W_DELTAcxx . . $ `Descent3/GameLoop.cpp:939:9`! ((Max_window_w / 16) & ~1)
940 #define WINDOW_H_DELTAcxx . . $ `Descent3/GameLoop.cpp:940:9`! ((Max_window_h / 16) & ~1)
941
942 #define WINDOW_MIN_Wcxx . . $ `Descent3/GameLoop.cpp:942:9`! ((Max_window_w * 10) / 22)
943 #define WINDOW_MIN_Hcxx . . $ `Descent3/GameLoop.cpp:943:9`! ((Max_window_h * 10) / 22)
944
945 // Functions
946 void ApplyShadowsToRoomscxx . . $ ApplyShadowsToRooms(49f6e7a06ebc5aa8).();
947 void StartGameMenucxx . . $ StartGameMenu(49f6e7a06ebc5aa8).();
948 void EndGameMenucxx . . $ EndGameMenu(49f6e7a06ebc5aa8).();
949 void ProcessGuidebotKeyscxx . . $ ProcessGuidebotKeys(d4f767463ce0a6b3).(int key);
950
951 // Make the 3D window larger
952 void GrowWindowcxx . . $ GrowWindow(49f6e7a06ebc5aa8).() {
953 if (GetHUDModecxx . . $ GetHUDMode(d2d05048dda10524).() == HUD_LETTERBOXcxx . . $ HUD_LETTERBOX.)
954 return;
955
956 Game_window_wcxx . . $ Game_window_w. += WINDOW_W_DELTAcxx . . $ `Descent3/GameLoop.cpp:939:9`!;
957 Game_window_hcxx . . $ Game_window_h. += WINDOW_H_DELTAcxx . . $ `Descent3/GameLoop.cpp:940:9`!;
958
959 if (Game_window_hcxx . . $ Game_window_h. > Max_window_hcxx . . $ Max_window_h.)
960 Game_window_hcxx . . $ Game_window_h. = Max_window_hcxx . . $ Max_window_h.;
961
962 if (Game_window_wcxx . . $ Game_window_w. > Max_window_wcxx . . $ Max_window_w.)
963 Game_window_wcxx . . $ Game_window_w. = Max_window_wcxx . . $ Max_window_w.;
964
965 Game_window_xcxx . . $ Game_window_x. = (Max_window_wcxx . . $ Max_window_w. - Game_window_wcxx . . $ Game_window_w.) / 2;
966 Game_window_ycxx . . $ Game_window_y. = (Max_window_hcxx . . $ Max_window_h. - Game_window_hcxx . . $ Game_window_h.) / 2;
967
968 Current_pilotcxx . . $ Current_pilot..set_hud_datacxx . . $ pilot#set_hud_data(c4a38c24677fe9fd).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, &Game_window_wcxx . . $ Game_window_w., &Game_window_hcxx . . $ Game_window_h.);
969
970 Clear_screencxx . . $ Clear_screen. = 4;
971
972 ResizeCockpitcxx . . $ ResizeCockpit(49f6e7a06ebc5aa8).();
973 }
974
975 // Make the 3D window smaller
976 void ShrinkWindowcxx . . $ ShrinkWindow(49f6e7a06ebc5aa8).() {
977 if (GetHUDModecxx . . $ GetHUDMode(d2d05048dda10524).() == HUD_LETTERBOXcxx . . $ HUD_LETTERBOX.)
978 return;
979
980 if (Game_window_wcxx . . $ Game_window_w. > WINDOW_MIN_Wcxx . . $ `Descent3/GameLoop.cpp:942:9`!) {
981
982 Game_window_wcxx . . $ Game_window_w. -= WINDOW_W_DELTAcxx . . $ `Descent3/GameLoop.cpp:939:9`!;
983 Game_window_hcxx . . $ Game_window_h. -= WINDOW_H_DELTAcxx . . $ `Descent3/GameLoop.cpp:940:9`!;
984
985 if (Game_window_wcxx . . $ Game_window_w. < WINDOW_MIN_Wcxx . . $ `Descent3/GameLoop.cpp:942:9`!)
986 Game_window_wcxx . . $ Game_window_w. = WINDOW_MIN_Wcxx . . $ `Descent3/GameLoop.cpp:942:9`!;
987
988 if (Game_window_hcxx . . $ Game_window_h. < WINDOW_MIN_Hcxx . . $ `Descent3/GameLoop.cpp:943:9`!)
989 Game_window_hcxx . . $ Game_window_h. = WINDOW_MIN_Hcxx . . $ `Descent3/GameLoop.cpp:943:9`!;
990
991 Game_window_xcxx . . $ Game_window_x. = (Max_window_wcxx . . $ Max_window_w. - Game_window_wcxx . . $ Game_window_w.) / 2;
992 Game_window_ycxx . . $ Game_window_y. = (Max_window_hcxx . . $ Max_window_h. - Game_window_hcxx . . $ Game_window_h.) / 2;
993
994 Clear_screencxx . . $ Clear_screen. = 4;
995
996 ResizeCockpitcxx . . $ ResizeCockpit(49f6e7a06ebc5aa8).();
997
998 Current_pilotcxx . . $ Current_pilot..set_hud_datacxx . . $ pilot#set_hud_data(c4a38c24677fe9fd).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, &Game_window_wcxx . . $ Game_window_w., &Game_window_hcxx . . $ Game_window_h.);
999 }
1000 }
1001
1002 // Data and code for camera views
1003
1004 #define CV_NONEcxx . . $ `Descent3/GameLoop.cpp:1004:9`! 0 // View not active
1005 #define CV_REARVIEWcxx . . $ `Descent3/GameLoop.cpp:1005:9`! 1 // Rear view
1006 #define CV_MARKER1cxx . . $ `Descent3/GameLoop.cpp:1006:9`! 2 // Marker view
1007 #define CV_MARKER2cxx . . $ `Descent3/GameLoop.cpp:1007:9`! 3 // Marker view
1008 #define CV_MARKER3cxx . . $ `Descent3/GameLoop.cpp:1008:9`! 4 // Marker view
1009 #define CV_MARKER4cxx . . $ `Descent3/GameLoop.cpp:1009:9`! 5 // Marker view
1010 #define CV_MARKER5cxx . . $ `Descent3/GameLoop.cpp:1010:9`! 6 // Marker view
1011 #define CV_MARKER6cxx . . $ `Descent3/GameLoop.cpp:1011:9`! 7 // Marker view
1012 #define CV_MARKER7cxx . . $ `Descent3/GameLoop.cpp:1012:9`! 8 // Last marker view
1013 #define CV_MARKER8cxx . . $ `Descent3/GameLoop.cpp:1013:9`! 9 // Last marker view
1014 #define CV_GUIDEBOTcxx . . $ `Descent3/GameLoop.cpp:1014:9`! 10 // Guide-Bot
1015 // #define CV_COOP 3 //View from a coop player
1016
1017 #define NUM_CAMERA_VIEWScxx . . $ `Descent3/GameLoop.cpp:1017:9`! 3
1018
1019 int Camera_view_modecxx . . $ Camera_view_mode.[NUM_CAMERA_VIEWScxx . . $ `Descent3/GameLoop.cpp:1017:9`!];
1020
1021 // Selects the next mode for this view
1022 void SelectNextCameraViewcxx . . $ SelectNextCameraView(d4f767463ce0a6b3).(int window) {
1023 int current = Camera_view_modecxx . . $ Camera_view_mode.[window];
1024
1025 // If the window has gone away because there's no object, then the current state is none
1026 if (GetSmallViewercxx . . $ GetSmallViewer(7864480464b09eea).(window) == OBJECT_HANDLE_NONEcxx . . $ `Descent3/object_external.h:156:9`!)
1027 current = CV_NONEcxx . . $ `Descent3/GameLoop.cpp:1004:9`!;
1028
1029 switch (current) {
1030 case CV_NONEcxx . . $ `Descent3/GameLoop.cpp:1004:9`!:
1031 Camera_view_modecxx . . $ Camera_view_mode.[window] = CV_REARVIEWcxx . . $ `Descent3/GameLoop.cpp:1005:9`!;
1032 CreateSmallViewcxx . . $ CreateSmallView(114097c446ee1c3e).(window, Player_objectcxx . . $ Player_object.->handlecxx . . $ object#handle., SVF_REARVIEWcxx . . $ `Descent3/SmallViews.h:79:9`!, 0.0, D3_DEFAULT_ZOOMcxx . . $ `Descent3/descent.h:178:9`!, -1, TXT_VIEW_REARcxx . . $ `Descent3/stringtable.h:802:9`!);
1033 if (window == 0)
1034 Current_pilotcxx . . $ Current_pilot..lrearview_enabledcxx . . $ pilot#lrearview_enabled. = true; // set to true.
1035 else if (window == 2)
1036 Current_pilotcxx . . $ Current_pilot..rrearview_enabledcxx . . $ pilot#rrearview_enabled. = true;
1037 break;
1038
1039 case CV_REARVIEWcxx . . $ `Descent3/GameLoop.cpp:1005:9`!: {
1040 objectcxx . . $ object# *objp = ObjGetcxx . . $ ObjGet(11672e354c0b263a).(Buddy_handlecxx . . $ Buddy_handle.[Player_numcxx . . $ Player_num.]);
1041 if (window == 0)
1042 Current_pilotcxx . . $ Current_pilot..lrearview_enabledcxx . . $ pilot#lrearview_enabled. = false; // leaving rearview
1043 else if (window == 2)
1044 Current_pilotcxx . . $ Current_pilot..rrearview_enabledcxx . . $ pilot#rrearview_enabled. = false;
1045
1046 if (objp && objp->typecxx . . $ object#type. == OBJ_ROBOTcxx . . $ `Descent3/object_external.h:162:9`!) { // Not hidden
1047 Camera_view_modecxx . . $ Camera_view_mode.[window] = CV_GUIDEBOTcxx . . $ `Descent3/GameLoop.cpp:1014:9`!;
1048 CreateSmallViewcxx . . $ CreateSmallView(114097c446ee1c3e).(window, objp->handlecxx . . $ object#handle., 0, 0.0, D3_DEFAULT_ZOOMcxx . . $ `Descent3/descent.h:178:9`!, -1, TXT_VIEW_GUIDEBOTcxx . . $ `Descent3/stringtable.h:800:9`!);
1049 break;
1050 }
1051 // If no GB, then fall into next case
1052 }
1053 case CV_GUIDEBOTcxx . . $ `Descent3/GameLoop.cpp:1014:9`!:
1054 case CV_MARKER1cxx . . $ `Descent3/GameLoop.cpp:1006:9`!:
1055 case CV_MARKER2cxx . . $ `Descent3/GameLoop.cpp:1007:9`!:
1056 case CV_MARKER3cxx . . $ `Descent3/GameLoop.cpp:1008:9`!:
1057 case CV_MARKER4cxx . . $ `Descent3/GameLoop.cpp:1009:9`!:
1058 case CV_MARKER5cxx . . $ `Descent3/GameLoop.cpp:1010:9`!:
1059 case CV_MARKER6cxx . . $ `Descent3/GameLoop.cpp:1011:9`!:
1060 case CV_MARKER7cxx . . $ `Descent3/GameLoop.cpp:1012:9`!:
1061 case CV_MARKER8cxx . . $ `Descent3/GameLoop.cpp:1013:9`!: {
1062 if (window == 0)
1063 Current_pilotcxx . . $ Current_pilot..lrearview_enabledcxx . . $ pilot#lrearview_enabled. = false; // leaving rearview
1064 else if (window == 2)
1065 Current_pilotcxx . . $ Current_pilot..rrearview_enabledcxx . . $ pilot#rrearview_enabled. = false;
1066
1067 if (Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].num_markerscxx . . $ player#num_markers. > 0) {
1068 int num = (current == CV_GUIDEBOTcxx . . $ `Descent3/GameLoop.cpp:1014:9`!) ? 0 : (current - CV_MARKER1cxx . . $ `Descent3/GameLoop.cpp:1006:9`!) + 1;
1069 int max = (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!) ? 2 : 8; // Why no symbolic constants? Ask Jason.
1070 int id = Player_numcxx . . $ Player_num. * 2 + num;
1071
1072 if (num < max) {
1073 int i;
1074
1075 // Search for the marker
1076 for (i = 0; i <= Highest_object_indexcxx . . $ Highest_object_index.; i++) {
1077 if ((Objectscxx . . $ Objects.[i].typecxx . . $ object#type. == OBJ_MARKERcxx . . $ `Descent3/object_external.h:175:9`!) && (Objectscxx . . $ Objects.[i].idcxx . . $ object#id. == id))
1078 break;
1079 }
1080
1081 if (i <= Highest_object_indexcxx . . $ Highest_object_index.) {
1082 char buf[25];
1083 snprintf(buf, sizeof(buf), TXT_VIEW_MARKERcxx . . $ `Descent3/stringtable.h:801:9`!, num + 1);
1084
1085 CreateSmallViewcxx . . $ CreateSmallView(114097c446ee1c3e).(window, Objectscxx . . $ Objects.[i].handlecxx . . $ object#handle., 0, 0.0, D3_DEFAULT_ZOOMcxx . . $ `Descent3/descent.h:178:9`!, -1, buf);
1086 Camera_view_modecxx . . $ Camera_view_mode.[window] = CV_MARKER1cxx . . $ `Descent3/GameLoop.cpp:1006:9`! + num;
1087
1088 break;
1089 }
1090 }
1091 }
1092 // If couldn't find marker or have cycled though all, close window
1093 Camera_view_modecxx . . $ Camera_view_mode.[window] = CV_NONEcxx . . $ `Descent3/GameLoop.cpp:1004:9`!;
1094 CloseSmallViewcxx . . $ CloseSmallView(d4f767463ce0a6b3).(window);
1095 break;
1096 }
1097 default:
1098 Int3cxx . . $ `misc/pserror.h:247:9`!(); // all cases should be handled
1099 }
1100 }
1101
1102 // Turn off all camera views
1103 // If total reset is true, set all views to none, otherwise kill object view but keep rear views.
1104 void InitCameraViewscxx . . $ InitCameraViews(b45ddcbc8423892c).(bool total_reset) {
1105 for (int i = 0; i < NUM_CAMERA_VIEWScxx . . $ `Descent3/GameLoop.cpp:1017:9`!; i++) {
1106 if (total_reset || (Camera_view_modecxx . . $ Camera_view_mode.[i] != CV_REARVIEWcxx . . $ `Descent3/GameLoop.cpp:1005:9`!)) {
1107 Camera_view_modecxx . . $ Camera_view_mode.[i] = CV_NONEcxx . . $ `Descent3/GameLoop.cpp:1004:9`!;
1108 } else { // is rear view, so keep it
1109 Camera_view_modecxx . . $ Camera_view_mode.[i] = CV_REARVIEWcxx . . $ `Descent3/GameLoop.cpp:1005:9`!;
1110 CreateSmallViewcxx . . $ CreateSmallView(114097c446ee1c3e).(i, Player_objectcxx . . $ Player_object.->handlecxx . . $ object#handle., SVF_REARVIEWcxx . . $ `Descent3/SmallViews.h:79:9`!, 0.0, D3_DEFAULT_ZOOMcxx . . $ `Descent3/descent.h:178:9`!, -1, TXT_VIEW_REARcxx . . $ `Descent3/stringtable.h:802:9`!);
1111 }
1112 }
1113 }
1114
1115 void RestoreCameraRearviewscxx . . $ RestoreCameraRearviews(49f6e7a06ebc5aa8).() {
1116 if (Camera_view_modecxx . . $ Camera_view_mode.[0] != CV_REARVIEWcxx . . $ `Descent3/GameLoop.cpp:1005:9`!) {
1117 if (Current_pilotcxx . . $ Current_pilot..lrearview_enabledcxx . . $ pilot#lrearview_enabled.) {
1118 Camera_view_modecxx . . $ Camera_view_mode.[0] = CV_REARVIEWcxx . . $ `Descent3/GameLoop.cpp:1005:9`!;
1119 CreateSmallViewcxx . . $ CreateSmallView(114097c446ee1c3e).(0, Player_objectcxx . . $ Player_object.->handlecxx . . $ object#handle., SVF_REARVIEWcxx . . $ `Descent3/SmallViews.h:79:9`!, 0.0, D3_DEFAULT_ZOOMcxx . . $ `Descent3/descent.h:178:9`!, -1, TXT_VIEW_REARcxx . . $ `Descent3/stringtable.h:802:9`!);
1120 }
1121 }
1122 if (Camera_view_modecxx . . $ Camera_view_mode.[2] != CV_REARVIEWcxx . . $ `Descent3/GameLoop.cpp:1005:9`!) {
1123 if (Current_pilotcxx . . $ Current_pilot..rrearview_enabledcxx . . $ pilot#rrearview_enabled.) {
1124 Camera_view_modecxx . . $ Camera_view_mode.[2] = CV_REARVIEWcxx . . $ `Descent3/GameLoop.cpp:1005:9`!;
1125 CreateSmallViewcxx . . $ CreateSmallView(114097c446ee1c3e).(2, Player_objectcxx . . $ Player_object.->handlecxx . . $ object#handle., SVF_REARVIEWcxx . . $ `Descent3/SmallViews.h:79:9`!, 0.0, D3_DEFAULT_ZOOMcxx . . $ `Descent3/descent.h:178:9`!, -1, TXT_VIEW_REARcxx . . $ `Descent3/stringtable.h:802:9`!);
1126 }
1127 }
1128 }
1129
1130 void ProcessButtonscxx . . $ ProcessButtons(49f6e7a06ebc5aa8).() {
1131 // If dead, any key not handled above will eand the death sequence
1132 // this shouldn't be called in ReadPlayerControls since the player is DEAD!
1133 if (Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].flagscxx . . $ player#flags. & PLAYER_FLAGS_DEADcxx . . $ `Descent3/player_external.h:81:9`!) {
1134 int x, y;
1135 PollControlscxx . . $ PollControls(49f6e7a06ebc5aa8).();
1136 if (Controllercxx . . $ Controller.->get_joy_raw_valuescxx . . $ gameController#get_joy_raw_values(ef0362c0d321f56b).(&x, &y) || Controllercxx . . $ Controller.->get_mouse_raw_valuescxx . . $ gameController#get_mouse_raw_values(aa23d0250da59a45).(&x, &y)) {
1137 // death.
1138 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "here?");
1139
1140 if (Total_time_deadcxx . . $ Total_time_dead. < DEATH_RESPAWN_TIMEcxx . . $ `Descent3/player.h:439:9`!)
1141 return;
1142
1143 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Respawning joystick death. Death time=%f\n", Total_time_dead);
1144
1145 if (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!)
1146 MultiSendEndPlayerDeathcxx . . $ MultiSendEndPlayerDeath(49f6e7a06ebc5aa8).(); // couldn't this be called from withing EndPlayerDeath()?
1147 else
1148 EndPlayerDeathcxx . . $ EndPlayerDeath(d4f767463ce0a6b3).(Player_numcxx . . $ Player_num.);
1149 // Clear keyboard
1150 ResetPersistentHUDMessagecxx . . $ ResetPersistentHUDMessage(49f6e7a06ebc5aa8).();
1151 ddio_KeyFlushcxx . . $ ddio_KeyFlush(49f6e7a06ebc5aa8).();
1152 if (Controllercxx . . $ Controller.) {
1153 Controllercxx . . $ Controller.->flushcxx . . $ gameController#flush(49f6e7a06ebc5aa8).();
1154 }
1155 }
1156 return;
1157 }
1158 }
1159
1160 #define GBC_FIND_ACTIVE_GOAL_0cxx . . $ `Descent3/GameLoop.cpp:1160:9`! 3 // Find next primary
1161 #define GBC_FIND_SPEWcxx . . $ `Descent3/GameLoop.cpp:1161:9`! 19 // Find Spew
1162 #define GBC_FIND_POWERUPcxx . . $ `Descent3/GameLoop.cpp:1162:9`! 20 // Find Powerup
1163 #define GBC_FIND_ENERGY_CENTERcxx . . $ `Descent3/GameLoop.cpp:1163:9`! 21 // Find energy
1164 #define GBC_ESCORT_SHIPcxx . . $ `Descent3/GameLoop.cpp:1164:9`! 35 // Escort Ship
1165 #define GBC_EXTINGUISHcxx . . $ `Descent3/GameLoop.cpp:1165:9`! 36 // Use Extinguisher
1166 #define GBC_GO_WINGNUTcxx . . $ `Descent3/GameLoop.cpp:1166:9`! 37 // Use Wingnut Powerup
1167 #define GBC_RTYPEcxx . . $ `Descent3/GameLoop.cpp:1167:9`! 39 // Use Gaurdian Powerup
1168 #define GBC_ANTI_VIRUScxx . . $ `Descent3/GameLoop.cpp:1168:9`! 40 // Use Anti-virus Powerup
1169 #define GBC_RETURN_TO_SHIPcxx . . $ `Descent3/GameLoop.cpp:1169:9`! 43 // Return to ship
1170 // Handles guidebot shortcut keys
1171 void ProcessGuidebotKeyscxx . . $ ProcessGuidebotKeys(d4f767463ce0a6b3).(int key) {
1172 if (!(key & KEY_SHIFTEDcxx . . $ `ddio/ddio_common.h:208:9`!))
1173 return;
1174 key &= ~KEY_SHIFTEDcxx . . $ `ddio/ddio_common.h:208:9`!;
1175
1176 // check to make sure our Guidebot is out of the ship
1177 objectcxx . . $ object# *buddy = ObjGetcxx . . $ ObjGet(11672e354c0b263a).(Buddy_handlecxx . . $ Buddy_handle.[Player_numcxx . . $ Player_num.]);
1178 if (!buddy || buddy->typecxx . . $ object#type. != OBJ_ROBOTcxx . . $ `Descent3/object_external.h:162:9`!) {
1179 // not out of the ship
1180 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Guidebot: mrmph mmrump..mrmph...LET ME OUT OF YOUR SHIP!\n");
1181 return;
1182 }
1183 int command_id = -1;
1184
1185 switch (key) {
1186 case KEY_1cxx . . $ `ddio/ddio_common.h:220:9`!:
1187 command_id = GBC_FIND_ACTIVE_GOAL_0cxx . . $ `Descent3/GameLoop.cpp:1160:9`!;
1188 break;
1189 case KEY_2cxx . . $ `ddio/ddio_common.h:221:9`!:
1190 command_id = GBC_FIND_SPEWcxx . . $ `Descent3/GameLoop.cpp:1161:9`!;
1191 break;
1192 case KEY_3cxx . . $ `ddio/ddio_common.h:222:9`!:
1193 command_id = GBC_FIND_POWERUPcxx . . $ `Descent3/GameLoop.cpp:1162:9`!;
1194 break;
1195 case KEY_4cxx . . $ `ddio/ddio_common.h:223:9`!:
1196 command_id = GBC_FIND_ENERGY_CENTERcxx . . $ `Descent3/GameLoop.cpp:1163:9`!;
1197 break;
1198 case KEY_5cxx . . $ `ddio/ddio_common.h:224:9`!:
1199 command_id = GBC_ESCORT_SHIPcxx . . $ `Descent3/GameLoop.cpp:1164:9`!;
1200 break;
1201 case KEY_6cxx . . $ `ddio/ddio_common.h:225:9`!:
1202 command_id = GBC_EXTINGUISHcxx . . $ `Descent3/GameLoop.cpp:1165:9`!;
1203 break;
1204 case KEY_7cxx . . $ `ddio/ddio_common.h:226:9`!:
1205 command_id = GBC_GO_WINGNUTcxx . . $ `Descent3/GameLoop.cpp:1166:9`!;
1206 break;
1207 case KEY_8cxx . . $ `ddio/ddio_common.h:227:9`!:
1208 command_id = GBC_RTYPEcxx . . $ `Descent3/GameLoop.cpp:1167:9`!;
1209 break;
1210 case KEY_9cxx . . $ `ddio/ddio_common.h:228:9`!:
1211 command_id = GBC_ANTI_VIRUScxx . . $ `Descent3/GameLoop.cpp:1168:9`!;
1212 break;
1213 case KEY_0cxx . . $ `ddio/ddio_common.h:219:9`!:
1214 command_id = GBC_RETURN_TO_SHIPcxx . . $ `Descent3/GameLoop.cpp:1169:9`!;
1215 break;
1216 default:
1217 // nope
1218 return;
1219 break;
1220 }
1221
1222 // Process the command
1223 gb_comcxx . . $ gb_com# command;
1224 command.actioncxx . . $ gb_com#action. = COM_DO_ACTIONcxx . . $ `scripts/osiris_common.h:955:9`!;
1225 command.indexcxx . . $ gb_com#index. = command_id;
1226 command.ptrcxx . . $ gb_com#ptr. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1227
1228 if ((!(Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!)) || (Netgamecxx . . $ Netgame..local_rolecxx . . $ netgame_info#local_role. != LR_CLIENTcxx . . $ `Descent3/multi_external.h:128:9`!)) {
1229 AINotifycxx . . $ AINotify(f32b5964aaa42c22).(buddy, AIN_USER_DEFINEDcxx . . $ `Descent3/aistruct_external.h:301:9`!, (void *)&command);
1230 } else {
1231 MultiSendGuidebotMenuSelectioncxx . . $ MultiSendGuidebotMenuSelection(42ff5bb989597209).(&command);
1232 }
1233 }
1234
1235 // Deals with a normal (non-debug) key. Once the key is handled, this function returns
1236
1237 void ProcessNormalKeycxx . . $ ProcessNormalKey(d4f767463ce0a6b3).(int key) {
1238 // First do keys that work normally even when dead
1239 switch (key) {
1240
1241 // ingnore the modifier keys
1242 case KEY_LALTcxx . . $ `ddio/ddio_common.h:277:9`!:
1243 case KEY_RALTcxx . . $ `ddio/ddio_common.h:278:9`!:
1244 case KEY_LSHIFTcxx . . $ `ddio/ddio_common.h:275:9`!:
1245 case KEY_RSHIFTcxx . . $ `ddio/ddio_common.h:276:9`!:
1246 case KEY_LCTRLcxx . . $ `ddio/ddio_common.h:279:9`!:
1247 case KEY_RCTRLcxx . . $ `ddio/ddio_common.h:280:9`!:
1248 return;
1249
1250 case KEY_ESCcxx . . $ `ddio/ddio_common.h:267:9`!:
1251 Game_interface_modecxx . . $ Game_interface_mode. = GAME_EXIT_CONFIRMcxx . . $ `Descent3/gamesequence.h:137:9`!;
1252 return;
1253
1254 case KEY_PAUSEcxx . . $ `ddio/ddio_common.h:323:9`!:
1255 Game_interface_modecxx . . $ Game_interface_mode. = GAME_PAUSE_INTERFACEcxx . . $ `Descent3/gamesequence.h:131:9`!;
1256 return;
1257
1258 case KEY_F1cxx . . $ `ddio/ddio_common.h:282:9`!:
1259 Game_interface_modecxx . . $ Game_interface_mode. = GAME_HELP_INTERFACEcxx . . $ `Descent3/gamesequence.h:132:9`!;
1260 return;
1261
1262 case KEY_F2cxx . . $ `ddio/ddio_common.h:283:9`!:
1263 Game_interface_modecxx . . $ Game_interface_mode. = GAME_OPTIONS_INTERFACEcxx . . $ `Descent3/gamesequence.h:130:9`!;
1264 return;
1265
1266 case KEY_F8cxx . . $ `ddio/ddio_common.h:289:9`!:
1267 if (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!) {
1268 StartHUDInputMessagecxx . . $ StartHUDInputMessage(49f6e7a06ebc5aa8).();
1269 return;
1270 }
1271 break;
1272
1273 case KEY_SHIFTEDcxx . . $ `ddio/ddio_common.h:208:9`! + KEY_F8cxx . . $ `ddio/ddio_common.h:289:9`!:
1274 ToggleGameMessageConsolecxx . . $ ToggleGameMessageConsole(49f6e7a06ebc5aa8).();
1275 Clear_screencxx . . $ Clear_screen. = 4;
1276 break;
1277
1278 case KEY_SHIFTEDcxx . . $ `ddio/ddio_common.h:208:9`! + KEY_F9cxx . . $ `ddio/ddio_common.h:290:9`!:
1279 ToggleHUDMessageConsolecxx . . $ ToggleHUDMessageConsole(49f6e7a06ebc5aa8).();
1280 Clear_screencxx . . $ Clear_screen. = 4; // clears screen.
1281 break;
1282
1283 // #ifndef DEMO
1284 case KEY_F5cxx . . $ `ddio/ddio_common.h:286:9`!:
1285 Game_interface_modecxx . . $ Game_interface_mode. = GAME_TOGGLE_DEMOcxx . . $ `Descent3/gamesequence.h:141:9`!;
1286 return;
1287 case KEY_ALTEDcxx . . $ `ddio/ddio_common.h:209:9`! + KEY_F5cxx . . $ `ddio/ddio_common.h:286:9`!:
1288 DemoAbortcxx . . $ DemoAbort(b45ddcbc8423892c).(true);
1289 return;
1290 // #endif
1291 // case KEY_SHIFTED+KEY_LAPOSTRO: Game_interface_mode = GAME_TELCOM_CARGO;return;
1292 // case KEY_ALTED+KEY_LAPOSTRO: Game_interface_mode = GAME_TELCOM_BRIEFINGS; return;
1293 case KEY_SHIFTEDcxx . . $ `ddio/ddio_common.h:208:9`! + KEY_TABcxx . . $ `ddio/ddio_common.h:270:9`!:
1294 Game_interface_modecxx . . $ Game_interface_mode. = GAME_TELCOM_BRIEFINGScxx . . $ `Descent3/gamesequence.h:134:9`!;
1295 return;
1296 case KEY_ALTEDcxx . . $ `ddio/ddio_common.h:209:9`! + KEY_F3cxx . . $ `ddio/ddio_common.h:284:9`!:
1297 if (!Cinematic_inusecxx . . $ Cinematic_inuse.) {
1298 Game_interface_modecxx . . $ Game_interface_mode. = GAME_LOAD_INTERFACEcxx . . $ `Descent3/gamesequence.h:140:9`!;
1299 return;
1300 }
1301 break;
1302
1303 case KEY_CTRLEDcxx . . $ `ddio/ddio_common.h:210:9`! + KEY_F8cxx . . $ `ddio/ddio_common.h:289:9`!:
1304 if (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!) {
1305 StartTeamHUDInputMessagecxx . . $ StartTeamHUDInputMessage(49f6e7a06ebc5aa8).();
1306 return;
1307 }
1308 break;
1309 case KEY_CTRLEDcxx . . $ `ddio/ddio_common.h:210:9`! + KEY_1cxx . . $ `ddio/ddio_common.h:220:9`!:
1310 case KEY_CTRLEDcxx . . $ `ddio/ddio_common.h:210:9`! + KEY_2cxx . . $ `ddio/ddio_common.h:221:9`!:
1311 case KEY_CTRLEDcxx . . $ `ddio/ddio_common.h:210:9`! + KEY_3cxx . . $ `ddio/ddio_common.h:222:9`!:
1312 case KEY_CTRLEDcxx . . $ `ddio/ddio_common.h:210:9`! + KEY_4cxx . . $ `ddio/ddio_common.h:223:9`!:
1313 case KEY_CTRLEDcxx . . $ `ddio/ddio_common.h:210:9`! + KEY_5cxx . . $ `ddio/ddio_common.h:224:9`!:
1314 case KEY_CTRLEDcxx . . $ `ddio/ddio_common.h:210:9`! + KEY_6cxx . . $ `ddio/ddio_common.h:225:9`!:
1315 case KEY_CTRLEDcxx . . $ `ddio/ddio_common.h:210:9`! + KEY_7cxx . . $ `ddio/ddio_common.h:226:9`!:
1316 case KEY_CTRLEDcxx . . $ `ddio/ddio_common.h:210:9`! + KEY_8cxx . . $ `ddio/ddio_common.h:227:9`!: {
1317 int index = key & ~KEY_CTRLEDcxx . . $ `ddio/ddio_common.h:210:9`!;
1318 index = index - KEY_1cxx . . $ `ddio/ddio_common.h:220:9`!;
1319
1320 if (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!) {
1321 char str[80];
1322
1323 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Printing message %d!\n", index);
1324
1325 int save_do = Doing_input_messagecxx . . $ Doing_input_message.;
1326 int save_len = HudInputMessageLencxx . . $ HudInputMessageLen.;
1327 strcpy(str, HudInputMessagecxx . . $ HudInputMessage.);
1328
1329 // strcpy (HudInputMessage,Current_pilot.taunts[index]);
1330 // decode the text macro by sending it off to the DLL
1331 // for processesing
1332 DLLInfocxx . . $ DLLInfo..input_stringcxx . . $ dllinfo#input_string. = Current_pilotcxx . . $ Current_pilot..tauntscxx . . $ pilot#taunts.[index];
1333 DLLInfocxx . . $ DLLInfo..special_datacxx . . $ dllinfo#special_data. = (uint8_tcxx . . $ uint8_t# *)HudInputMessagecxx . . $ HudInputMessage.;
1334 DLLInfocxx . . $ DLLInfo..iParamcxx . . $ dllinfo#iParam. = MAX_HUD_INPUT_LENcxx . . $ `Descent3/hud.h:317:9`!;
1335 CallGameDLLcxx . . $ CallGameDLL(32ca0c0c7dbc2fcf).(EVT_CLIENT_DECODETEXTMACROcxx . . $ `lib/d3events.h:126:9`!, &DLLInfocxx . . $ DLLInfo.);
1336
1337 Doing_input_messagecxx . . $ Doing_input_message. = 1;
1338 SendOffHUDInputMessagecxx . . $ SendOffHUDInputMessage(49f6e7a06ebc5aa8).();
1339 strcpy(HudInputMessagecxx . . $ HudInputMessage., str);
1340 HudInputMessageLencxx . . $ HudInputMessageLen. = save_len;
1341 Doing_input_messagecxx . . $ Doing_input_message. = save_do;
1342 }
1343
1344 break;
1345 }
1346
1347 case KEY_PRINT_SCREENcxx . . $ `ddio/ddio_common.h:322:9`!:
1348 case KEY_SHIFTEDcxx . . $ `ddio/ddio_common.h:208:9`! + KEY_PRINT_SCREENcxx . . $ `ddio/ddio_common.h:322:9`!:
1349 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Doing screenshot!\n");
1350 DoScreenshotcxx . . $ DoScreenshot(49f6e7a06ebc5aa8).();
1351 return;
1352
1353 case KEY_SHIFTEDcxx . . $ `ddio/ddio_common.h:208:9`! + KEY_MINUScxx . . $ `ddio/ddio_common.h:255:9`!:
1354 case KEY_MINUScxx . . $ `ddio/ddio_common.h:255:9`!:
1355 ShrinkWindowcxx . . $ ShrinkWindow(49f6e7a06ebc5aa8).();
1356 return;
1357
1358 case KEY_SHIFTEDcxx . . $ `ddio/ddio_common.h:208:9`! + KEY_EQUALcxx . . $ `ddio/ddio_common.h:256:9`!:
1359 case KEY_EQUALcxx . . $ `ddio/ddio_common.h:256:9`!:
1360 GrowWindowcxx . . $ GrowWindow(49f6e7a06ebc5aa8).();
1361 return;
1362 case KEY_SPACEBARcxx . . $ `ddio/ddio_common.h:271:9`!:
1363 if (Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].flagscxx . . $ player#flags. & PLAYER_FLAGS_DEADcxx . . $ `Descent3/player_external.h:81:9`!) {
1364
1365 if (Total_time_deadcxx . . $ Total_time_dead. < DEATH_RESPAWN_TIMEcxx . . $ `Descent3/player.h:439:9`!)
1366 return;
1367
1368 if (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!)
1369 MultiSendEndPlayerDeathcxx . . $ MultiSendEndPlayerDeath(49f6e7a06ebc5aa8).(); // couldn't this be called from withing EndPlayerDeath()?
1370 else
1371 EndPlayerDeathcxx . . $ EndPlayerDeath(d4f767463ce0a6b3).(Player_numcxx . . $ Player_num.);
1372
1373 // Clear keyboard
1374 ResetPersistentHUDMessagecxx . . $ ResetPersistentHUDMessage(49f6e7a06ebc5aa8).();
1375 ddio_KeyFlushcxx . . $ ddio_KeyFlush(49f6e7a06ebc5aa8).();
1376 if (Controllercxx . . $ Controller.) {
1377 Controllercxx . . $ Controller.->flushcxx . . $ gameController#flush(49f6e7a06ebc5aa8).();
1378 }
1379
1380 return;
1381 }
1382 }
1383 if (Demo_flagscxx . . $ Demo_flags. == DF_PLAYBACKcxx . . $ `lib/demofile.h:123:9`!) {
1384 switch (key) {
1385 case KEY_Ccxx . . $ `ddio/ddio_common.h:231:9`!: {
1386 // goto next player
1387 int viewer_objnum = Viewer_objectcxx . . $ Viewer_object. - Objectscxx . . $ Objects.;
1388 int found = 0;
1389
1390 for (int i = viewer_objnum + 1; i <= Highest_object_indexcxx . . $ Highest_object_index. && !found; i++, i %= (Highest_object_indexcxx . . $ Highest_object_index. + 1)) {
1391 if (Objectscxx . . $ Objects.[i].typecxx . . $ object#type. == OBJ_CAMERAcxx . . $ `Descent3/object_external.h:169:9`!) {
1392 found = 1;
1393 Viewer_objectcxx . . $ Viewer_object. = &Objectscxx . . $ Objects.[i];
1394 }
1395 }
1396 } break;
1397 case KEY_Pcxx . . $ `ddio/ddio_common.h:244:9`!: {
1398 // goto next player
1399 int viewer_objnum = Viewer_objectcxx . . $ Viewer_object. - Objectscxx . . $ Objects.;
1400 int found = 0;
1401
1402 for (int i = viewer_objnum + 1; i <= Highest_object_indexcxx . . $ Highest_object_index. && !found; i++, i %= (Highest_object_indexcxx . . $ Highest_object_index. + 1)) {
1403 if (Objectscxx . . $ Objects.[i].typecxx . . $ object#type. == OBJ_PLAYERcxx . . $ `Descent3/object_external.h:164:9`!) {
1404 found = 1;
1405 Viewer_objectcxx . . $ Viewer_object. = &Objectscxx . . $ Objects.[i];
1406 }
1407 }
1408 } break;
1409 case KEY_Rcxx . . $ `ddio/ddio_common.h:246:9`!: {
1410 // goto next robot
1411 int viewer_objnum = Viewer_objectcxx . . $ Viewer_object. - Objectscxx . . $ Objects.;
1412 int found = 0;
1413
1414 for (int i = viewer_objnum + 1; i <= Highest_object_indexcxx . . $ Highest_object_index. && !found; i++, i %= (Highest_object_indexcxx . . $ Highest_object_index. + 1)) {
1415 if (Objectscxx . . $ Objects.[i].typecxx . . $ object#type. == OBJ_ROBOTcxx . . $ `Descent3/object_external.h:162:9`!) {
1416 found = 1;
1417 Viewer_objectcxx . . $ Viewer_object. = &Objectscxx . . $ Objects.[i];
1418 }
1419 }
1420 } break;
1421 case KEY_SPACEBARcxx . . $ `ddio/ddio_common.h:271:9`!:
1422 // Reset view
1423 Viewer_objectcxx . . $ Viewer_object. = Player_objectcxx . . $ Player_object.;
1424 break;
1425 case KEY_DOWNcxx . . $ `ddio/ddio_common.h:319:9`!:
1426 Game_pausedcxx . . $ Game_paused. = true;
1427 Demo_pausedcxx . . $ Demo_paused. = true;
1428 break;
1429 case KEY_RIGHTcxx . . $ `ddio/ddio_common.h:321:9`!:
1430 Demo_do_one_framecxx . . $ Demo_do_one_frame. = true;
1431 break;
1432 case KEY_CTRLEDcxx . . $ `ddio/ddio_common.h:210:9`! + KEY_LEFTcxx . . $ `ddio/ddio_common.h:320:9`!: {
1433 char sztmp[_MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`! * 2];
1434 strcpy(sztmp, Demo_fnamecxx . . $ Demo_fname.);
1435 DemoAbortcxx . . $ DemoAbort(b45ddcbc8423892c).();
1436 Game_interface_modecxx . . $ Game_interface_mode. = GAME_DEMO_LOOPcxx . . $ `Descent3/gamesequence.h:143:9`!;
1437 Demo_restartcxx . . $ Demo_restart. = true;
1438 strcpy(Demo_fnamecxx . . $ Demo_fname., sztmp);
1439 } break;
1440 case KEY_UPcxx . . $ `ddio/ddio_common.h:318:9`!:
1441 Game_pausedcxx . . $ Game_paused. = false;
1442 Demo_pausedcxx . . $ Demo_paused. = false;
1443 break;
1444 default:
1445 break;
1446 }
1447 }
1448
1449 // If dead, any key not handled above will eand the death sequence
1450 if (Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].flagscxx . . $ player#flags. & PLAYER_FLAGS_DEADcxx . . $ `Descent3/player_external.h:81:9`!) {
1451 return;
1452 }
1453
1454 // If dying, only the keys handled above do anything, so bail
1455 if (Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].flagscxx . . $ player#flags. & PLAYER_FLAGS_DYINGcxx . . $ `Descent3/player_external.h:80:9`!)
1456 return;
1457
1458 // These keys only work when not dying or dead
1459 ProcessGuidebotKeyscxx . . $ ProcessGuidebotKeys(d4f767463ce0a6b3).(key);
1460
1461 switch (key) {
1462 case KEY_SHIFTEDcxx . . $ `ddio/ddio_common.h:208:9`! + KEY_F1cxx . . $ `ddio/ddio_common.h:282:9`!:
1463 SelectNextCameraViewcxx . . $ SelectNextCameraView(d4f767463ce0a6b3).(0);
1464 return;
1465 case KEY_SHIFTEDcxx . . $ `ddio/ddio_common.h:208:9`! + KEY_F2cxx . . $ `ddio/ddio_common.h:283:9`!:
1466 SelectNextCameraViewcxx . . $ SelectNextCameraView(d4f767463ce0a6b3).(2);
1467 return;
1468 // case KEY_SHIFTED+KEY_F3: SelectNextCameraView(2); return;
1469
1470 case KEY_1cxx . . $ `ddio/ddio_common.h:220:9`!:
1471 SelectWeaponcxx . . $ SelectWeapon(d4f767463ce0a6b3).(0);
1472 return;
1473 case KEY_2cxx . . $ `ddio/ddio_common.h:221:9`!:
1474 SelectWeaponcxx . . $ SelectWeapon(d4f767463ce0a6b3).(1);
1475 return;
1476 case KEY_3cxx . . $ `ddio/ddio_common.h:222:9`!:
1477 SelectWeaponcxx . . $ SelectWeapon(d4f767463ce0a6b3).(2);
1478 return;
1479 case KEY_4cxx . . $ `ddio/ddio_common.h:223:9`!:
1480 SelectWeaponcxx . . $ SelectWeapon(d4f767463ce0a6b3).(3);
1481 return;
1482 case KEY_5cxx . . $ `ddio/ddio_common.h:224:9`!:
1483 SelectWeaponcxx . . $ SelectWeapon(d4f767463ce0a6b3).(4);
1484 return;
1485 case KEY_6cxx . . $ `ddio/ddio_common.h:225:9`!:
1486 SelectWeaponcxx . . $ SelectWeapon(d4f767463ce0a6b3).(5);
1487 return;
1488 case KEY_7cxx . . $ `ddio/ddio_common.h:226:9`!:
1489 SelectWeaponcxx . . $ SelectWeapon(d4f767463ce0a6b3).(6);
1490 return;
1491 case KEY_8cxx . . $ `ddio/ddio_common.h:227:9`!:
1492 SelectWeaponcxx . . $ SelectWeapon(d4f767463ce0a6b3).(7);
1493 return;
1494 case KEY_9cxx . . $ `ddio/ddio_common.h:228:9`!:
1495 SelectWeaponcxx . . $ SelectWeapon(d4f767463ce0a6b3).(8);
1496 return;
1497 case KEY_0cxx . . $ `ddio/ddio_common.h:219:9`!:
1498 SelectWeaponcxx . . $ SelectWeapon(d4f767463ce0a6b3).(9);
1499 return;
1500
1501 case KEY_F3cxx . . $ `ddio/ddio_common.h:284:9`!:
1502 if (GetHUDModecxx . . $ GetHUDMode(d2d05048dda10524).() != HUD_OBSERVERcxx . . $ HUD_OBSERVER.)
1503 ToggleHUDModecxx . . $ ToggleHUDMode(49f6e7a06ebc5aa8).();
1504 return;
1505 case KEY_F12cxx . . $ `ddio/ddio_common.h:293:9`!:
1506 Marker_messagecxx . . $ Marker_message. = 1;
1507 StartHUDInputMessagecxx . . $ StartHUDInputMessage(49f6e7a06ebc5aa8).();
1508 break;
1509 case KEY_F4cxx . . $ `ddio/ddio_common.h:285:9`!: {
1510 if ((!(Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!)) || (Netgamecxx . . $ Netgame..flagscxx . . $ netgame_info#flags. & NF_ALLOWGUIDEBOTcxx . . $ `Descent3/multi_external.h:232:9`!)) {
1511 Game_interface_modecxx . . $ Game_interface_mode. = GAME_BUDDY_INTERFACEcxx . . $ `Descent3/gamesequence.h:133:9`!;
1512 }
1513 return;
1514 } break;
1515 case KEY_F9cxx . . $ `ddio/ddio_common.h:290:9`!:
1516 // quick save key!
1517 if (!Cinematic_inusecxx . . $ Cinematic_inuse.) {
1518 StartGameMenucxx . . $ StartGameMenu(49f6e7a06ebc5aa8).();
1519 QuickSaveGamecxx . . $ QuickSaveGame(49f6e7a06ebc5aa8).();
1520 EndGameMenucxx . . $ EndGameMenu(49f6e7a06ebc5aa8).();
1521 }
1522 break;
1523 case KEY_ALTEDcxx . . $ `ddio/ddio_common.h:209:9`! + KEY_F2cxx . . $ `ddio/ddio_common.h:283:9`!:
1524 if (!Cinematic_inusecxx . . $ Cinematic_inuse.) {
1525 Game_interface_modecxx . . $ Game_interface_mode. = GAME_SAVE_INTERFACEcxx . . $ `Descent3/gamesequence.h:139:9`!;
1526 return;
1527 }
1528 break;
1529 }
1530 }
1531 bool Force_one_texturecxx . . $ Force_one_texture. = false;
1532
1533 #ifdef _DEBUGcxx . . $ `<built-in>:482:9`!
1534 static int test_kill_objscxx . . $ test_kill_objs. = 0;
1535
1536 void InitTestSystemscxx . . $ InitTestSystems(49f6e7a06ebc5aa8).() { test_kill_objscxx . . $ test_kill_objs. = 0; }
1537
1538 // Tells others that we are cheating
1539 void SendCheaterTextcxx . . $ SendCheaterText(49f6e7a06ebc5aa8).() {
1540 // Notify other players that you're using debug/test keys. We may want to change this to
1541 // only send the message for some keys.
1542 if (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!) {
1543 char str[255];
1544 snprintf(str, sizeof(str), TXT_CHEATERcxx . . $ `Descent3/stringtable.h:125:9`!, Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].callsigncxx . . $ player#callsign.);
1545
1546 if (Netgamecxx . . $ Netgame..local_rolecxx . . $ netgame_info#local_role. == LR_SERVERcxx . . $ `Descent3/multi_external.h:129:9`!)
1547 MultiSendMessageFromServercxx . . $ MultiSendMessageFromServer(99469d7ff9a1485a).(GR_RGBcxx . . $ GR_RGB(530956271a9518a5).(255, 0, 0), str);
1548 else
1549 MultiSendMessageToServercxx . . $ MultiSendMessageToServer(99469d7ff9a1485a).(0, str);
1550 }
1551 }
1552
1553 #include "osiris_dll.h"cxx . . $ `<file>/Descent3/osiris_dll.h`/
1554 #include "audiotaunts.h"cxx . . $ `<file>/Descent3/audiotaunts.h`/
1555
1556 void InitObjectScriptscxx . . $ InitObjectScripts(674fac047436fc5b).(objectcxx . . $ object# *obj, bool call_evt_created = true);
1557
1558 #ifdef _DEBUGcxx . . $ `<built-in>:482:9`!
1559 extern bool Cinematics_enabledcxx . . $ Cinematics_enabled.;
1560 #endif
1561
1562 // Deal with keys that only work for testing & debugging (eg., slew)
1563 void ProcessTestKeyscxx . . $ ProcessTestKeys(d4f767463ce0a6b3).(int key) {
1564 static int ffret = -1;
1565 int i;
1566
1567 // Debug break
1568 if (key == KEY_SHIFTEDcxx . . $ `ddio/ddio_common.h:208:9`! + KEY_BACKSPcxx . . $ `ddio/ddio_common.h:269:9`!)
1569 Int3cxx . . $ `misc/pserror.h:247:9`!();
1570
1571 // Handle slew keys
1572 if (Player_objectcxx . . $ Player_object.->control_typecxx . . $ object#control_type. == CT_SLEWcxx . . $ `Descent3/object_external.h:220:9`!) {
1573 switch (key) // Special for slew keys. Add all new debugging keys to the second switch statement.
1574 {
1575 case KEY_PAD5cxx . . $ `ddio/ddio_common.h:300:9`!:
1576 SlewStopcxx . . $ SlewStop(2da2a862cad4c994).(Player_objectcxx . . $ Player_object.);
1577 break;
1578 case KEY_PAD0cxx . . $ `ddio/ddio_common.h:295:9`!:
1579 SlewResetOrientcxx . . $ SlewResetOrient(419c470199a90a97).(Player_objectcxx . . $ Player_object.);
1580 break;
1581 }
1582 }
1583
1584 if (key == (KEY_SHIFTEDcxx . . $ `ddio/ddio_common.h:208:9`! + KEY_LBRACKETcxx . . $ `ddio/ddio_common.h:263:9`!)) {
1585 MultiSendRequestPlayTauntcxx . . $ MultiSendRequestPlayTaunt(d4f767463ce0a6b3).(0);
1586 }
1587
1588 if (key == (KEY_SHIFTEDcxx . . $ `ddio/ddio_common.h:208:9`! + KEY_RBRACKETcxx . . $ `ddio/ddio_common.h:264:9`!)) {
1589 MultiSendRequestPlayTauntcxx . . $ MultiSendRequestPlayTaunt(d4f767463ce0a6b3).(1);
1590 }
1591
1592 // All other debug/test keys require the DEBUGGED modifier, so bail if it's not set
1593 if (!(key & KEY_DEBUGGEDcxx . . $ `ddio/ddio_common.h:211:9`!))
1594 return;
1595
1596 switch (key & ~KEY_DEBUGGEDcxx . . $ `ddio/ddio_common.h:211:9`!) // for simplicity, do swich on keycode without the flag
1597 {
1598
1599 /*
1600 **************************************************
1601 Keys A-Z
1602 **************************************************
1603 */
1604 case KEY_Acxx . . $ `ddio/ddio_common.h:229:9`!:
1605
1606 DoAIcxx . . $ DoAI. = !DoAIcxx . . $ DoAI.;
1607 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("AI turned %s.", DoAIcxx . . $ DoAI. ? "on" : "off");
1608 break;
1609
1610 case KEY_Bcxx . . $ `ddio/ddio_common.h:230:9`!:
1611 Game_show_spherecxx . . $ Game_show_sphere. = (Game_show_spherecxx . . $ Game_show_sphere. + 1) % 4;
1612
1613 if (Game_show_spherecxx . . $ Game_show_sphere. == 0)
1614 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("No visible spheres.");
1615 else if (Game_show_spherecxx . . $ Game_show_sphere. == 1)
1616 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("Wall collision spheres(only encompass first anim frame).");
1617 else if (Game_show_spherecxx . . $ Game_show_sphere. == 2)
1618 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("Spheres for FVI(encompass all anims).");
1619 else if (Game_show_spherecxx . . $ Game_show_sphere. == 3)
1620 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("Object size spheres.");
1621
1622 break;
1623
1624 case KEY_Ccxx . . $ `ddio/ddio_common.h:231:9`!:
1625 SendCheaterTextcxx . . $ SendCheaterText(49f6e7a06ebc5aa8).();
1626 if (Player_objectcxx . . $ Player_object.->effect_infocxx . . $ object#effect_info.->type_flagscxx . . $ effect_info_s#type_flags. & EF_CLOAKEDcxx . . $ `Descent3/object_external.h:197:9`!) {
1627 MakeObjectVisiblecxx . . $ MakeObjectVisible(419c470199a90a97).(Player_objectcxx . . $ Player_object.);
1628 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("You escape the darkness!");
1629 } else {
1630 MakeObjectInvisiblecxx . . $ MakeObjectInvisible(3cdd7424a643b971).(Player_objectcxx . . $ Player_object., 10000);
1631 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("You enter the darkness!");
1632 }
1633 break;
1634
1635 case (KEY_Ccxx . . $ `ddio/ddio_common.h:231:9`! + KEY_SHIFTEDcxx . . $ `ddio/ddio_common.h:208:9`!): {
1636 Cinematics_enabledcxx . . $ Cinematics_enabled. = !Cinematics_enabledcxx . . $ Cinematics_enabled.;
1637
1638 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("Game Cinematics: %s", Cinematics_enabledcxx . . $ Cinematics_enabled. ? "enabled" : "disabled");
1639 } break;
1640
1641 case KEY_Dcxx . . $ `ddio/ddio_common.h:232:9`!: {
1642
1643 int GetRankIndexcxx . . $ GetRankIndex(3c8082c546dd2ea0).(int pnum, char *rankbuf);
1644 void ChangeRankIndexcxx . . $ ChangeRankIndex(3e454b8ccf442868).(int old_index, int pnum);
1645
1646 int oldrank = GetRankIndexcxx . . $ GetRankIndex(3c8082c546dd2ea0).(1, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
1647 Playerscxx . . $ Players.[1].rankcxx . . $ player#rank. += 100;
1648 ChangeRankIndexcxx . . $ ChangeRankIndex(3e454b8ccf442868).(oldrank, 1);
1649
1650 break;
1651 }
1652
1653 case KEY_SHIFTEDcxx . . $ `ddio/ddio_common.h:208:9`! + KEY_Dcxx . . $ `ddio/ddio_common.h:232:9`!: {
1654 int done = 0;
1655 for (i = 0; i <= Highest_room_indexcxx . . $ Highest_room_index. && !done; i++) {
1656 for (int t = 0; t < Roomscxx . . $ Rooms.[i].num_facescxx . . $ room#num_faces. && !done; t++) {
1657 if (GameTexturescxx . . $ GameTextures.[Roomscxx . . $ Rooms.[i].facescxx . . $ room#faces.[t].tmapcxx . . $ face#tmap.].flagscxx . . $ texture#flags. & TF_LIGHTcxx . . $ `Descent3/gametexture.h:220:9`!) {
1658 DestroyLightcxx . . $ DestroyLight(3e454b8ccf442868).(i, t);
1659 done = 1;
1660 }
1661 }
1662 }
1663 break;
1664 }
1665
1666 case KEY_Ecxx . . $ `ddio/ddio_common.h:233:9`!:
1667 // ends level prematurely
1668 // this is only for single player
1669 if (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!) {
1670 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("Press F6 to end a multiplayer level");
1671 } else {
1672 SetGameStatecxx . . $ SetGameState(35729c5b0b4aef73).(GAMESTATE_LVLENDcxx . . $ GAMESTATE_LVLEND.);
1673 }
1674 break;
1675
1676 case KEY_Ecxx . . $ `ddio/ddio_common.h:233:9`! + KEY_ALTEDcxx . . $ `ddio/ddio_common.h:209:9`!:
1677 // restart level
1678 if ((!(Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!)) || Netgamecxx . . $ Netgame..local_rolecxx . . $ netgame_info#local_role. == LR_SERVERcxx . . $ `Descent3/multi_external.h:129:9`!) {
1679 SetGameStatecxx . . $ SetGameState(35729c5b0b4aef73).(GAMESTATE_LVLFAILEDcxx . . $ GAMESTATE_LVLFAILED.);
1680 }
1681 break;
1682
1683 case KEY_Fcxx . . $ `ddio/ddio_common.h:234:9`!:
1684 Hud_stat_maskcxx . . $ Hud_stat_mask. ^= STAT_FPScxx . . $ `Descent3/hud.h:275:9`!;
1685 break;
1686
1687 /*case KEY_G:
1688 {
1689 char dmb_msg[100];
1690 mprintf(0,"Current Gametime is %f\n",Gametime);
1691 snprintf(dmb_msg,sizeof(dmb_msg),"Current Gametime is %f\n",Gametime);
1692 AddHUDMessage(dmb_msg);
1693 }
1694 break;*/
1695
1696 case KEY_Gcxx . . $ `ddio/ddio_common.h:235:9`!: {
1697 if (Player_objectcxx . . $ Player_object.->typecxx . . $ object#type. == OBJ_OBSERVERcxx . . $ `Descent3/object_external.h:182:9`!) {
1698 if (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!)
1699 MultiSendRequestToObservecxx . . $ MultiSendRequestToObserve(b1146eedae1e1d0b).(OBSERVER_MODE_ROAMcxx . . $ `Descent3/player_external.h:75:9`!, 0, 0);
1700 else
1701 PlayerStopObservingcxx . . $ PlayerStopObserving(d4f767463ce0a6b3).(Player_numcxx . . $ Player_num.);
1702
1703 } else {
1704 if (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!)
1705 MultiSendRequestToObservecxx . . $ MultiSendRequestToObserve(b1146eedae1e1d0b).(OBSERVER_MODE_ROAMcxx . . $ `Descent3/player_external.h:75:9`!, 1, 0);
1706 else
1707 PlayerSwitchToObservercxx . . $ PlayerSwitchToObserver(b1146eedae1e1d0b).(Player_numcxx . . $ Player_num., OBSERVER_MODE_ROAMcxx . . $ `Descent3/player_external.h:75:9`!);
1708 }
1709 } break;
1710
1711 case KEY_Hcxx . . $ `ddio/ddio_common.h:236:9`!:
1712 HUD_disabledcxx . . $ HUD_disabled. = !HUD_disabledcxx . . $ HUD_disabled.;
1713 if (!HUD_disabledcxx . . $ HUD_disabled.)
1714 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).(TXT_HUDENABLEDcxx . . $ `Descent3/stringtable.h:126:9`!);
1715 break;
1716
1717 case KEY_Icxx . . $ `ddio/ddio_common.h:237:9`!:
1718
1719 SendCheaterTextcxx . . $ SendCheaterText(49f6e7a06ebc5aa8).();
1720 if (Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].flagscxx . . $ player#flags. & PLAYER_FLAGS_INVULNERABLEcxx . . $ `Descent3/player_external.h:79:9`!) {
1721 MakePlayerVulnerablecxx . . $ MakePlayerVulnerable(d4f767463ce0a6b3).(Player_numcxx . . $ Player_num.);
1722 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("Your mother wont protect you now!");
1723 } else {
1724 MakePlayerInvulnerablecxx . . $ MakePlayerInvulnerable(a421cb528a2d8d2f).(Player_numcxx . . $ Player_num., 10000);
1725 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("You're a wimp!");
1726 }
1727 break;
1728
1729 case KEY_Jcxx . . $ `ddio/ddio_common.h:238:9`!: {
1730 objectcxx . . $ object# *obj = &Objectscxx . . $ Objects.[Player_numcxx . . $ Player_num.];
1731 for (i = 0; i < 21; i++) {
1732 if (obj->dynamic_wbcxx . . $ object#dynamic_wb.[i].flagscxx . . $ dynamic_wb_info#flags. & DWBF_QUADcxx . . $ `lib/robotfirestruct_external.h:47:9`!) {
1733 obj->dynamic_wbcxx . . $ object#dynamic_wb.[i].flagscxx . . $ dynamic_wb_info#flags. &= ~DWBF_QUADcxx . . $ `lib/robotfirestruct_external.h:47:9`!;
1734 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("Quad Flag Turned Off");
1735 } else {
1736 obj->dynamic_wbcxx . . $ object#dynamic_wb.[i].flagscxx . . $ dynamic_wb_info#flags. |= DWBF_QUADcxx . . $ `lib/robotfirestruct_external.h:47:9`!;
1737 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("Quad Flag Turned On");
1738 }
1739 }
1740
1741 } break;
1742
1743 case KEY_Kcxx . . $ `ddio/ddio_common.h:239:9`!: {
1744 if (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!)
1745 break;
1746
1747 for (i = 0; i < MAX_OBJECTScxx . . $ `lib/object_external_struct.h:107:9`!; i++) {
1748 if (test_kill_objscxx . . $ test_kill_objs. == 0 && Objectscxx . . $ Objects.[i].typecxx . . $ object#type. == OBJ_ROBOTcxx . . $ `Descent3/object_external.h:162:9`!) {
1749 DoAIcxx . . $ DoAI. = 0;
1750 ObjDeletecxx . . $ ObjDelete(d4f767463ce0a6b3).(i);
1751 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("All robots dead!");
1752 } else if (test_kill_objscxx . . $ test_kill_objs. == 1 && Objectscxx . . $ Objects.[i].typecxx . . $ object#type. == OBJ_CLUTTERcxx . . $ `Descent3/object_external.h:171:9`!) {
1753 ObjDeletecxx . . $ ObjDelete(d4f767463ce0a6b3).(i);
1754 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("All clutter gone!");
1755 } else if (test_kill_objscxx . . $ test_kill_objs. == 2 && Objectscxx . . $ Objects.[i].typecxx . . $ object#type. == OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!) {
1756 ObjDeletecxx . . $ ObjDelete(d4f767463ce0a6b3).(i);
1757 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("All powerups gone!");
1758 }
1759 }
1760 test_kill_objscxx . . $ test_kill_objs.++;
1761
1762 test_kill_objscxx . . $ test_kill_objs. = test_kill_objscxx . . $ test_kill_objs. % 3;
1763
1764 break;
1765 }
1766
1767 case KEY_Lcxx . . $ `ddio/ddio_common.h:240:9`!:
1768 Terrain_LOD_engine_offcxx . . $ Terrain_LOD_engine_off. = !Terrain_LOD_engine_offcxx . . $ Terrain_LOD_engine_off.;
1769 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("Terrain LOD engine turned %s", Terrain_LOD_engine_offcxx . . $ Terrain_LOD_engine_off. ? "OFF" : "ON");
1770 break;
1771
1772 case KEY_Mcxx . . $ `ddio/ddio_common.h:241:9`!:
1773 Render_portalscxx . . $ Render_portals. = 1 - Render_portalscxx . . $ Render_portals.;
1774 break;
1775
1776 case KEY_Ncxx . . $ `ddio/ddio_common.h:242:9`!:
1777 if (Current_levelcxx . . $ Current_level. && Current_levelcxx . . $ Current_level.->filenamecxx . . $ tLevelNode#filename.) {
1778 vectorcxx . . $ vector# player_pos = Player_objectcxx . . $ Player_object.->poscxx . . $ object#pos.;
1779 matrixcxx . . $ matrix# player_orient = Player_objectcxx . . $ Player_object.->orientcxx . . $ object#orient.;
1780 int player_roomnum = Player_objectcxx . . $ Player_object.->roomnumcxx . . $ object#roomnum.;
1781
1782 // Load the level
1783 LoadAndStartCurrentLevelcxx . . $ LoadAndStartCurrentLevel(c9857a73d68e59ba).();
1784
1785 // Restore player position
1786 ObjSetPoscxx . . $ ObjSetPos(bbb518390bedd509).(Player_objectcxx . . $ Player_object., &player_pos, player_roomnum, &player_orient, true);
1787 }
1788 break;
1789
1790 case KEY_Ocxx . . $ `ddio/ddio_common.h:243:9`!:
1791 Outline_modecxx . . $ Outline_mode. ^= OM_ONcxx . . $ `Descent3/render.h:200:9`!;
1792 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("Outline mode turned %s", OUTLINE_ONcxx . . $ `Descent3/render.h:197:9`!(0) ? "ON" : "OFF");
1793 break;
1794
1795 case KEY_Ocxx . . $ `ddio/ddio_common.h:243:9`! + KEY_SHIFTEDcxx . . $ `ddio/ddio_common.h:208:9`!:
1796 Outline_modecxx . . $ Outline_mode. = OM_ONcxx . . $ `Descent3/render.h:200:9`! + OM_ALLcxx . . $ `Descent3/render.h:205:9`!;
1797 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("All outline options turned on.");
1798 break;
1799
1800 case KEY_Pcxx . . $ `ddio/ddio_common.h:244:9`!:
1801 MakeTestPathcxx . . $ MakeTestPath(26b728a3f807ec4f).(&Player_objectcxx . . $ Player_object.->roomnumcxx . . $ object#roomnum., &Player_objectcxx . . $ Player_object.->poscxx . . $ object#pos.);
1802 break;
1803
1804 case KEY_Qcxx . . $ `ddio/ddio_common.h:245:9`!:
1805 if (StateLimitedcxx . . $ StateLimited.) {
1806 StateLimitedcxx . . $ StateLimited. = 0;
1807 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("State limited turned off.");
1808 } else {
1809 StateLimitedcxx . . $ StateLimited. = 1;
1810 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("State limited turned on.");
1811 }
1812 break;
1813
1814 case KEY_Rcxx . . $ `ddio/ddio_common.h:246:9`!:
1815 if (Weathercxx . . $ Weather..flagscxx . . $ weather#flags. & WEATHER_FLAGS_SNOWcxx . . $ `Descent3/weather.h:24:9`!) {
1816 Weathercxx . . $ Weather..flagscxx . . $ weather#flags. &= ~WEATHER_FLAGS_SNOWcxx . . $ `Descent3/weather.h:24:9`!;
1817 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("Snow turned off.");
1818 } else {
1819 Weathercxx . . $ Weather..flagscxx . . $ weather#flags. |= WEATHER_FLAGS_SNOWcxx . . $ `Descent3/weather.h:24:9`!;
1820 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("Snow turned on.");
1821 }
1822 break;
1823
1824 case KEY_Scxx . . $ `ddio/ddio_common.h:247:9`!:
1825 if (Sound_systemcxx . . $ Sound_system..IsActivecxx . . $ hlsSystem#IsActive(c9857a73d68e59ba).()) {
1826 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("Sound system off.");
1827 Sound_systemcxx . . $ Sound_system..KillSoundLibcxx . . $ hlsSystem#KillSoundLib(b45ddcbc8423892c).(false);
1828 } else {
1829 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("Sound system on.");
1830 Sound_systemcxx . . $ Sound_system..InitSoundLibcxx . . $ hlsSystem#InitSoundLib(bc2f84f4176dee7e).(Descentcxx . . $ Descent., Sound_mixercxx . . $ Sound_mixer., Sound_qualitycxx . . $ Sound_quality., false);
1831 }
1832 break;
1833
1834 case KEY_Scxx . . $ `ddio/ddio_common.h:247:9`! + KEY_SHIFTEDcxx . . $ `ddio/ddio_common.h:208:9`!: {
1835 // extern spewinfo SpewEffects[MAX_SPEW_EFFECTS];
1836 int count;
1837
1838 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("Spewers Killed");
1839
1840 for (count = 0; count < MAX_SPEW_EFFECTScxx . . $ `Descent3/spew.h:131:9`!; count++) {
1841 SpewEffectscxx . . $ SpewEffects.[count].inusecxx . . $ spewinfo#inuse. = 0;
1842 }
1843
1844 } break;
1845
1846 case KEY_Tcxx . . $ `ddio/ddio_common.h:248:9`!:
1847 if (Timedemo_framecxx . . $ Timedemo_frame. == -1)
1848 Timedemo_framecxx . . $ Timedemo_frame. = 0;
1849 break;
1850
1851 case KEY_Ucxx . . $ `ddio/ddio_common.h:249:9`!:
1852 AIPath_test_end_roomcxx . . $ AIPath_test_end_room. = Player_objectcxx . . $ Player_object.->roomnumcxx . . $ object#roomnum.;
1853 AIPath_test_end_poscxx . . $ AIPath_test_end_pos. =cxx . . $ vector#`operator=`(a48bc7e93a8dae5e). Player_objectcxx . . $ Player_object.->poscxx . . $ object#pos.;
1854 break;
1855
1856 case KEY_Vcxx . . $ `ddio/ddio_common.h:250:9`!:
1857 // TODO: should this actually be a fallthrough?
1858
1859 case KEY_Wcxx . . $ `ddio/ddio_common.h:251:9`!:
1860 if (Weathercxx . . $ Weather..flagscxx . . $ weather#flags. & WEATHER_FLAGS_LIGHTNINGcxx . . $ `Descent3/weather.h:23:9`!) {
1861 Weathercxx . . $ Weather..flagscxx . . $ weather#flags. &= ~WEATHER_FLAGS_LIGHTNINGcxx . . $ `Descent3/weather.h:23:9`!;
1862 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("Lighting turned off.");
1863
1864 } else {
1865 Weathercxx . . $ Weather..flagscxx . . $ weather#flags. |= WEATHER_FLAGS_LIGHTNINGcxx . . $ `Descent3/weather.h:23:9`!;
1866 Weathercxx . . $ Weather..lightning_sequencecxx . . $ weather#lightning_sequence. = 0;
1867 Weathercxx . . $ Weather..lightning_rand_valuecxx . . $ weather#lightning_rand_value. = 70;
1868 Weathercxx . . $ Weather..lightning_interval_timecxx . . $ weather#lightning_interval_time. = .01f;
1869 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("Lighting turned on.");
1870 }
1871 break;
1872
1873 case KEY_Xcxx . . $ `ddio/ddio_common.h:252:9`!: {
1874 SendCheaterTextcxx . . $ SendCheaterText(49f6e7a06ebc5aa8).();
1875 Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].energycxx . . $ player#energy. = 200.0f;
1876 Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].weapon_flagscxx . . $ player#weapon_flags. = 0xFFFFFFFF;
1877 int i;
1878
1879 for (i = 0; i < MAX_PLAYER_WEAPONScxx . . $ `Descent3/player_external_struct.h:91:9`!; i++)
1880 Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].weapon_ammocxx . . $ player#weapon_ammo.[i] = Shipscxx . . $ Ships.[Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].ship_indexcxx . . $ player#ship_index.].max_ammocxx . . $ ship#max_ammo.[i];
1881
1882 Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].afterburn_time_leftcxx . . $ player#afterburn_time_left. = AFTERBURN_TIMEcxx . . $ `Descent3/player.h:394:9`!;
1883
1884 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("All weapons!");
1885
1886 // add all the countermeasures
1887 if (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!)
1888 break;
1889 int c_id, b_id, s_id, g_id, p_id;
1890 c_id = FindWeaponNamecxx . . $ FindWeaponName(5c4306d8553b3696).("Chaff");
1891 b_id = FindWeaponNamecxx . . $ FindWeaponName(5c4306d8553b3696).("Betty");
1892 s_id = FindWeaponNamecxx . . $ FindWeaponName(5c4306d8553b3696).("SeekerMine");
1893 g_id = FindWeaponNamecxx . . $ FindWeaponName(5c4306d8553b3696).("Gunboy");
1894 p_id = FindWeaponNamecxx . . $ FindWeaponName(5c4306d8553b3696).("ProxMine");
1895
1896 int c_pid, b_pid, s_pid, g_pid, p_pid;
1897 c_pid = FindObjectIDNamecxx . . $ FindObjectIDName(5c4306d8553b3696).("chaff");
1898 b_pid = FindObjectIDNamecxx . . $ FindObjectIDName(5c4306d8553b3696).("Betty4pack");
1899 s_pid = FindObjectIDNamecxx . . $ FindObjectIDName(5c4306d8553b3696).("Seeker3pack");
1900 g_pid = FindObjectIDNamecxx . . $ FindObjectIDName(5c4306d8553b3696).("gunboypowerup");
1901 p_pid = FindObjectIDNamecxx . . $ FindObjectIDName(5c4306d8553b3696).("ProxMinepowerup");
1902
1903 if (c_pid == -1)
1904 c_pid = FindObjectIDNamecxx . . $ FindObjectIDName(5c4306d8553b3696).("Shield");
1905 if (b_pid == -1)
1906 b_pid = FindObjectIDNamecxx . . $ FindObjectIDName(5c4306d8553b3696).("Energy");
1907 if (s_pid == -1)
1908 s_pid = FindObjectIDNamecxx . . $ FindObjectIDName(5c4306d8553b3696).("Shield");
1909 if (g_pid == -1)
1910 g_pid = FindObjectIDNamecxx . . $ FindObjectIDName(5c4306d8553b3696).("Energy");
1911 if (p_pid == -1)
1912 p_pid = FindObjectIDNamecxx . . $ FindObjectIDName(5c4306d8553b3696).("Shield");
1913
1914 objectcxx . . $ object# *objp = &Objectscxx . . $ Objects.[Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].objnumcxx . . $ player#objnum.];
1915 for (i = 0; i < 30; i++) {
1916 if (c_id != -1)
1917 Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].counter_measurescxx . . $ player#counter_measures..Addcxx . . $ Inventory#Add(122d808d8b1091da).(OBJ_WEAPONcxx . . $ `Descent3/object_external.h:165:9`!, c_id, objp, OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!, c_pid);
1918 if (b_id != -1)
1919 Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].counter_measurescxx . . $ player#counter_measures..Addcxx . . $ Inventory#Add(122d808d8b1091da).(OBJ_WEAPONcxx . . $ `Descent3/object_external.h:165:9`!, b_id, objp, OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!, b_pid);
1920 if (s_id != -1)
1921 Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].counter_measurescxx . . $ player#counter_measures..Addcxx . . $ Inventory#Add(122d808d8b1091da).(OBJ_WEAPONcxx . . $ `Descent3/object_external.h:165:9`!, s_id, objp, OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!, s_pid);
1922 if (g_id != -1)
1923 Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].counter_measurescxx . . $ player#counter_measures..Addcxx . . $ Inventory#Add(122d808d8b1091da).(OBJ_WEAPONcxx . . $ `Descent3/object_external.h:165:9`!, g_id, objp, OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!, g_pid);
1924 if (p_id != -1)
1925 Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].counter_measurescxx . . $ player#counter_measures..Addcxx . . $ Inventory#Add(122d808d8b1091da).(OBJ_WEAPONcxx . . $ `Descent3/object_external.h:165:9`!, p_id, objp, OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!, p_pid);
1926 }
1927
1928 break;
1929 }
1930
1931 case KEY_Ycxx . . $ `ddio/ddio_common.h:253:9`!:
1932 Physics_player_verbosecxx . . $ Physics_player_verbose. = 1 - Physics_player_verbosecxx . . $ Physics_player_verbose.;
1933 if (Physics_player_verbosecxx . . $ Physics_player_verbose.)
1934 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("Verbose player physics info\n");
1935 else
1936 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("Player physics info off\n");
1937 break;
1938
1939 case KEY_Zcxx . . $ `ddio/ddio_common.h:254:9`!: {
1940 // Inventory test
1941 int id, objnum;
1942
1943 id = FindObjectIDNamecxx . . $ FindObjectIDName(5c4306d8553b3696).("Betty4Pack");
1944 objnum = ObjCreatecxx . . $ ObjCreate(849c3da80a4f387f).(OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!, id, Player_objectcxx . . $ Player_object.->roomnumcxx . . $ object#roomnum., &Player_objectcxx . . $ Player_object.->poscxx . . $ object#pos., &Player_objectcxx . . $ Player_object.->orientcxx . . $ object#orient.);
1945
1946 if (objnum != -1) {
1947 if (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!)
1948 MultiSendObjectcxx . . $ MultiSendObject(d7354c60e612ede5).(&Objectscxx . . $ Objects.[objnum], false);
1949
1950 InitObjectScriptscxx . . $ InitObjectScripts(674fac047436fc5b).(&Objectscxx . . $ Objects.[objnum], true);
1951 Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].inventorycxx . . $ player#inventory..AddObjectcxx . . $ Inventory#AddObject(bc9c4eeb54e60257).(Objectscxx . . $ Objects.[objnum].handlecxx . . $ object#handle., true);
1952 }
1953 } break;
1954
1955 case KEY_Zcxx . . $ `ddio/ddio_common.h:254:9`! + KEY_ALTEDcxx . . $ `ddio/ddio_common.h:209:9`!: {
1956 // look for a betty4pack and remove the sucker
1957 int id;
1958 id = FindObjectIDNamecxx . . $ FindObjectIDName(5c4306d8553b3696).("Betty4Pack");
1959 for (i = 0; i < MAX_OBJECTScxx . . $ `lib/object_external_struct.h:107:9`!; i++) {
1960 if (Objectscxx . . $ Objects.[i].typecxx . . $ object#type. == OBJ_DUMMYcxx . . $ `Descent3/object_external.h:181:9`! && Objectscxx . . $ Objects.[i].dummy_typecxx . . $ object#dummy_type. == OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`! && Objectscxx . . $ Objects.[i].idcxx . . $ object#id. == id) {
1961 // here's a betty
1962 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Killing a betty\n");
1963 SetObjectDeadFlagcxx . . $ SetObjectDeadFlag(80a724877f6428f2).(&Objectscxx . . $ Objects.[i], true);
1964 }
1965 }
1966
1967 } break;
1968 /*
1969 **************************************************
1970 Keypad Keys
1971 **************************************************
1972 */
1973
1974 case KEY_PAD0cxx . . $ `ddio/ddio_common.h:295:9`!: {
1975 Game_update_attachcxx . . $ Game_update_attach. = 1 - Game_update_attachcxx . . $ Game_update_attach.;
1976
1977 if (Game_update_attachcxx . . $ Game_update_attach.) {
1978 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Update attach on\n");
1979 } else {
1980 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Update attach off\n");
1981 }
1982 } break;
1983
1984 case KEY_PAD1cxx . . $ `ddio/ddio_common.h:296:9`!: {
1985 Game_do_flying_simcxx . . $ Game_do_flying_sim. = 1 - Game_do_flying_simcxx . . $ Game_do_flying_sim.;
1986 if (Game_do_flying_simcxx . . $ Game_do_flying_sim.) {
1987 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Game_do_flying_sim on\n");
1988 } else {
1989 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Game_do_flying_sim off\n");
1990 }
1991 } break;
1992
1993 case KEY_PAD2cxx . . $ `ddio/ddio_common.h:297:9`!: {
1994 Game_do_walking_simcxx . . $ Game_do_walking_sim. = 1 - Game_do_walking_simcxx . . $ Game_do_walking_sim.;
1995 if (Game_do_walking_simcxx . . $ Game_do_walking_sim.) {
1996 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Game_do_walking_sim on\n");
1997 } else {
1998 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Game_do_walking_sim off\n");
1999 }
2000 } break;
2001
2002 case KEY_PAD3cxx . . $ `ddio/ddio_common.h:298:9`!: {
2003 Game_do_vis_simcxx . . $ Game_do_vis_sim. = 1 - Game_do_vis_simcxx . . $ Game_do_vis_sim.;
2004 if (Game_do_vis_simcxx . . $ Game_do_vis_sim.) {
2005 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Game_do_vis_sim on\n");
2006 } else {
2007 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Game_do_vis_sim off\n");
2008 }
2009 } break;
2010
2011 case KEY_PAD4cxx . . $ `ddio/ddio_common.h:299:9`!: {
2012 Game_do_ai_movementcxx . . $ Game_do_ai_movement. = 1 - Game_do_ai_movementcxx . . $ Game_do_ai_movement.;
2013 if (Game_do_ai_movementcxx . . $ Game_do_ai_movement.) {
2014 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Game_do_ai_movement on\n");
2015 } else {
2016 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Game_do_ai_movement off\n");
2017 }
2018 } break;
2019
2020 case KEY_PAD5cxx . . $ `ddio/ddio_common.h:300:9`!: {
2021 Game_do_ai_viscxx . . $ Game_do_ai_vis. = 1 - Game_do_ai_viscxx . . $ Game_do_ai_vis.;
2022 if (Game_do_ai_viscxx . . $ Game_do_ai_vis.) {
2023 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Game_do_ai_vis on\n");
2024 } else {
2025 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Game_do_ai_vis off\n");
2026 }
2027 } break;
2028
2029 case KEY_PAD6cxx . . $ `ddio/ddio_common.h:301:9`!: {
2030 if (AI_debug_robot_docxx . . $ AI_debug_robot_do.) {
2031 AI_debug_robot_docxx . . $ AI_debug_robot_do. = false;
2032 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "AI Debug Info Off\n");
2033 } else {
2034 AI_debug_robot_docxx . . $ AI_debug_robot_do. = true;
2035 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "AI Debug Info On\n");
2036 }
2037 } break;
2038
2039 case KEY_PAD7cxx . . $ `ddio/ddio_common.h:302:9`!: {
2040 bool killed_something = false;
2041 int killed_count = 0;
2042 int i, a;
2043 for (i = 0; i < MAX_OBJECTScxx . . $ `lib/object_external_struct.h:107:9`!; i++) {
2044 if (Objectscxx . . $ Objects.[i].typecxx . . $ object#type. == OBJ_ROBOTcxx . . $ `Descent3/object_external.h:162:9`! || (Objectscxx . . $ Objects.[i].typecxx . . $ object#type. == OBJ_BUILDINGcxx . . $ `Descent3/object_external.h:176:9`! && Objectscxx . . $ Objects.[i].ai_infocxx . . $ object#ai_info.)) {
2045 // Now, kill all robots of this type!
2046 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("Killing all %s robots!", Object_infocxx . . $ Object_info.[Objectscxx . . $ Objects.[i].idcxx . . $ object#id.].namecxx . . $ object_info#name.);
2047 for (a = 0; a < MAX_OBJECTScxx . . $ `lib/object_external_struct.h:107:9`!; a++) {
2048 if (Objectscxx . . $ Objects.[a].idcxx . . $ object#id. == Objectscxx . . $ Objects.[i].idcxx . . $ object#id.) {
2049 SetObjectDeadFlagcxx . . $ SetObjectDeadFlag(80a724877f6428f2).(&Objectscxx . . $ Objects.[a]);
2050 killed_something = true;
2051 killed_count++;
2052 }
2053 }
2054 /*
2055 SetObjectDeadFlag(&Objects[i]);
2056 AddHUDMessage("Killed object %d!",i);
2057
2058 if(killed_count>4)
2059 break;
2060 */
2061 }
2062 if (killed_something)
2063 break;
2064 }
2065 if (!killed_something)
2066 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("Nothing to kill!");
2067 else
2068 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Killed %d objects of type %s!\n", killed_count, Object_info[Objects[i].id].name);
2069 } break;
2070 /*
2071 **************************************************
2072 Number Keys
2073 **************************************************
2074 */
2075
2076 case KEY_1cxx . . $ `ddio/ddio_common.h:220:9`!: {
2077 // goto prev viewer
2078 int viewer_objnum = Viewer_objectcxx . . $ Viewer_object. - Objectscxx . . $ Objects.;
2079 int found = 0;
2080
2081 for (i = viewer_objnum - 1; i >= 0 && !found; i--, i < 0 ? i = Highest_object_indexcxx . . $ Highest_object_index. : i = i) {
2082 if (Objectscxx . . $ Objects.[i].typecxx . . $ object#type. == OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`! || Objectscxx . . $ Objects.[i].typecxx . . $ object#type. == OBJ_PLAYERcxx . . $ `Descent3/object_external.h:164:9`! || Objectscxx . . $ Objects.[i].typecxx . . $ object#type. == OBJ_ROBOTcxx . . $ `Descent3/object_external.h:162:9`! ||
2083 Objectscxx . . $ Objects.[i].typecxx . . $ object#type. == OBJ_CLUTTERcxx . . $ `Descent3/object_external.h:171:9`! || Objectscxx . . $ Objects.[i].typecxx . . $ object#type. == OBJ_BUILDINGcxx . . $ `Descent3/object_external.h:176:9`! || Objectscxx . . $ Objects.[i].typecxx . . $ object#type. == OBJ_MARKERcxx . . $ `Descent3/object_external.h:175:9`!) {
2084 found = 1;
2085 Viewer_objectcxx . . $ Viewer_object. = &Objectscxx . . $ Objects.[i];
2086 }
2087 }
2088
2089 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("Viewer set to previous object.");
2090
2091 } break;
2092
2093 case KEY_2cxx . . $ `ddio/ddio_common.h:221:9`!: {
2094 // reset viewer
2095 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("Viewer set to player object.");
2096 Viewer_objectcxx . . $ Viewer_object. = Player_objectcxx . . $ Player_object.;
2097 } break;
2098
2099 case KEY_3cxx . . $ `ddio/ddio_common.h:222:9`!: {
2100 // goto next viewer
2101 int viewer_objnum = Viewer_objectcxx . . $ Viewer_object. - Objectscxx . . $ Objects.;
2102 int found = 0;
2103
2104 for (i = viewer_objnum + 1; i <= Highest_object_indexcxx . . $ Highest_object_index. && !found; i++, i %= (Highest_object_indexcxx . . $ Highest_object_index. + 1)) {
2105 if (Objectscxx . . $ Objects.[i].typecxx . . $ object#type. == OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`! || Objectscxx . . $ Objects.[i].typecxx . . $ object#type. == OBJ_PLAYERcxx . . $ `Descent3/object_external.h:164:9`! || Objectscxx . . $ Objects.[i].typecxx . . $ object#type. == OBJ_ROBOTcxx . . $ `Descent3/object_external.h:162:9`! ||
2106 Objectscxx . . $ Objects.[i].typecxx . . $ object#type. == OBJ_CLUTTERcxx . . $ `Descent3/object_external.h:171:9`! || Objectscxx . . $ Objects.[i].typecxx . . $ object#type. == OBJ_BUILDINGcxx . . $ `Descent3/object_external.h:176:9`! || Objectscxx . . $ Objects.[i].typecxx . . $ object#type. == OBJ_MARKERcxx . . $ `Descent3/object_external.h:175:9`!) {
2107 found = 1;
2108 Viewer_objectcxx . . $ Viewer_object. = &Objectscxx . . $ Objects.[i];
2109 }
2110 }
2111
2112 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("Viewer set to next object.");
2113 } break;
2114
2115 case KEY_4cxx . . $ `ddio/ddio_common.h:223:9`!:
2116 if (Tracking_FVIcxx . . $ Tracking_FVI.)
2117 Tracking_FVIcxx . . $ Tracking_FVI. = false;
2118 else
2119 Tracking_FVIcxx . . $ Tracking_FVI. = true;
2120
2121 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("Tracking FVI now set to %s.", Tracking_FVIcxx . . $ Tracking_FVI. ? "on" : "off");
2122
2123 break;
2124
2125 case KEY_6cxx . . $ `ddio/ddio_common.h:225:9`!:
2126 Render_FOVcxx . . $ Render_FOV. -= 1;
2127 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("FOV is now %f", Render_FOVcxx . . $ Render_FOV.);
2128 break;
2129
2130 case KEY_7cxx . . $ `ddio/ddio_common.h:226:9`!:
2131 Render_FOVcxx . . $ Render_FOV. += 1;
2132 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("FOV is now %f", Render_FOVcxx . . $ Render_FOV.);
2133 break;
2134
2135 case KEY_8cxx . . $ `ddio/ddio_common.h:227:9`!:
2136 Render_FOVcxx . . $ Render_FOV. = D3_DEFAULT_FOVcxx . . $ `Descent3/descent.h:176:9`!;
2137 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("FOV has been reset to %f", Render_FOVcxx . . $ Render_FOV.);
2138 break;
2139
2140 case KEY_9cxx . . $ `ddio/ddio_common.h:228:9`!:
2141 Force_one_texturecxx . . $ Force_one_texture. = !Force_one_texturecxx . . $ Force_one_texture.;
2142 break;
2143
2144 /*
2145 **************************************************
2146 Function Keys
2147 **************************************************
2148 */
2149
2150 case KEY_F5cxx . . $ `ddio/ddio_common.h:286:9`!:
2151 D3MusicTogglecxx . . $ D3MusicToggle(49f6e7a06ebc5aa8).();
2152 break;
2153
2154 case KEY_F6cxx . . $ `ddio/ddio_common.h:287:9`!: {
2155 vectorcxx . . $ vector# test_pos;
2156 fvi_infocxx . . $ fvi_info# hit_info;
2157 fvi_querycxx . . $ fvi_query# fq;
2158 int fate;
2159 int this_key = key & ~KEY_DEBUGGEDcxx . . $ `ddio/ddio_common.h:211:9`!;
2160
2161 test_pos =cxx . . $ vector#`operator=`(c0842353a20857d). Player_objectcxx . . $ Player_object.->poscxx . . $ object#pos. +cxx . . $ operator+(b77b703cd1e43e33). Player_objectcxx . . $ Player_object.->orientcxx . . $ object#orient..fveccxx . . $ matrix#fvec. *cxx . . $ `operator*`(252247219a31502c). 1000000.0f;
2162
2163 fq.p0cxx . . $ fvi_query#p0. = &Player_objectcxx . . $ Player_object.->poscxx . . $ object#pos.;
2164 fq.startroomcxx . . $ fvi_query#startroom. = Player_objectcxx . . $ Player_object.->roomnumcxx . . $ object#roomnum.;
2165 fq.p1cxx . . $ fvi_query#p1. = &test_pos;
2166 fq.radcxx . . $ fvi_query#rad. = 0.0;
2167 fq.thisobjnumcxx . . $ fvi_query#thisobjnum. = OBJNUMcxx . . $ `Descent3/object.h:700:9`!(Player_object);
2168 fq.ignore_obj_listcxx . . $ fvi_query#ignore_obj_list. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
2169 if (this_key == KEY_F6cxx . . $ `ddio/ddio_common.h:287:9`!)
2170 fq.flagscxx . . $ fvi_query#flags. = FQ_CHECK_OBJScxx . . $ `lib/findintersection_external.h:59:9`! | FQ_IGNORE_RENDER_THROUGH_PORTALScxx . . $ `lib/findintersection_external.h:84:9`!;
2171 else
2172 fq.flagscxx . . $ fvi_query#flags. = 0;
2173
2174 fate = fvi_FindIntersectioncxx . . $ fvi_FindIntersection(e1c4d7bd350effc8).(&fq, &hit_info);
2175
2176 switch (fate) {
2177 case HIT_NONEcxx . . $ `lib/findintersection_external.h:45:9`!:
2178 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Hit nothing\n");
2179 break;
2180 case HIT_WALLcxx . . $ `lib/findintersection_external.h:46:9`!:
2181 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Hit wall\n");
2182 break;
2183 case HIT_OBJECTcxx . . $ `lib/findintersection_external.h:47:9`!:
2184 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Hit Object %d\n", hit_info.hit_object);
2185 break;
2186 case HIT_TERRAINcxx . . $ `lib/findintersection_external.h:48:9`!:
2187 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Hit Terrain %d\n", CELLNUM(hit_info.hit_room));
2188 break;
2189 case HIT_OUT_OF_TERRAIN_BOUNDScxx . . $ `lib/findintersection_external.h:50:9`!:
2190 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Hit nothing: Leaving Terrain\n");
2191 break;
2192 case HIT_SPHERE_2_POLY_OBJECTcxx . . $ `lib/findintersection_external.h:52:9`!:
2193 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Hit Poly_object\n");
2194 break;
2195 default:
2196 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Hit %d not printed, add to list\n", fate);
2197 break;
2198 }
2199
2200 if (fate) {
2201 int objnum;
2202
2203 objnum = ObjCreatecxx . . $ ObjCreate(849c3da80a4f387f).(OBJ_DEBUG_LINEcxx . . $ `Descent3/object_external.h:183:9`!, 1, Player_objectcxx . . $ Player_object.->roomnumcxx . . $ object#roomnum., &Player_objectcxx . . $ Player_object.->poscxx . . $ object#pos., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
2204 if (objnum >= 0) { // DAJ -1FIX
2205 Objectscxx . . $ Objects.[objnum].rtypecxx . . $ object#rtype..line_infocxx . . $ object#$anonymous_type_10#line_info..end_poscxx . . $ line_info_s#end_pos. =cxx . . $ vector#`operator=`(a48bc7e93a8dae5e). hit_info.hit_pntcxx . . $ fvi_info#hit_pnt.;
2206 Objectscxx . . $ Objects.[objnum].sizecxx . . $ object#size. = vm_VectorDistancecxx . . $ vm_VectorDistance(e65d563e2b53cc54).(&Player_objectcxx . . $ Player_object.->poscxx . . $ object#pos., &hit_info.hit_pntcxx . . $ fvi_info#hit_pnt.);
2207 ObjSetAABBcxx . . $ ObjSetAABB(419c470199a90a97).(&Objectscxx . . $ Objects.[objnum]);
2208 }
2209 }
2210
2211 Sound_systemcxx . . $ Sound_system..CheckAndForceSoundDataAlloccxx . . $ hlsSystem#CheckAndForceSoundDataAlloc(83c267b20bac841a).(SOUND_REFUELINGcxx . . $ `Descent3/sounds.h:106:9`!);
2212 Sound_systemcxx . . $ Sound_system..PlayStreamcxx . . $ hlsSystem#PlayStream(bf4d5b0c3a7930a0).(0, SoundFilescxx . . $ SoundFiles.[Soundscxx . . $ Sounds.[SOUND_REFUELINGcxx . . $ `Descent3/sounds.h:106:9`!].sample_indexcxx . . $ sound_info#sample_index.].sample_8bitcxx . . $ sound_file_info#sample_8bit.,
2213 SoundFilescxx . . $ SoundFiles.[Soundscxx . . $ Sounds.[SOUND_REFUELINGcxx . . $ `Descent3/sounds.h:106:9`!].sample_indexcxx . . $ sound_info#sample_index.].sample_lengthcxx . . $ sound_file_info#sample_length., SIF_STREAMING_8_Mcxx . . $ `sndlib/ssl_lib.h:384:9`!, 1.0,
2214 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
2215 } break;
2216
2217 case KEY_F7cxx . . $ `ddio/ddio_common.h:288:9`!:
2218 // Toggle Music Debug Info!!
2219 Music_debug_verbosecxx . . $ Music_debug_verbose. = !Music_debug_verbosecxx . . $ Music_debug_verbose.;
2220 break;
2221
2222 case KEY_F8cxx . . $ `ddio/ddio_common.h:289:9`!:
2223 D3MusicSetRegioncxx . . $ D3MusicSetRegion(472b8ebd11b2ca81).((D3MusicGetRegioncxx . . $ D3MusicGetRegion(4c3706f7850cf040).() > 0) ? 0 : 1);
2224 break;
2225
2226 case KEY_F9cxx . . $ `ddio/ddio_common.h:290:9`!: {
2227 vectorcxx . . $ vector# vec = Player_objectcxx . . $ Player_object.->poscxx . . $ object#pos. +cxx . . $ operator+(b77b703cd1e43e33). (Player_objectcxx . . $ Player_object.->orientcxx . . $ object#orient..fveccxx . . $ matrix#fvec. *cxx . . $ `operator*`(252247219a31502c). 20);
2228 if (BSPRayOccludedcxx . . $ BSPRayOccluded(96b8ef6b7178d0f9).(&Player_objectcxx . . $ Player_object.->poscxx . . $ object#pos., &vec, MineBSPcxx . . $ MineBSP..rootcxx . . $ bsptree#root.))
2229 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Occluded!\n");
2230 else
2231 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "NOT occluded!\n");
2232 } break;
2233
2234 case KEY_F10cxx . . $ `ddio/ddio_common.h:291:9`!:
2235 int ObjInitTypeSpecificcxx . . $ ObjInitTypeSpecific(d27f719725f38807).(objectcxx . . $ object# * objp, bool reinitializing);
2236 FreeCockpitcxx . . $ FreeCockpit(49f6e7a06ebc5aa8).();
2237 CloseShipHUDcxx . . $ CloseShipHUD(49f6e7a06ebc5aa8).();
2238 Playerscxx . . $ Players.[0].ship_indexcxx . . $ player#ship_index. = GetNextShipcxx . . $ GetNextShip(7864480464b09eea).(Playerscxx . . $ Players.[0].ship_indexcxx . . $ player#ship_index.);
2239 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("Player ship set to %s\n", Shipscxx . . $ Ships.[Playerscxx . . $ Players.[0].ship_indexcxx . . $ player#ship_index.].namecxx . . $ ship#name.);
2240 ObjInitTypeSpecificcxx . . $ ObjInitTypeSpecific(d27f719725f38807).(Player_objectcxx . . $ Player_object., 0); // reset physics, model, etc.
2241 InitShipHUDcxx . . $ InitShipHUD(d4f767463ce0a6b3).(Playerscxx . . $ Players.[0].ship_indexcxx . . $ player#ship_index.);
2242 InitCockpitcxx . . $ InitCockpit(d4f767463ce0a6b3).(Playerscxx . . $ Players.[0].ship_indexcxx . . $ player#ship_index.);
2243 if (GetHUDModecxx . . $ GetHUDMode(d2d05048dda10524).() == HUD_COCKPITcxx . . $ HUD_COCKPIT.)
2244 SetHUDModecxx . . $ SetHUDMode(1efe68d6753032ab).(HUD_COCKPITcxx . . $ HUD_COCKPIT.);
2245 else if (GetHUDModecxx . . $ GetHUDMode(d2d05048dda10524).() == HUD_FULLSCREENcxx . . $ HUD_FULLSCREEN.)
2246 SetHUDModecxx . . $ SetHUDMode(1efe68d6753032ab).(HUD_FULLSCREENcxx . . $ HUD_FULLSCREEN.);
2247 break;
2248
2249 case KEY_F11cxx . . $ `ddio/ddio_common.h:292:9`!:
2250 /*
2251 if(Player_object->control_type != CT_SOAR)
2252 {
2253 AddHUDMessage("SOAR ON. Auto-pilot engaged.");
2254
2255 SetObjectControlType(Player_object, CT_SOAR);
2256 SoarCreateAgent(OBJNUM(Player_object), 0);
2257 }
2258 else
2259 {
2260 AddHUDMessage("SOAR OFF. Manual control returned.");
2261
2262 SoarDestroyAgent(OBJNUM(Player_object), 0);
2263 SetObjectControlType(Player_object, CT_FLYING);
2264 }
2265 break;
2266
2267 case KEY_F12:
2268 */
2269 {
2270 char test[MAX_MATCEN_NAME_LENcxx . . $ `Descent3/matcen.h:27:9`!];
2271 bool f_name_changed;
2272
2273 strcpy(test, "test");
2274
2275 int m_id = CreateMatcencxx . . $ CreateMatcen(d75b4a580f3cbb10).(test, &f_name_changed);
2276
2277 if (m_id >= 0) {
2278 int id = FindObjectIDNamecxx . . $ FindObjectIDName(5c4306d8553b3696).("Tubbs");
2279 int p = 100;
2280 float t = 5.0f;
2281 int m = 5;
2282
2283 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Matcen alive!\n");
2284
2285 vectorcxx . . $ vector# centerPt = Player_objectcxx . . $ Player_object.->poscxx . . $ object#pos. +cxx . . $ operator+(b77b703cd1e43e33). (Player_objectcxx . . $ Player_object.->orientcxx . . $ object#orient..fveccxx . . $ matrix#fvec. *cxx . . $ `operator*`(252247219a31502c). 2.0f);
2286 Matcencxx . . $ Matcen.[m_id]->SetAttachTypecxx . . $ matcen#SetAttachType(b5fd09639b7a0261).(MT_ROOMcxx . . $ `Descent3/matcen_external.h:66:9`!);
2287 Matcencxx . . $ Matcen.[m_id]->SetAttachcxx . . $ matcen#SetAttach(83c267b20bac841a).(Player_objectcxx . . $ Player_object.->roomnumcxx . . $ object#roomnum.);
2288 Matcencxx . . $ Matcen.[m_id]->SetCreateRoomcxx . . $ matcen#SetCreateRoom(83c267b20bac841a).(Player_objectcxx . . $ Player_object.->roomnumcxx . . $ object#roomnum.);
2289 Matcencxx . . $ Matcen.[m_id]->SetCreatePntcxx . . $ matcen#SetCreatePnt(4719af520dcffa60).(&centerPt);
2290 Matcencxx . . $ Matcen.[m_id]->SetControlTypecxx . . $ matcen#SetControlType(b5fd09639b7a0261).(MPC_WHILE_PLAYER_NEARcxx . . $ `Descent3/matcen_external.h:55:9`!);
2291
2292 Matcencxx . . $ Matcen.[m_id]->SetMaxProdcxx . . $ matcen#SetMaxProd(83c267b20bac841a).(12);
2293 Matcencxx . . $ Matcen.[m_id]->SetNumProdTypescxx . . $ matcen#SetNumProdTypes(b5fd09639b7a0261).(3);
2294 Matcencxx . . $ Matcen.[m_id]->SetMaxAliveChildrencxx . . $ matcen#SetMaxAliveChildren(83c267b20bac841a).(1);
2295 Matcencxx . . $ Matcen.[m_id]->SetProdInfocxx . . $ matcen#SetProdInfo(a55cc0d2b0f04aaa).(0, &id, &p, &t, &m);
2296 id = FindObjectIDNamecxx . . $ FindObjectIDName(5c4306d8553b3696).("Sixgun");
2297 Matcencxx . . $ Matcen.[m_id]->SetProdInfocxx . . $ matcen#SetProdInfo(a55cc0d2b0f04aaa).(1, &id, &p, &t, &m);
2298 id = FindObjectIDNamecxx . . $ FindObjectIDName(5c4306d8553b3696).("bladescaled");
2299 Matcencxx . . $ Matcen.[m_id]->SetProdInfocxx . . $ matcen#SetProdInfo(a55cc0d2b0f04aaa).(2, &id, &p, &t, &m);
2300
2301 Matcencxx . . $ Matcen.[m_id]->SetStatuscxx . . $ matcen#SetStatus(9609253e83e89946).(MSTAT_ACTIVEcxx . . $ `Descent3/matcen_external.h:28:9`! | MSTAT_RANDOM_PROD_ORDERcxx . . $ `Descent3/matcen_external.h:33:9`!, true);
2302 } else {
2303 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Nope!\n");
2304 }
2305 }
2306 break;
2307
2308 /*
2309 **************************************************
2310 Other Keys
2311 **************************************************
2312 */
2313 case KEY_TABcxx . . $ `ddio/ddio_common.h:270:9`!:
2314 Game_interface_modecxx . . $ Game_interface_mode. = GAME_DEBUGGRAPH_INTERFACEcxx . . $ `Descent3/gamesequence.h:145:9`!;
2315 break;
2316
2317 case KEY_COMMAcxx . . $ `ddio/ddio_common.h:260:9`!:
2318 rtp_StartLogcxx . . $ rtp_StartLog(49f6e7a06ebc5aa8).();
2319 break;
2320
2321 case KEY_PERIODcxx . . $ `ddio/ddio_common.h:261:9`!:
2322 rtp_StopLogcxx . . $ rtp_StopLog(49f6e7a06ebc5aa8).();
2323 break;
2324
2325 case KEY_LAPOSTROcxx . . $ `ddio/ddio_common.h:266:9`!:
2326 Show_osiris_debugcxx . . $ Show_osiris_debug. = !Show_osiris_debugcxx . . $ Show_osiris_debug.;
2327 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("%s osiris debug messages", (Show_osiris_debugcxx . . $ Show_osiris_debug.) ? "Enabling" : "Disabling");
2328 break;
2329
2330 case KEY_BACKSLASHcxx . . $ `ddio/ddio_common.h:258:9`!:
2331 // attempt to restore video
2332 if (DebugBreak_callback_stopcxx . . $ DebugBreak_callback_stop.)
2333 (*DebugBreak_callback_stopcxx . . $ DebugBreak_callback_stop.)();
2334 if (DebugBreak_callback_resumecxx . . $ DebugBreak_callback_resume.)
2335 (*DebugBreak_callback_resumecxx . . $ DebugBreak_callback_resume.)();
2336 break;
2337
2338 case KEY_SPACEBARcxx . . $ `ddio/ddio_common.h:271:9`!:
2339 if (Player_objectcxx . . $ Player_object.->control_typecxx . . $ object#control_type. == CT_FLYINGcxx . . $ `Descent3/object_external.h:219:9`!) {
2340 SetObjectControlTypecxx . . $ SetObjectControlType(766a1b7183ffa4b4).(Player_objectcxx . . $ Player_object., CT_SLEWcxx . . $ `Descent3/object_external.h:220:9`!);
2341 Player_objectcxx . . $ Player_object.->movement_typecxx . . $ object#movement_type. = MT_NONEcxx . . $ `Descent3/object_external.h:233:9`!;
2342 SlewStopcxx . . $ SlewStop(2da2a862cad4c994).(Player_objectcxx . . $ Player_object.);
2343 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("Slew on");
2344 } else {
2345 SlewStopcxx . . $ SlewStop(2da2a862cad4c994).(Player_objectcxx . . $ Player_object.);
2346 SetObjectControlTypecxx . . $ SetObjectControlType(766a1b7183ffa4b4).(Player_objectcxx . . $ Player_object., CT_FLYINGcxx . . $ `Descent3/object_external.h:219:9`!);
2347 Player_objectcxx . . $ Player_object.->movement_typecxx . . $ object#movement_type. = MT_PHYSICScxx . . $ `Descent3/object_external.h:234:9`!;
2348 AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("Physics on");
2349 }
2350 break;
2351
2352 case KEY_BACKSPcxx . . $ `ddio/ddio_common.h:269:9`!: {
2353 if (!ROOMNUM_OUTSIDEcxx . . $ `lib/object_external_struct.h:127:9`!(Player_object->roomnum)) {
2354 int i;
2355
2356 Game_show_portal_vis_pntscxx . . $ Game_show_portal_vis_pnts. = 1 - Game_show_portal_vis_pntscxx . . $ Game_show_portal_vis_pnts.;
2357
2358 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Vis info for room %d\n", Player_object->roomnum);
2359
2360 for (i = 0; i <= Highest_room_indexcxx . . $ Highest_room_index.; i++) {
2361 if (BOA_IsVisiblecxx . . $ BOA_IsVisible(cf9ef193275fa6d8).(i, Player_objectcxx . . $ Player_object.->roomnumcxx . . $ object#roomnum.)) {
2362 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "%d can see you in %d\n", i, Player_object->roomnum);
2363 }
2364 }
2365
2366 for (i = Highest_room_indexcxx . . $ Highest_room_index. + 1; i <= Highest_room_indexcxx . . $ Highest_room_index. + 8; i++) {
2367 if (BOA_IsVisiblecxx . . $ BOA_IsVisible(cf9ef193275fa6d8).(i, Player_objectcxx . . $ Player_object.->roomnumcxx . . $ object#roomnum.)) {
2368 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Terrain %d can see you in %d\n", i - Highest_room_index - 1, Player_object->roomnum);
2369 }
2370 }
2371 }
2372 } break;
2373 }
2374 }
2375 #endif
2376
2377 // Sends this key to the multiplayer game DLL
2378 // Return: true means to handle the key normally
2379 // false means to do no further processing on this key
2380 bool SendKeyToGameDLLcxx . . $ SendKeyToGameDLL(83c267b20bac841a).(int key) {
2381 DLLInfocxx . . $ DLLInfo..input_keycxx . . $ dllinfo#input_key. = key;
2382
2383 DLLInfocxx . . $ DLLInfo..iRetcxx . . $ dllinfo#$anonymous_type_0#iRet. = 0;
2384 CallGameDLLcxx . . $ CallGameDLL(32ca0c0c7dbc2fcf).(EVT_CLIENT_KEYPRESScxx . . $ `lib/d3events.h:105:9`!, &DLLInfocxx . . $ DLLInfo.);
2385
2386 if (DLLInfocxx . . $ DLLInfo..iRetcxx . . $ dllinfo#$anonymous_type_0#iRet. != 0) {
2387
2388 ddio_KeyFlushcxx . . $ ddio_KeyFlush(49f6e7a06ebc5aa8).(); // keep the controls stuff from getting any keys
2389 return 0; // Don't process this key
2390 }
2391
2392 // Handle key normally
2393 return 1;
2394 }
2395
2396 void DemoCheatscxx . . $ DemoCheats(d4f767463ce0a6b3).(int key);
2397 // Get and handle all pending keys
2398 void ProcessKeyscxx . . $ ProcessKeys(49f6e7a06ebc5aa8).() {
2399 int key;
2400
2401 if (Dedicated_servercxx . . $ Dedicated_server.)
2402 return; // No key processing for dedicated server!
2403
2404 // if we are in some menu then don't process game keys!
2405 if (Game_interface_modecxx . . $ Game_interface_mode. != GAME_INTERFACEcxx . . $ `Descent3/gamesequence.h:129:9`! || Menu_interface_modecxx . . $ Menu_interface_mode.)
2406 return;
2407
2408 // Process all pending keys
2409 while ((key = ddio_KeyInKeycxx . . $ ddio_KeyInKey(b126dc7c1de90089).()) != 0) {
2410
2411 // Where does this belong?
2412 // do d3x debugging console
2413 // D3XDebugIO(key);
2414
2415 // If inputting a multiplayer message, send keys there
2416 if (Doing_input_messagecxx . . $ Doing_input_message.) {
2417 DoHUDInputMessageKeycxx . . $ DoHUDInputMessageKey(d4f767463ce0a6b3).(key);
2418 continue;
2419 }
2420
2421 // If multiplayer, send the key to the game DLL
2422 if (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!) {
2423 if (!SendKeyToGameDLLcxx . . $ SendKeyToGameDLL(83c267b20bac841a).(key)) // returns true if should keep processing this key
2424 continue; // the DLL says not process this key
2425 }
2426
2427 // Handle normal key
2428 ProcessNormalKeycxx . . $ ProcessNormalKey(d4f767463ce0a6b3).(key);
2429
2430 // Handle debugging & test keys
2431 #ifdef _DEBUGcxx . . $ `<built-in>:482:9`!
2432 ProcessTestKeyscxx . . $ ProcessTestKeys(d4f767463ce0a6b3).(key);
2433 #endif
2434
2435 // #ifdef DEMO
2436 DemoCheatscxx . . $ DemoCheats(d4f767463ce0a6b3).(key);
2437 // #endif
2438 }
2439 }
2440
2441 // Render the world into a game window
2442 // Parameters: viewer - if not null, this object disabled from rendering. Not used otherwise.
2443 // viewer_eye - where we're rendering from
2444 // viewer_roomnum - the roomnum viewer_eye is in
2445 // viewer_orient - the oriention for this view
2446 // zoom - the zoom for this view
2447 // rear_view - if true, we're looking out the rear of this object
2448
2449 #ifdef _DEBUGcxx . . $ `<built-in>:482:9`!
2450 extern void DrawRoomVisPntscxx . . $ DrawRoomVisPnts(419c470199a90a97).(objectcxx . . $ object# *obj);
2451 #endif
2452
2453 void GameRenderWorldcxx . . $ GameRenderWorld(68d409d91ffdd12f).(objectcxx . . $ object# *viewer, vectorcxx . . $ vector# *viewer_eye, int viewer_roomnum, matrixcxx . . $ matrix# *viewer_orient, float zoom,
2454 bool rear_view) {
2455 matrixcxx . . $ matrix# temp_orient, save_orient;
2456
2457 // Get the viewer orientation
2458 if (rear_view) {
2459 temp_orient.fveccxx . . $ matrix#fvec. =cxx . . $ vector#`operator=`(c0842353a20857d). -cxx . . $ operator-(9e07539e219c6f20).viewer_orient->fveccxx . . $ matrix#fvec.;
2460 temp_orient.rveccxx . . $ matrix#rvec. =cxx . . $ vector#`operator=`(c0842353a20857d). -cxx . . $ operator-(9e07539e219c6f20).viewer_orient->rveccxx . . $ matrix#rvec.;
2461 temp_orient.uveccxx . . $ matrix#uvec. =cxx . . $ vector#`operator=`(a48bc7e93a8dae5e). viewer_orient->uveccxx . . $ matrix#uvec.;
2462 viewer_orient = &temp_orient;
2463 save_orient =cxx . . $ matrix#`operator=`(4c6f8b29806742). viewer->orientcxx . . $ object#orient.;
2464 viewer->orientcxx . . $ object#orient. =cxx . . $ matrix#`operator=`(4c6f8b29806742). temp_orient;
2465 }
2466
2467 // Start the 3D
2468 g3_StartFramecxx . . $ g3_StartFrame(e35d136ceab5c8a2).(viewer_eye, viewer_orient, zoom);
2469
2470 // Reset fog,zbuffer
2471 Num_fogged_rooms_this_framecxx . . $ Num_fogged_rooms_this_frame. = 0;
2472 rend_SetZBufferStatecxx . . $ rend_SetZBufferState(4af4fd0e2b26c4ac).(1);
2473 rend_SetZBufferWriteMaskcxx . . $ rend_SetZBufferWriteMask(d4f767463ce0a6b3).(1);
2474
2475 // Reset our postrenderings
2476 ResetPostrenderListcxx . . $ ResetPostrenderList(49f6e7a06ebc5aa8).();
2477
2478 // Render!
2479 if (ROOMNUM_OUTSIDEcxx . . $ `lib/object_external_struct.h:127:9`!(viewer_roomnum))
2480 RenderTerraincxx . . $ RenderTerrain(29744a30b22ab106).(0);
2481 else {
2482 bool flag_automap = (viewer != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) ? (viewer->typecxx . . $ object#type. != OBJ_ROBOTcxx . . $ `Descent3/object_external.h:162:9`!) : 0;
2483 RenderMinecxx . . $ RenderMine(b1146eedae1e1d0b).(viewer_roomnum, flag_automap, 0);
2484
2485 #ifdef _DEBUGcxx . . $ `<built-in>:482:9`!
2486 if (Game_show_portal_vis_pntscxx . . $ Game_show_portal_vis_pnts.) {
2487 DrawRoomVisPntscxx . . $ DrawRoomVisPnts(419c470199a90a97).(Player_objectcxx . . $ Player_object.);
2488 }
2489 #endif
2490 }
2491
2492 // Done with 3D
2493 PostRendercxx . . $ PostRender(d4f767463ce0a6b3).(viewer_roomnum);
2494 g3_EndFramecxx . . $ g3_EndFrame(49f6e7a06ebc5aa8).();
2495
2496 // Restore viewer orientation
2497 if (rear_view)
2498 viewer->orientcxx . . $ object#orient. =cxx . . $ matrix#`operator=`(4c6f8b29806742). save_orient;
2499 }
2500
2501 // Render into the big window
2502 void GameDrawMainViewcxx . . $ GameDrawMainView(49f6e7a06ebc5aa8).() {
2503 extern bool Guided_missile_smallviewcxx . . $ Guided_missile_smallview.; // smallviews.cpp
2504
2505 bool rear_view = 0;
2506 objectcxx . . $ object# *save_view;
2507
2508 // Start rendering
2509 StartFramecxx . . $ StartFrame(b45ddcbc8423892c).(false);
2510
2511 // Set guided view
2512 if (!Cinematic_inusecxx . . $ Cinematic_inuse. && Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].guided_objcxx . . $ player#guided_obj. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! && !Guided_missile_smallviewcxx . . $ Guided_missile_smallview.) {
2513 save_view = Viewer_objectcxx . . $ Viewer_object.;
2514 Viewer_objectcxx . . $ Viewer_object. = Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].guided_objcxx . . $ player#guided_obj.;
2515
2516 } else if ((Viewer_objectcxx . . $ Viewer_object. == Player_objectcxx . . $ Player_object.) && (Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].flagscxx . . $ player#flags. & PLAYER_FLAGS_REARVIEWcxx . . $ `Descent3/player_external.h:97:9`!))
2517 rear_view = 1;
2518
2519 // Draw the world
2520 Rendering_main_viewcxx . . $ Rendering_main_view. = true;
2521 GameRenderWorldcxx . . $ GameRenderWorld(68d409d91ffdd12f).(Viewer_objectcxx . . $ Viewer_object., &Viewer_objectcxx . . $ Viewer_object.->poscxx . . $ object#pos., Viewer_objectcxx . . $ Viewer_object.->roomnumcxx . . $ object#roomnum., &Viewer_objectcxx . . $ Viewer_object.->orientcxx . . $ object#orient., Render_zoomcxx . . $ Render_zoom.,
2522 rear_view);
2523 Rendering_main_viewcxx . . $ Rendering_main_view. = false;
2524
2525 // Restore viewer object if guided
2526 if (!Cinematic_inusecxx . . $ Cinematic_inuse. && Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].guided_objcxx . . $ player#guided_obj. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`! && !Guided_missile_smallviewcxx . . $ Guided_missile_smallview.)
2527 Viewer_objectcxx . . $ Viewer_object. = save_view;
2528
2529 // Room changes
2530 DoRoomChangeFramecxx . . $ DoRoomChangeFrame(49f6e7a06ebc5aa8).();
2531
2532 // Draw Matcen Effects
2533 DoMatcensRenderFramecxx . . $ DoMatcensRenderFrame(49f6e7a06ebc5aa8).();
2534
2535 // Draw any render events
2536 ProcessRenderEventscxx . . $ ProcessRenderEvents(49f6e7a06ebc5aa8).();
2537
2538 // We're done with this window
2539 EndFramecxx . . $ EndFrame(49f6e7a06ebc5aa8).();
2540 }
2541
2542 // Added by Samir
2543 #define HUD_RENDER_ZOOMcxx . . $ `Descent3/GameLoop.cpp:2543:9`! 0.56f
2544
2545 // Do Cockpit/Hud
2546 void GameDrawHudcxx . . $ GameDrawHud(49f6e7a06ebc5aa8).() {
2547 // Start frame and 3d frame
2548 StartFramecxx . . $ StartFrame(b45ddcbc8423892c).(false);
2549 g3_StartFramecxx . . $ g3_StartFrame(e35d136ceab5c8a2).(&Viewer_objectcxx . . $ Viewer_object.->poscxx . . $ object#pos., &Viewer_objectcxx . . $ Viewer_object.->orientcxx . . $ object#orient., HUD_RENDER_ZOOMcxx . . $ `Descent3/GameLoop.cpp:2543:9`!);
2550
2551 // render HUD
2552 RenderHUDFramecxx . . $ RenderHUDFrame(49f6e7a06ebc5aa8).();
2553
2554 // End frame
2555 g3_EndFramecxx . . $ g3_EndFrame(49f6e7a06ebc5aa8).();
2556 EndFramecxx . . $ EndFrame(49f6e7a06ebc5aa8).();
2557
2558 // render auxillary consoles
2559 StartFramecxx . . $ StartFrame(3285c9bef785d51c).(0, 0, Max_window_wcxx . . $ Max_window_w., Max_window_hcxx . . $ Max_window_h., false);
2560 g3_StartFramecxx . . $ g3_StartFrame(e35d136ceab5c8a2).(&Viewer_objectcxx . . $ Viewer_object.->poscxx . . $ object#pos., &Viewer_objectcxx . . $ Viewer_object.->orientcxx . . $ object#orient., HUD_RENDER_ZOOMcxx . . $ `Descent3/GameLoop.cpp:2543:9`!);
2561
2562 RenderAuxHUDFramecxx . . $ RenderAuxHUDFrame(49f6e7a06ebc5aa8).();
2563
2564 // End frame
2565 g3_EndFramecxx . . $ g3_EndFrame(49f6e7a06ebc5aa8).();
2566 EndFramecxx . . $ EndFrame(49f6e7a06ebc5aa8).();
2567 }
2568
2569 // Draw a frame of the game
2570 void GameRenderFramecxx . . $ GameRenderFrame(49f6e7a06ebc5aa8).(void) {
2571 bool no_render = false;
2572 AI_NumRenderedcxx . . $ AI_NumRendered. = 0;
2573 AI_NumHostileAlertcxx . . $ AI_NumHostileAlert. = 0;
2574
2575 if (Dedicated_servercxx . . $ Dedicated_server.)
2576 return;
2577
2578 #ifndef RELEASE
2579 Mine_depthcxx . . $ Mine_depth. = 0;
2580 #endif
2581
2582 // increase our timing for the powerup sparkles, used globally by all
2583 Last_powerup_sparkle_timecxx . . $ Last_powerup_sparkle_time. += Frametimecxx . . $ Frametime.;
2584
2585 PreUpdateAllLightGlowscxx . . $ PreUpdateAllLightGlows(49f6e7a06ebc5aa8).();
2586
2587 // Don't render if receiving data
2588 if ((Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!) && NetPlayerscxx . . $ NetPlayers.[Player_numcxx . . $ Player_num.].sequencecxx . . $ netplayer#sequence. != NETSEQ_PLAYINGcxx . . $ `Descent3/multi_external.h:161:9`!) {
2589 no_render = true;
2590 ShowProgressScreencxx . . $ ShowProgressScreen(8d00172ec7558ddf).(TXT_RECEIVINGDATAcxx . . $ `Descent3/stringtable.h:127:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, 0);
2591 }
2592
2593 // Generate "shaken" view for player
2594 if (!Game_pausedcxx . . $ Game_paused.)
2595 ShakePlayercxx . . $ ShakePlayer(49f6e7a06ebc5aa8).();
2596
2597 rend_SetZBufferStatecxx . . $ rend_SetZBufferState(4af4fd0e2b26c4ac).(1);
2598 rend_SetZBufferWriteMaskcxx . . $ rend_SetZBufferWriteMask(d4f767463ce0a6b3).(1);
2599
2600 // clear screen if needed
2601 if (Clear_screencxx . . $ Clear_screen.) {
2602 StartFramecxx . . $ StartFrame(3285c9bef785d51c).(0, 0, Max_window_wcxx . . $ Max_window_w., Max_window_hcxx . . $ Max_window_h., false);
2603 rend_ClearScreencxx . . $ rend_ClearScreen(cb2f890c2fdad230).(GR_BLACKcxx . . $ GR_BLACK.);
2604 EndFramecxx . . $ EndFrame(49f6e7a06ebc5aa8).();
2605 Clear_screencxx . . $ Clear_screen.--;
2606 }
2607
2608 // Render the mine
2609 if (!no_render) {
2610 // render preliminary hud view (for dirty rectangles)
2611 if (Small_hud_flagcxx . . $ Small_hud_flag.) { // small hud flag is set in RenderHUDFrame in GameDrawHud.
2612 StartFramecxx . . $ StartFrame(3285c9bef785d51c).(0, 0, Max_window_wcxx . . $ Max_window_w., Max_window_hcxx . . $ Max_window_h., false);
2613 RenderPreHUDFramecxx . . $ RenderPreHUDFrame(49f6e7a06ebc5aa8).();
2614 EndFramecxx . . $ EndFrame(49f6e7a06ebc5aa8).();
2615 }
2616
2617 // Draw the big 3d view
2618 GameDrawMainViewcxx . . $ GameDrawMainView(49f6e7a06ebc5aa8).();
2619
2620 // Do the small views. These should be before GameDrawHUD() for the small windows
2621 DrawSmallViewscxx . . $ DrawSmallViews(49f6e7a06ebc5aa8).();
2622
2623 // Do Cockpit/Hud
2624 if (!HUD_disabledcxx . . $ HUD_disabled.)
2625 GameDrawHudcxx . . $ GameDrawHud(49f6e7a06ebc5aa8).();
2626
2627 // Render Ingame Cinematics
2628 Cinematic_RenderFramecxx . . $ Cinematic_RenderFrame(49f6e7a06ebc5aa8).();
2629
2630 // Process the debug visual graph
2631 DebugGraph_Rendercxx . . $ DebugGraph_Render(49f6e7a06ebc5aa8).();
2632
2633 if (Display_renderer_statscxx . . $ Display_renderer_stats.) {
2634 // display some rendering stats
2635 tRendererStatscxx . . $ tRendererStats# stats;
2636 rend_GetStatisticscxx . . $ rend_GetStatistics(65752c52ae58fada).(&stats);
2637 grtext_SetFontcxx . . $ grtext_SetFont(d4f767463ce0a6b3).(HUD_FONTcxx . . $ `Descent3/gamefont.h:105:9`!);
2638
2639 char buffer[128];
2640 int x, y, height;
2641
2642 x = 15;
2643 y = 240;
2644 StartFramecxx . . $ StartFrame(3285c9bef785d51c).(0, 0, Game_window_wcxx . . $ Game_window_w., Game_window_hcxx . . $ Game_window_h.);
2645 rend_StartFramecxx . . $ rend_StartFrame(1559a299834bcdd5).(0, 0, Game_window_wcxx . . $ Game_window_w., Game_window_hcxx . . $ Game_window_h., 0);
2646 height = grfont_GetHeightcxx . . $ grfont_GetHeight(7864480464b09eea).(HUD_FONTcxx . . $ `Descent3/gamefont.h:105:9`!) + 1;
2647 snprintf(buffer, sizeof(buffer), "Polys=%d", stats.poly_countcxx . . $ tRendererStats#poly_count.);
2648 RenderHUDTextcxx . . $ RenderHUDText(e69f8330415a42f1).(GR_RGBcxx . . $ GR_RGB(530956271a9518a5).(255, 40, 40), 255, 1, x, y, buffer);
2649 y += height;
2650 snprintf(buffer, sizeof(buffer), "Verts=%d", stats.vert_countcxx . . $ tRendererStats#vert_count.);
2651 RenderHUDTextcxx . . $ RenderHUDText(e69f8330415a42f1).(GR_RGBcxx . . $ GR_RGB(530956271a9518a5).(255, 40, 40), 255, 1, x, y, buffer);
2652 y += height;
2653 snprintf(buffer, sizeof(buffer), "Uploads=%d", stats.texture_uploadscxx . . $ tRendererStats#texture_uploads.);
2654 RenderHUDTextcxx . . $ RenderHUDText(e69f8330415a42f1).(GR_RGBcxx . . $ GR_RGB(530956271a9518a5).(255, 40, 40), 255, 1, x, y, buffer);
2655 y += height;
2656 grtext_Flushcxx . . $ grtext_Flush(49f6e7a06ebc5aa8).();
2657 EndFramecxx . . $ EndFrame(49f6e7a06ebc5aa8).();
2658 }
2659 }
2660
2661 // Do UI Frame
2662 if (Game_interface_modecxx . . $ Game_interface_mode. == GAME_INTERFACEcxx . . $ `Descent3/gamesequence.h:129:9`! && !Menu_interface_modecxx . . $ Menu_interface_mode.) {
2663 DoUIFrameWithoutInputcxx . . $ DoUIFrameWithoutInput(49f6e7a06ebc5aa8).();
2664 rend_Flipcxx . . $ rend_Flip(49f6e7a06ebc5aa8).();
2665 }
2666
2667 // Restore normal view
2668 if (!Game_pausedcxx . . $ Game_paused.)
2669 UnshakePlayercxx . . $ UnshakePlayer(49f6e7a06ebc5aa8).();
2670
2671 // Done with the dynamic lights
2672 ClearDynamicLightmapscxx . . $ ClearDynamicLightmaps(49f6e7a06ebc5aa8).();
2673
2674 // Increment frame count
2675 FrameCountcxx . . $ FrameCount.++;
2676 frames_one_secondcxx . . $ frames_one_second.++;
2677
2678 // Update our glows
2679 PostUpdateAllLightGlowscxx . . $ PostUpdateAllLightGlows(49f6e7a06ebc5aa8).();
2680
2681 // Reset our powerup sparkle time if it has overflowed
2682 while (Last_powerup_sparkle_timecxx . . $ Last_powerup_sparkle_time. >= POWERUP_SPARKLE_INTERVALcxx . . $ `Descent3/renderobject.h:57:9`!) {
2683 Last_powerup_sparkle_timecxx . . $ Last_powerup_sparkle_time. -= POWERUP_SPARKLE_INTERVALcxx . . $ `Descent3/renderobject.h:57:9`!;
2684 }
2685 }
2686
2687 void GameProcessMusiccxx . . $ GameProcessMusic(49f6e7a06ebc5aa8).() {
2688 // the last game state in the sequencer.
2689 extern tGameStatecxx . . $ tGameState# Last_game_statecxx . . $ Last_game_state.;
2690
2691 if (Last_game_statecxx . . $ Last_game_state. == GAMESTATE_LVLSTARTcxx . . $ GAMESTATE_LVLSTART.) {
2692 Game_music_infocxx . . $ Game_music_info..started_levelcxx . . $ tMusicSeqInfo#started_level. = true;
2693 } else {
2694 Game_music_infocxx . . $ Game_music_info..started_levelcxx . . $ tMusicSeqInfo#started_level. = false;
2695 }
2696
2697 // player_damaged set in damage.cpp DecreasePlayerShields.
2698
2699 if ((Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].flagscxx . . $ player#flags. & PLAYER_FLAGS_DYINGcxx . . $ `Descent3/player_external.h:80:9`!) || (Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].flagscxx . . $ player#flags. & PLAYER_FLAGS_DEADcxx . . $ `Descent3/player_external.h:81:9`!)) {
2700 Game_music_infocxx . . $ Game_music_info..player_deadcxx . . $ tMusicSeqInfo#player_dead. = true;
2701 } else {
2702 Game_music_infocxx . . $ Game_music_info..player_deadcxx . . $ tMusicSeqInfo#player_dead. = false;
2703 }
2704
2705 Game_music_infocxx . . $ Game_music_info..n_hostilescxx . . $ tMusicSeqInfo#n_hostiles. = AI_NumHostileAlertcxx . . $ AI_NumHostileAlert.;
2706 Game_music_infocxx . . $ Game_music_info..frametimecxx . . $ tMusicSeqInfo#frametime. = Frametimecxx . . $ Frametime.;
2707
2708 D3MusicDoFramecxx . . $ D3MusicDoFrame(54ecf43cdccad508).(&Game_music_infocxx . . $ Game_music_info.);
2709 }
2710
2711 // variables for Frametime system
2712
2713 // timer_GetMSTime()
2714 // float last_timer=0.0;
2715 int timer_pausedcxx . . $ timer_paused. = 0;
2716
2717 // Stop the Frametime clock
2718 void StopTimecxx . . $ StopTime(49f6e7a06ebc5aa8).() {
2719 if (!timer_pausedcxx . . $ timer_paused.) {
2720 last_timercxx . . $ last_timer. = timer_GetMSTimecxx . . $ `ddio/ddio.h:237:9`!() - last_timercxx . . $ last_timer.;
2721 if (last_timercxx . . $ last_timer. < 0) {
2722 // Int3();
2723 last_timercxx . . $ last_timer. = 0;
2724 }
2725 }
2726
2727 timer_pausedcxx . . $ timer_paused.++;
2728 }
2729
2730 // Restart the Frametime clock
2731 void StartTimecxx . . $ StartTime(49f6e7a06ebc5aa8).() {
2732 if (timer_pausedcxx . . $ timer_paused. == 0)
2733 return;
2734
2735 timer_pausedcxx . . $ timer_paused.--;
2736
2737 ASSERTcxx . . $ `misc/pserror.h:246:9`!(timer_paused >= 0);
2738
2739 if (!timer_pausedcxx . . $ timer_paused.)
2740 last_timercxx . . $ last_timer. = timer_GetMSTimecxx . . $ `ddio/ddio.h:237:9`!() - last_timercxx . . $ last_timer.;
2741 }
2742
2743 float Min_frametimecxx . . $ Min_frametime. = 500;
2744 float Max_frametimecxx . . $ Max_frametime. = 0;
2745 float Avg_frametimecxx . . $ Avg_frametime. = 0;
2746 uint32_tcxx . . $ uint32_t# Frames_countedcxx . . $ Frames_counted. = 0;
2747
2748 // Compute how long last frame took
2749 void CalcFrameTimecxx . . $ CalcFrameTime(49f6e7a06ebc5aa8).(void) {
2750 int64_t current_timer;
2751
2752 if (timer_pausedcxx . . $ timer_paused.)
2753 return;
2754
2755 current_timer = timer_GetMSTimecxx . . $ `ddio/ddio.h:237:9`!();
2756 if (current_timer >= last_timercxx . . $ last_timer.) {
2757 Frametimecxx . . $ Frametime. = static_cast<float>(current_timer - last_timercxx . . $ last_timer.) / 1000.0f;
2758 } else {
2759 Frametimecxx . . $ Frametime. = 0.0f;
2760 }
2761
2762 last_timercxx . . $ last_timer. = current_timer;
2763
2764 if (Min_frametimecxx . . $ Min_frametime. > Frametimecxx . . $ Frametime.) {
2765 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "This was the fastest frame yet!\n");
2766 Min_frametimecxx . . $ Min_frametime. = Frametimecxx . . $ Frametime. - Demo_frame_ofscxx . . $ Demo_frame_ofs.;
2767 } else if (Max_frametimecxx . . $ Max_frametime. < Frametimecxx . . $ Frametime.) {
2768 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "This was the slowest frame yet!\n");
2769 Max_frametimecxx . . $ Max_frametime. = Frametimecxx . . $ Frametime. - Demo_frame_ofscxx . . $ Demo_frame_ofs.;
2770 }
2771 Frames_countedcxx . . $ Frames_counted.++;
2772 Avg_frametimecxx . . $ Avg_frametime. += (Frametimecxx . . $ Frametime. - Demo_frame_ofscxx . . $ Demo_frame_ofs.);
2773 }
2774
2775 // called before first call to StopTime, StartTime or CalcFrameTime
2776 void InitFrameTimecxx . . $ InitFrameTime(49f6e7a06ebc5aa8).(void) {
2777
2778 if (timer_pausedcxx . . $ timer_paused.) {
2779 mprintfcxx . . $ `ddebug/mono.h:82:9`!(1, "Timer paused in InitFrameTime()\n");
2780 }
2781 last_timercxx . . $ last_timer. = timer_GetMSTimecxx . . $ `ddio/ddio.h:237:9`!();
2782 timer_pausedcxx . . $ timer_paused. = 0;
2783 }
2784
2785 // Pauses game
2786 void PauseGamecxx . . $ PauseGame(49f6e7a06ebc5aa8).() {
2787 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Game paused.\n");
2788 Game_pausedcxx . . $ Game_paused. = true;
2789
2790 D3MusicPausecxx . . $ D3MusicPause(49f6e7a06ebc5aa8).();
2791 Sound_systemcxx . . $ Sound_system..PauseSoundscxx . . $ hlsSystem#PauseSounds(b45ddcbc8423892c).();
2792 StopTimecxx . . $ StopTime(49f6e7a06ebc5aa8).();
2793 }
2794
2795 // resumes game operation.
2796 void ResumeGamecxx . . $ ResumeGame(49f6e7a06ebc5aa8).() {
2797 StartTimecxx . . $ StartTime(49f6e7a06ebc5aa8).();
2798 Game_pausedcxx . . $ Game_paused. = false;
2799 Sound_systemcxx . . $ Sound_system..ResumeSoundscxx . . $ hlsSystem#ResumeSounds(49f6e7a06ebc5aa8).();
2800 D3MusicResumecxx . . $ D3MusicResume(49f6e7a06ebc5aa8).();
2801 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Game resumed.\n");
2802 }
2803
2804 // Data for terrain sound
2805 terrain_sound_bandcxx . . $ terrain_sound_band# Terrain_sound_bandscxx . . $ Terrain_sound_bands.[NUM_TERRAIN_SOUND_BANDScxx . . $ `Descent3/game.h:317:9`!];
2806 int Terrain_sound_handlescxx . . $ Terrain_sound_handles.[NUM_TERRAIN_SOUND_BANDScxx . . $ `Descent3/game.h:317:9`!];
2807 float Terrain_sound_fadecxx . . $ Terrain_sound_fade.; // used for transitions between inside & outside
2808
2809 #define FADE_TIMEcxx . . $ `Descent3/GameLoop.cpp:2809:9`! 1.0
2810
2811 // Update the sound on the terrain
2812 void UpdateTerrainSoundcxx . . $ UpdateTerrainSound(49f6e7a06ebc5aa8).() {
2813 // Update fade in/out (for inside/outside transitions)
2814 if (OBJECT_OUTSIDEcxx . . $ `lib/object_external_struct.h:130:9`!(Player_object)) {
2815 if (Terrain_sound_fadecxx . . $ Terrain_sound_fade. < 1.0) { // fading in
2816 Terrain_sound_fadecxx . . $ Terrain_sound_fade. += Frametimecxx . . $ Frametime. / FADE_TIMEcxx . . $ `Descent3/GameLoop.cpp:2809:9`!;
2817 if (Terrain_sound_fadecxx . . $ Terrain_sound_fade. > 1.0)
2818 Terrain_sound_fadecxx . . $ Terrain_sound_fade. = 1.0;
2819 }
2820 } else {
2821 if (Terrain_sound_fadecxx . . $ Terrain_sound_fade. > 0.0) { // fading out
2822 Terrain_sound_fadecxx . . $ Terrain_sound_fade. -= Frametimecxx . . $ Frametime. / FADE_TIMEcxx . . $ `Descent3/GameLoop.cpp:2809:9`!;
2823 if (Terrain_sound_fadecxx . . $ Terrain_sound_fade. < 0.0)
2824 Terrain_sound_fadecxx . . $ Terrain_sound_fade. = 0.0;
2825 } else
2826 return; // already faded out
2827 }
2828
2829 // Get player altitude
2830 int alt = Player_objectcxx . . $ Player_object.->poscxx . . $ object#pos..ycxx . . $ vector#y. / TERRAIN_HEIGHT_INCREMENTcxx . . $ `Descent3/terrain.h:47:9`!;
2831 if (alt > 255) {
2832 alt = 255;
2833 }
2834
2835 // Update each sound
2836 for (int b = 0; b < NUM_TERRAIN_SOUND_BANDScxx . . $ `Descent3/game.h:317:9`!; b++) {
2837 terrain_sound_bandcxx . . $ terrain_sound_band# *tb = &Terrain_sound_bandscxx . . $ Terrain_sound_bands.[b];
2838 if (tb->sound_indexcxx . . $ terrain_sound_band#sound_index. != -1) {
2839 float volume;
2840
2841 if ((alt < tb->low_altcxx . . $ terrain_sound_band#low_alt.) || (alt > tb->high_altcxx . . $ terrain_sound_band#high_alt.))
2842 volume = 0.0;
2843 else
2844 volume =
2845 tb->low_volumecxx . . $ terrain_sound_band#low_volume. + ((tb->high_volumecxx . . $ terrain_sound_band#high_volume. - tb->low_volumecxx . . $ terrain_sound_band#low_volume.) * (alt - tb->low_altcxx . . $ terrain_sound_band#low_alt.) / (tb->high_altcxx . . $ terrain_sound_band#high_alt. - tb->low_altcxx . . $ terrain_sound_band#low_alt.));
2846
2847 Sound_systemcxx . . $ Sound_system..Update2dSoundcxx . . $ hlsSystem#Update2dSound(29af73b9646cef78).(Terrain_sound_handlescxx . . $ Terrain_sound_handles.[b], volume * Terrain_sound_fadecxx . . $ Terrain_sound_fade., 0.0);
2848 }
2849 }
2850 }
2851
2852 // Clear out all the terrain sound bands
2853 void ClearTerrainSoundcxx . . $ ClearTerrainSound(49f6e7a06ebc5aa8).() {
2854 for (int b = 0; b < NUM_TERRAIN_SOUND_BANDScxx . . $ `Descent3/game.h:317:9`!; b++) {
2855 Terrain_sound_bandscxx . . $ Terrain_sound_bands.[b].sound_indexcxx . . $ terrain_sound_band#sound_index. = -1;
2856 Terrain_sound_bandscxx . . $ Terrain_sound_bands.[b].low_altcxx . . $ terrain_sound_band#low_alt. = 0;
2857 Terrain_sound_bandscxx . . $ Terrain_sound_bands.[b].high_altcxx . . $ terrain_sound_band#high_alt. = 0;
2858 Terrain_sound_bandscxx . . $ Terrain_sound_bands.[b].low_volumecxx . . $ terrain_sound_band#low_volume. = 0.0;
2859 Terrain_sound_bandscxx . . $ Terrain_sound_bands.[b].high_volumecxx . . $ terrain_sound_band#high_volume. = 0.0;
2860 }
2861 }
2862
2863 // Starts the sound on the terrain
2864 void StartTerrainSoundcxx . . $ StartTerrainSound(49f6e7a06ebc5aa8).() {
2865 // Set to be full on or full off
2866 if (OBJECT_OUTSIDEcxx . . $ `lib/object_external_struct.h:130:9`!(Player_object))
2867 Terrain_sound_fadecxx . . $ Terrain_sound_fade. = 1.0;
2868 else
2869 Terrain_sound_fadecxx . . $ Terrain_sound_fade. = Frametimecxx . . $ Frametime. / FADE_TIMEcxx . . $ `Descent3/GameLoop.cpp:2809:9`!; // will fade to zero first time
2870
2871 // Start the sounds
2872 for (int b = 0; b < NUM_TERRAIN_SOUND_BANDScxx . . $ `Descent3/game.h:317:9`!; b++) {
2873 terrain_sound_bandcxx . . $ terrain_sound_band# *tb = &Terrain_sound_bandscxx . . $ Terrain_sound_bands.[b];
2874 if (tb->sound_indexcxx . . $ terrain_sound_band#sound_index. != -1) {
2875 Terrain_sound_handlescxx . . $ Terrain_sound_handles.[b] = Sound_systemcxx . . $ Sound_system..Play2dSoundcxx . . $ hlsSystem#Play2dSound(d251026853493025).(tb->sound_indexcxx . . $ terrain_sound_band#sound_index.);
2876 }
2877 }
2878
2879 // Set the volumes
2880 UpdateTerrainSoundcxx . . $ UpdateTerrainSound(49f6e7a06ebc5aa8).();
2881 }
2882
2883 // The main loop for D3. It renders, gets input, etc. for one frame
2884 extern bool Skip_render_game_framecxx . . $ Skip_render_game_frame.;
2885 void GameFramecxx . . $ GameFrame(49f6e7a06ebc5aa8).(void) {
2886 #ifdef USE_RTP
2887 INT64 curr_time;
2888 #endif
2889
2890 bool is_game_idle = !Descentcxx . . $ Descent.->activecxx . . $ oeApplication#active(50ce9a9e25b4a850).();
2891
2892 if (Tracking_FVIcxx . . $ Tracking_FVI.) {
2893 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Beginning frame!\n");
2894 }
2895
2896 // Begin Gameloop stuff
2897 Physics_normal_countercxx . . $ Physics_normal_counter. = 0;
2898 Physics_normal_looping_countercxx . . $ Physics_normal_looping_counter. = 0;
2899 Physics_walking_countercxx . . $ Physics_walking_counter. = 0;
2900 Physics_walking_looping_countercxx . . $ Physics_walking_looping_counter. = 0;
2901 Physics_vis_countercxx . . $ Physics_vis_counter. = 0;
2902
2903 FVI_countercxx . . $ FVI_counter. = 0;
2904 FVI_room_countercxx . . $ FVI_room_counter. = 0;
2905
2906 #ifdef _DEBUGcxx . . $ `<built-in>:482:9`!
2907 // Dump networking stats to virtual window
2908 tNetworkStatuscxx . . $ tNetworkStatus# netstat;
2909 static tNetworkStatuscxx . . $ tNetworkStatus# old_netstat;
2910 static bool netstat_init = false;
2911 static float netstat_time = 0;
2912
2913 nw_GetNetworkStatscxx . . $ nw_GetNetworkStats(3e736517eddecfba).(&netstat);
2914 mprintf_atcxx . . $ `ddebug/mono.h:83:9`!(5, 0, 0, "TCP/IP Network Stats:");
2915 mprintf_atcxx . . $ `ddebug/mono.h:83:9`!(5, 1, 0, "TCP: tx: %d/%d rtx: %d/%d rx: %d/%d", netstat.tcp_total_packets_sent,
2916 netstat.tcp_total_bytes_sent, netstat.tcp_total_packets_resent, netstat.tcp_total_bytes_resent,
2917 netstat.tcp_total_packets_rec, netstat.tcp_total_bytes_rec);
2918 mprintf_atcxx . . $ `ddebug/mono.h:83:9`!(5, 2, 0, "UDP: tx: %d/%d rx: %d/%d", netstat.udp_total_packets_sent, netstat.udp_total_bytes_sent,
2919 netstat.udp_total_packets_rec, netstat.udp_total_bytes_rec);
2920
2921 if (!netstat_init) {
2922 netstat_time = timer_GetTimecxx . . $ `ddio/ddio.h:236:9`!();
2923
2924 old_netstat =cxx . . $ tNetworkStatus#`operator=`(6314c9db7b7356b0). netstat;
2925 netstat_init = true;
2926 } else {
2927 float newt = timer_GetTimecxx . . $ `ddio/ddio.h:236:9`!();
2928 if (netstat_time + 0.5f <= newt) {
2929 // time to update
2930 float tcp_rx, tcp_rtx, tcp_tx;
2931 float udp_rx, udp_tx;
2932 float time_diff = newt - netstat_time;
2933
2934 tcp_rx = ((float)(netstat.tcp_total_bytes_reccxx . . $ tNetworkStatus#tcp_total_bytes_rec. - old_netstat.tcp_total_bytes_reccxx . . $ tNetworkStatus#tcp_total_bytes_rec.)) / time_diff;
2935 tcp_tx = ((float)(netstat.tcp_total_bytes_sentcxx . . $ tNetworkStatus#tcp_total_bytes_sent. - old_netstat.tcp_total_bytes_sentcxx . . $ tNetworkStatus#tcp_total_bytes_sent.)) / time_diff;
2936 tcp_rtx = ((float)(netstat.tcp_total_bytes_resentcxx . . $ tNetworkStatus#tcp_total_bytes_resent. - old_netstat.tcp_total_bytes_resentcxx . . $ tNetworkStatus#tcp_total_bytes_resent.)) / time_diff;
2937
2938 udp_rx = ((float)(netstat.udp_total_bytes_reccxx . . $ tNetworkStatus#udp_total_bytes_rec. - old_netstat.udp_total_bytes_reccxx . . $ tNetworkStatus#udp_total_bytes_rec.)) / time_diff;
2939 udp_tx = ((float)(netstat.udp_total_bytes_sentcxx . . $ tNetworkStatus#udp_total_bytes_sent. - old_netstat.udp_total_bytes_sentcxx . . $ tNetworkStatus#udp_total_bytes_sent.)) / time_diff;
2940
2941 mprintf_atcxx . . $ `ddebug/mono.h:83:9`!(5, 3, 0, "TCP/s: TX: % 5.1f RTX: % 5.1f RX: % 5.1f", tcp_tx, tcp_rtx, tcp_rx);
2942 mprintf_atcxx . . $ `ddebug/mono.h:83:9`!(5, 4, 0, "UDP/s: TX: % 5.1f RX: % 5.1f", udp_tx, udp_rx);
2943
2944 old_netstat =cxx . . $ tNetworkStatus#`operator=`(6314c9db7b7356b0). netstat;
2945 netstat_time = newt;
2946 }
2947 }
2948
2949 #endif
2950 // clear out music struct
2951 memset(&Game_music_infocxx . . $ Game_music_info., 0, sizeof(Game_music_infocxx . . $ Game_music_info.));
2952
2953 // if in user interface, clear screen every frame for small game windows.
2954 if (Game_interface_modecxx . . $ Game_interface_mode. != GAME_INTERFACEcxx . . $ `Descent3/gamesequence.h:129:9`! || Menu_interface_modecxx . . $ Menu_interface_mode.)
2955 Clear_screencxx . . $ Clear_screen. = 4;
2956
2957 // Setup sound for new frame
2958 Sound_systemcxx . . $ Sound_system..BeginSoundFramecxx . . $ hlsSystem#BeginSoundFrame(b45ddcbc8423892c).();
2959 UpdateVoicescxx . . $ UpdateVoices(49f6e7a06ebc5aa8).();
2960
2961 #ifdef USE_RTP
2962 RTP_GETCLOCK(curr_time);
2963 #endif
2964
2965 if ((!Game_pausedcxx . . $ Game_paused.) || (Demo_do_one_framecxx . . $ Demo_do_one_frame.)) {
2966 // if we are recording a demo, all moved objects will be written
2967 if (!Skip_render_game_framecxx . . $ Skip_render_game_frame.) {
2968 DemoWriteChangedObjectscxx . . $ DemoWriteChangedObjects(49f6e7a06ebc5aa8).();
2969 }
2970 // Demo Frame (do this first so all subsequent demo items are marked for this frame)
2971 if (!Skip_render_game_framecxx . . $ Skip_render_game_frame.) {
2972 DemoStartNewFramecxx . . $ DemoStartNewFrame(49f6e7a06ebc5aa8).();
2973 }
2974 if (Demo_flagscxx . . $ Demo_flags. == DF_PLAYBACKcxx . . $ `lib/demofile.h:123:9`!) {
2975 DemoFramecxx . . $ DemoFrame(49f6e7a06ebc5aa8).();
2976 }
2977
2978 if (!is_game_idle) {
2979 // Get and process keys
2980 RTP_tSTARTTIMEcxx . . $ `rtperformance/rtperformance.h:120:9`!(processkeys_time, curr_time);
2981 ProcessKeyscxx . . $ ProcessKeys(49f6e7a06ebc5aa8).();
2982 ProcessButtonscxx . . $ ProcessButtons(49f6e7a06ebc5aa8).();
2983 RTP_tENDTIMEcxx . . $ `rtperformance/rtperformance.h:122:9`!(processkeys_time, curr_time);
2984 }
2985
2986 // Global AI Frame Stuff -- must be before ObjMoveAll
2987 RTP_tSTARTTIMEcxx . . $ `rtperformance/rtperformance.h:120:9`!(aiframeall_time, curr_time);
2988 if (DoAIcxx . . $ DoAI.) {
2989 AIFrameAllcxx . . $ AIFrameAll(49f6e7a06ebc5aa8).();
2990 }
2991 a_lifecxx . . $ a_life..DoFramecxx . . $ ambient_life#DoFrame(49f6e7a06ebc5aa8).();
2992 RTP_tENDTIMEcxx . . $ `rtperformance/rtperformance.h:122:9`!(aiframeall_time, curr_time);
2993
2994 // ApplyShadowsToRooms ();
2995
2996 // Move objects for this frame
2997 RTP_tSTARTTIMEcxx . . $ `rtperformance/rtperformance.h:120:9`!(objframe_time, curr_time);
2998 ObjDoFrameAllcxx . . $ ObjDoFrameAll(49f6e7a06ebc5aa8).();
2999 RTP_tENDTIMEcxx . . $ `rtperformance/rtperformance.h:122:9`!(objframe_time, curr_time);
3000
3001 RTP_tSTARTTIMEcxx . . $ `rtperformance/rtperformance.h:120:9`!(matcenframe_time, curr_time);
3002 DoMatcensFramecxx . . $ DoMatcensFrame(49f6e7a06ebc5aa8).();
3003 RTP_tENDTIMEcxx . . $ `rtperformance/rtperformance.h:122:9`!(matcenframe_time, curr_time);
3004
3005 // Checks for goal completion
3006 RTP_tSTARTTIMEcxx . . $ `rtperformance/rtperformance.h:120:9`!(levelgoal_time, curr_time);
3007 Level_goalscxx . . $ Level_goals..DoFramecxx . . $ levelgoals#DoFrame(49f6e7a06ebc5aa8).();
3008 RTP_tENDTIMEcxx . . $ `rtperformance/rtperformance.h:122:9`!(levelgoal_time, curr_time);
3009
3010 // Do doorways
3011 RTP_tSTARTTIMEcxx . . $ `rtperformance/rtperformance.h:120:9`!(doorframe_time, curr_time);
3012 DoorwayDoFramecxx . . $ DoorwayDoFrame(49f6e7a06ebc5aa8).();
3013 RTP_tENDTIMEcxx . . $ `rtperformance/rtperformance.h:122:9`!(doorframe_time, curr_time);
3014
3015 // Do player frame
3016 RTP_tSTARTTIMEcxx . . $ `rtperformance/rtperformance.h:120:9`!(playerframe_time, curr_time);
3017 DoPlayerFramecxx . . $ DoPlayerFrame(49f6e7a06ebc5aa8).();
3018 RTP_tENDTIMEcxx . . $ `rtperformance/rtperformance.h:122:9`!(playerframe_time, curr_time);
3019
3020 // Weather frame
3021 RTP_tSTARTTIMEcxx . . $ `rtperformance/rtperformance.h:120:9`!(weatherframe_time, curr_time);
3022 DoWeatherForFramecxx . . $ DoWeatherForFrame(49f6e7a06ebc5aa8).();
3023 RTP_tENDTIMEcxx . . $ `rtperformance/rtperformance.h:122:9`!(weatherframe_time, curr_time);
3024
3025 // Ambient sounds
3026 RTP_tSTARTTIMEcxx . . $ `rtperformance/rtperformance.h:120:9`!(ambsound_frame_time, curr_time);
3027 DoAmbientSoundscxx . . $ DoAmbientSounds(49f6e7a06ebc5aa8).();
3028 RTP_tENDTIMEcxx . . $ `rtperformance/rtperformance.h:122:9`!(ambsound_frame_time, curr_time);
3029
3030 // Terrain sound
3031 UpdateTerrainSoundcxx . . $ UpdateTerrainSound(49f6e7a06ebc5aa8).();
3032
3033 // Call the interval script for the level script
3034 //@$-D3XExecScript(Current_level->d3xthread, Current_mission.cur_level, REF_LEVELTYPE, EVT_INTERVAL, 0, 0);
3035 tOSIRISEventInfocxx . . $ tOSIRISEventInfo# ei;
3036 ei.evt_intervalcxx . . $ tOSIRISEventInfo#$anonymous_type_1#evt_interval..frame_timecxx . . $ tOSIRISEVTINTERVAL#frame_time. = Frametimecxx . . $ Frametime.;
3037 ei.evt_intervalcxx . . $ tOSIRISEventInfo#$anonymous_type_1#evt_interval..game_timecxx . . $ tOSIRISEVTINTERVAL#game_time. = Gametimecxx . . $ Gametime.;
3038 Osiris_CallLevelEventcxx . . $ Osiris_CallLevelEvent(a880c8b99cdc05b4).(EVT_INTERVALcxx . . $ `scripts/osiris_common.h:363:9`!, &ei);
3039 Osiris_ProcessTimerscxx . . $ Osiris_ProcessTimers(49f6e7a06ebc5aa8).();
3040
3041 // Process any in-game cinematics
3042 Cinematic_Framecxx . . $ Cinematic_Frame(49f6e7a06ebc5aa8).();
3043
3044 } else {
3045 Sleepcxx . . $ Sleep(d4f767463ce0a6b3).(3);
3046 }
3047
3048 // do music always.
3049 RTP_tSTARTTIMEcxx . . $ `rtperformance/rtperformance.h:120:9`!(musicframe_time, curr_time);
3050 GameProcessMusiccxx . . $ GameProcessMusic(49f6e7a06ebc5aa8).();
3051 RTP_tENDTIMEcxx . . $ `rtperformance/rtperformance.h:122:9`!(musicframe_time, curr_time);
3052
3053 if ((Demo_pausedcxx . . $ Demo_paused.) && (Demo_flagscxx . . $ Demo_flags. == DF_PLAYBACKcxx . . $ `lib/demofile.h:123:9`!) && !is_game_idle) {
3054 Demo_do_one_framecxx . . $ Demo_do_one_frame. = false;
3055 ProcessKeyscxx . . $ ProcessKeys(49f6e7a06ebc5aa8).();
3056 }
3057
3058 // Always do multiplayer frames before render frame
3059 //
3060 // Do multiplayer stuff
3061 RTP_tSTARTTIMEcxx . . $ `rtperformance/rtperformance.h:120:9`!(multiframe_time, curr_time);
3062 MultiDoFramecxx . . $ MultiDoFrame(49f6e7a06ebc5aa8).();
3063 RTP_tENDTIMEcxx . . $ `rtperformance/rtperformance.h:122:9`!(multiframe_time, curr_time);
3064
3065 #ifdef USE_RTP
3066 RTP_GETCLOCK(curr_time); // update the current time, since something has happened since ENDFTIME
3067 #endif
3068
3069 if (!is_game_idle) {
3070 RTP_tSTARTTIMEcxx . . $ `rtperformance/rtperformance.h:120:9`!(renderframe_time, curr_time);
3071 if (!Skip_render_game_framecxx . . $ Skip_render_game_frame.) {
3072 // Render the frame
3073 GameRenderFramecxx . . $ GameRenderFrame(49f6e7a06ebc5aa8).();
3074 }
3075 RTP_tENDTIMEcxx . . $ `rtperformance/rtperformance.h:122:9`!(renderframe_time, curr_time);
3076 }
3077
3078 if (!Game_pausedcxx . . $ Game_paused.) {
3079 // Do pending events
3080 RTP_tSTARTTIMEcxx . . $ `rtperformance/rtperformance.h:120:9`!(normalevent_time, curr_time);
3081 ProcessNormalEventscxx . . $ ProcessNormalEvents(49f6e7a06ebc5aa8).();
3082 RTP_tENDTIMEcxx . . $ `rtperformance/rtperformance.h:122:9`!(normalevent_time, curr_time);
3083
3084 // float start_delay = timer_GetTime();
3085 // Slow down the game if the user asked us to
3086
3087 int64_t current_timer;
3088 uint32_tcxx . . $ uint32_t# sleeptime;
3089 current_timer = timer_GetMSTimecxx . . $ `ddio/ddio.h:237:9`!();
3090 if ((current_timer - last_timercxx . . $ last_timer.) < Min_allowed_frametimecxx . . $ Min_allowed_frametime.) {
3091 sleeptime = (uint32_tcxx . . $ uint32_t#)Min_allowed_frametimecxx . . $ Min_allowed_frametime. - (current_timer - last_timercxx . . $ last_timer.);
3092 // mprintf(0,"Sleeping for %d ms\n",sleeptime);
3093 Sleepcxx . . $ Sleep(d4f767463ce0a6b3).(sleeptime);
3094 }
3095
3096 static int graph_id = -2;
3097 if (graph_id == -2) {
3098 graph_id = DebugGraph_Addcxx . . $ DebugGraph_Add(9bc3e79dc6ad0d07).((float)0.0f, (float)260.0f, "Framerate");
3099 }
3100 if (graph_id >= 0) {
3101 float fps;
3102
3103 if (Frametimecxx . . $ Frametime. > 0) {
3104 fps = 1.0 / Frametimecxx . . $ Frametime.;
3105 DebugGraph_Updatecxx . . $ DebugGraph_Update(43c79ee2f1b9aefe).(graph_id, fps);
3106 }
3107 }
3108
3109 // Compute how long frame took
3110 CalcFrameTimecxx . . $ CalcFrameTime(49f6e7a06ebc5aa8).();
3111
3112 // Update Gametime
3113 Gametimecxx . . $ Gametime. += Frametimecxx . . $ Frametime.;
3114 }
3115
3116 // End Gameloop Loop stuff
3117 Sound_systemcxx . . $ Sound_system..EndSoundFramecxx . . $ hlsSystem#EndSoundFrame(49f6e7a06ebc5aa8).();
3118 DoDestroyedLightsForFramecxx . . $ DoDestroyedLightsForFrame(49f6e7a06ebc5aa8).();
3119
3120 // Clear lod stuff
3121 ClearLODOffscxx . . $ ClearLODOffs(49f6e7a06ebc5aa8).();
3122
3123 static int fvi_graph_id = -2;
3124 if (fvi_graph_id == -2) {
3125 fvi_graph_id = DebugGraph_Addcxx . . $ DebugGraph_Add(b9ead6aff293bd59).(0, 1000, "FVI Calls");
3126 }
3127 if (fvi_graph_id >= 0) {
3128 DebugGraph_Updatecxx . . $ DebugGraph_Update(3e454b8ccf442868).(fvi_graph_id, FVI_countercxx . . $ FVI_counter.);
3129 }
3130
3131 #ifdef USE_RTP
3132 RTP_RECORDVALUE(frame_time, Frametime);
3133 rtp_RecordFrame();
3134
3135 /*
3136 if (frame_info.ai_time>.1)
3137 mprintf(0,"NOTE: AI frame took longer than .1 seconds! %f\n",frame_info.ai_time);
3138 if (frame_info.render_time>.1)
3139 mprintf(0,"NOTE: Render frame took longer than .1 seconds! %f\n",frame_info.render_time);
3140 if (frame_info.multi_time>.1)
3141 mprintf(0,"NOTE: Multi frame took longer than .1 seconds! %f\n",frame_info.multi_time);
3142 if (frame_info.obj_time>.1)
3143 mprintf(0,"NOTE: Object frame took longer than .1 seconds! %f\n",frame_info.obj_time);
3144 */
3145 #endif
3146
3147 mprintf_atcxx . . $ `ddebug/mono.h:83:9`!(1, 0, 39, "Pn %05d, L %05d", Physics_normal_counter, Physics_normal_looping_counter);
3148 mprintf_atcxx . . $ `ddebug/mono.h:83:9`!(1, 1, 39, "Pw %05d, L %05d", Physics_walking_counter, Physics_walking_looping_counter);
3149 mprintf_atcxx . . $ `ddebug/mono.h:83:9`!(1, 2, 39, "Pv %05d", Physics_vis_counter);
3150 mprintf_atcxx . . $ `ddebug/mono.h:83:9`!(1, 3, 39, "Fc %05d, R %05d", FVI_counter, FVI_room_counter);
3151
3152 #ifdef D3_FAST
3153 if (FrameCount > 20)
3154 SetFunctionMode(MENU_MODE);
3155 else {
3156 int key;
3157 int rand_num = ps_rand() % 4;
3158
3159 if (rand_num == 0)
3160 key = KEY_LCTRL;
3161 else if (rand_num == 1)
3162 key = KEY_SPACEBAR;
3163 else if (rand_num == 2)
3164 key = KEY_A;
3165 else
3166 key = KEY_Z;
3167
3168 ddio_UpdateKeyState(key, timer_GetTime(), 1);
3169 ddio_UpdateKeyState(key, timer_GetTime() + .5f, 0);
3170 }
3171 #endif
3172
3173 if (Tracking_FVIcxx . . $ Tracking_FVI.) {
3174 mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Ending frame!\n");
3175 }
3176
3177 if (!is_game_idle) {
3178 Descentcxx . . $ Descent.->defercxx . . $ oeApplication#defer(db52760e79bf9054).();
3179 }
3180 }
3181
3182 // game menu functions
3183 void StartGameMenucxx . . $ StartGameMenu(49f6e7a06ebc5aa8).() {
3184 SetUICallbackcxx . . $ SetUICallback(964b12a25712bdc3).(GameFramecxx . . $ GameFrame(49f6e7a06ebc5aa8).);
3185 SuspendControlscxx . . $ SuspendControls(49f6e7a06ebc5aa8).();
3186 Menu_interface_modecxx . . $ Menu_interface_mode. = true;
3187
3188 // reset bail flag.
3189 Multi_bail_ui_menucxx . . $ Multi_bail_ui_menu. = false;
3190
3191 if (!(Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!)) {
3192 PauseGamecxx . . $ PauseGame(49f6e7a06ebc5aa8).();
3193 }
3194
3195 ui_ShowCursorcxx . . $ ui_ShowCursor(c9857a73d68e59ba).();
3196 }
3197
3198 void EndGameMenucxx . . $ EndGameMenu(49f6e7a06ebc5aa8).() {
3199 ui_HideCursorcxx . . $ ui_HideCursor(c9857a73d68e59ba).();
3200
3201 if (!(Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!)) {
3202 ResumeGamecxx . . $ ResumeGame(49f6e7a06ebc5aa8).();
3203 }
3204
3205 Menu_interface_modecxx . . $ Menu_interface_mode. = false;
3206
3207 ResumeControlscxx . . $ ResumeControls(49f6e7a06ebc5aa8).();
3208 SetUICallbackcxx . . $ SetUICallback(964b12a25712bdc3).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
3209 Clear_screencxx . . $ Clear_screen. = 4;
3210 }