#ifndef _WINGS_H__
#define _WINGS_H__



enum
{
	WM_SQUARE,
	WM_CROSS,
	WM_CIRCLE,
	WM_TRIANGLE,
	WM_NUM_BUTTONS
};


enum
{
	WING_POLE,
	WING_MATERIAL,
	WING_STITCH,
	NUM_WING_WORKERS,
};


// chicken states
enum
{
	WM_CHICKEN_GETTING_SCARED,
	WM_CHICK_SCARED,
	WM_CHICK_PEEKING,
	WM_CHICKEN_LOOKING_LR,
	WM_CHICKEN_MOVING_UP,
	WM_CHICKEN_UP,
	WM_CHICKEN_WORKING,
	WM_CHICKEN_READY,
	WM_CHICKEN_HANDED_BACK,
};


typedef struct
{
	int state;
	int timer;
	short fusePos;
	short lastFusePos;
	short targetActorYPos;
	short fuseSpeed;

	PSIMODEL *model;
	ACTOR *actor;

	VECTOR velProduce;
	ACTOR *produce;

}WM_CHICKEN;




typedef struct
{
	char done[NUM_WING_WORKERS];
	int buttonState[NUM_WING_WORKERS][2];
	int barAlpha[NUM_WING_WORKERS][2];

	TextureType *backPoles;
	TextureType *backPolesSelected;

	TextureType *backCanvas[3];

	TextureType *buttonTexture;				
	TextureType *buttonInTexture;				

	TextureType *mButtonTexture[WM_NUM_BUTTONS];				
	TextureType *mButtonInTexture[WM_NUM_BUTTONS];				



	TextureType *bulb;
	TextureType *bulbAlpha;

	TextureType *fuse;

	TextureType *pumpup;
	TextureType *spring;


}WM_BARS;



typedef struct
{
	int progress[NUM_WING_WORKERS];

	TextureType *poles;
	TextureType *material;
	TextureType *stitching;
	TextureType *wing;
}WM_PROGRESS;




typedef struct
{
	long	frameCount;
	int		countdown;
	short	state;
	short   station;
	short   lastStation;

	short	cameraMoving;
	short	cameraMovingCount;
	short	cameraXRot;
	short	cameraYRot;
	
	short	cameraTargetYRot;

	//short   mememememe;

	TextureType *arrow;

	WM_BARS bars;
	WM_PROGRESS progressBar;
	WM_CHICKEN workers[NUM_WING_WORKERS];

}WINGCTRL;



enum	// the current state of the game
{
	WM_FADEIN,
	WM_INTRO,
	WM_RUNNING,
	WM_FINISHING_SUCCEED,
	WM_FINISHING_FAIL,
	WM_BRONZE_SUCCESS,
	WM_SILVER_SUCCESS,
	WM_GOLD_SUCCESS,
	WM_FAILED,
	WM_FADEOUT,
};


enum  // actions for the wing workers. .  .. 
{
	WW_IDLE,
	WW_WORKING,
	WW_FINISHED,
	WW_THROW_STUFF,
	WW_COMPLETE,
};


void wingStart();
void wingDraw();
void wingCycle();
void wingEnd();
void wingCamera();
void wingWorkerUpdate();
//void wingDrawPowerBars();
void wingDrawProgress();

void wingDrawIntro();
void wingDrawFail();
void wingDrawGoldSuccess();
void wingDrawSilverSuccess();
void wingDrawBronzeSuccess();

void wingPrintDebug();

void wingBarDraw();





#endif