/*********************************************************************************************/
/*                                                                                           */
/* General Game Type Definitions                                                             */
/*                                                                                           */
/*********************************************************************************************/

#ifndef TYPES_H
#define TYPES_H

#ifdef __cplusplus
extern "C" {
#endif

#include "objects.h"
/********************************* TYPE DEFINITIONS ******************************************/

#define GAME_FOV	80			   // Field of View for Game

/* Useful macros */
#define SQUARE(A) ((A)*(A))

enum sfx_types {
		SFX_LANDANDWATER = 0<<14,
		SFX_LANDONLY     = 1<<14,
		SFX_WATERONLY    = 2<<14
};

/*
enum init_level_types {
		IL_TITLE,
		IL_NORMAL,
		IL_SAVED,
		IL_DEMO,
		IL_CUTSCENE,
		IL_STORY_SO_FAR,
		IL_QUIET,
		IL_STORY_SO_FAR_MIDLEVEL
};
*/


/* Game options - bits determine what options appear on wheel */
#define NO_ACTION    0
#define GAME_ACTION  1
#define END_ACTION	 2
#define LOAD_ACTION  4
#define SAVE_ACTION  8
#define SOUND_ACTION 16
#define VIDEO_ACTION 32

#define GRAVITY           6
#define FASTFALL_SPEED  128

#define DONT_TARGET	(-16384)

#define DEMOCOUNT_MAX	(30*60*5)			// 5 Minutes Max of Demo..

#define UNIT_SHADOW		256
#define UNIT_SHADOW_SHIFT 8

/* For triggers */
#define ATONESHOT	0x80		// Anti-trigger ONESHOT.
#define ONESHOT     0x0100
#define CODE_BITS   0x3e00
#define REVERSE	  0x4000
#define NOT_VISIBLE ONESHOT
#define KILLED_ITEM (-0x8000)
#define CLEAR_BODY  KILLED_ITEM

#define MAX_CD_TRACKS 64
#define MAX_SECRETS 16

#define MAX_DYNAMICS 10

extern int record_demo;
typedef struct sphere {
	sint32	x,y,z,r;
} SPHERE;


/************************************ Camera structure ***********************************/

#define NO_CAMERA -1

typedef enum camera_type {CHASE_CAMERA, FIXED_CAMERA, LOOK_CAMERA, COMBAT_CAMERA, CINEMATIC_CAMERA, HEAVY_CAMERA} CAMERA_TYPE;

/* Camera flags to modify basic behaviour */
#define FOLLOW_CENTRE 1
#define NO_CHUNKY     2
#define CHASE_OBJECT  3
#define	NO_MINY	0xffffff

typedef struct camera_info {
	GAME_VECTOR pos;
	GAME_VECTOR target;
	CAMERA_TYPE type;
	sint32 shift, flags, fixed_camera;
	sint32 number_frames, bounce, underwater;
	sint32 target_distance, target_square;
	sint16 target_angle, actual_angle;
	sint16 target_elevation;
	sint16 box;
	sint16 number, last, timer, speed;
	long		min_ypos;		// Set the minimum Y position that camera will fall to (0xffffff = not used).
	ITEM_INFO *item, *last_item;			// item to use as target (usually Lara)
	OBJECT_VECTOR *fixed;     // array of fixed camera positions
	int mike_at_lara;
	PHD_VECTOR mike_pos;	// world coordinate origin of projection plane (0,0,phd_persp in screen coordinates) (for sound)
} CAMERA_INFO;

typedef struct sample_info {
	sint16 number;			 // base sound effect number
	sint16 volume;			 // default volume of sound
	sint16 randomness;	     // Chance of playing sample 0-32767  0=Always
	sint16 flags;	         // Flags for all sorts of stuff
}SAMPLE_INFO;

#ifdef PSX_VERSION					// Jasons Gouraud definition...
typedef uint32 SG_COL;
#else
typedef uint16 SG_COL;
#endif


/* Include data types for particular object types + item specific prototypes */
#include "box.h"
#include "lara.h"
#include "traps.h"
#include "inventry.h"
#include "text.h"
#include "gameflow.h"
#include "title.h"
#include "gametext.h"
#include "savegame.h"

#ifdef __cplusplus
}
#endif

#endif
