L.H 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608
  1. /*
  2. THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
  3. SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
  4. END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
  5. ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
  6. IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
  7. SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
  8. FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
  9. CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
  10. AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
  11. COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
  12. */
  13. /*
  14. * $Source: f:/miner/source/main/rcs/object.h $
  15. * $Revision: 1.122 $
  16. * $Author: allender $
  17. * $Date: 1995/02/22 12:35:53 $
  18. *
  19. * object system definitions
  20. *
  21. * $Log: object.h $
  22. * Revision 1.122 1995/02/22 12:35:53 allender
  23. * remove anonymous unions
  24. *
  25. * Revision 1.121 1995/02/06 20:43:25 rob
  26. * Extern'ed Dead_player_camera so it can be reset by multi.c
  27. *
  28. * Revision 1.120 1995/02/01 16:34:07 john
  29. * Linted.
  30. *
  31. * Revision 1.119 1995/01/29 13:46:42 mike
  32. * adapt to new create_small_fireball_on_object prototype.
  33. *
  34. * Revision 1.118 1995/01/26 22:11:27 mike
  35. * Purple chromo-blaster (ie, fusion cannon) spruce up (chromification)
  36. *
  37. * Revision 1.117 1995/01/24 12:09:29 mike
  38. * Boost MAX_OBJECTS from 250 to 350.
  39. *
  40. * Revision 1.116 1995/01/13 19:39:51 rob
  41. * Removed outdated remote_info structure. (looking for cause of bugs
  42. *
  43. * Revision 1.115 1995/01/12 12:09:38 yuan
  44. * Added coop object capability.
  45. *
  46. * Revision 1.114 1994/12/15 13:04:20 mike
  47. * Replace Players[Player_num].time_total references with GameTime.
  48. *
  49. * Revision 1.113 1994/12/12 17:18:09 mike
  50. * make boss cloak/teleport when get hit, make quad laser 3/4 as powerful.
  51. *
  52. * Revision 1.112 1994/12/09 14:58:42 matt
  53. * Added system to attach a fireball to another object for rendering purposes,
  54. * so the fireball always renders on top of (after) the object.
  55. *
  56. * Revision 1.111 1994/12/08 12:35:35 matt
  57. * Added new object allocation & deallocation functions so other code
  58. * could stop messing around with internal object data structures.
  59. *
  60. * Revision 1.110 1994/11/21 17:30:21 matt
  61. * Increased max number of objects
  62. *
  63. * Revision 1.109 1994/11/18 23:41:52 john
  64. * Changed some shorts to ints.
  65. *
  66. * Revision 1.108 1994/11/10 14:02:45 matt
  67. * Hacked in support for player ships with different textures
  68. *
  69. * Revision 1.107 1994/11/08 12:19:27 mike
  70. * Small explosions on objects.
  71. *
  72. * Revision 1.106 1994/10/25 10:51:17 matt
  73. * Vulcan cannon powerups now contain ammo count
  74. *
  75. * Revision 1.105 1994/10/21 12:19:41 matt
  76. * Clear transient objects when saving (& loading) games
  77. *
  78. * Revision 1.104 1994/10/21 11:25:04 mike
  79. * Add IMMORTAL_TIME.
  80. *
  81. * Revision 1.103 1994/10/17 21:34:54 matt
  82. * Added support for new Control Center/Main Reactor
  83. *
  84. * Revision 1.102 1994/10/14 18:12:28 mike
  85. * Make egg dropping return object number.
  86. *
  87. * Revision 1.101 1994/10/12 21:07:19 matt
  88. * Killed unused field in object structure
  89. *
  90. * Revision 1.100 1994/10/12 10:38:24 mike
  91. * Add field OF_SILENT to obj->flags.
  92. *
  93. * Revision 1.99 1994/10/11 20:35:48 matt
  94. * Clear "transient" objects (weapons,explosions,etc.) when starting a level
  95. *
  96. * Revision 1.98 1994/10/03 20:56:13 rob
  97. * Added velocity to shortpos strucutre.
  98. *
  99. * Revision 1.97 1994/09/30 18:24:00 rob
  100. * Added new control type CT_REMOTE for remote controlled objects.
  101. * Also added a union struct 'remote_info' for this type.
  102. *
  103. * Revision 1.96 1994/09/28 09:23:05 mike
  104. * Prototype Object_type_names.
  105. *
  106. * Revision 1.95 1994/09/25 23:32:37 matt
  107. * Changed the object load & save code to read/write the structure fields one
  108. * at a time (rather than the whole structure at once). This mean that the
  109. * object structure can be changed without breaking the load/save functions.
  110. * As a result of this change, the local_object data can be and has been
  111. * incorporated into the object array. Also, timeleft is now a property
  112. * of all objects, and the object structure has been otherwise cleaned up.
  113. *
  114. * Revision 1.94 1994/09/25 15:45:28 matt
  115. * Added OBJ_LIGHT, a type of object that casts light
  116. * Added generalized lifeleft, and moved it to local_object
  117. *
  118. * Revision 1.93 1994/09/24 17:41:19 mike
  119. * Add stuff to Local_object structure for materialization centers.
  120. *
  121. * Revision 1.92 1994/09/24 13:16:50 matt
  122. * Added (hacked in, really) support for overriding the bitmaps used on to
  123. * texture map a polygon object, and using a new bitmap for all the faces.
  124. *
  125. * Revision 1.91 1994/09/22 19:02:14 mike
  126. * Prototype functions extract_shortpos and create_shortpos which reside in
  127. * gameseg.c, but are prototyped here to prevent circular dependencies.
  128. *
  129. * Revision 1.90 1994/09/15 21:47:14 mike
  130. * Prototype dead_player_end().
  131. *
  132. * Revision 1.89 1994/09/15 16:34:47 mike
  133. * Add danger_laser_num and danger_laser_signature to object_local to
  134. * enable robots to efficiently (too efficiently!) avoid player fire.
  135. *
  136. * Revision 1.88 1994/09/11 22:46:19 mike
  137. * Death_sequence_aborted prototyped.
  138. *
  139. * Revision 1.87 1994/09/09 20:04:30 mike
  140. * Add vclips for weapons.
  141. *
  142. * Revision 1.86 1994/09/09 14:20:54 matt
  143. * Added flag that says object uses thrust
  144. *
  145. * Revision 1.85 1994/09/08 14:51:32 mike
  146. * Make a crucial name change to a field of local_object struct.
  147. *
  148. * Revision 1.84 1994/09/07 19:16:45 mike
  149. * Homing missile.
  150. *
  151. * Revision 1.83 1994/09/06 17:05:43 matt
  152. * Added new type for dead player
  153. *
  154. * Revision 1.82 1994/09/02 11:56:09 mike
  155. * Add persistency (PF_PERSISTENT) to physics_info.
  156. *
  157. * Revision 1.81 1994/08/28 19:10:28 mike
  158. * Add Player_is_dead.
  159. *
  160. * Revision 1.80 1994/08/18 15:11:44 mike
  161. * powerup stuff.
  162. *
  163. * Revision 1.79 1994/08/15 15:24:54 john
  164. * Made players know who killed them; Disabled cheat menu
  165. * during net player; fixed bug with not being able to turn
  166. * of invulnerability; Made going into edit/starting new leve
  167. * l drop you out of a net game; made death dialog box.
  168. *
  169. * Revision 1.78 1994/08/14 23:15:12 matt
  170. * Added animating bitmap hostages, and cleaned up vclips a bit
  171. *
  172. * Revision 1.77 1994/08/13 14:58:27 matt
  173. * Finished adding support for miscellaneous objects
  174. *
  175. * Revision 1.76 1994/08/09 16:04:13 john
  176. * Added network players to editor.
  177. *
  178. * Revision 1.75 1994/08/03 21:06:19 matt
  179. * Added prototype for fix_object_segs(), and renamed now-unused spawn_pos
  180. *
  181. * Revision 1.74 1994/08/02 12:30:27 matt
  182. * Added support for spinning objects
  183. *
  184. * Revision 1.73 1994/07/27 20:53:25 matt
  185. * Added rotational drag & thrust, so turning now has momemtum like moving
  186. *
  187. * Revision 1.72 1994/07/27 19:44:21 mike
  188. * Objects containing objects.
  189. *
  190. * Revision 1.71 1994/07/22 20:43:29 matt
  191. * Fixed flares, by adding a physics flag that makes them stick to walls.
  192. *
  193. * Revision 1.70 1994/07/21 12:42:10 mike
  194. * Prototype new find_object_seg and update_object_seg.
  195. *
  196. * Revision 1.69 1994/07/19 15:26:39 mike
  197. * New ai_static structure.
  198. *
  199. * Revision 1.68 1994/07/13 00:15:06 matt
  200. * Moved all (or nearly all) of the values that affect player movement to
  201. * bitmaps.tbl
  202. *
  203. * Revision 1.67 1994/07/12 12:40:12 matt
  204. * Revamped physics system
  205. *
  206. * Revision 1.66 1994/07/06 15:26:23 yuan
  207. * Added chase mode.
  208. *
  209. *
  210. *
  211. */
  212. #ifndef _OBJECT_H
  213. #define _OBJECT_H
  214. #include "types.h"
  215. #include "vecmat.h"
  216. #include "segment.h"
  217. #include "gameseg.h"
  218. #include "aistruct.h"
  219. #include "gr.h"
  220. /*
  221. * CONSTANTS
  222. */
  223. #define MAX_OBJECTS 350 //increased on 01/24/95 for multiplayer. --MK; total number of objects in world
  224. //Object types
  225. #define OBJ_NONE 255 //unused object
  226. #define OBJ_WALL 0 //A wall... not really an object, but used for collisions
  227. #define OBJ_FIREBALL 1 //a fireball, part of an explosion
  228. #define OBJ_ROBOT 2 //an evil enemy
  229. #define OBJ_HOSTAGE 3 //a hostage you need to rescue
  230. #define OBJ_PLAYER 4 //the player on the console
  231. #define OBJ_WEAPON 5 //a laser, missile, etc
  232. #define OBJ_CAMERA 6 //a camera to slew around with
  233. #define OBJ_POWERUP 7 //a powerup you can pick up
  234. #define OBJ_DEBRIS 8 //a piece of robot
  235. #define OBJ_CNTRLCEN 9 //the control center
  236. #define OBJ_FLARE 10 //a flare
  237. #define OBJ_CLUTTER 11 //misc objects
  238. #define OBJ_GHOST 12 //what the player turns into when dead
  239. #define OBJ_LIGHT 13 //a light source, & not much else
  240. #define OBJ_COOP 14 //a cooperative player object.
  241. // WARNING!! If you add a type here, add its name to Object_type_names in object.c
  242. #define MAX_OBJECT_TYPES 15
  243. //Result types
  244. #define RESULT_NOTHING 0 //Ignore this collision
  245. #define RESULT_CHECK 1 //Check for this collision
  246. //Control types - what tells this object what do do
  247. #define CT_NONE 0 //doesn't move (or change movement)
  248. #define CT_AI 1 //driven by AI
  249. #define CT_EXPLOSION 2 //explosion sequencer
  250. #define CT_FLYING 4 //the player is flying
  251. #define CT_SLEW 5 //slewing
  252. #define CT_FLYTHROUGH 6 //the flythrough system
  253. #define CT_WEAPON 9 //laser, etc.
  254. #define CT_REPAIRCEN 10 //under the control of the repair center
  255. #define CT_MORPH 11 //this object is being morphed
  256. #define CT_DEBRIS 12 //this is a piece of debris
  257. #define CT_POWERUP 13 //animating powerup blob
  258. #define CT_LIGHT 14 //doesn't actually do anything
  259. #define CT_REMOTE 15 //controlled by another net player
  260. #define CT_CNTRLCEN 16 //the control center/main reactor
  261. //Movement types
  262. #define MT_NONE 0 //doesn't move
  263. #define MT_PHYSICS 1 //moves by physics
  264. #define MT_SPINNING 3 //this object doesn't move, just sits and spins
  265. //Render types
  266. #define RT_NONE 0 //does not render
  267. #define RT_POLYOBJ 1 //a polygon model
  268. #define RT_FIREBALL 2 //a fireball
  269. #define RT_LASER 3 //a laser
  270. #define RT_HOSTAGE 4 //a hostage
  271. #define RT_POWERUP 5 //a powerup
  272. #define RT_MORPH 6 //a robot being morphed
  273. #define RT_WEAPON_VCLIP 7 //a weapon that renders as a vclip
  274. //misc object flags
  275. #define OF_EXPLODING 1 //this object is exploding
  276. #define OF_SHOULD_BE_DEAD 2 //this object should be dead, so next time we can, we should delete this object.
  277. #define OF_DESTROYED 4 //this has been killed, and is showing the dead version
  278. #define OF_SILENT 8 //this makes no sound when it hits a wall. Added by MK for weapons, if you extend it to other types, do it completely!
  279. #define OF_ATTACHED 16 //this object is a fireball attached to another object
  280. #define OF_HARMLESS 32 //this object does no damage. Added to make quad lasers do 1.5 damage as normal lasers.
  281. //Different Weapon ID types...
  282. #define WEAPON_ID_LASER 0
  283. #define WEAPON_ID_MISSLE 1
  284. #define WEAPON_ID_CANNONBALL 2
  285. //Object Initial shields...
  286. #define OBJECT_INITIAL_SHIELDS F1_0/2
  287. //physics flags
  288. #define PF_TURNROLL 0x01 // roll when turning
  289. #define PF_LEVELLING 0x02 // level object with closest side
  290. #define PF_BOUNCE 0x04 // bounce (not slide) when hit will
  291. #define PF_WIGGLE 0x08 // wiggle while flying
  292. #define PF_STICK 0x10 // object sticks (stops moving) when hits wall
  293. #define PF_PERSISTENT 0x20 // object keeps going even after it hits another object (eg, fusion cannon)
  294. #define PF_USES_THRUST 0x40 // this object uses its thrust
  295. #define IMMORTAL_TIME 0x3fffffff // Time assigned to immortal objects, about 32768 seconds, or about 9 hours.
  296. extern char Object_type_names[MAX_OBJECT_TYPES][9];
  297. // List of objects rendered last frame in order. Created at render time, used by homing missiles in laser.c
  298. #define MAX_RENDERED_OBJECTS 50
  299. extern short Ordered_rendered_object_list[MAX_RENDERED_OBJECTS];
  300. extern int Num_rendered_objects;
  301. /*
  302. * STRUCTURES
  303. */
  304. // A compressed form for sending crucial data about via slow devices, such as modems and buggies.
  305. typedef struct shortpos {
  306. byte bytemat[9];
  307. short xo,yo,zo;
  308. short segment;
  309. short velx, vely, velz;
  310. } shortpos;
  311. // This is specific to the shortpos extraction routines in gameseg.c.
  312. #define RELPOS_PRECISION 10
  313. #define MATRIX_PRECISION 9
  314. #define MATRIX_MAX 0x7f // This is based on MATRIX_PRECISION, 9 => 0x7f
  315. //information for physics sim for an object
  316. typedef struct physics_info {
  317. vms_vector velocity; //velocity vector of this object
  318. vms_vector thrust; //constant force applied to this object
  319. fix mass; //the mass of this object
  320. fix drag; //how fast this slows down
  321. fix brakes; //how much brakes applied
  322. vms_vector rotvel; //rotational velecity (angles)
  323. vms_vector rotthrust; //rotational acceleration
  324. fixang turnroll; //rotation caused by turn banking
  325. ushort flags; //misc physics flags
  326. } physics_info;
  327. //stuctures for different kinds of simulation
  328. typedef struct laser_info {
  329. short parent_type; // The type of the parent of this object
  330. short parent_num; // The object's parent's number
  331. int parent_signature; // The object's parent's signature...
  332. fix creation_time; // Absolute time of creation.
  333. short last_hitobj; // For persistent weapons (survive object collision), object it most recently hit.
  334. short track_goal; // Object this object is tracking.
  335. fix multiplier; // Power if this is a fusion bolt (or other super weapon to be added).
  336. } laser_info;
  337. typedef struct explosion_info {
  338. fix spawn_time; // when lifeleft is < this, spawn another
  339. fix delete_time; // when to delete object
  340. short delete_objnum; // and what object to delete
  341. short attach_parent; // explosion is attached to this object
  342. short prev_attach; // previous explosion in attach list
  343. short next_attach; // next explosion in attach list
  344. } explosion_info;
  345. typedef struct light_info {
  346. fix intensity; //how bright the light is
  347. } light_info;
  348. typedef struct powerup_info {
  349. int count; //how many/much we pick up (vulcan cannon only?)
  350. } powerup_info;
  351. typedef struct vclip_info {
  352. int vclip_num;
  353. fix frametime;
  354. byte framenum;
  355. } vclip_info;
  356. //structures for different kinds of rendering
  357. typedef struct polyobj_info {
  358. int model_num; //which polygon model
  359. vms_angvec anim_angles[MAX_SUBMODELS]; //angles for each subobject
  360. int subobj_flags; //specify which subobjs to draw
  361. int tmap_override; //if this is not -1, map all face to this
  362. grs_bitmap ***alt_textures; //if not NULL, use these textures instead
  363. } polyobj_info;
  364. typedef struct object {
  365. int signature; // Every object ever has a unique signature...
  366. ubyte type; // what type of object this is... robot, weapon, hostage, powerup, fireball
  367. ubyte id; // which form of object...which powerup, robot, etc.
  368. short next,prev; // id of next and previous connected object in Objects, -1 = no connection
  369. ubyte control_type; // how this object is controlled
  370. ubyte movement_type; // how this object moves
  371. ubyte render_type; // how this object renders
  372. ubyte flags; // misc flags
  373. short segnum; // segment number containing object
  374. short attached_obj; // number of attached fireball object
  375. vms_vector pos; // absolute x,y,z coordinate of center of object
  376. vms_matrix orient; // orientation of object in world
  377. fix size; // 3d size of object - for collision detection
  378. fix shields; // Starts at maximum, when <0, object dies..
  379. vms_vector last_pos; // where object was last frame
  380. byte contains_type; // Type of object this object contains (eg, spider contains powerup)
  381. byte contains_id; // ID of object this object contains (eg, id = blue type = key)
  382. byte contains_count;// number of objects of type:id this object contains
  383. byte matcen_creator;// Materialization center that created this object, high bit set if matcen-created
  384. fix lifeleft; // how long until goes away, or 7fff if immortal
  385. //movement info, determined by MOVEMENT_TYPE
  386. union {
  387. physics_info phys_info; //a physics object
  388. vms_vector spin_rate; //for spinning objects
  389. } mtype;
  390. //control info, determined by CONTROL_TYPE
  391. union {
  392. laser_info laser_info;
  393. explosion_info expl_info; //NOTE: debris uses this also
  394. ai_static ai_info;
  395. light_info light_info; //why put this here? Didn't know what else to do with it.
  396. powerup_info powerup_info;
  397. } ctype;
  398. //render info, determined by RENDER_TYPE
  399. union {
  400. polyobj_info pobj_info; //polygon model
  401. vclip_info vclip_info; //vclip
  402. } rtype;
  403. } object;
  404. typedef struct obj_position {
  405. vms_vector pos; // absolute x,y,z coordinate of center of object
  406. vms_matrix orient; // orientation of object in world
  407. short segnum; // segment number containing object
  408. } obj_position;
  409. /*
  410. * VARIABLES
  411. */
  412. extern int Object_next_signature; // The next signature for the next newly created object
  413. extern ubyte CollisionResult[MAX_OBJECT_TYPES][MAX_OBJECT_TYPES];
  414. // ie CollisionResult[a][b]== what happens to a when it collides with b
  415. extern object Objects[];
  416. extern int Highest_object_index; //highest objnum
  417. extern grs_bitmap *robot_bms[]; //all bitmaps for all robots
  418. extern int robot_bm_nums[]; //starting bitmap num for each robot
  419. extern int robot_n_bitmaps[]; //how many bitmaps for each robot
  420. extern char *robot_names[]; //name of each robot
  421. extern int Num_robot_types;
  422. extern object *ConsoleObject; //pointer to the object that is the player
  423. extern object *Viewer; //which object we are seeing from
  424. extern object *Dead_player_camera;
  425. extern object Follow;
  426. extern int Player_is_dead; // !0 means player is dead!
  427. extern int Player_exploded;
  428. extern int Death_sequence_aborted;
  429. extern int Player_fired_laser_this_frame;
  430. /*
  431. * FUNCTIONS
  432. */
  433. //do whatever setup needs to be done
  434. void init_objects();
  435. //returns segment number object is in. Searches out from object's current
  436. //seg, so this shouldn't be called if the object has "jumped" to a new seg
  437. int obj_get_new_seg(object *obj);
  438. //when an object has moved into a new segment, this function unlinks it
  439. //from its old segment, and links it into the new segment
  440. void obj_relink(int objnum,int newsegnum);
  441. //move an object from one segment to another. unlinks & relinks
  442. void obj_set_new_seg(int objnum,int newsegnum);
  443. //links an object into a segment's list of objects.
  444. //takes object number and segment number
  445. void obj_link(int objnum,int segnum);
  446. //unlinks an object from a segment's list of objects
  447. void obj_unlink(int objnum);
  448. //initialize a new object. adds to the list for the given segment
  449. //returns the object number
  450. int obj_create(ubyte type,ubyte id,int segnum,vms_vector *pos,
  451. vms_matrix *orient,fix size,ubyte ctype,ubyte mtype,ubyte rtype);
  452. //make a copy of an object. returs num of new object
  453. int obj_create_copy(int objnum, vms_vector *new_pos, int newsegnum);
  454. //remove object from the world
  455. void obj_delete(int objnum);
  456. //called after load. Takes number of objects, and objects should be
  457. //compressed
  458. void reset_objects(int n_objs);
  459. //make object array non-sparse
  460. void compress_objects(void);
  461. //Render an object. Calls one of several routines based on type
  462. void render_object(object *obj);
  463. //Draw a blob-type object, like a fireball
  464. void draw_object_blob(object *obj,grs_bitmap *bitmap);
  465. //draw an object that is a texture-mapped rod
  466. void draw_object_tmap_rod(object *obj,grs_bitmap *bitmap,int lighted);
  467. //Deletes all objects that have been marked for death.
  468. void obj_delete_all_that_should_be_dead();
  469. // Toggles whether or not lock-boxes draw.
  470. void object_toggle_lock_targets();
  471. //move all objects for the current frame
  472. void object_move_all(); // moves all objects
  473. //set viewer object to next object in array
  474. void object_goto_next_viewer();
  475. //draw target boxes for nearby robots
  476. void object_render_targets(void);
  477. //move an object for the current frame
  478. void object_move_one( object * obj );
  479. //make object0 the player, setting all relevant fields
  480. void init_player_object();
  481. //check if object is in object->segnum. if not, check the adjacent segs.
  482. //if not any of these, returns false, else sets obj->segnum & returns true
  483. //callers should really use find_vector_intersection()
  484. //Note: this function is in gameseg.c
  485. extern int update_object_seg(struct object *obj);
  486. // Finds what segment *obj is in, returns segment number.
  487. // If not in any segment, returns -1.
  488. // Note: This function is defined in gameseg.h, but object.h depends on gameseg.h, and
  489. // object.h is where object is defined...get it?
  490. extern int find_object_seg(object * obj );
  491. //go through all objects and make sure they have the correct segment numbers
  492. //used when debugging is on
  493. fix_object_segs();
  494. // Drops objects contained in objp.
  495. int object_create_egg(object *objp);
  496. // Interface to object_create_egg, puts count objects of type type, id = id in objp and then drops them.
  497. int call_object_create_egg(object *objp, int count, int type, int id);
  498. extern void dead_player_end(void);
  499. // Extract information from an object (objp->orient, objp->pos, objp->segnum), stuff in a shortpos structure.
  500. // See typedef shortpos.
  501. extern void create_shortpos(shortpos *spp, object *objp);
  502. // Extract information from a shortpos, stuff in objp->orient (matrix), objp->pos, objp->segnum
  503. extern void extract_shortpos(object *objp, shortpos *spp);
  504. //delete objects, such as weapons & explosions, that shouldn't stay between levels
  505. //if clear_all is set, clear even proximity bombs
  506. void clear_transient_objects(int clear_all);
  507. //returns the number of a free object, updating Highest_object_index.
  508. //Generally, obj_create() should be called to get an object, since it
  509. //fills in important fields and does the linking.
  510. //returns -1 if no free objects
  511. int obj_allocate(void);
  512. //frees up an object. Generally, obj_delete() should be called to get
  513. //rid of an object. This function deallocates the object entry after
  514. //the object has been unlinked
  515. void obj_free(int objnum);
  516. //after calling init_object(), the network code has grabbed specific
  517. //object slots without allocating them. Go though the objects & build
  518. //the free list, then set the apporpriate globals
  519. //Don't call this function if you don't know what you're doing.
  520. void special_reset_objects(void);
  521. //attaches an object, such as a fireball, to another object, such as a robot
  522. void obj_attach(object *parent,object *sub);
  523. extern void create_small_fireball_on_object(object *objp, fix size_scale, int sound_flag);
  524. #endif
  525.