/****************************************************************************
*
* MINECART.H
*
* PROGRAMMER : Chris
*    VERSION : 00.00
*    CREATED : 11/08/98
*   MODIFIED : 11/08/98
*       TABS : 5
*
* DESCRIPTION
*	Header file for MINECART.C
*
*****************************************************************************/

#ifndef _MINECART_H
#define _MINECART_H

#ifdef __cplusplus
extern "C" {
#endif

/*---------------------------------------------------------------------------
 *	Import Headers
\*--------------------------------------------------------------------------*/

#ifdef PSX_VERSION
#include "../spec_psx/typedefs.h"
#else
#include "..\specific\stypes.h"
#endif

#include "items.h"
#include "collide.h"

/*---------------------------------------------------------------------------
 *	Type Definitions
\*--------------------------------------------------------------------------*/

typedef struct {
	sint32 Speed;
	sint32 MidPos;
	sint32 FrontPos;
	sint32 TurnX;
	sint32 TurnZ;
	sint16 TurnLen;
	sint16 TurnRot;
	sint16 YVel;
	sint16 Gradient;
	char Flags;
	char StopDelay;
}CARTINFO;

/* -------- flags */

#define CF_MESH	1
#define CF_TURNINGL	2
#define CF_TURNINGR	4
#define CF_RDIR	8
#define CF_CONTROL	16
#define CF_STOPPED	32
#define CF_NOANIM	64
#define CF_DEAD	128

/*---------------------------------------------------------------------------
 *	Prototypes
\*--------------------------------------------------------------------------*/

#if !defined(CARTINFO_ONLY)

#if defined(PSX_VERSION) && defined(RELOC)

typedef void (MINECARTFUNC1)(sint16, ITEM_INFO *, COLL_INFO *);
typedef int (MINECARTFUNC2)(void);

#define MineCartInitialise	((VOIDFUNCSINT16 *)VehiclePtr[0])
#define MineCartCollision	((MINECARTFUNC1 *)VehiclePtr[1])
#define MineCartControl		((MINECARTFUNC2 *)VehiclePtr[2])

#else

extern void MineCartInitialise(sint16 item_number);
extern void MineCartCollision(sint16 item_number, ITEM_INFO *l, COLL_INFO *coll);
extern int MineCartControl();

#endif

#endif

#ifdef __cplusplus
}
#endif

#endif
