/******************************************************************************************
	CRTEST PS   (c) 1999-2001 ISL

	options.h:			Options screen stuff
******************************************************************************************/


#ifndef __OPTIONS_H__
#define __OPTIONS_H__

#if PALMODE == 0
	#define BOTTOM_WINDOW_Y	85
#else
	#define BOTTOM_WINDOW_Y	100
#endif


typedef struct {
	int days;
	int tenshours;
	int hours;
	int tensminutes;
	int minutes;
	int tensseconds;
	int seconds;
	int tenths;
	int hundredths;} gametimerType;

enum
{
	OPTIONS_BED_START,
	OPTIONS_BOMB_START,
	OPTIONS_CINEMA_START,	// coz the movie theatre needs to free the fowlers hut data, then reload it.
	OPTIONS_DOOR_START,
	OPTIONS_DIARY_START,
	OPTIONS_DAYTIME = 64	// For act 2 - there's a re-lit fowler's hut
};

#define OPTIONS_FROM_GAME		0
#define OPTIONS_FROM_TITLE		128

void optionsStart(int mode);			// 0 = start on Bed (default) or 1 = start on Bomb

void optionsDraw(void);
void optionsCycle(void);
void optionsEnd(void);
void optionsSetCamera(void);
void optionsAlphaRectangle(int x, int y, int w, int h, int depth, unsigned long colour);
void optionsDrawOptionScreen(void);
void optionsDrawList(int *text_ids, unsigned short base_item, unsigned short num_items , int x, int align);
void optionsSaveCycle(void);
void optionsControllerCycle(void);
void optionsDrawOnly(void);
void optionsSoundCycle(void);
void optionsDrawControllerOptions(void);
void optionsResetAllToDefaults(void);
void optionsDrawSoundOptions(void);
void optionsDrawBoxOutline(int x, int y, int w, int h, unsigned int colour);
void optionsScenicsInit(void);
void optionsDrawRatingsRatings(void);
void optionsRatingsRatingsCycle(void);
void optionsRatingsStatsCycle(void);
void optionsRatingsTimesCycle(void);
void optionsDrawLevelSelect(void);
void optionsLevelSelectCycle(void);
void optionsSaveCycle(void);
void optionsReturn(void);
void optionsRatingsCycle(void);
void optionsDrawLevelSelect(void);
void optionsLevelSelectCycle(void);
void optionsDrawRatingsStats(void);
void optionsDrawRatingsTimes(void);
void optionsDoTestData(void);
void optionsMoviesCycle(void);
void optionsMoviesDraw(void);
void optionsEndToGame(void);
void optionsDrawTime(gametimerType *timetoprint, int x, int y, int r, int g, int b);
void optionsFramesToTimer (int timeinframes, gametimerType *timer);
void optionsDrawBestTimes(void);
void optionsResetGame(void);
void optionsGalleryCycle(void);
void centreScreenStart(void);
void optionsGalleryDraw(void);
void optionsDebouncedAnalogCycle(void);

enum
{
	MOVIENO_BLITZ,
	MOVIENO_DREAMWORKS,
	MOVIENO_EIDOS,
	MOVIENO_AARDMAN,

	MOVIENO_ACT1_INTRO,		// IN	Fence
	MOVIENO_BOSS1_INTRO,	// IN	Mannequin walks round corner
	MOVIENO_BOSS1_FAIL,		// IN	Dogs get mannequin
	MOVIENO_BOSS1_DONE,		// IN	We've got to get out of here

	MOVIENO_ACT2_INTRO,
	MOVIENO_BOSS2_INTRO,
	MOVIENO_BOSS2_DONE,

	MOVIENO_ACT4_INTRO,
	MOVIENO_BOSS4_INTRO,
	MOVIENO_BOSS4_DONE,

	MOVIENO_GAME_COMPLETE,

	NUM_MOVIES
};
//#define SELECTABLE_MOVIE_BASE MOVIENO_ACT1_INTRO		// Base number for the selectable menu
#define SELECTABLE_MOVIE_BASE 0		// Base number for the selectable menu

#define MOVIENO_BONUS1	MOVIENO_BLITZ	// Just so it's defined, because inventory.c assumes the bonus vis exist


// The openy-closey main menu window
// (As used by all good splash screens)
extern unsigned char menuopening;
extern unsigned char menuclosing;
extern int menuwidth;

extern unsigned int optionTextRGB;


void optionsAlphaMainMenuInit();
int optionsAlphaMainMenuDraw(int y, int h, int colour);

void optionsPhaseMenuRGB();




extern unsigned char lastoptionstate;
extern unsigned char optionstate;
extern int options_returnlevel;

// states
enum{SAVE_MAIN,					// 0 - main save / load game screen - just a menu
	TIMES_MAIN,					// 1 - main best times screen - ?
	RATINGS_MAIN,				// 2 - Ratings \ Medals
	SOUND_MAIN,					// 3 - main sound options screen - just a menu
	CONTROLLER_MAIN,			// 4 - main controller options screen - just a menu
	SCREENSETUP_MAIN,			// 5 - centre screen options 
	EXIT_MAIN,					// 6 - Exit
	MOVIES_MAIN,				// 7 - main movies screen - ?
	LANGUAGE_MAIN,
	GALLERY_MAIN,				// 8 - main gallery screen - ?
	CREDITS_MAIN,				// 9 - Credits
	LEVELSELECT_MAIN,			// 10 - level select screen - list of already completed levels
	OPTIONS_MAIN,				// 11 - Viewing main options (Fowler's hut)
	TOTAL_STATES,				// 12 =======sub-menus follow=======
	RATINGS_RATINGS,			// 13
	RATINGS_TIMES,				// 15
	SAVE_LOAD,					// 16
	LOAD_LOAD,					// 17
	CONTROL_METHOD};			// 18

#define SAVE_MAIN_NUM 2
#define RATINGS_MAIN_NUM 0
#define TIMES_MAIN_NUM 6
#define SOUND_MAIN_NUM 4
#define CONTROLLER_MAIN_NUM 2				// number of options per menu
#define SCREENSETUP_MAIN_NUM 1
#define EXIT_MAIN_NUM 0
#define MOVIES_MAIN_NUM 7
#define GALLERY_MAIN_NUM 7
#define CREDITS_MAIN_NUM 3
#define LEVELSELECT_MAIN_NUM 6
#define LEVEL_ACT1_NUM 2
#define LEVEL_ACT2_NUM 5
#define LEVEL_ACT3_NUM 6
#define CONTROL_METHOD_NUM 6			// just enough to cover the controller picture
#define NUM_CONTROL_METHODS 4			// 4 alternative control methods available




void video_PlayVid(int n, int make_avail);	// coz I've not got a better "h" file to put it in at the moment ;)


#define OPTIONS_HIT_ALL	65535
#define OPTIONS_HIT_SCREEN_POS		1
#define OPTIONS_HIT_SHOCKENABLE		2
#define OPTIONS_HIT_SFX_VOL		4
void optionsHitOptions(int which);


	typedef struct {
		unsigned short vibration;							// whether or not vibration is enabled
		unsigned short analog;
	} controlType;				// whether or not analog control is enabled

	typedef struct {
		unsigned short sfxvol;				// the SFX volume
		unsigned short speechvol;							// the speech volume
		unsigned short musicvol;							// the music volume
		unsigned short mastervol;							// master volume
		unsigned short stereo;
		unsigned short dummy;
	} soundType;					// stereo enable (0=mono, 1 = stereo)
	
	typedef struct
	{
		int offset_x;
		int offset_y;
	}optionsScreenType;

	typedef struct {
		soundType sound;
		controlType control;
		optionsScreenType screen;
		} OPTIONDATASTR;
	
	extern OPTIONDATASTR optionData;

	extern void cardFowlerLoadStart();

	extern void cardFowlerLoadStart();




#endif			// __OPTIONS_H__
