Debian Codegraph @

Descent3/ObjInit.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/ObjInit.cpp $
21 * $Revision: 170 $
22 * $Date: 4/19/00 5:18p $
23 * $Author: Matt $
24 *
25 * Functions to initialize objects
26 *
27 * $Log: /DescentIII/main/ObjInit.cpp $
28 *
29 * 170 4/19/00 5:18p Matt
30 * From Duane for 1.4
31 * Added check for ai_info
32 *
33 * 169 3/20/00 12:18p Matt
34 * Merge of Duane's post-1.3 changes.
35 * msize change (Mac only)
36 *
37 * 168 2/22/00 10:00a Matt
38 * Fixed Jason's typo
39 *
40 * 167 2/19/00 6:44p Jason
41 * Fixed out of bounds weapon problem
42 *
43 * 166 10/24/99 9:33a Chris
44 * Cleaned a little more Mac code
45 *
46 * 165 10/22/99 10:59p Matt
47 * Added check for anim data before renferencing it.
48 *
49 * 164 10/22/99 11:30a Matt
50 * Mac merge
51 *
52 * 163 7/28/99 5:18p Kevin
53 * Mac merge fixes
54 *
55 * 162 7/28/99 3:50p Kevin
56 * Mac!
57 *
58 * 161 5/20/99 7:54p 3dsmax
59 * added better memory support changing ships
60 *
61 * 160 5/19/99 3:54p Jeff
62 * error is scripts are being bound to an object more than once
63 *
64 * 159 5/08/99 6:20p Jason
65 * fixed framerate wiggle problem
66 *
67 * 158 4/28/99 5:09p Jason
68 * fixed some bugs with latest build
69 *
70 * 157 4/27/99 4:44p Jason
71 * fixed moving buildings not getting lit
72 *
73 * 156 4/22/99 8:29p Kevin
74 * made psrand.h come after stdlib.h
75 *
76 * 155 4/21/99 1:23p Chris
77 * Added the check ceiling checkbox for generic objects
78 *
79 * 154 4/21/99 11:05a Kevin
80 * new ps_rand and ps_srand to replace rand & srand
81 *
82 * 153 4/20/99 3:33p Matt
83 * ObjInit() was bashing creation time after setting it.
84 *
85 * 152 4/20/99 2:44p Matt
86 * Deal with initializing a generic object whose ID isn't defined. This
87 * can happen if an object is deleted and the level in memory uses that
88 * object.
89 *
90 * 151 4/20/99 12:24p Matt
91 * Re-revised the ObjInit() system. ObjInit() again does all the
92 * initialization stuff, but now it's passed a lot more information so
93 * those fields can be set before the rest of the initialization takes
94 * place.
95 *
96 * 150 4/18/99 5:33p Jason
97 * fixed object multiplayer problem
98 *
99 * 149 4/18/99 4:50p Matt
100 * Took out code that hacked in ammo amounts for weapon powerups, and
101 * added code to set the counts on the page and read and write to the
102 * table file.
103 *
104 * 148 4/15/99 1:42a Jeff
105 * changes for linux compile
106 *
107 * 147 4/14/99 3:57a Jeff
108 * fixed case mismatch in #includes
109 *
110 * 146 4/12/99 6:11p Jason
111 * fix clutter objects so that they are volume lit as well
112 *
113 * 145 4/12/99 3:53p Matt
114 * Page in polymodel for markers so model size is right.
115 *
116 * 144 4/10/99 5:56p Matt
117 * Cleaned up object initialization code, including create object & load
118 * object.
119 *
120 * 143 4/08/99 6:38p Matt
121 * Improved message.
122 *
123 * 142 4/08/99 6:15p Matt
124 * Deal with generic objects that have changed type.
125 *
126 * 141 4/05/99 10:54a Matt
127 * Added auto-waypoint system
128 *
129 * 140 3/02/99 4:54p Matt
130 * Took out assert
131 *
132 * 139 3/02/99 12:22p Matt
133 * Revisions to weapon & ammo powerups. Not fully tested.
134 *
135 * 138 2/25/99 11:01a Matt
136 * Added new explosion system.
137 *
138 * 137 2/22/99 2:04p Jason
139 * added different damages for players and generics
140 *
141 * 136 2/21/99 4:20p Matt
142 * Added SoundSource objects (and reformatted parts of the object header
143 * files).
144 *
145 * 135 2/15/99 6:10p Chris
146 *
147 * 134 2/10/99 1:47p Matt
148 * Changed object handle symbolic constants
149 *
150 * 133 2/04/99 2:05p Matt
151 * Added blastable doors
152 *
153 * 132 2/02/99 8:43a Chris
154 * I made buildings with AI work correctly (ie really big robots should be
155 * buildings)
156 * anim to and from states are now shorts instead of bytes
157 *
158 * 131 1/28/99 11:32a Jason
159 * added marker cameras
160 *
161 * 130 1/27/99 6:08p Jason
162 * first pass at markers
163 *
164 * 129 1/21/99 11:15p Jeff
165 * pulled out some structs and defines from header files and moved them
166 * into seperate header files so that multiplayer dlls don't require major
167 * game headers, just those new headers. Side effect is a shorter build
168 * time. Also cleaned up some header file #includes that weren't needed.
169 * This affected polymodel.h, object.h, player.h, vecmat.h, room.h,
170 * manage.h and multi.h
171 *
172 * 128 1/13/99 6:38a Jeff
173 * fixed object.h. There were numerous struct declarations that were the
174 * same name as the instance of the struct (gcc doesn't like this).
175 * Changed the struct name. Also added some #ifdef's for linux build,
176 * along with fixing case-sensitive includes
177 *
178 * 127 1/13/99 2:29a Chris
179 * Massive AI, OSIRIS update
180 *
181 * 126 1/08/99 2:56p Samir
182 * Ripped out OSIRIS1.
183 *
184 * 125 10/29/98 6:15p Chris
185 * Made a minimum rotdrag for robots
186 *
187 * 124 10/22/98 5:36p Chris
188 * Fixed ObjGet bugs
189 *
190 * 123 10/19/98 7:18p Matt
191 * Added system to support different types of damage to the player and
192 * have these different types make different sounds.
193 *
194 * 122 10/15/98 6:46p Chris
195 * Added custom size for weapons
196 *
197 * 121 10/13/98 5:48p Jeff
198 * CHRISHACK -- multiplayer ship hack for attach points -- DEMO SAFE
199 *
200 * 120 10/13/98 3:58p Kevin
201 * changed free to mem_free
202 *
203 * 119 10/11/98 10:53p Matt
204 * Fixed some zero-length malloc()s
205 *
206 * 118 10/11/98 2:40p Matt
207 * Added some error checking to ObjInitGeneric()
208 *
209 * 117 10/09/98 3:32p Kevin
210 * New memory library
211 *
212 * 116 10/08/98 4:23p Kevin
213 * Changed code to comply with memory library usage. Always use mem_malloc
214 * , mem_free and mem_strdup
215 *
216 * 115 10/02/98 1:47p Jason
217 * added lod player ships
218 *
219 * 114 9/28/98 4:09p Chris
220 * Added birth animations
221 *
222 * 113 9/22/98 3:55p Samir
223 * ifdef out stuff for non-debug version.
224 *
225 * 112 8/26/98 12:09p Jason
226 * made object reinitialization not undo lightmaps
227 *
228 * 111 8/25/98 4:40p Samir
229 * small sequencing prob,
230 *
231 * 110 8/25/98 3:44p Sean
232 * moved control intitalization of player to after polymodel is paged in.
233 *
234 * 109 8/18/98 12:48p Jason
235 * made debris objects have volume lighting
236 *
237 * 108 8/12/98 6:37p Jeff
238 * removed init stuff for OBJ_DUMMY
239 *
240 * 107 8/03/98 4:29p Chris
241 * Added additional support for the attach system
242 *
243 * 106 8/03/98 4:29p Jason
244 * took out presets for ship physics flags
245 *
246 * 105 7/28/98 12:29p Jason
247 * added rotational velocity to multiplayer position packets
248 *
249 * 104 7/20/98 2:06p Chris
250 * Added the precomputation of some weapons (fixed speed weapons). This
251 * algorithm can be expanded to include some missiles with some minor
252 * work.
253 *
254 * 103 7/07/98 7:34p Jeff
255 * created object type, OBJ_DUMMY
256 *
257 * 102 7/06/98 12:22p Keneta
258 * Fixed a bug with dynamically allocated weapon batteries
259 *
260 * 101 7/02/98 2:47p Chris
261 * Dynamic weapon info is now dynamically allocated
262 *
263 * 100 6/12/98 4:07p Jason
264 * added dynamic volume lighting to objects
265 *
266 * 99 6/11/98 12:48p Jason
267 * added better spewing weapons
268 *
269 * 98 5/21/98 12:34p Jason
270 * made particles drop differently
271 *
272 * 97 5/19/98 4:42a Chris
273 * Added shockwave's -- enjoy. :)
274 *
275 * 96 5/15/98 5:41p Jason
276 * implemented volume lighting system
277 *
278 * 95 5/14/98 12:56p Jason
279 * changes to help lower memory usage
280 *
281 * 94 5/12/98 11:58a Chris
282 * Offset animation's for generic objects
283 *
284 * 93 5/11/98 4:40p Chris
285 * AI info is now a malloc'ed pointer
286 *
287 * 92 5/07/98 2:22p Chris
288 * Hit die dot
289 *
290 * 91 5/04/98 3:51p Matt
291 * Finished (for now) with breaking glass.
292 *
293 * 90 5/04/98 12:28p Matt
294 * Added shard objects
295 *
296 * 89 5/01/98 3:38p Chris
297 * Leveling defaults off
298 *
299 * 88 5/30/98 10:16p Chris
300 * Fixed some bad spelling
301 *
302 * 87 4/30/98 11:32a Chris
303 * ClearWB to WBClear
304 *
305 * 86 4/22/98 3:25p Jason
306 * changes for multiplayer debugging
307 *
308 * 85 4/19/98 5:00p Jason
309 * added cool napalm effect, plus made object effects dynamically
310 * allocated
311 *
312 * 84 4/17/98 1:59p Jason
313 * added cool object effects
314 *
315 * 83 4/16/98 2:56p Chris
316 * Updated buddy support and intergrated scripting and AI
317 *
318 * 82 4/15/98 8:38p Jason
319 * fixed some multiplayer issues
320 *
321 * 81 4/15/98 12:56p Chris
322 * Updated parent_handle support and added buddy bot support
323 *
324 * 80 4/03/98 11:27a Chris
325 * Doubled the size of powerups
326 *
327 * 79 4/03/98 10:07a Chris
328 * Added support for objects getting their size computed when the
329 * polymodel is paged in the first time as an object
330 *
331 * 78 4/02/98 6:38p Jason
332 * page in low-res models with generic objects
333 *
334 * 77 4/02/98 3:54p Jason
335 * first pass in getting polymodel paging to work
336 *
337 * 76 3/31/98 6:11p Jason
338 * took out auto ship selection
339 *
340 * 75 3/30/98 6:58p Matt
341 * When reinitializing an object, don't bash its custom script.
342 *
343 * 74 3/30/98 6:20p Matt
344 * Renamed ResetObject() to be ObjReInitAll()
345 *
346 * 73 3/20/98 5:51p Jason
347 * more changes for multiplayer
348 *
349 * 72 3/19/98 7:15p Jason
350 * more changes for multiplayer
351 *
352 * 71 3/13/98 5:55p Chris
353 * Added the new collision spheres
354 *
355 * 70 3/11/98 4:59p Chris
356 * Changed the ComputeDefualtSize function call
357 *
358 * 69 3/09/98 10:49a Chris
359 * Worked on the homing code
360 *
361 * 68 2/25/98 2:06p Jason
362 * fixed objinit player to give you different ships in the correct order
363 *
364 * 67 2/25/98 12:32p Jason
365 * added a new player ship for multiplayer games
366 *
367 * 66 2/23/98 4:52p Chris
368 * Removed size hack
369 *
370 * 65 2/17/98 8:17p Jeff
371 * hacked a player ship size in for the milestone
372 *
373 * 64 2/17/98 8:16p Jeff
374 * Call compute default size for player ships
375 *
376 * 63 2/16/98 4:41p Jason
377 * took out starhawk ship (again!)
378 *
379 * 62 2/16/98 2:47a Chris
380 * Massive improvements to the animation system and the AI
381 *
382 * 61 2/11/98 6:58p Matt
383 * Changed the way cameras are rendered, so they show up on the terrain as
384 * well.
385 *
386 * 60 2/10/98 7:02p Jason
387 * fixed lighting render type for rooms
388 *
389 * 59 2/09/98 7:28p Matt
390 * Added a rendering type for external room so we could check against
391 * render type == RT_NONE
392 *
393 * 58 2/03/98 1:06p Jason
394 * tidied up some multiplayer loose ends
395 *
396 * 57 1/30/98 12:13p Jason
397 * give weapons lifetime
398 *
399 * 56 1/29/98 5:49p Matt
400 * Changed old camera object type to be viewer object (for editor), and
401 * now camera objects will just be for game cameras.
402 *
403 * 55 1/29/98 3:29p Chris
404 * Major update to the AI system.
405 *
406 * 54 1/28/98 12:00p Jason
407 * more changes for multiplayer
408 *
409 * 53 1/23/98 6:25p Jason
410 * Got spray weapons working
411 *
412 * 52 1/23/98 11:21a Jason
413 * incremental multiplayer checkin
414 *
415 * 51 1/20/98 4:12p Samir
416 * New script housekeeping system.
417 *
418 * 50 1/18/98 9:05p Matt
419 * Changed a comment, and deleted some unused code
420 *
421 * 49 1/10/98 2:24p Jason
422 * better multiplayer code checked in
423 *
424 * 48 12/08/97 6:18p Jason
425 * more tweaks for destroyable buildings
426 *
427 * 47 12/05/97 6:38p Chris
428 * Fixed bug with impact_size initialization
429 *
430 * 46 12/01/97 9:54a Chris
431 * Added support for concussive forces, generalized robot collisions to
432 * generic collisions
433 *
434 * 45 11/04/97 6:18p Chris
435 * Added support so that the player ship uses the robot's firing dialog.
436 *
437 * 44 10/28/97 12:21p Chris
438 * Unified AIInit
439 *
440 * 43 10/23/97 11:34p Chris
441 * Fixed problems with idle animations
442 *
443 * 42 10/23/97 5:36p Jason
444 * added splinter objects (probably temporary)
445 *
446 * 41 10/21/97 11:57a Jason
447 * added ability to set dying model for player ship
448 *
449 * 40 10/20/97 6:10p Jason
450 * added of_polygon_object flag to debris stuff
451 *
452 * 39 10/20/97 6:02p Jason
453 * fixed dumb objweapon bug
454 *
455 * 38 10/20/97 5:54p Jason
456 * added polygon_object flag
457 *
458 * 37 10/20/97 4:59p Jason
459 * made player ships render with gouraud shading
460 *
461 * 36 10/20/97 4:46p Jason
462 * changes for explosions
463 *
464 * 35 10/17/97 5:09p Jason
465 * added more fireball stuff
466 *
467 * 34 10/05/97 5:31a Chris
468 * Make AI init match ai_init_all in aimain.cpp
469 *
470 * 33 10/03/97 5:18p Chris
471 * Added OBJ_LINE as a new type
472 *
473 * 32 10/03/97 4:43p Chris
474 * added debug fvi call and object type line
475 *
476 * 31 10/01/97 7:51p Matt
477 * Added code for external rooms
478 *
479 * 30 10/01/97 12:39p Chris
480 * Added support for new physics values in generic objects
481 *
482 * 29 9/30/97 6:40p Jason
483 * got lightmap stuff sort of working with objects
484 *
485 * 28 9/30/97 1:15p Matt
486 * Made player objects other than player 0 have physics and control types
487 * of none
488 *
489 * 27 9/24/97 6:18p Samir
490 * Use script names instead of script id values to identify scripts.
491 *
492 * 26 9/22/97 6:18p Matt
493 * Removed include of stub.h
494 *
495 * 25 9/19/97 9:37p Chris
496 * Attempted to fix door collisions -- almost there, but not quite
497 *
498 * 24 9/15/97 5:21a Chris
499 * Fixed the weapon fixed rotate initialization
500 *
501 * 23 9/11/97 5:38p Jason
502 * initial door coding for room engine
503 *
504 * 22 9/10/97 3:58p Samir
505 * Initialize custom script handle to -1
506 *
507 * 21 9/05/97 1:29p Jason
508 * revamped generic object lighting
509 *
510 * 20 9/04/97 3:21p Jason
511 * added pulse timing for lit objects
512 *
513 * 19 9/03/97 6:17p Jason
514 * added code to support powerups/robots/etc that cast light
515 *
516 * 18 9/03/97 3:54p Jason
517 * got objects to cast light
518 *
519 * 17 9/03/97 2:12p Chris
520 * Added new weapon battery system and made the animation system usable.
521 *
522 * 16 8/21/97 5:56p Samir
523 * Took out script specific stuff from ObjInit and moved to ObjScript
524 *
525 * 15 8/18/97 1:42a Chris
526 * Fixed the flags = 0 bug. Remove an ASSERT that broke the debris code.
527 * Until the debris creation is changed, the assert will have to remain
528 * removed.
529 *
530 * 14 8/13/97 4:54p Matt
531 * Added destroyable flag & hitpoints
532 *
533 * 13 8/12/97 5:29p Matt
534 * Added support for clutter & building types
535 *
536 * 12 8/12/97 3:23p Samir
537 * Added code to initialize scripts for objects.
538 *
539 * 11 8/11/97 1:53p Matt
540 * Ripped out robot & powerup pages, and added generic page
541 *
542 * 10 8/07/97 4:47p Chris
543 * Massively expanded the weapon system. Not done yet.
544 *
545 * 9 8/06/97 4:33p Chris
546 * Expanded the weapons page
547 *
548 * 8 8/06/97 1:35p Matt
549 * Changes for new generic object_info struct which replace robot-specific
550 * structure
551 *
552 * 7 7/28/97 1:14p Chris
553 * Added support for sub-object visability. Plus, debris.
554 *
555 * 6 7/15/97 7:29p Chris
556 * Added a sound for helicopter blades.
557 *
558 * 5 7/15/97 5:35p Chris
559 * New AI code
560 *
561 * 4 7/15/97 4:59p Chris
562 * added support for AI and animations
563 *
564 * 10 6/30/97 5:23p Chris
565 *
566 * 9 6/25/97 9:28p Chris
567 * Added code to allow for robots that are unmovable and/or with/without
568 * AI.
569 *
570 * 8 5/15/97 6:09p Chris
571 *
572 * 7 4/24/97 5:42p Jason
573 * got fireball vclips working
574 *
575 * 6 4/16/97 11:50a Jason
576 * finally got weapons to fire
577 *
578 * 5 4/15/97 6:32p Chris
579 * Added some temporary stuff to get weapons firing.
580 *
581 * 4 4/15/97 2:28p Jason
582 * trying to get weapon firing working...it won't due to a (i think)
583 * physics bug. Checked in so Chris can have a look.
584 *
585 *
586 * 3 4/08/97 2:00a Chris
587 * Made powerups always bouncy and have unlimitted
588 * bounce. This will change as time goes on.
589 *
590 * 2 4/04/97 2:57p Matt
591 * Added code to initialize all the type-specific data for an object from
592 * the page for that object type. This means that we need to pass less
593 * info to ObjCreate(), and that we save less info in the level save file.
594 * It also makes it easy to reset all the objects when an object page has
595 * changed.
596 *
597 * 1 4/04/97 10:01a Matt
598 *
599 * $NoKeywords: $
600 */
601 #include "objinit.h"cxx . . $ `<file>/Descent3/objinit.h`/
602 #include "player.h"cxx . . $ `<file>/Descent3/player.h`/
603 #include "ship.h"cxx . . $ `<file>/Descent3/ship.h`/
604 #include "pserror.h"cxx . . $ `<file>/misc/pserror.h`/
605 #include "physics.h"cxx . . $ `<file>/physics/physics.h`/
606 #include "weapon.h"cxx . . $ `<file>/Descent3/weapon.h`/
607 #include "AIMain.h"cxx . . $ `<file>/Descent3/AIMain.h`/
608 #include "fireball.h"cxx . . $ `<file>/Descent3/fireball.h`/
609 #include "objinfo.h"cxx . . $ `<file>/Descent3/objinfo.h`/
610 #include "Mission.h"cxx . . $ `<file>/Descent3/Mission.h`/
611 #include "robotfire.h"cxx . . $ `<file>/Descent3/robotfire.h`/
612 #include "door.h"cxx . . $ `<file>/Descent3/door.h`/
613 #include "vclip.h"cxx . . $ `<file>/Descent3/vclip.h`/
614 #include "polymodel.h"cxx . . $ `<file>/model/polymodel.h`/
615 #include "robot.h"cxx . . $ `<file>/Descent3/robot.h`/
616 #include "sounds.h"cxx . . $ `<file>/Descent3/sounds.h`/
617 #include "mem.h"cxx . . $ `<file>/mem/mem.h`/
618 #include "marker.h"cxx . . $ `<file>/Descent3/marker.h`/
619 // #include <malloc.h>
620 #include <stdlib.h>
621 #include "psrand.h"cxx . . $ `<file>/misc/psrand.h`/
622 // Allocate and initialize an effect_info struct for an object
623 void ObjCreateEffectInfocxx . . $ ObjCreateEffectInfo(419c470199a90a97).(objectcxx . . $ object# *objp) {
624 if (objp->effect_infocxx . . $ object#effect_info.)
625 mem_freecxx . . $ `mem/mem.h:80:9`!(objp->effect_info);
626
627 objp->effect_infocxx . . $ object#effect_info. = (effect_info_scxx . . $ effect_info_s# *)mem_malloccxx . . $ `mem/mem.h:79:9`!(sizeof(effect_info_s));
628 memset(objp->effect_infocxx . . $ object#effect_info., 0, sizeof(effect_info_scxx . . $ effect_info_s#));
629 ASSERTcxx . . $ `misc/pserror.h:246:9`!(objp->effect_info);
630 objp->effect_infocxx . . $ object#effect_info.->sound_handlecxx . . $ effect_info_s#sound_handle. = SOUND_NONE_INDEXcxx . . $ `Descent3/sounds.h:105:9`!;
631 }
632 void ObjSetRenderPolyobjcxx . . $ ObjSetRenderPolyobj(a7790401ac9fc765).(objectcxx . . $ object# *objp, int model_num, int dying_model_num = -1);
633 #define NUM_PLAYER_ATTACH_POINTScxx . . $ `Descent3/ObjInit.cpp:633:9`! 3
634 // Initialize the polygon object information for an object
635 void ObjSetRenderPolyobjcxx . . $ ObjSetRenderPolyobj(a7790401ac9fc765).(objectcxx . . $ object# *objp, int model_num, int dying_model_num) {
636 objp->render_typecxx . . $ object#render_type. = RT_POLYOBJcxx . . $ `Descent3/object_external.h:258:9`!;
637 objp->flagscxx . . $ object#flags. |= OF_POLYGON_OBJECTcxx . . $ `Descent3/object_external.h:281:9`!;
638 polyobj_infocxx . . $ polyobj_info# *p_info = &objp->rtypecxx . . $ object#rtype..pobj_infocxx . . $ object#$anonymous_type_10#pobj_info.;
639 p_info->model_numcxx . . $ polyobj_info#model_num. = model_num;
640 p_info->dying_model_numcxx . . $ polyobj_info#dying_model_num. = dying_model_num;
641 p_info->anim_framecxx . . $ polyobj_info#anim_frame. = 0.0f;
642 p_info->tmap_overridecxx . . $ polyobj_info#tmap_override. = -1;
643 p_info->subobj_flagscxx . . $ polyobj_info#subobj_flags. = 0xFFFFFFFF;
644 p_info->multi_turret_infocxx . . $ polyobj_info#multi_turret_info..num_turretscxx . . $ multi_turret#num_turrets. = 0;
645 p_info->multi_turret_infocxx . . $ polyobj_info#multi_turret_info..keyframescxx . . $ multi_turret#keyframes. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
646 p_info->multi_turret_infocxx . . $ polyobj_info#multi_turret_info..last_keyframescxx . . $ multi_turret#last_keyframes. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
647 // Initialize attach slots
648 if (model_num != -1) {
649 poly_modelcxx . . $ poly_model# *pm = GetPolymodelPointercxx . . $ GetPolymodelPointer(ac85e77c73ebf794).(model_num); // get also pages in
650 if (objp->attach_childrencxx . . $ object#attach_children. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) {
651 mem_freecxx . . $ `mem/mem.h:80:9`!(objp->attach_children);
652 objp->attach_childrencxx . . $ object#attach_children. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
653 }
654 if ((objp->attach_childrencxx . . $ object#attach_children. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) && pm->n_attachcxx . . $ poly_model#n_attach.) {
655 objp->attach_childrencxx . . $ object#attach_children. = (int *)mem_malloccxx . . $ `mem/mem.h:79:9`!(sizeof(int) * pm->n_attach);
656 if (objp->typecxx . . $ object#type. == OBJ_PLAYERcxx . . $ `Descent3/object_external.h:164:9`!)
657 ASSERTcxx . . $ `misc/pserror.h:246:9`!(pm->n_attach >= NUM_PLAYER_ATTACH_POINTScxx . . $ `Descent3/ObjInit.cpp:633:9`!);
658 for (int i = 0; i < pm->n_attachcxx . . $ poly_model#n_attach.; i++)
659 objp->attach_childrencxx . . $ object#attach_children.[i] = OBJECT_HANDLE_NONEcxx . . $ `Descent3/object_external.h:156:9`!;
660 }
661 }
662 }
663 // Initialize a player object
664 // Returns 1 if ok, 0 if error
665 int ObjInitPlayercxx . . $ ObjInitPlayer(2da2a862cad4c994).(objectcxx . . $ object# *objp) {
666 shipcxx . . $ ship# *ship;
667 int ret = 1;
668 ASSERTcxx . . $ `misc/pserror.h:246:9`!(objp->type == OBJ_PLAYERcxx . . $ `Descent3/object_external.h:164:9`!);
669 objp->shieldscxx . . $ object#shields. = INITIAL_SHIELDScxx . . $ `Descent3/player_external.h:69:9`!;
670 ship = &Shipscxx . . $ Ships.[Playerscxx . . $ Players.[objp->idcxx . . $ object#id.].ship_indexcxx . . $ player#ship_index.];
671 if (!ship->usedcxx . . $ ship#used.) { // this ship doesn't exist
672 int new_ship;
673 Int3cxx . . $ `misc/pserror.h:247:9`!();
674 ret = 0;
675 new_ship = GetNextShipcxx . . $ GetNextShip(7864480464b09eea).(0);
676 ASSERTcxx . . $ `misc/pserror.h:246:9`!(new_ship != -1);
677 Playerscxx . . $ Players.[objp->idcxx . . $ object#id.].ship_indexcxx . . $ player#ship_index. = new_ship;
678 ship = &Shipscxx . . $ Ships.[Playerscxx . . $ Players.[objp->idcxx . . $ object#id.].ship_indexcxx . . $ player#ship_index.];
679 }
680 // Set up render info
681 ObjSetRenderPolyobjcxx . . $ ObjSetRenderPolyobj(a7790401ac9fc765).(objp, ship->model_handlecxx . . $ ship#model_handle., ship->dying_model_handlecxx . . $ ship#dying_model_handle.);
682 ASSERTcxx . . $ `misc/pserror.h:246:9`!(Poly_models[ship->model_handle].n_attach >= 3);
683 objp->lighting_render_typecxx . . $ object#lighting_render_type. = LRT_GOURAUDcxx . . $ `Descent3/object.h:650:9`!;
684 objp->lm_objectcxx . . $ object#lm_object..usedcxx . . $ lightmap_object#used. = 0;
685 // Page in those models
686 PageInPolymodelcxx . . $ PageInPolymodel(726816c99d57134).(ship->model_handlecxx . . $ ship#model_handle., OBJ_PLAYERcxx . . $ `Descent3/object_external.h:164:9`!, &ship->sizecxx . . $ ship#size.);
687 if (ship->dying_model_handlecxx . . $ ship#dying_model_handle. >= 0)
688 PageInPolymodelcxx . . $ PageInPolymodel(726816c99d57134).(ship->dying_model_handlecxx . . $ ship#dying_model_handle.);
689 if (ship->lo_render_handlecxx . . $ ship#lo_render_handle. >= 0)
690 PageInPolymodelcxx . . $ PageInPolymodel(726816c99d57134).(ship->lo_render_handlecxx . . $ ship#lo_render_handle.);
691 if (ship->med_render_handlecxx . . $ ship#med_render_handle. >= 0)
692 PageInPolymodelcxx . . $ PageInPolymodel(726816c99d57134).(ship->med_render_handlecxx . . $ ship#med_render_handle.);
693 // Set size
694 objp->sizecxx . . $ object#size. = ship->sizecxx . . $ ship#size.;
695 // Set up control info. The player flies, other players do nothing
696 // MUST be after paging in polymodel cause SetObjectControlType does some
697 // stuff with the object's polymodel.
698 if (objp->idcxx . . $ object#id. == Player_numcxx . . $ Player_num.) {
699 SetObjectControlTypecxx . . $ SetObjectControlType(766a1b7183ffa4b4).(objp, CT_FLYINGcxx . . $ `Descent3/object_external.h:219:9`!);
700 objp->movement_typecxx . . $ object#movement_type. = MT_PHYSICScxx . . $ `Descent3/object_external.h:234:9`!;
701 objp->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info. =cxx . . $ physics_info#`operator=`(fa4a94890b261b64). ship->phys_infocxx . . $ ship#phys_info.;
702 Player_objectcxx . . $ Player_object. = objp;
703 } else {
704 SetObjectControlTypecxx . . $ SetObjectControlType(766a1b7183ffa4b4).(objp, CT_NONEcxx . . $ `Descent3/object_external.h:216:9`!);
705 objp->movement_typecxx . . $ object#movement_type. = MT_NONEcxx . . $ `Descent3/object_external.h:233:9`!;
706 objp->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info. =cxx . . $ physics_info#`operator=`(fa4a94890b261b64). ship->phys_infocxx . . $ ship#phys_info.;
707 objp->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..flagscxx . . $ physics_info#flags. = PF_FIXED_VELOCITYcxx . . $ `Descent3/object_external.h:324:9`!;
708 }
709 // Set up physics info
710 // These are always set for a player
711 objp->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..num_bouncescxx . . $ physics_info#num_bounces. = PHYSICS_UNLIMITED_BOUNCEcxx . . $ `physics/physics.h:81:9`!;
712 if (objp->dynamic_wbcxx . . $ object#dynamic_wb. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) {
713 objp->dynamic_wbcxx . . $ object#dynamic_wb. = (dynamic_wb_infocxx . . $ dynamic_wb_info# *)mem_malloccxx . . $ `mem/mem.h:79:9`!(sizeof(dynamic_wb_info) * MAX_WBS_PER_OBJcxx . . $ `lib/robotfirestruct.h:32:9`!);
714 }
715 WBClearInfocxx . . $ WBClearInfo(419c470199a90a97).(objp);
716 // Set a few misc things
717 Playerscxx . . $ Players.[objp->idcxx . . $ object#id.].teamcxx . . $ player#team. = objp->idcxx . . $ object#id. % 2;
718 ObjCreateEffectInfocxx . . $ ObjCreateEffectInfo(419c470199a90a97).(objp);
719 objp->effect_infocxx . . $ object#effect_info.->type_flagscxx . . $ effect_info_s#type_flags. = EF_VOLUME_LITcxx . . $ `Descent3/object_external.h:201:9`!;
720
721 return ret;
722 }
723 // Initialize a generic object (robot, powerup, building, etc.)
724 // Returns 1 if ok, 0 if error
725 int ObjInitGenericcxx . . $ ObjInitGeneric(d27f719725f38807).(objectcxx . . $ object# *objp, bool reinit) {
726 object_infocxx . . $ object_info# *obj_info;
727 int ret = 1;
728 float r_val = (float)ps_randcxx . . $ ps_rand(b126dc7c1de90089).() / (float)D3_RAND_MAXcxx . . $ `misc/psrand.h:41:9`!;
729 if ((objp->idcxx . . $ object#id. < 0) || (objp->idcxx . . $ object#id. >= MAX_OBJECT_IDScxx . . $ `Descent3/objinfo.h:327:9`!)) {
730 Int3cxx . . $ `misc/pserror.h:247:9`!();
731 return 0;
732 }
733 obj_info = &Object_infocxx . . $ Object_info.[objp->idcxx . . $ object#id.];
734 // Deal with deleted type
735 if (obj_info->typecxx . . $ object_info#type. == OBJ_NONEcxx . . $ `Descent3/object_external.h:159:9`!) {
736 int i;
737 for (i = 0, obj_info = Object_infocxx . . $ Object_info.; i < MAX_OBJECT_IDScxx . . $ `Descent3/objinfo.h:327:9`!; i++, obj_info) { // find other object of same type
738 if (Object_infocxx . . $ Object_info.[i].typecxx . . $ object_info#type. == objp->typecxx . . $ object#type.)
739 break;
740 }
741 ASSERTcxx . . $ `misc/pserror.h:246:9`!(i < MAX_OBJECT_IDScxx . . $ `Descent3/objinfo.h:327:9`!); // There should (in real life) always be at least one of each type
742 #ifdef EDITOR
743 if (GetFunctionMode() == EDITOR_MODE)
744 OutrageMessageBox("Object %d (\"%s\") had ID %d which no longer exists. Changing to %d, \"%s\".", OBJNUM(objp),
745 objp->name ? objp->name : "<no name>", objp->id, i, obj_info->name);
746 #endif
747 }
748 if (obj_info->typecxx . . $ object_info#type. != objp->typecxx . . $ object#type.) {
749 #ifdef EDITOR
750 if (GetFunctionMode() == EDITOR_MODE)
751 OutrageMessageBox("Object %d (\"%s\"), type name \"%s\", changed from type %s to %s", OBJNUM(objp),
752 objp->name ? objp->name : "<no name>", obj_info->name, Object_type_names[objp->type],
753 Object_type_names[obj_info->type]);
754 #endif
755 objp->typecxx . . $ object#type. = obj_info->typecxx . . $ object_info#type.;
756 }
757 // Set size & shields
758 objp->shieldscxx . . $ object#shields. = obj_info->hit_pointscxx . . $ object_info#hit_points.;
759 // Set impact stuff for non-weapons
760 objp->impact_sizecxx . . $ object#impact_size. = obj_info->impact_sizecxx . . $ object_info#impact_size.;
761 objp->impact_timecxx . . $ object#impact_time. = obj_info->impact_timecxx . . $ object_info#impact_time.;
762 objp->impact_player_damagecxx . . $ object#impact_player_damage. = obj_info->damagecxx . . $ object_info#damage.;
763 objp->impact_generic_damagecxx . . $ object#impact_generic_damage. = obj_info->damagecxx . . $ object_info#damage.;
764 objp->impact_forcecxx . . $ object#impact_force. = obj_info->damagecxx . . $ object_info#damage. * 50.0;
765 // Set flags
766 if (obj_info->flagscxx . . $ object_info#flags. & OIF_DESTROYABLEcxx . . $ `Descent3/objinfo.h:335:9`!)
767 objp->flagscxx . . $ object#flags. |= OF_DESTROYABLEcxx . . $ `Descent3/object_external.h:279:9`!;
768 if (obj_info->flagscxx . . $ object_info#flags. & OIF_AI_SCRIPTED_DEATHcxx . . $ `Descent3/objinfo.h:341:9`!)
769 objp->flagscxx . . $ object#flags. |= OF_AI_DO_DEATHcxx . . $ `Descent3/object_external.h:275:9`!;
770 if (obj_info->flagscxx . . $ object_info#flags. & OIF_DO_CEILING_CHECKcxx . . $ `Descent3/objinfo.h:342:9`!)
771 objp->flagscxx . . $ object#flags. |= OF_FORCE_CEILING_CHECKcxx . . $ `Descent3/object_external.h:269:9`!;
772 // Set up movement info
773 if (obj_info->flagscxx . . $ object_info#flags. & OIF_USES_PHYSICScxx . . $ `Descent3/objinfo.h:334:9`!) {
774 objp->movement_typecxx . . $ object#movement_type. = MT_PHYSICScxx . . $ `Descent3/object_external.h:234:9`!;
775 // Setup some physics things
776 objp->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info. =cxx . . $ physics_info#`operator=`(fa4a94890b261b64). obj_info->phys_infocxx . . $ object_info#phys_info.; // Set the initial velocity
777 // Warn about initial velocity & rotvel
778 if (obj_info->phys_infocxx . . $ object_info#phys_info..velocitycxx . . $ physics_info#velocity..zcxx . . $ vector#z. > 0.0)
779 Int3cxx . . $ `misc/pserror.h:247:9`!(); // Warning: This object has an initial velocity. This is not supported.
780 // If your object does not need an initial velocity, set it to zero on
781 // the page. If you do need an initial velocity, someone will have to
782 // add code to deal with it, perhaps here or perhaps at level start.
783 } else
784 objp->movement_typecxx . . $ object#movement_type. = MT_NONEcxx . . $ `Descent3/object_external.h:233:9`!;
785
786 // Set up render info
787 ObjSetRenderPolyobjcxx . . $ ObjSetRenderPolyobj(a7790401ac9fc765).(objp, obj_info->render_handlecxx . . $ object_info#render_handle.);
788 PageInPolymodelcxx . . $ PageInPolymodel(726816c99d57134).(obj_info->render_handlecxx . . $ object_info#render_handle., objp->typecxx . . $ object#type., &obj_info->sizecxx . . $ object_info#size.);
789 objp->sizecxx . . $ object#size. = obj_info->sizecxx . . $ object_info#size.;
790
791 // Page in low-res models
792 if (obj_info->lo_render_handlecxx . . $ object_info#lo_render_handle. != -1)
793 PageInPolymodelcxx . . $ PageInPolymodel(726816c99d57134).(obj_info->lo_render_handlecxx . . $ object_info#lo_render_handle.);
794 if (obj_info->med_render_handlecxx . . $ object_info#med_render_handle. != -1)
795 PageInPolymodelcxx . . $ PageInPolymodel(726816c99d57134).(obj_info->med_render_handlecxx . . $ object_info#med_render_handle.);
796
797 // Set anim frame
798 if (Object_infocxx . . $ Object_info.[objp->idcxx . . $ object#id.].animcxx . . $ object_info#anim.) {
799 objp->rtypecxx . . $ object#rtype..pobj_infocxx . . $ object#$anonymous_type_10#pobj_info..anim_framecxx . . $ polyobj_info#anim_frame. =
800 ((1.0f - r_val) * (float)Object_infocxx . . $ Object_info.[objp->idcxx . . $ object#id.].animcxx . . $ object_info#anim.[MC_STANDINGcxx . . $ `Descent3/object_external.h:245:9`!].elemcxx . . $ anim_elem#elem.[AS_ALERTcxx . . $ `Descent3/aistruct_external.h:409:9`!].fromcxx . . $ anim_entry#from.) +
801 (r_val * (float)Object_infocxx . . $ Object_info.[objp->idcxx . . $ object#id.].animcxx . . $ object_info#anim.[MC_STANDINGcxx . . $ `Descent3/object_external.h:245:9`!].elemcxx . . $ anim_elem#elem.[AS_ALERTcxx . . $ `Descent3/aistruct_external.h:409:9`!].tocxx . . $ anim_entry#to.);
802 } else {
803 objp->rtypecxx . . $ object#rtype..pobj_infocxx . . $ object#$anonymous_type_10#pobj_info..anim_framecxx . . $ polyobj_info#anim_frame. = 0.0f;
804 }
805
806 // Set up control info (must be after wb stuff)
807 if (obj_info->ai_infocxx . . $ object_info#ai_info. && obj_info->flagscxx . . $ object_info#flags. & OIF_CONTROL_AIcxx . . $ `Descent3/objinfo.h:333:9`!) // DAJ 12/18/99 added check for ai_info
808 {
809 SetObjectControlTypecxx . . $ SetObjectControlType(766a1b7183ffa4b4).(objp, CT_AIcxx . . $ `Descent3/object_external.h:217:9`!);
810 AIInitcxx . . $ AIInit(cc53779520928514).(objp, obj_info->ai_infocxx . . $ object_info#ai_info.->ai_classcxx . . $ t_ai_info#ai_class., obj_info->ai_infocxx . . $ object_info#ai_info.->ai_typecxx . . $ t_ai_info#ai_type., obj_info->ai_infocxx . . $ object_info#ai_info.->movement_typecxx . . $ t_ai_info#movement_type.);
811 } else
812 SetObjectControlTypecxx . . $ SetObjectControlType(766a1b7183ffa4b4).(objp, CT_NONEcxx . . $ `Descent3/object_external.h:216:9`!);
813 if (objp->control_typecxx . . $ object#control_type. == CT_AIcxx . . $ `Descent3/object_external.h:217:9`!) {
814 poly_modelcxx . . $ poly_model# *pm = &Poly_modelscxx . . $ Poly_models.[objp->rtypecxx . . $ object#rtype..pobj_infocxx . . $ object#$anonymous_type_10#pobj_info..model_numcxx . . $ polyobj_info#model_num.];
815 int num_wbs = pm->num_wbscxx . . $ poly_model#num_wbs.;
816
817 if ((objp->dynamic_wbcxx . . $ object#dynamic_wb. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) && ((uint32_tcxx . . $ uint32_t#)num_wbs != mem_sizecxx . . $ `mem/mem.h:82:9`!(objp->dynamic_wb) / sizeof(dynamic_wb_infocxx . . $ dynamic_wb_info#)))
818 {
819 mem_freecxx . . $ `mem/mem.h:80:9`!(objp->dynamic_wb);
820 objp->dynamic_wbcxx . . $ object#dynamic_wb. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
821 }
822 if ((objp->dynamic_wbcxx . . $ object#dynamic_wb. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) && num_wbs) {
823 objp->dynamic_wbcxx . . $ object#dynamic_wb. = (dynamic_wb_infocxx . . $ dynamic_wb_info# *)mem_malloccxx . . $ `mem/mem.h:79:9`!(sizeof(dynamic_wb_info) * num_wbs);
824 }
825 // Setup the weapon batteries (must be after polymodel stuff)
826 WBClearInfocxx . . $ WBClearInfo(419c470199a90a97).(objp);
827 }
828 objp->lighting_render_typecxx . . $ object#lighting_render_type. = obj_info->lighting_infocxx . . $ object_info#lighting_info..lighting_render_typecxx . . $ light_info#lighting_render_type.;
829 if (!reinit)
830 objp->lm_objectcxx . . $ object#lm_object..usedcxx . . $ lightmap_object#used. = 0;
831 // Allocate effect memory
832 ObjCreateEffectInfocxx . . $ ObjCreateEffectInfo(419c470199a90a97).(objp);
833
834 if (objp->typecxx . . $ object#type. != OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!)
835 objp->effect_infocxx . . $ object#effect_info.->type_flagscxx . . $ effect_info_s#type_flags. = EF_VOLUME_LITcxx . . $ `Descent3/object_external.h:201:9`!;
836 if (objp->movement_typecxx . . $ object#movement_type. == MT_PHYSICScxx . . $ `Descent3/object_external.h:234:9`!) {
837 if (objp->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..rotdragcxx . . $ physics_info#rotdrag. < 60.0f)
838 objp->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..rotdragcxx . . $ physics_info#rotdrag. = 60.0; // CHRISHACK - MAKES SURE ROBOTS DONT SPIN FOREVER
839 }
840
841 // Set ammo amounts for powerups
842 if (objp->typecxx . . $ object#type. == OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!) {
843 if (objp->control_typecxx . . $ object#control_type. == CT_NONEcxx . . $ `Descent3/object_external.h:216:9`!) { // some powerups have AI; don't mess with them
844 SetObjectControlTypecxx . . $ SetObjectControlType(766a1b7183ffa4b4).(objp, CT_POWERUPcxx . . $ `Descent3/object_external.h:224:9`!);
845 objp->ctypecxx . . $ object#ctype..powerup_infocxx . . $ object#$anonymous_type_9#powerup_info..countcxx . . $ powerup_info_s#count. = obj_info->ammo_countcxx . . $ object_info#ammo_count.;
846 }
847 }
848 // Clear wiggle flag to supersede those pesky designer errors!
849 objp->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..flagscxx . . $ physics_info#flags. &= ~PF_WIGGLEcxx . . $ `Descent3/object_external.h:316:9`!;
850 return ret;
851 }
852 int ObjInitDebriscxx . . $ ObjInitDebris(2da2a862cad4c994).(objectcxx . . $ object# *objp) {
853 ASSERTcxx . . $ `misc/pserror.h:246:9`!(objp->type == OBJ_DEBRIScxx . . $ `Descent3/object_external.h:168:9`!);
854 objp->movement_typecxx . . $ object#movement_type. = MT_PHYSICScxx . . $ `Descent3/object_external.h:234:9`!;
855 SetObjectControlTypecxx . . $ SetObjectControlType(766a1b7183ffa4b4).(objp, CT_DEBRIScxx . . $ `Descent3/object_external.h:223:9`!);
856 objp->lifeleftcxx . . $ object#lifeleft. = DEBRIS_LIFEcxx . . $ `Descent3/fireball.h:161:9`!;
857 objp->flagscxx . . $ object#flags. |= OF_USES_LIFELEFTcxx . . $ `Descent3/object_external.h:276:9`!;
858 objp->ctypecxx . . $ object#ctype..debris_infocxx . . $ object#$anonymous_type_9#debris_info..death_flagscxx . . $ debris_info_s#death_flags. = 0;
859 // Set up render info
860 ObjSetRenderPolyobjcxx . . $ ObjSetRenderPolyobj(a7790401ac9fc765).(objp, -1);
861 objp->lighting_render_typecxx . . $ object#lighting_render_type. = LRT_GOURAUDcxx . . $ `Descent3/object.h:650:9`!;
862 objp->lm_objectcxx . . $ object#lm_object..usedcxx . . $ lightmap_object#used. = 0;
863 // Allocate effect memory
864 ObjCreateEffectInfocxx . . $ ObjCreateEffectInfo(419c470199a90a97).(objp);
865
866 objp->effect_infocxx . . $ object#effect_info.->type_flagscxx . . $ effect_info_s#type_flags. = EF_VOLUME_LITcxx . . $ `Descent3/object_external.h:201:9`!;
867
868 return 1;
869 }
870 int ObjInitShardcxx . . $ ObjInitShard(2da2a862cad4c994).(objectcxx . . $ object# *objp) {
871 ASSERTcxx . . $ `misc/pserror.h:246:9`!(objp->type == OBJ_SHARDcxx . . $ `Descent3/object_external.h:163:9`!);
872 objp->movement_typecxx . . $ object#movement_type. = MT_PHYSICScxx . . $ `Descent3/object_external.h:234:9`!;
873 SetObjectControlTypecxx . . $ SetObjectControlType(766a1b7183ffa4b4).(objp, CT_NONEcxx . . $ `Descent3/object_external.h:216:9`!);
874 objp->lifeleftcxx . . $ object#lifeleft. = DEBRIS_LIFEcxx . . $ `Descent3/fireball.h:161:9`! * 5;
875 objp->flagscxx . . $ object#flags. |= OF_USES_LIFELEFTcxx . . $ `Descent3/object_external.h:276:9`!;
876 // Set physics info
877 objp->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..flagscxx . . $ physics_info#flags. = PF_GRAVITYcxx . . $ `Descent3/object_external.h:320:9`! + PF_BOUNCEcxx . . $ `Descent3/object_external.h:315:9`!;
878 objp->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..masscxx . . $ physics_info#mass. = 1.0;
879 objp->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..dragcxx . . $ physics_info#drag. = 0.0001f;
880 objp->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..coeff_restitutioncxx . . $ physics_info#coeff_restitution. = 0.3f;
881 objp->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..num_bouncescxx . . $ physics_info#num_bounces. = 0;
882
883 // Set up render info
884 objp->render_typecxx . . $ object#render_type. = RT_SHARDcxx . . $ `Descent3/object_external.h:266:9`!;
885 return 1;
886 }
887 #ifdef _DEBUGcxx . . $ `<built-in>:482:9`!
888 int ObjInitLinecxx . . $ ObjInitLine(2da2a862cad4c994).(objectcxx . . $ object# *objp) {
889 ASSERTcxx . . $ `misc/pserror.h:246:9`!(objp->type == OBJ_DEBUG_LINEcxx . . $ `Descent3/object_external.h:183:9`!);
890 objp->movement_typecxx . . $ object#movement_type. = MT_NONEcxx . . $ `Descent3/object_external.h:233:9`!;
891 SetObjectControlTypecxx . . $ SetObjectControlType(766a1b7183ffa4b4).(objp, CT_NONEcxx . . $ `Descent3/object_external.h:216:9`!);
892 objp->render_typecxx . . $ object#render_type. = RT_LINEcxx . . $ `Descent3/object_external.h:261:9`!;
893 return 1;
894 }
895 #endif
896 // Initialize a camera
897 // Returns 1 if ok, 0 if error
898 int ObjInitCameracxx . . $ ObjInitCamera(2da2a862cad4c994).(objectcxx . . $ object# *objp) {
899 // Set size & shields
900 objp->sizecxx . . $ object#size. = 0.5;
901 objp->shieldscxx . . $ object#shields. = 0;
902 // Set up various info
903 SetObjectControlTypecxx . . $ SetObjectControlType(766a1b7183ffa4b4).(objp, CT_NONEcxx . . $ `Descent3/object_external.h:216:9`!);
904 objp->movement_typecxx . . $ object#movement_type. = MT_NONEcxx . . $ `Descent3/object_external.h:233:9`!;
905 objp->lm_objectcxx . . $ object#lm_object..usedcxx . . $ lightmap_object#used. = 0;
906 #ifdef EDITOR
907 objp->render_type = RT_EDITOR_SPHERE; // draw cameras as spheres in the editor
908 objp->rtype.sphere_color = GR_RGB(255, 255, 0);
909 #else
910 objp->render_typecxx . . $ object#render_type. = RT_NONEcxx . . $ `Descent3/object_external.h:257:9`!;
911 #endif
912 return 1;
913 }
914 // Initialize a sound object
915 // Returns 1 if ok, 0 if error
916 int ObjInitSoundSourcecxx . . $ ObjInitSoundSource(2da2a862cad4c994).(objectcxx . . $ object# *objp) {
917 // Set size & shields
918 objp->sizecxx . . $ object#size. = 0.5;
919 objp->shieldscxx . . $ object#shields. = 0;
920 // Set up various info
921 SetObjectControlTypecxx . . $ SetObjectControlType(766a1b7183ffa4b4).(objp, CT_SOUNDSOURCEcxx . . $ `Descent3/object_external.h:228:9`!);
922 objp->movement_typecxx . . $ object#movement_type. = MT_NONEcxx . . $ `Descent3/object_external.h:233:9`!;
923 objp->lm_objectcxx . . $ object#lm_object..usedcxx . . $ lightmap_object#used. = 0;
924 #ifdef EDITOR
925 objp->render_type = RT_EDITOR_SPHERE; // draw cameras as spheres in the editor
926 objp->rtype.sphere_color = GR_RGB(0, 255, 0);
927 #else
928 objp->render_typecxx . . $ object#render_type. = RT_NONEcxx . . $ `Descent3/object_external.h:257:9`!;
929 #endif
930 return 1;
931 }
932 // Initialize a waypoint object
933 // Returns 1 if ok, 0 if error
934 int ObjInitWaypointcxx . . $ ObjInitWaypoint(2da2a862cad4c994).(objectcxx . . $ object# *objp) {
935 // Set size & shields
936 objp->sizecxx . . $ object#size. = 0.5;
937 objp->shieldscxx . . $ object#shields. = 0;
938 // Set up various info
939 SetObjectControlTypecxx . . $ SetObjectControlType(766a1b7183ffa4b4).(objp, CT_NONEcxx . . $ `Descent3/object_external.h:216:9`!);
940 objp->movement_typecxx . . $ object#movement_type. = MT_NONEcxx . . $ `Descent3/object_external.h:233:9`!;
941 objp->lm_objectcxx . . $ object#lm_object..usedcxx . . $ lightmap_object#used. = 0;
942 #ifdef EDITOR
943 objp->render_type = RT_EDITOR_SPHERE; // draw cameras as spheres in the editor
944 objp->rtype.sphere_color = GR_RGB(255, 130, 33);
945 #else
946 objp->render_typecxx . . $ object#render_type. = RT_NONEcxx . . $ `Descent3/object_external.h:257:9`!;
947 #endif
948 return 1;
949 }
950 // Initialize an editor viewer object
951 // Returns 1 if ok, 0 if error
952 int ObjInitViewercxx . . $ ObjInitViewer(2da2a862cad4c994).(objectcxx . . $ object# *objp) {
953 // Set size & shields
954 objp->sizecxx . . $ object#size. = 5.0;
955 objp->shieldscxx . . $ object#shields. = 0;
956 // Set up various info
957 SetObjectControlTypecxx . . $ SetObjectControlType(766a1b7183ffa4b4).(objp, CT_NONEcxx . . $ `Descent3/object_external.h:216:9`!);
958 objp->movement_typecxx . . $ object#movement_type. = MT_NONEcxx . . $ `Descent3/object_external.h:233:9`!;
959 objp->render_typecxx . . $ object#render_type. = RT_NONEcxx . . $ `Descent3/object_external.h:257:9`!;
960 objp->lm_objectcxx . . $ object#lm_object..usedcxx . . $ lightmap_object#used. = 0;
961 return 1;
962 }
963 // Initialize a weapon
964 // Returns 1 if ok, 0 if error
965 int ObjInitWeaponcxx . . $ ObjInitWeapon(2da2a862cad4c994).(objectcxx . . $ object# *objp) {
966 weaponcxx . . $ weapon# *weap;
967 int ret = 1;
968 ASSERTcxx . . $ `misc/pserror.h:246:9`!(objp->type == OBJ_WEAPONcxx . . $ `Descent3/object_external.h:165:9`!);
969
970 if (objp->idcxx . . $ object#id. < 0 || objp->idcxx . . $ object#id. >= MAX_WEAPONScxx . . $ `Descent3/weapon.h:208:9`!)
971 return 0;
972
973 weap = &Weaponscxx . . $ Weapons.[objp->idcxx . . $ object#id.];
974 ASSERTcxx . . $ `misc/pserror.h:246:9`!(weap->used > 0);
975 // Set up shields
976 objp->shieldscxx . . $ object#shields. = 0;
977 // Set up control info
978 SetObjectControlTypecxx . . $ SetObjectControlType(766a1b7183ffa4b4).(objp, CT_WEAPONcxx . . $ `Descent3/object_external.h:222:9`!);
979 // Not tracking anything
980 objp->ctypecxx . . $ object#ctype..laser_infocxx . . $ object#$anonymous_type_9#laser_info..track_handlecxx . . $ laser_info_s#track_handle. = OBJECT_HANDLE_NONEcxx . . $ `Descent3/object_external.h:156:9`!;
981 // Set up physics info
982 objp->movement_typecxx . . $ object#movement_type. = MT_PHYSICScxx . . $ `Descent3/object_external.h:234:9`!;
983 objp->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..masscxx . . $ physics_info#mass. = weap->phys_infocxx . . $ weapon#phys_info..masscxx . . $ physics_info#mass.;
984 objp->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..dragcxx . . $ physics_info#drag. = weap->phys_infocxx . . $ weapon#phys_info..dragcxx . . $ physics_info#drag.;
985 objp->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..rotdragcxx . . $ physics_info#rotdrag. = weap->phys_infocxx . . $ weapon#phys_info..rotdragcxx . . $ physics_info#rotdrag.;
986 objp->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..flagscxx . . $ physics_info#flags. = weap->phys_infocxx . . $ weapon#phys_info..flagscxx . . $ physics_info#flags.;
987
988 objp->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..full_rotthrustcxx . . $ physics_info#$anonymous_type_4#full_rotthrust. = weap->phys_infocxx . . $ weapon#phys_info..full_rotthrustcxx . . $ physics_info#$anonymous_type_4#full_rotthrust.;
989 objp->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..full_thrustcxx . . $ physics_info#$anonymous_type_3#full_thrust. = weap->phys_infocxx . . $ weapon#phys_info..full_thrustcxx . . $ physics_info#$anonymous_type_3#full_thrust.;
990 objp->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..rotvelcxx . . $ physics_info#$anonymous_type_1#rotvel. =cxx . . $ vector#`operator=`(a48bc7e93a8dae5e). weap->phys_infocxx . . $ weapon#phys_info..rotvelcxx . . $ physics_info#$anonymous_type_1#rotvel.;
991 // objp->mtype.phys_info.rot_thrust = weap->phys_info.full_rot_thrust;
992 objp->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..wiggle_amplitudecxx . . $ physics_info#wiggle_amplitude. = weap->phys_infocxx . . $ weapon#phys_info..wiggle_amplitudecxx . . $ physics_info#wiggle_amplitude.;
993 objp->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..wiggles_per_seccxx . . $ physics_info#wiggles_per_sec. = weap->phys_infocxx . . $ weapon#phys_info..wiggles_per_seccxx . . $ physics_info#wiggles_per_sec.;
994 objp->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..num_bouncescxx . . $ physics_info#num_bounces. = weap->phys_infocxx . . $ weapon#phys_info..num_bouncescxx . . $ physics_info#num_bounces.;
995 objp->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..coeff_restitutioncxx . . $ physics_info#coeff_restitution. = weap->phys_infocxx . . $ weapon#phys_info..coeff_restitutioncxx . . $ physics_info#coeff_restitution.;
996 objp->lifeleftcxx . . $ object#lifeleft. = weap->life_timecxx . . $ weapon#life_time.;
997 objp->lifetimecxx . . $ object#lifetime. = weap->life_timecxx . . $ weapon#life_time.;
998 objp->ctypecxx . . $ object#ctype..laser_infocxx . . $ object#$anonymous_type_9#laser_info..thrust_leftcxx . . $ laser_info_s#thrust_left. = weap->thrust_timecxx . . $ weapon#thrust_time.;
999 objp->ctypecxx . . $ object#ctype..laser_infocxx . . $ object#$anonymous_type_9#laser_info..last_drop_timecxx . . $ laser_info_s#last_drop_time. = 0;
1000 objp->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..hit_die_dotcxx . . $ physics_info#$anonymous_type_5#hit_die_dot. = weap->phys_infocxx . . $ weapon#phys_info..hit_die_dotcxx . . $ physics_info#$anonymous_type_5#hit_die_dot.;
1001 // Set impact stuff
1002 objp->impact_sizecxx . . $ object#impact_size. = weap->impact_sizecxx . . $ weapon#impact_size.;
1003 objp->impact_timecxx . . $ object#impact_time. = weap->impact_timecxx . . $ weapon#impact_time.;
1004 objp->impact_player_damagecxx . . $ object#impact_player_damage. = weap->impact_player_damagecxx . . $ weapon#impact_player_damage.;
1005 objp->impact_generic_damagecxx . . $ object#impact_generic_damage. = weap->impact_generic_damagecxx . . $ weapon#impact_generic_damage.;
1006 objp->impact_forcecxx . . $ object#impact_force. = weap->impact_forcecxx . . $ weapon#impact_force.;
1007 // Set up a few flags
1008 objp->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..flagscxx . . $ physics_info#flags. |= PF_NO_COLLIDE_PARENTcxx . . $ `Descent3/object_external.h:326:9`!;
1009 objp->flagscxx . . $ object#flags. |= OF_USES_LIFELEFTcxx . . $ `Descent3/object_external.h:276:9`!;
1010 // Set up rendering info
1011 objp->render_typecxx . . $ object#render_type. = RT_WEAPONcxx . . $ `Descent3/object_external.h:260:9`!;
1012
1013 if (!((weap->flagscxx . . $ weapon#flags. & WF_IMAGE_BITMAPcxx . . $ `Descent3/weapon.h:219:9`!) || (weap->flagscxx . . $ weapon#flags. & WF_IMAGE_VCLIPcxx . . $ `Descent3/weapon.h:223:9`!))) {
1014 objp->rtypecxx . . $ object#rtype..pobj_infocxx . . $ object#$anonymous_type_10#pobj_info..model_numcxx . . $ polyobj_info#model_num. = weap->fire_image_handlecxx . . $ weapon#fire_image_handle.;
1015 objp->rtypecxx . . $ object#rtype..pobj_infocxx . . $ object#$anonymous_type_10#pobj_info..dying_model_numcxx . . $ polyobj_info#dying_model_num. = -1;
1016 PageInPolymodelcxx . . $ PageInPolymodel(726816c99d57134).(weap->fire_image_handlecxx . . $ weapon#fire_image_handle., OBJ_WEAPONcxx . . $ `Descent3/object_external.h:165:9`!, &weap->sizecxx . . $ weapon#size.);
1017
1018 objp->rtypecxx . . $ object#rtype..pobj_infocxx . . $ object#$anonymous_type_10#pobj_info..subobj_flagscxx . . $ polyobj_info#subobj_flags. = 0xFFFFFFFF;
1019 objp->flagscxx . . $ object#flags. |= OF_POLYGON_OBJECTcxx . . $ `Descent3/object_external.h:281:9`!;
1020 } else if (weap->flagscxx . . $ weapon#flags. & WF_IMAGE_VCLIPcxx . . $ `Descent3/weapon.h:223:9`!) {
1021 PageInVClipcxx . . $ PageInVClip(d4f767463ce0a6b3).(weap->fire_image_handlecxx . . $ weapon#fire_image_handle.);
1022 }
1023
1024 objp->sizecxx . . $ object#size. = weap->sizecxx . . $ weapon#size.;
1025 objp->ctypecxx . . $ object#ctype..laser_infocxx . . $ object#$anonymous_type_9#laser_info..hit_statuscxx . . $ laser_info_s#hit_status. = WPC_NOT_USEDcxx . . $ `Descent3/object.h:657:9`!;
1026 if (weap->flagscxx . . $ weapon#flags. & WF_CUSTOM_SIZEcxx . . $ `Descent3/weapon.h:249:9`!) {
1027 objp->sizecxx . . $ object#size. = weap->custom_sizecxx . . $ weapon#custom_size.;
1028 }
1029 objp->lighting_render_typecxx . . $ object#lighting_render_type. = LRT_STATICcxx . . $ `Descent3/object.h:649:9`!;
1030 objp->lm_objectcxx . . $ object#lm_object..usedcxx . . $ lightmap_object#used. = 0;
1031
1032 return ret;
1033 }
1034 int ObjInitFireballcxx . . $ ObjInitFireball(2da2a862cad4c994).(objectcxx . . $ object# *objp) {
1035 int ret = 1;
1036 ASSERTcxx . . $ `misc/pserror.h:246:9`!(objp->type == OBJ_FIREBALLcxx . . $ `Descent3/object_external.h:161:9`!);
1037 // Set size & shields
1038 objp->shieldscxx . . $ object#shields. = 0;
1039 objp->sizecxx . . $ object#size. = 0;
1040 // Set up control info
1041 SetObjectControlTypecxx . . $ SetObjectControlType(766a1b7183ffa4b4).(objp, CT_EXPLOSIONcxx . . $ `Descent3/object_external.h:218:9`!);
1042 // Set up physics info
1043 objp->movement_typecxx . . $ object#movement_type. = MT_NONEcxx . . $ `Descent3/object_external.h:233:9`!;
1044 objp->mtypecxx . . $ object#mtype..phys_infocxx . . $ object#$anonymous_type_8#phys_info..num_bouncescxx . . $ physics_info#num_bounces. = PHYSICS_UNLIMITED_BOUNCEcxx . . $ `physics/physics.h:81:9`!;
1045
1046 // Set up render info
1047 objp->render_typecxx . . $ object#render_type. = RT_FIREBALLcxx . . $ `Descent3/object_external.h:259:9`!;
1048 objp->sizecxx . . $ object#size. = Fireballscxx . . $ Fireballs.[objp->idcxx . . $ object#id.].sizecxx . . $ fireball#size.;
1049 objp->flagscxx . . $ object#flags. |= OF_USES_LIFELEFTcxx . . $ `Descent3/object_external.h:276:9`!;
1050 objp->lifeleftcxx . . $ object#lifeleft. = Fireballscxx . . $ Fireballs.[objp->idcxx . . $ object#id.].total_lifecxx . . $ fireball#total_life.;
1051 objp->lighting_render_typecxx . . $ object#lighting_render_type. = LRT_STATICcxx . . $ `Descent3/object.h:649:9`!;
1052 objp->lm_objectcxx . . $ object#lm_object..usedcxx . . $ lightmap_object#used. = 0;
1053 return ret;
1054 }
1055 int ObjInitMarkercxx . . $ ObjInitMarker(2da2a862cad4c994).(objectcxx . . $ object# *objp) {
1056 int ret = 1;
1057 static int first = 1;
1058 static int polynum = -1;
1059 ASSERTcxx . . $ `misc/pserror.h:246:9`!(objp->type == OBJ_MARKERcxx . . $ `Descent3/object_external.h:175:9`!);
1060 // Set size & shields
1061 objp->shieldscxx . . $ object#shields. = 100;
1062 objp->sizecxx . . $ object#size. = 2.0;
1063 // Set up control info
1064 SetObjectControlTypecxx . . $ SetObjectControlType(766a1b7183ffa4b4).(objp, CT_NONEcxx . . $ `Descent3/object_external.h:216:9`!);
1065 objp->movement_typecxx . . $ object#movement_type. = MT_NONEcxx . . $ `Descent3/object_external.h:233:9`!;
1066 ObjSetRenderPolyobjcxx . . $ ObjSetRenderPolyobj(a7790401ac9fc765).(objp, Marker_polynumcxx . . $ Marker_polynum.);
1067 PageInPolymodelcxx . . $ PageInPolymodel(726816c99d57134).(Marker_polynumcxx . . $ Marker_polynum., OBJ_MARKERcxx . . $ `Descent3/object_external.h:175:9`!, &objp->sizecxx . . $ object#size.);
1068 objp->lm_objectcxx . . $ object#lm_object..usedcxx . . $ lightmap_object#used. = 0;
1069 objp->lighting_render_typecxx . . $ object#lighting_render_type. = LRT_STATICcxx . . $ `Descent3/object.h:649:9`!;
1070 return ret;
1071 }
1072 int ObjInitDoorcxx . . $ ObjInitDoor(d27f719725f38807).(objectcxx . . $ object# *objp, bool reinit) {
1073 // Set up movement info
1074 objp->movement_typecxx . . $ object#movement_type. = MT_NONEcxx . . $ `Descent3/object_external.h:233:9`!;
1075 SetObjectControlTypecxx . . $ SetObjectControlType(766a1b7183ffa4b4).(objp, CT_NONEcxx . . $ `Descent3/object_external.h:216:9`!);
1076 // Set up render info
1077 ObjSetRenderPolyobjcxx . . $ ObjSetRenderPolyobj(a7790401ac9fc765).(objp, GetDoorImagecxx . . $ GetDoorImage(7864480464b09eea).(objp->idcxx . . $ object#id.));
1078 PageInPolymodelcxx . . $ PageInPolymodel(726816c99d57134).(objp->rtypecxx . . $ object#rtype..pobj_infocxx . . $ object#$anonymous_type_10#pobj_info..model_numcxx . . $ polyobj_info#model_num.);
1079 ComputeDefaultSizecxx . . $ ComputeDefaultSize(30915566dd087c6c).(OBJ_DOORcxx . . $ `Descent3/object_external.h:177:9`!, objp->rtypecxx . . $ object#rtype..pobj_infocxx . . $ object#$anonymous_type_10#pobj_info..model_numcxx . . $ polyobj_info#model_num., &objp->sizecxx . . $ object#size.);
1080 objp->lighting_render_typecxx . . $ object#lighting_render_type. = LRT_LIGHTMAPScxx . . $ `Descent3/object.h:651:9`!;
1081 // Set shields
1082 if (Doorscxx . . $ Doors.[objp->idcxx . . $ object#id.].flagscxx . . $ door#flags. & DF_BLASTABLEcxx . . $ `Descent3/door.h:119:9`!) {
1083 objp->flagscxx . . $ object#flags. |= OF_DESTROYABLEcxx . . $ `Descent3/object_external.h:279:9`!;
1084 objp->shieldscxx . . $ object#shields. = Doorscxx . . $ Doors.[objp->idcxx . . $ object#id.].hit_pointscxx . . $ door#hit_points.;
1085 }
1086 if (!reinit)
1087 objp->lm_objectcxx . . $ object#lm_object..usedcxx . . $ lightmap_object#used. = 0;
1088
1089 return 1;
1090 }
1091 int ObjInitRoomcxx . . $ ObjInitRoom(2da2a862cad4c994).(objectcxx . . $ object# *objp) {
1092 // Set up movement info
1093 objp->movement_typecxx . . $ object#movement_type. = MT_NONEcxx . . $ `Descent3/object_external.h:233:9`!;
1094 SetObjectControlTypecxx . . $ SetObjectControlType(766a1b7183ffa4b4).(objp, CT_NONEcxx . . $ `Descent3/object_external.h:216:9`!);
1095 // Set up render info
1096 objp->render_typecxx . . $ object#render_type. = RT_ROOMcxx . . $ `Descent3/object_external.h:264:9`!; // rendering handled as special case
1097 // I have no idea about this stuff
1098 objp->lighting_render_typecxx . . $ object#lighting_render_type. = LRT_STATICcxx . . $ `Descent3/object.h:649:9`!;
1099 objp->lm_objectcxx . . $ object#lm_object..usedcxx . . $ lightmap_object#used. = 0;
1100 objp->flagscxx . . $ object#flags. |= OF_POLYGON_OBJECTcxx . . $ `Descent3/object_external.h:281:9`!;
1101
1102 return 1;
1103 }
1104 // Set all the type-specific info for this object
1105 // Returns 1 if ok, 0 if error
1106 int ObjInitTypeSpecificcxx . . $ ObjInitTypeSpecific(d27f719725f38807).(objectcxx . . $ object# *objp, bool reinitializing) {
1107 switch (objp->typecxx . . $ object#type.) {
1108 case OBJ_CLUTTERcxx . . $ `Descent3/object_external.h:171:9`!:
1109 case OBJ_BUILDINGcxx . . $ `Descent3/object_external.h:176:9`!:
1110 case OBJ_ROBOTcxx . . $ `Descent3/object_external.h:162:9`!:
1111 case OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!:
1112 return ObjInitGenericcxx . . $ ObjInitGeneric(d27f719725f38807).(objp, reinitializing);
1113 break;
1114 case OBJ_SHOCKWAVEcxx . . $ `Descent3/object_external.h:170:9`!:
1115 return 1;
1116 break;
1117 case OBJ_PLAYERcxx . . $ `Descent3/object_external.h:164:9`!:
1118 return ObjInitPlayercxx . . $ ObjInitPlayer(2da2a862cad4c994).(objp);
1119 break;
1120 case OBJ_CAMERAcxx . . $ `Descent3/object_external.h:169:9`!:
1121 return ObjInitCameracxx . . $ ObjInitCamera(2da2a862cad4c994).(objp);
1122 break;
1123 case OBJ_MARKERcxx . . $ `Descent3/object_external.h:175:9`!:
1124 return ObjInitMarkercxx . . $ ObjInitMarker(2da2a862cad4c994).(objp);
1125 break;
1126 case OBJ_VIEWERcxx . . $ `Descent3/object_external.h:166:9`!:
1127 return ObjInitViewercxx . . $ ObjInitViewer(2da2a862cad4c994).(objp);
1128 break;
1129 case OBJ_WEAPONcxx . . $ `Descent3/object_external.h:165:9`!:
1130 return ObjInitWeaponcxx . . $ ObjInitWeapon(2da2a862cad4c994).(objp);
1131 break;
1132 case OBJ_FIREBALLcxx . . $ `Descent3/object_external.h:161:9`!:
1133 return ObjInitFireballcxx . . $ ObjInitFireball(2da2a862cad4c994).(objp);
1134 break;
1135 case OBJ_DOORcxx . . $ `Descent3/object_external.h:177:9`!:
1136 return ObjInitDoorcxx . . $ ObjInitDoor(d27f719725f38807).(objp, reinitializing);
1137 break;
1138 case OBJ_ROOMcxx . . $ `Descent3/object_external.h:178:9`!:
1139 return ObjInitRoomcxx . . $ ObjInitRoom(2da2a862cad4c994).(objp);
1140 break;
1141 case OBJ_DEBRIScxx . . $ `Descent3/object_external.h:168:9`!:
1142 return ObjInitDebriscxx . . $ ObjInitDebris(2da2a862cad4c994).(objp);
1143 break;
1144 case OBJ_SHARDcxx . . $ `Descent3/object_external.h:163:9`!:
1145 return ObjInitShardcxx . . $ ObjInitShard(2da2a862cad4c994).(objp);
1146 break;
1147 case OBJ_SOUNDSOURCEcxx . . $ `Descent3/object_external.h:184:9`!:
1148 return ObjInitSoundSourcecxx . . $ ObjInitSoundSource(2da2a862cad4c994).(objp);
1149 break;
1150 case OBJ_WAYPOINTcxx . . $ `Descent3/object_external.h:185:9`!:
1151 return ObjInitWaypointcxx . . $ ObjInitWaypoint(2da2a862cad4c994).(objp);
1152 break;
1153 case OBJ_SPLINTERcxx . . $ `Descent3/object_external.h:180:9`!:
1154 return 1;
1155 break;
1156 #ifdef _DEBUGcxx . . $ `<built-in>:482:9`!
1157 case OBJ_DEBUG_LINEcxx . . $ `Descent3/object_external.h:183:9`!:
1158 return ObjInitLinecxx . . $ ObjInitLine(2da2a862cad4c994).(objp);
1159 break;
1160 #endif
1161 break;
1162 default:
1163 Int3cxx . . $ `misc/pserror.h:247:9`!();
1164 return 0;
1165 }
1166 }
1167 // Initializes a new object. All fields not passed in set to defaults.
1168 // Returns 1 if ok, 0 if error
1169 int ObjInitcxx . . $ ObjInit(e978d4035b3bbb3f).(objectcxx . . $ object# *objp, int type, int id, int handle, vectorcxx . . $ vector# *pos, float creation_time, int parent_handle) {
1170 // Zero out object structure to keep weird bugs from happening in uninitialized fields.
1171 // I hate doing this because it seems sloppy, but it's probably better to do it
1172 memset(objp, 0, sizeof(objectcxx . . $ object#));
1173 // Set the stuff that's passed in
1174 objp->typecxx . . $ object#type. = type;
1175 objp->idcxx . . $ object#id. = id;
1176 objp->handlecxx . . $ object#handle. = handle;
1177 objp->poscxx . . $ object#pos. =cxx . . $ vector#`operator=`(a48bc7e93a8dae5e). objp->last_poscxx . . $ object#last_pos. =cxx . . $ vector#`operator=`(a48bc7e93a8dae5e). *pos;
1178 objp->parent_handlecxx . . $ object#parent_handle. = parent_handle;
1179 objp->creation_timecxx . . $ object#creation_time. = creation_time;
1180 objp->osiris_scriptcxx . . $ object#osiris_script. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1181 // Initialize some general stuff
1182 objp->roomnumcxx . . $ object#roomnum. = -1;
1183 objp->orientcxx . . $ object#orient. =cxx . . $ matrix#`operator=`(4c6f8b29806742). Identity_matrixcxx . . $ Identity_matrix.;
1184 objp->nextcxx . . $ object#next. = objp->prevcxx . . $ object#prev. = -1;
1185 objp->dummy_typecxx . . $ object#dummy_type. = OBJ_NONEcxx . . $ `Descent3/object_external.h:159:9`!;
1186 objp->flagscxx . . $ object#flags. = 0;
1187 objp->sizecxx . . $ object#size. = 0;
1188 objp->change_flagscxx . . $ object#change_flags. = 0;
1189 objp->generic_nonvis_flagscxx . . $ object#generic_nonvis_flags. = 0;
1190 objp->generic_sent_nonviscxx . . $ object#generic_sent_nonvis. = 0;
1191 objp->namecxx . . $ object#name. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1192 objp->custom_default_script_namecxx . . $ object#custom_default_script_name. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1193 objp->custom_default_module_namecxx . . $ object#custom_default_module_name. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1194 objp->contains_typecxx . . $ object#contains_type. = -1;
1195 objp->lifeleftcxx . . $ object#lifeleft. = 0;
1196 objp->effect_infocxx . . $ object#effect_info. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1197 objp->ai_infocxx . . $ object#ai_info. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1198 objp->dynamic_wbcxx . . $ object#dynamic_wb. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1199 objp->attach_childrencxx . . $ object#attach_children. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
1200 // Now initialize the type-specific data
1201 return ObjInitTypeSpecificcxx . . $ ObjInitTypeSpecific(d27f719725f38807).(objp, 0);
1202 }
1203 // Re-copies data to each object from the appropriate page for that object type.
1204 // Called after an object page has changed.
1205 void ObjReInitAllcxx . . $ ObjReInitAll(49f6e7a06ebc5aa8).() {
1206 int objnum;
1207 objectcxx . . $ object# *objp;
1208 for (objnum = 0, objp = Objectscxx . . $ Objects.; objnum <= Highest_object_indexcxx . . $ Highest_object_index.; objnum++, objp++)
1209 if (objp->typecxx . . $ object#type. != OBJ_NONEcxx . . $ `Descent3/object_external.h:159:9`!)
1210 ObjInitTypeSpecificcxx . . $ ObjInitTypeSpecific(d27f719725f38807).(objp, 1);
1211 }