home *** CD-ROM | disk | FTP | other *** search
/ Amiga ACS 1998 #6 / amigaacscoverdisc1998-061998.iso / games / descent / source / main / object.h < prev    next >
Text File  |  1998-06-08  |  23KB  |  614 lines

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