

#ifndef __SUBGAME_H__
#define __SUBGAME_H__

#include "global.h"


#define LAUNCHGAME_CAMPOS		2
#define LAUNCHGAME_CAMLOOK		1



extern int subGameRestart;


extern int SUB_BAR_BAR_WIDTH;
extern ACTOR *myactor;




typedef struct _LAUNCH_GAME_DATA
{
	int	state, aimMoveState;
	int	aimXRot, aimYRot, aimXMove, aimYMove, aimXAccel, aimYAccel;
	
	ACTOR * flyActor, * walkOffActors[5];
	PSIMODEL * chickenModels[3];
} LAUNCH_GAME_DATA;





#define	SUBGAME_MOVESTATE_UP		1
#define	SUBGAME_MOVESTATE_DOWN		2
#define	SUBGAME_MOVESTATE_LEFT		4
#define	SUBGAME_MOVESTATE_RIGHT		8


void launchGame_Controls(LAUNCH_GAME_DATA *gd);
void launchGame_MoveAim(LAUNCH_GAME_DATA *gd);
void launchGame_SetupCamera(void);


void subgameInitPowerBar();
void subgameDrawPowerBar(int x, int y, int inpower);

//void sgStartCameraMove(VECTOR *targetPos, VECTOR *targetLook, int numFrames);
//int  sgUpdateCameraMove();


int drawClippedSpriteOverlay(TextureType *spr, int x, int y, int depth, short clipLeft, short clipRight, short clipTop, short clipBottom);
int drawClippedSpriteOverlayColour(TextureType *spr, int x, int y, int depth, short clipLeft, short clipRight, short clipTop, short clipBottom, ULONG colour);

int getWorldPosOfBone(ACTOR* actor, char *bone, VECTOR *res);
void moveActorTowardsCamera(ACTOR* actor, int dist);
int overlaySizeableSprite(TextureType *spr, int x, int y, int w, int h, int depth, unsigned long colour);
int drawVertScrollOverlay(TextureType *spr, int x, int y, int vPos, int depth);

void initCricketScores(int x, int y, int numBronze, int numSilver, int numGold, int depth);
void drawCricketScores(int x, int y, int num);
int PrintFixedDepth3DSprite(TextureType *spr,VERT *vect,SHORT scale, unsigned long colour, long depth);

void initStopWatch(int x, int y, int fov);
void drawStopWatch(int time);
void freeStopWatch();

void DrawDirectionArrows(TextureType *rarrow, int yPos);


void initFowler(int fov);
void startFowler(int animOffset, int length);
void fowlerDraw();
void freeFowler();





#endif