/*********************************************************************************************/
/*                                                                                           */
/* Lara Stuff                                                                                */
/*                                                                                           */
/*********************************************************************************************/

#ifndef LARA_H
#define LARA_H

#ifdef __cplusplus
extern "C" {
#endif

/***************************** FUNCTIONALITY DEFINES ****************************************/
#define NUM_EFFECTS			100
#define NUMBER_ITEMS		256
/********************************* CONSTANT DEFINES *****************************************/

#define ONE_DEGREE			182

#define NO_BAD_POS			(-NO_HEIGHT)	// for GetCollisionInfo
#define NO_BAD_NEG			NO_HEIGHT

#define LARA_AIR			(2*30*30)		// 2 Minutes of Air...
#define LARA_HITPOINTS		1000			// 1000 Hit Points special

#define LARA_DASH_TIME		(30*4)		// 4 seconds

#define LARA_RAD			100			// Global Radius Of Lara for Collisions
#define LARA_HITE			762            // Global Height of Lara Less than 3/4 BLOCK!!!
#define UW_RADIUS			300			// DITTO UnderWater
#define UW_HITE			400
#define CLIMB_WIDTHR		120			// extra width for Lara in climb stance
#define CLIMB_WIDTHL		80

#define DIVE_COUNT			10

#define LARA_LEAN_UNDO  	(ONE_DEGREE)        				// Leaning around Corners ..
#define LARA_LEAN_RATE		((ONE_DEGREE/2) + LARA_LEAN_UNDO)
#define LARA_LEAN_MAX		((10*ONE_DEGREE) + LARA_LEAN_UNDO)

#define LARA_TURN_UNDO  	(2*ONE_DEGREE) 						// Large Turn UNDO limits LAG
#define LARA_TURN_RATE		((ONE_DEGREE/4) + LARA_TURN_UNDO)
#define LARA_JUMP_TURN		((ONE_DEGREE*1) + LARA_TURN_UNDO)
#define LARA_SLOW_TURN		((ONE_DEGREE*2) + LARA_TURN_UNDO)
#define LARA_MED_TURN		((ONE_DEGREE*4) + LARA_TURN_UNDO)
#define LARA_FAST_TURN		((ONE_DEGREE*6) + LARA_TURN_UNDO)

#define LARA_FASTFALL_SPEED	(FASTFALL_SPEED+3)
#define STEPUP_HEIGHT		((STEP_L*3)/2)


#define GF(a,b)	(anims[a].frame_base+b)

#define STARTRUN_A			6

#define VAULT12_A			50										// Vault Anim and Frame Numbers
#define VAULT12_F			GF(VAULT12_A,0)		//759            	// to jump straight to..
#define VAULT34_A			42										// NOTE These can change if Tuby
#define VAULT34_F			GF(VAULT34_A,0)		//614            	// goes and deletes anims from Lara project.
#define LAND_A				31
#define LAND_F				GF(LAND_A,0)		//460
#define FASTSPLAT_A		32
#define FASTSPLAT_F     GF(FASTSPLAT_A,1)	//481
#define FASTFALL_A		23
#define FASTFALL_F      GF(FASTFALL_A,0)
#define STOP_A				11
#define STOP_F				GF(STOP_A,0)		//185
#define BREATH_A			103
#define BREATH_F			GF(BREATH_A,0)
#define FALLDOWN_A			34
#define FALLDOWN_F			GF(FALLDOWN_A,0)	//492
#define STOP_LEFT_A			2
#define STOP_LEFT_F			GF(STOP_LEFT_A,0)	//58
#define STOP_RIGHT_A		3
#define STOP_RIGHT_F		GF(STOP_RIGHT_A,0)	//74
#define HITWALLLEFT_A		53
#define HITWALLLEFT_F		GF(HITWALLLEFT_A,0)	//800
#define HITWALLRIGHT_A		54
#define HITWALLRIGHT_F		GF(HITWALLRIGHT_A,0)	//815
#define RUNSTEPUP_LEFT_A    56
#define RUNSTEPUP_LEFT_F    GF(RUNSTEPUP_LEFT_A,0)	//837
#define RUNSTEPUP_RIGHT_A	55
#define RUNSTEPUP_RIGHT_F   GF(RUNSTEPUP_RIGHT_A,0)	//830
#define WALKSTEPUP_LEFT_A   57
#define WALKSTEPUP_LEFT_F   GF(WALKSTEPUP_LEFT_A,0)	//844
#define WALKSTEPUP_RIGHT_A	58
#define WALKSTEPUP_RIGHT_F  GF(WALKSTEPUP_RIGHT_A,0)	//858
#define WALKSTEPD_LEFT_A    60
#define WALKSTEPD_LEFT_F    GF(WALKSTEPD_LEFT_A,0)	//887
#define WALKSTEPD_RIGHT_A	59
#define WALKSTEPD_RIGHT_F   GF(WALKSTEPD_RIGHT_A,0)	//874
#define BACKSTEPD_LEFT_A	61
#define BACKSTEPD_LEFT_F    GF(BACKSTEPD_LEFT_A,0)	//899
#define BACKSTEPD_RIGHT_A   62
#define BACKSTEPD_RIGHT_F   GF(BACKSTEPD_RIGHT_A,0)	//930
#define LANDFAR_A 			24
#define LANDFAR_F			GF(LANDFAR_A,0)			//358
#define GRABLEDGE_A			96        							// 32
#define GRABLEDGE_F			GF(GRABLEDGE_A,0)		//1493      // 621
#define SWIMGLIDE_A			87
#define SWIMGLIDE_F			GF(SWIMGLIDE_A,0)	//1431
#define FALLBACK_A			93
#define FALLBACK_F			GF(FALLBACK_A,0)	//1473
#define HANG_A				96        						 // 33
#define HANG_F				GF(HANG_A,21)		//1514       // 642
#define STARTHANG_A			96		   						 // 33		// where to start Hang from JumpUp
#define STARTHANG_F			GF(STARTHANG_A,12)	//1505       // 634
#define STOPHANG_A			28 								 // where to jump into Upjump from Hang
#define STOPHANG_F			GF(STOPHANG_A,9)	//448
#define SLIDE_A				70              				 // Slope Slide Forward Animation
#define SLIDE_F				GF(SLIDE_A,0)		//1133
#define SLIDEBACK_A			104     						 // Slope Slide Backward Animation
#define SLIDEBACK_F			GF(SLIDEBACK_A,0)	//1677
#define	COMPRESS_A			73
#define	COMPRESS_F			GF(COMPRESS_A,0)

#define TREAD_A				108
#define TREAD_F				GF(TREAD_A,0)		//1736
#define SURFTREAD_A			114             				// Treading Water Animation
#define SURFTREAD_F			GF(SURFTREAD_A,0)	//1937
#define	SURFSWIM_A			116								// Swimming forward on water surface
#define	SURFSWIM_F			GF(SURFSWIM_A,0)
#define	SURFBACK_A			141								// Swimming backward on water surface
#define	SURFBACK_F			GF(SURFBACK_A,0)
#define SURFTRD2BK_A		140								// Surf Tread to swim back
#define	SURFTRD2BK_F		GF(SURFTRD2BK_A,0)
#define SURFLEFT_A			143								// Swim left
#define SURFLEFT_F			GF(SURFLEFT_A,0)
#define	SURFRIGHT_A			144								// Swim Right
#define	SURFRIGHT_F			GF(SURFRIGHT_A,0)
#define SURFDIVE_A			119             				// Diving Animation..
#define SURFDIVE_F			GF(SURFDIVE_A,0)	//2041
#define SURFCLIMB_A			111								// Climb Out Of Water Animation
#define SURFCLIMB_F         GF(SURFCLIMB_A,0)	//1849
#define	SURF2WADE1_A		190
#define SURF2WADE1_F         GF(SURF2WADE1_A,0)	//1849
#define	SURF2WADE2_A		176
#define SURF2WADE2_F         GF(SURF2WADE2_A,0)	//1849
#define SWIM2QSTND_A		192
#define	SWIM2QSTND_F		GF(SWIM2QSTND_A,0)
#define SURF2QSTND_A		193
#define	SURF2QSTND_F		GF(SURF2QSTND_A,0)
#define	SURF2STND_A			191
#define SURF2STND_F			GF(SURF2STND_A,0)
#define UW2WADE_A			176
#define	UW2WADE_F			GF(UW2WADE_A,0)
#define JUMPIN_A			112
#define JUMPIN_F			GF(JUMPIN_A,0)		//1895
#define WADE_A				177
#define	WADE_F				GF(WADE_A,0)
#define ROLL_A				146
#define ROLL_F			    GF(ROLL_A,2)		//3857
#define WATERROLL_A			203
#define WATERROLL_F			GF(WATERROLL_A,0)
#define RBALL_DEATH_A		139
#define RBALL_DEATH_F       GF(RBALL_DEATH_A,0)	//3561
#define SPIKE_DEATH_A		149
#define SPIKE_DEATH_F		GF(SPIKE_DEATH_A,0)	//3887
#define GRABLEDGEIN_A		150
#define GRABLEDGEIN_F		GF(GRABLEDGEIN_A,0)	//3974
#define THROWFLARE_A		189
#define THROWFLARE_F		GF(THROWFLARE_A,0)

#define	CLIMBSTNC_A			164
#define	CLIMBSTNC_F			GF(CLIMBSTNC_A,0)		//4556
#define CLIMBRIGHT_A		170
#define CLIMBRIGHT_F		GF(CLIMBRIGHT_A,0)
#define	CLIMBLEFT_A			171
#define	CLIMBLEFT_F			GF(CLIMBLEFT_A,0)
#define HANGUP_A			187
#define HANGUP_F			GF(HANGUP_A,0)
#define HANGDOWN_A			188
#define	HANGDOWN_F			GF(HANGDOWN_A,0)
#define GRABRIGHT_A			201
#define	GRABRIGHT_F			GF(GRABRIGHT_A,0)
#define GRABLEFT_A			202
#define	GRABLEFT_F			GF(GRABLEFT_A,0)
#define	CLIMBING_A			161
#define	CLIMBUPLEND_A		162
#define	CLIMBUPREND_A		163
#define	CLIMBDOWN_A			168
#define	CLIMBDOWNLEND_A		166
#define	CLIMBDOWNREND_A		167
#define	CLIMB2HANG_A		194

#define CLIMBUP_LNK1	29
#define CLIMBUP_LNK2	58

#define	CLIMBDN_LNK1	29
#define	CLIMBDN_LNK2	58

#define PICKUPF_UW_A     206
#define PICKUPF_UW_F     GF(PICKUPF_UW_A,20)   // underwater flare pickup

#define PPREADY_F			GF(120,19)	//2091			// Are we ready to Push or Pull
#define PICKUP_F			GF(135,42)	//3443            // Are we ready to actually pickup the object??
#define PICKUPF_F			GF(204,58)  // Flare pickup frame
#define PICKUP_UW_F			GF(130,18)	//2970            // (base+18) Are we ready to actually pickup object UnderWater
#define PICKUPSCION_F		44				//  44 frames  from base
#define USEPUZZLE_F			GF(134,80)	//3372			// (base+80) Are we ready to swap PuzzleHole Meshes

#define SPAZ_FORWARD_A		125				// Anims for Spastication
#define SPAZ_BACK_A         126
#define SPAZ_RIGHT_A        127
#define SPAZ_LEFT_A         128

/* -------- Tomb Raider III additions */

#define STAND2DUCK_A	218
#define STAND2DUCK_F	GF(STAND2DUCK_A,0)
#define DUCKBREATHE_A	223
#define DUCKBREATHE_F	GF(DUCKBREATHE_A,0)
#define DUCKROLL_A		219
#define DUCKROLL_F		GF(DUCKROLL_A,0)
#define DASH_A			224
#define DASH_F			GF(DASH_A,0)
#define DASHDIVE_A		231
#define DASHDIVE_F		GF(DASHDIVE_A,0)
#define MONKEYHANG_A	235
#define MONKEYHANG_F	GF(MONKEYHANG_A, 0)
#define MONKEYSWING_A	237
#define MONKEYSWING_F	GF(MONKEYSWING_A, 0)

//*********** Weapon Amounts ********************/
#define NUM_SG_SHELLS		2		// 2 shells in a box

#define GUN_AMMO_CLIP		16		// How many bullets in Each Clip
#define MAGNUM_AMMO_CLIP	20     // Pickup is Two clips at a time
#define UZI_AMMO_CLIP		40
#define SHOTGUN_AMMO_CLIP	6       // all these blasted in one go
#if defined(PSX_VERSION) && defined(JAPAN)
#define FLARE_AMMO_BOX		8
#else
#define FLARE_AMMO_BOX		6
#endif
#define HARPOON_AMMO_CLIP  3
#define M16_AMMO_CLIP		40
#define ROCKET_AMMO_CLIP	1

#define GUN_AMMO_QTY		(GUN_AMMO_CLIP*2)					// How many bullets are in each pickup!
#define MAGNUM_AMMO_QTY		(MAGNUM_AMMO_CLIP*2)      			// Pickup is Two clips at a time
#define UZI_AMMO_QTY		(UZI_AMMO_CLIP*2)
#define SHOTGUN_AMMO_QTY	(SHOTGUN_AMMO_CLIP*NUM_SG_SHELLS)   // all these blasted in one go
#define FLARE_AMMO_QTY		FLARE_AMMO_BOX
#define HARPOON_AMMO_QTY	HARPOON_AMMO_CLIP
#define M16_AMMO_QTY			M16_AMMO_CLIP
#define ROCKET_AMMO_QTY		(ROCKET_AMMO_CLIP*2)

/****************** FLARE FRAME DEFS ****************************************/
#define FL_HOLD_FT		1
#define	FL_THROW_FT		32
#define	FL_DRAW_FT		39
#define	FL_IGNITE_FT	23
#define	FL_2HOLD_FT		15

#define	FL_HOLD_F		0
#define	FL_THROW_F		(FL_HOLD_F+FL_HOLD_FT)
#define	FL_DRAW_F		(FL_THROW_F+FL_THROW_FT)
#define	FL_IGNITE_F		(FL_DRAW_F+FL_DRAW_FT)
#define	FL_2HOLD_F		(FL_IGNITE_F+FL_IGNITE_FT)
#define	FL_END_F			(FL_2HOLD_F+FL_2HOLD_FT)

#define FL_DRAWGOTIT_F		(13+FL_DRAW_F)
#define FL_PICKUP_F			(58+FL_PICKINGUP_F)
#define FL_THROWRELEASE_F	(20+FL_THROW_F)

#define FL_THROW_FRAMES 32

/*********************************************************************************************/
/********************************* TYPE DEFINITIONS ******************************************/
/*********************************************************************************************/

typedef struct lara_arm {
	sint16		*frame_base;
	sint16		frame_number;
	sint16		anim_number;
	sint16		lock;
	PHD_ANGLE	y_rot,x_rot,z_rot;
	sint16		flash_gun;
} LARA_ARM;

typedef struct	ammo_info {
	int			ammo;
//	int			hit;
//	int			miss;
} AMMO_INFO;


typedef struct lara_info {
	sint16 		item_number;
	sint16 		gun_status;
	sint16		gun_type;
	sint16		request_gun_type;
	sint16		last_gun_type;
	sint16		calc_fallspeed;
	sint16		water_status;
	sint16		climb_status;
	sint16		pose_count;
	sint16		hit_frame;
	sint16		hit_direction;
	sint16		air;
	sint16		dive_count;
	sint16		death_count;
	sint16		current_active;							// Underwater current
	sint16		spaz_effect_count;                      // Effects can make lara spaz
	sint16		flare_age;							// How old is the flare in Lara's hand?
	sint16		skidoo;								// flag whether Lara is skidooing
	sint16		weapon_item;						// dummy item used for new weapon control
	sint16		back_gun;							// object number of gun that Lara has on her back currently
	sint16		flare_frame;
	uint16		flare_control_left:1;
	uint16		flare_control_right:1;
	uint16		extra_anim:1;							// 1 if Lara is running an anim from another project (LARA_EXTRA usually)
	uint16		look:1;									// 1 if OK for Lara to LookLeftRight
	uint16		burn:1;									// lara's botty is hot
	uint16		keep_ducked:1;		// can't get out of duck
	uint16		CanMonkeySwing:1;
	sint32		water_surface_dist;					// <0 if Lara's origin is below water)
	PHD_VECTOR	last_pos;
	FX_INFO		*spaz_effect;
	int			mesh_effects;							// Used for Special Effects
	sint16		*mesh_ptrs[15];
	ITEM_INFO	*target;
	PHD_ANGLE	target_angles[2];
	PHD_ANGLE   turn_rate;
	PHD_ANGLE	move_angle;
	PHD_ANGLE	head_y_rot,head_x_rot,head_z_rot;
	PHD_ANGLE	torso_y_rot,torso_x_rot,torso_z_rot;
	LARA_ARM		left_arm,right_arm;
	AMMO_INFO	pistols;
	AMMO_INFO	magnums;
	AMMO_INFO	uzis;
	AMMO_INFO	shotgun;
	AMMO_INFO	harpoon;
	AMMO_INFO	rocket;
	AMMO_INFO	m16;
	CREATURE_INFO *creature;		// lara uses baddie AI for water current
} LARA_INFO;

typedef struct	weapon_info {
	PHD_ANGLE	lock_angles[4];					// Min/Max for Y,X rots
	PHD_ANGLE	left_angles[4];					// Min/Max for Left arm Aim
	PHD_ANGLE	right_angles[4];                // Min/Max for Right arm Aim
	PHD_ANGLE   aim_speed;                      // Speed at which arms lockon
	PHD_ANGLE	shot_accuracy;					// Random angle range for Shot
	int			gun_height;                     // Height of Gun from Source Origin
	int			damage;							// Amount of Damage Done
	int			target_dist;					// Target distance
	sint16		recoil_frame;					// Recoil frame for pistol-type guns
	sint16		flash_time;						// How long GunFlash lasts
	sint16		sample_num;						// Sample number for Weapon
} WEAPON_INFO;


enum	lara_water_states {
	LARA_ABOVEWATER,
	LARA_UNDERWATER,
	LARA_SURFACE,
	LARA_CHEAT,
	LARA_WADE
};

enum	headings {
	NORTH = 0,
	EAST,
	SOUTH,
	WEST
};


enum lara_states {
	AS_WALK=0,
	AS_RUN,
	AS_STOP,
	AS_FORWARDJUMP,
	AS_POSE,
	AS_FASTBACK,
	AS_TURN_R,
	AS_TURN_L,
	AS_DEATH,
	AS_FASTFALL,
	AS_HANG,
	AS_REACH,
	AS_SPLAT,
	AS_TREAD,
	AS_LAND,
	AS_COMPRESS,
	AS_BACK,
	AS_SWIM,
	AS_GLIDE,
	AS_NULL,
	AS_FASTTURN,
	AS_STEPRIGHT,
	AS_STEPLEFT,
	AS_HIT,
	AS_SLIDE,
	AS_BACKJUMP,
	AS_RIGHTJUMP,
	AS_LEFTJUMP,
	AS_UPJUMP,
	AS_FALLBACK,
	AS_HANGLEFT,
	AS_HANGRIGHT,
	AS_SLIDEBACK,
	AS_SURFTREAD,
	AS_SURFSWIM,
	AS_DIVE,
	AS_PUSHBLOCK,
	AS_PULLBLOCK,
	AS_PPREADY,
	AS_PICKUP,
	AS_SWITCHON,
	AS_SWITCHOFF,
	AS_USEKEY,
	AS_USEPUZZLE,
	AS_UWDEATH,
	AS_ROLL,
	AS_SPECIAL,
	AS_SURFBACK,
	AS_SURFLEFT,
	AS_SURFRIGHT,
	AS_USEMIDAS,
	AS_DIEMIDAS,
	AS_SWANDIVE,
	AS_FASTDIVE,
	AS_GYMNAST,
	AS_WATEROUT,
	AS_CLIMBSTNC,
	AS_CLIMBING,
	AS_CLIMBLEFT,
	AS_CLIMBEND,
	AS_CLIMBRIGHT,
	AS_CLIMBDOWN,
	AS_LARATEST1,
	AS_LARATEST2,
	AS_LARATEST3,
	AS_WADE,
	AS_WATERROLL,
	AS_FLAREPICKUP,
	AS_TWIST,
	AS_KICK,
	AS_DEATHSLIDE,
	AS_DUCK,
	AS_DUCKROLL,
	AS_DASH,
	AS_DASHDIVE,
	AS_MONKEYSWING,
	AS_MONKEYF,
	AS_LAST
};

enum lara_extras {
	EXTRA_BREATH,
	EXTRA_PLUNGER,
	EXTRA_YETIKILL,
	EXTRA_SHARKKILL,
	EXTRA_AIRLOCK,
	EXTRA_GONGBONG,
	EXTRA_DINOKILL,
	EXTRA_PULLDAGGER,
	EXTRA_STARTANIM,
	EXTRA_STARTHOUSE,
	EXTRA_FINALANIM
};

enum lara_meshes {
	HIPS,
	THIGH_L,CALF_L,FOOT_L,
	THIGH_R,CALF_R,FOOT_R,
	TORSO,
	UARM_R,LARM_R,HAND_R,
	UARM_L,LARM_L,HAND_L,
	HEAD
};

enum lara_gun_types {
	LG_UNARMED=0,
	LG_PISTOLS,
	LG_MAGNUMS,
	LG_UZIS,
	LG_SHOTGUN,
	LG_M16,
	LG_ROCKET,
	LG_HARPOON,
	LG_FLARE,
	LG_SKIDOO,
	NUM_WEAPONS
};

enum lara_gun_states {
	LG_ARMLESS,
	LG_HANDSBUSY,
	LG_DRAW,
	LG_UNDRAW,
	LG_READY,
	LG_SPECIAL
};

enum lara_arm_states  {
	LA_LOCKOFF,
	LA_LOCKON,
	LA_RECOIL
};

	extern	int			assault_timer_display, assault_timer_active;
	extern	int			health_bar_timer;
	extern	int			animation_rate;
	extern	int			game_timer;
	extern	LARA_INFO 	lara;
	extern	ITEM_INFO 	*lara_item;
	extern	WEAPON_INFO	weapons[];
#ifdef PSX_VERSION
	extern	ITEM_INFO *boatitem;	// Lonely boat exit FRIG
	extern	int			lara_inboat;
#endif
	extern	char		*states[];
	extern	char		*quadrant_names[];
	extern	char		*gunstates[];
	extern	char		*coll_typess[];
	extern	char		*coll_directs[];
	extern	char		*waterstates[];
	extern	int			reset_flag;


	extern	void		(*lara_control_routines[])(ITEM_INFO *item,COLL_INFO *coll );
	extern	void		(*lara_collision_routines[])(ITEM_INFO *item,COLL_INFO *coll);
	extern	void		(*extra_control_routines[])(ITEM_INFO *item,COLL_INFO *coll );

#if CODER==JASON
#ifdef GAMEDEBUG
	extern	sint32	debug_ints[];
#endif
#endif

/*********************  JumpTable Function Prototypes Lara  ****************************/

void	lara_as_link( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_walk( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_run( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_stop( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_forwardjump( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_pose( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_fastback( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_turn_r( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_turn_l( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_death( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_fastfall( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_hang( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_reach( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_splat( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_tread( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_land( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_compress( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_back( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_swim( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_glide( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_null( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_fastturn( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_stepright( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_stepleft( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_roll2( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_slide( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_backjump( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_rightjump( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_leftjump( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_upjump( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_fallback( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_hangleft( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_hangright( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_climbleft( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_climbright( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_slideback( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_surftread( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_surfswim( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_dive( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_pushblock( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_pullblock( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_ppready( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_pickup( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_switchon( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_switchoff( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_usekey( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_usepuzzle( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_uwdeath( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_roll( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_special( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_surfback( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_surfleft( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_surfright( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_usemidas( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_diemidas( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_swandive( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_fastdive( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_gymnast( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_waterout( ITEM_INFO *item, COLL_INFO *coll );
void  lara_as_climbstnc( ITEM_INFO *item, COLL_INFO *coll );
void  lara_as_climbing( ITEM_INFO *item, COLL_INFO *coll );
void  lara_as_climbend( ITEM_INFO *item, COLL_INFO *coll );
void  lara_as_climbdown( ITEM_INFO *item, COLL_INFO *coll );
void  lara_as_laratest1( ITEM_INFO *item, COLL_INFO *coll );
void  lara_as_laratest2( ITEM_INFO *item, COLL_INFO *coll );
void  lara_as_laratest3( ITEM_INFO *item, COLL_INFO *coll );
void  lara_as_wade( ITEM_INFO *item, COLL_INFO *coll );
void  lara_as_waterroll( ITEM_INFO *item, COLL_INFO *coll );
void	lara_as_pickupflare(ITEM_INFO *item, COLL_INFO *coll);
void	lara_as_twist(ITEM_INFO *item, COLL_INFO *coll);
void	lara_as_kick(ITEM_INFO *item, COLL_INFO *coll);
void	lara_as_deathslide(ITEM_INFO *item, COLL_INFO *coll);

void	extra_as_breath(ITEM_INFO *item, COLL_INFO *coll);
void	extra_as_plunger(ITEM_INFO *item, COLL_INFO *coll);
void	extra_as_yetikill(ITEM_INFO *item, COLL_INFO *coll);
void	extra_as_sharkkill(ITEM_INFO *item, COLL_INFO *coll);
void	extra_as_airlock(ITEM_INFO *item, COLL_INFO *coll);
void	extra_as_gongbong(ITEM_INFO *item, COLL_INFO *coll);
void	extra_as_dinokill(ITEM_INFO *item, COLL_INFO *coll);
void	extra_as_pulldagger(ITEM_INFO *item, COLL_INFO *coll);
void	extra_as_startanim(ITEM_INFO *item, COLL_INFO *coll);
void	extra_as_starthouse(ITEM_INFO *item, COLL_INFO *coll);
void	extra_as_finalanim(ITEM_INFO *item, COLL_INFO *coll);

void	lara_col_link( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_walk( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_run( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_stop( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_forwardjump( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_pose( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_fastback( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_turn_r( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_turn_l( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_death( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_fastfall( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_hang( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_reach( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_splat( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_tread( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_land( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_compress( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_back( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_swim( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_glide( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_null( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_fastturn( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_stepright( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_stepleft( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_roll2( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_slide( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_backjump( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_rightjump( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_leftjump( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_upjump( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_fallback( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_hangleft( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_hangright( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_climbleft( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_climbright( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_slideback( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_surftread( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_surfswim( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_dive( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_pushblock( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_pullblock( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_ppready( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_pickup( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_switchon( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_switchoff( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_usekey( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_usepuzzle( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_uwdeath( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_roll( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_special( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_surfback( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_surfleft( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_surfright( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_usemidas( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_diemidas( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_swandive( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_fastdive( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_gymnast( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_waterout( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_climbstnc( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_climbing( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_climbend( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_climbdown( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_laratest1( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_laratest2( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_laratest3( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_wade( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_waterroll( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_twist( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_kick( ITEM_INFO *item, COLL_INFO *coll );
void	lara_col_deathslide( ITEM_INFO *item, COLL_INFO *coll );

extern void lara_as_duck(ITEM_INFO *item, COLL_INFO *coll);
extern void lara_col_duck(ITEM_INFO *item, COLL_INFO *coll);
extern void lara_as_duckroll(ITEM_INFO *item, COLL_INFO *coll);
extern void lara_col_duckroll(ITEM_INFO *item, COLL_INFO *coll);
extern void lara_as_dash(ITEM_INFO *item, COLL_INFO *coll);
extern void lara_col_dash(ITEM_INFO *item, COLL_INFO *coll);
extern void lara_as_dashdive(ITEM_INFO *item, COLL_INFO *coll);
extern void lara_col_dashdive(ITEM_INFO *item, COLL_INFO *coll);
extern void lara_as_monkeyswing(ITEM_INFO *item, COLL_INFO *coll);
extern void lara_col_monkeyswing(ITEM_INFO *item, COLL_INFO *coll);
extern void lara_as_monkeyswingf(ITEM_INFO *item, COLL_INFO *coll);

/************************************ LARA.C **********************************************/

void		LaraAboveWater( ITEM_INFO *item,COLL_INFO *coll );

void		LookUpDown(void);
void		LookLeftRight(void);
void		ResetLook(void);

void		lara_slide_slope( ITEM_INFO *item, COLL_INFO *coll );
void		GetLaraCollisionInfo( ITEM_INFO *item, COLL_INFO *info );
int			LaraHitCeiling( ITEM_INFO *item, COLL_INFO *coll );
void		LaraHangTest( ITEM_INFO *item, COLL_INFO *coll );
void		LaraClimbTest( ITEM_INFO *item, COLL_INFO *coll );
int			TestLaraVault( ITEM_INFO *item, COLL_INFO *info );
int			LaraDeflectEdge( ITEM_INFO *item, COLL_INFO *info );
void		LaraDeflectEdgeJump( ITEM_INFO *item, COLL_INFO *coll );
void		LaraSlideEdgeJump( ITEM_INFO *item, COLL_INFO *coll );
void		LaraDeflectWall( ITEM_INFO *item, COLL_INFO *info );
int			LaraTestHangJump( ITEM_INFO *item, COLL_INFO *info );
int			TestHangSwingIn( ITEM_INFO *item, PHD_ANGLE angle );
int			TestClimbRecess( ITEM_INFO *item );
int			LaraTestHangJumpUp( ITEM_INFO *item, COLL_INFO *info );
int			TestLaraSlide( ITEM_INFO *item, COLL_INFO *coll );
void 		AnimateLara( ITEM_INFO *item );
sint16		LaraFloorFront( ITEM_INFO *item, PHD_ANGLE ang, sint32 dist );
void		lara_col_jumper( ITEM_INFO *item, COLL_INFO *coll );
void		lara_default_col( ITEM_INFO *item, COLL_INFO *coll );
void		GetLaraJointAbsPosition( PHD_VECTOR *vec, int joint );
void		GetLJAInt( ITEM_INFO *item, PHD_VECTOR *vec, sint16 *frame1, sint16 *frame2, int frac, int rate );
int			LaraFallen( ITEM_INFO *item, COLL_INFO *coll );
void		GetLHAInt( ITEM_INFO *item, PHD_VECTOR *vec, sint16 *frame1, sint16 *frame2, int frac, int rate, long leftright);


/******************************** LARAFIRE.C *********************************************/
void		LaraGun( void );
void		InitialiseNewWeapon( void );
ITEM_INFO	*find_nearest_target_info( sint32 *fdist, sint32 maxdist, PHD_ANGLE *outangles, PHD_ANGLE *inangles );
int			find_target_info( ITEM_INFO *item, sint32 maxdist, PHD_ANGLE *outangles, PHD_ANGLE *inangles );
void		find_target_point( ITEM_INFO *item, GAME_VECTOR *target );
void		LaraTargetInfo( WEAPON_INFO *winfo );
void		LaraGetNewTarget( WEAPON_INFO *winfo );
void		AimWeapon( WEAPON_INFO *winfo, LARA_ARM *arm );
int			FireWeapon( int weapon_type, ITEM_INFO *target, ITEM_INFO *src, PHD_ANGLE *angles );
void		HitTarget( ITEM_INFO *item, GAME_VECTOR *hitpos, int damage );
int		WeaponObject(int weapon_type);

/********************************* LARAMISC.C ********************************************/
void		LaraControl( sint16 item_num );
void		LaraInitialiseMeshes( int level_number );
void		InitialiseLaraLoad( sint16 item_num );
void		InitialiseLara( int type );
void     	InitialiseLaraInventory(int level_number);
void		UseItem( sint16 object_num );
void		LaraCheat( ITEM_INFO *item, COLL_INFO *coll );
void		LaraCheatyBits( void );
void		ControlLaraExtra( sint16 item_num );
void    	LaraDinoDeath( ITEM_INFO *item );
void		InitialiseEvilLara( sint16 item_num );
void		ControlEvilLara( sint16 item_num );
void		DrawEvilLara( ITEM_INFO *item );

/******************************* LARA2GUN.C ***********************************************/
void		draw_pistols( int weapon_type );
void		undraw_pistols( int weapon_type );
void		ready_pistols( int weapon_type );
void		draw_pistol_meshes( int weapon_type );
void		undraw_pistol_mesh_left( int weapon_type );
void		undraw_pistol_mesh_right( int weapon_type );
void		LaraSwapMeshExtra( void );
void		PistolHandler( int weapon_type );
void		AnimatePistols( int weapon_type );

/******************************* LARA1GUN.C ***********************************************/
void		draw_shotgun( int weapon_type );
void		undraw_shotgun( int weapon_type );
void		draw_shotgun_meshes( int weapon_type );
void		undraw_shotgun_meshes( int weapon_type );
void		ready_shotgun( int weapon_type );
void		RifleHandler( int weapon_type );
void		AnimateShotgun( int weapon_type );
void		FireShotgun( void );
void		FireHarpoon( void );
void		FireM16(int running);
void		FireRocket( void );
void		ControlHarpoonBolt(sint16 item_number);
void		ControlRocket(sint16 item_number);

/******************************* LARAFLAR.C ***********************************************/

int		DoFlareLight(PHD_VECTOR *pos, int flare_age);
void		DoFlareInHand(int flare_age);
void		DrawFlareInAir(ITEM_INFO *item);
void		CreateFlare(int thrown);
void		draw_flare( void );
void		undraw_flare( void );
void		draw_flare_meshes( void );
void		undraw_flare_meshes( void );
void		ready_flare( void );

/******************************* LARASWIM.C **********************************************/
void		LaraUnderWater( ITEM_INFO *item, COLL_INFO *coll );
void		LaraSwimCollision( ITEM_INFO *item, COLL_INFO *coll );
void 		LaraWaterCurrent( COLL_INFO *coll );
sint32		GetWaterDepth(sint32 x, sint32 y, sint32 z, sint16 room_number );

/******************************* LARASURF.C **********************************************/
void		LaraSurface( ITEM_INFO *item, COLL_INFO *coll );
void		LaraSurfaceCollision( ITEM_INFO *item, COLL_INFO *coll );
int			LaraTestWaterClimbOut( ITEM_INFO *item, COLL_INFO *coll );

/******************************* COLLIDE.C  **********************************************/
void		GetCollisionInfo( COLL_INFO *info, sint32 xpos, sint32 ypos, sint32 zpos,
						 	  sint16 room_number, sint32 objheight );
sint32		FindGridShift( sint32 src, sint32 dst );
int			CollideStaticObjects( COLL_INFO *coll, sint32 x, sint32 y, sint32 z,
							  	  sint16 room_number, sint32 hite );
void		GetNearByRooms( sint32 x, sint32 y, sint32 z, sint32 r, sint32 h, sint16 room_number );
void		GetNewRoom( sint32 x, sint32 y, sint32 z, sint16 room_number );
void		ShiftItem( ITEM_INFO *item, COLL_INFO *coll );
void		UpdateLaraRoom( ITEM_INFO *item, int height );
sint16		GetTiltType( FLOOR_INFO *floor, sint32 x, sint32 y, sint32 z);
void		LaraBaddieCollision( ITEM_INFO *litem, COLL_INFO *coll );
void		EffectSpaz( ITEM_INFO *laraitem, COLL_INFO *coll );
void		CreatureCollision( sint16 item_num, ITEM_INFO *laraitem, COLL_INFO *coll );
void		ObjectCollision( sint16 item_num, ITEM_INFO *laraitem, COLL_INFO *coll );
void		TrapCollision( sint16 item_num, ITEM_INFO *laraitem, COLL_INFO *coll );
void		DoorCollision( sint16 item_num, ITEM_INFO *laraitem, COLL_INFO *coll );
void		ItemPushLara( ITEM_INFO *item, ITEM_INFO *laraitem, COLL_INFO *coll, int spazon, int bigpush );
int			TestBoundsCollide( ITEM_INFO *item, ITEM_INFO *laraitem, sint32 radius );
int			TestSpriteCollide( ITEM_INFO *item, ITEM_INFO *laraitem, sint32 radius );
int			TestLaraPosition( sint16 *bounds, ITEM_INFO *item, ITEM_INFO *laraitem );
void		AlignLaraPosition( PHD_VECTOR *vec, ITEM_INFO *item, ITEM_INFO *laraitem );
int			MoveLaraPosition( PHD_VECTOR *vec, ITEM_INFO *item, ITEM_INFO *laraitem );
int			Move3DPosTo3DPos( PHD_3DPOS *srcpos, PHD_3DPOS *destpos, int velocity, PHD_ANGLE angadd );

/******************************* SPHERE.C *************************************************/
int			TestCollision( ITEM_INFO *item, ITEM_INFO *laraitem );
int			GetSpheres( ITEM_INFO *item, SPHERE *ptr, int WorldSpace );
void		GetJointAbsPosition( ITEM_INFO *item, PHD_VECTOR *vec, int joint );
void		BaddieBiteEffect( ITEM_INFO *item, BITE_INFO *offset );

/******************************* HEALTH.C *************************************************/
extern	int	overlay_flag;
int		FlashIt(void);
void		DrawHealthBar( int flash_state );
void		DrawAirBar( int flash_state );
void 		MakeAmmoString(char *string);
void		DrawAmmoInfo( void );
void		DrawModeInfo(void);
void		InitialisePickUpDisplay( void );
void		DrawPickups( int timed );
void		AddDisplayPickup( sint16 objnum );

/******************************* MOVEBLOK.C ***********************************************/
void		InitialiseMovingBlock( sint16 item_num );
void		MovableBlock( sint16 item_number );
void		MovableBlockCollision( sint16 item_num, ITEM_INFO *laraitem, COLL_INFO *coll );
void		AlterFloorHeight( ITEM_INFO *item, int height );
int		TestBlockPush( ITEM_INFO *item, int blokhite, uint16 quadrant );
int		TestBlockPull( ITEM_INFO *item, int blokhite, uint16 quadrant );
void		InitialiseRollingBlock( sint16 item_num );
void		RollingBlock( sint16 item_number );
void		DrawMovableBlock( ITEM_INFO *item );
void		DrawUnclippedItem( ITEM_INFO *item );

/******************************* PICKUP.C *************************************************/
void		DetonatorCollision(sint16 item_number, ITEM_INFO *laraitem, COLL_INFO *coll);
void		PickUpCollision( sint16 item_num, ITEM_INFO *laraitem, COLL_INFO *coll );
void		PickUpScionCollision( sint16 item_num, ITEM_INFO *laraitem, COLL_INFO *coll );
void		PickUpScion4Collision( sint16 item_num, ITEM_INFO *laraitem, COLL_INFO *coll );
void		MidasCollision( sint16 item_num, ITEM_INFO *laraitem, COLL_INFO *coll );
void		SwitchCollision( sint16 item_num, ITEM_INFO *laraitem, COLL_INFO *coll );
void		SwitchCollision2( sint16 item_num, ITEM_INFO *laraitem, COLL_INFO *coll );
void		KeyHoleCollision( sint16 item_num, ITEM_INFO *laraitem, COLL_INFO *coll );
void		PuzzleHoleCollision( sint16 item_num, ITEM_INFO *laraitem, COLL_INFO *coll );
void		SwitchControl( sint16 item_number );
int		SwitchTrigger( sint16 item_num, sint16 timer );
int		KeyTrigger( sint16 item_num );
int		PickupTrigger( sint16 item_num );
void		PickUpSaveGameCollision( sint16 item_num, ITEM_INFO *laraitem, COLL_INFO *coll );
void		InitialiseSavegameItem( sint16 item_num );
void		ControlSavegameItem( sint16 item_num );
void		DrawSavegameItem( ITEM_INFO *item );
void		SecretControl(sint16 item_number);

/******************************* EFFECTS.C ***********************************************/
sint16	DoBloodSplat( sint32 x, sint32 y, sint32 z, sint16 speed, PHD_ANGLE direction, sint16 room_num );
void		DoLotsOfBlood(sint32 x, sint32 y, sint32 z, sint16 speed, PHD_ANGLE direction, sint16 room_num, int number);
void		ControlBlood1( sint16 item_num );
void		move_explosion( sint16 fx_num );
void		CreateBubble(PHD_3DPOS *pos, sint16 room_number);
void		ControlBubble1( sint16 item_num );
void		ControlExplosion1( sint16 item_num );
void		InitialiseBubbleEmitter( sint16 item_num );
void		ControlBubbleEmitter( sint16 item_num );
void		Richochet( GAME_VECTOR *pos );
void		ControlRichochet1( sint16 fx_num );
void		Twinkle( GAME_VECTOR *pos );
void		ControlTwinkle( sint16 fx_num );
void		LaraBubbles( ITEM_INFO *item );
void		Splash( ITEM_INFO *item );
void		WadeSplash( ITEM_INFO *item, int waterheight, int waterdepth );
void		ControlSplash1( sint16 fx_num );
void		ControlSnowSprite(sint16 fx_num);
void		ControlWaterSprite(sint16 fx_num);
void		ControlHotLiquid(sint16 fx_num);

void	floor_shake_effect( ITEM_INFO *item );
void	silly_effect( ITEM_INFO *item );
extern	void	(*effect_routines[])( ITEM_INFO *item );
void	ItemSparkle( ITEM_INFO *item, int meshmask );

/***************************** LIGHTNIN.C ***********************************************/
void	DrawLightning( ITEM_INFO *item );
void	InitialiseLightning( sint16 item_num );
void	LightningControl( sint16 item_number );
void	LightningCollision( sint16 item_num, ITEM_INFO *laraitem, COLL_INFO *coll );
void	InitialiseThorsHandle( sint16 item_num );
void	ThorsHandleControl( sint16 item_number );
void	ThorsHandleCollision( sint16 item_num, ITEM_INFO *laraitem, COLL_INFO *coll );
void	ThorsHeadCollision( sint16 item_num, ITEM_INFO *laraitem, COLL_INFO *coll );

/******************************* ITEMS.C *************************************************/
void	InitialiseItemArray( int numitems );
void	KillItem( sint16 item_number );
sint16	CreateItem( void );
void	InitialiseItem( sint16	item_num );
void	RemoveActiveItem( sint16 item_num );
void	RemoveDrawnItem( sint16 item_num );
void	AddActiveItem( sint16 item_num );
void 	ItemNewRoom( sint16 item_number, sint16 room_number );
sint16	SpawnItem( ITEM_INFO *item, int object_number );
int		GlobalItemReplace( int in_objnum, int out_objnum );
void	InitialiseFXArray( void );
void	KillEffect( sint16 fx_num );
sint16	CreateEffect( sint16 room_num );
void	InitialiseEffect( sint16 fx_num );
void	EffectNewRoom(sint16 fx_num, sint16 room_number);
void	ClearBodyBag(void);
extern sint16 body_bag;

/*********************************** DRAW.C **************************************************/


sint32		DrawPhaseGame(void);
sint32		DrawPhaseCinematic(void);
void 		DrawRooms(sint16 current_room);
//void 		GetRoomBounds(sint16 room_number);
//int 		SetRoomBounds(sint16 *objptr, sint16 room_number, ROOM_INFO *parent);
void 		PrintRooms(sint16 room_number);
void		DrawEffect(sint16 fx_num);
void		DrawDummyItem( ITEM_INFO *item );
void		DrawLara( ITEM_INFO *item );
void		DrawSpriteItem( ITEM_INFO *item );
void		DrawAnimatingItem( ITEM_INFO *item );
void		DrawLaraInCutScene( ITEM_INFO *item );
void		DrawGunFlash(int weapon_type, int clip);
void		CalculateObjectLighting	(ITEM_INFO *item, sint16 *frame);
void		InitInterpolate( int frac, int rate );
void		phd_PopMatrix_I(void);
void		phd_PushMatrix_I(void);
void		phd_TranslateRel_I( sint32 x, sint32 y, sint32 z );
void		phd_TranslateRel_ID( sint32 x, sint32 y, sint32 z, sint32 x2, sint32 y2, sint32 z2 );
void		phd_RotY_I( sint16 ang );
void		phd_RotX_I( sint16 ang );
void		phd_RotZ_I( sint16 ang );
void		phd_RotYXZ_I( sint16 y, sint16 x, sint16 z );
void		phd_RotYXZpack_I( sint32 r1, sint32 r2 );
void		gar_RotYXZsuperpack( sint16 **pprot, int skip );
void		gar_RotYXZsuperpack_I( sint16 **pprot1, sint16 **pprot2, int skip );
void		phd_PutPolygons_I( sint16 *ptr, int clip );
void		InterpolateMatrix( void );
void		InterpolateArmMatrix( void );
void		DrawLaraInt( ITEM_INFO *item, sint16 *frame1, sint16 *frame2,int frac,int rate );
int			GetFrames( ITEM_INFO *item, sint16 *frm[], int *rate );
sint16		*GetBestFrame( ITEM_INFO *item );
sint16		*GetBoundsAccurate( ITEM_INFO *item );

/****************************** CINEMA.C ****************************************/

extern		sint16		*cine;
extern		sint16		num_cine_frames;
extern		sint16		cine_frame;
extern		PHD_3DPOS	cinematic_pos;

sint32		StartCinematic( int level_number );
sint32		DoCinematic(sint32 nframes);
void		LaraControlCinematic( sint16 item_num );
void		ControlCinematicPlayer( sint16 item_num );
void		CalculateCinematicCamera( void );
void		InitialisePlayer1( sint16 item_num );
void		InitialiseGenPlayer( sint16 item_num );
void		InGameCinematicCamera( void );

/******************************** LOT.C *****************************************/
extern	CREATURE_INFO 	*baddie_slots;
extern	int				slots_used;

void		InitialiseLOTarray( void );
void		DisableBaddieAI( sint16 item_num );
int			EnableBaddieAI( sint16 item_number, int Always );
void		InitialiseSlot( sint16 item_number, int slot );
int 		InitialiseLOT(LOT_INFO *LOT);
void 		ClearLOT(LOT_INFO *LOT);
#ifdef PSX_VERSION
int			OnIdleLOTUpdate(int (*pfnIdleCheckRoutine)(void));
#endif

/***************************** SKIDOO.C *****************************************/

void InitialiseSkidoo(sint16 item_number);
void SkidooCollision(sint16 item_number, ITEM_INFO *litem, COLL_INFO *coll);
int SkidooControl(void);
void DrawSkidoo(ITEM_INFO *item);

/***************************** BOAT.C *******************************************/

void InitialiseBoat(sint16 item_number);
void BoatCollision(sint16 item_number, ITEM_INFO *litem, COLL_INFO *coll);
void BoatControl(sint16 item_number);

/***************************** EOF **********************************************/
#ifdef __cplusplus
}
#endif

#endif
