#ifndef _DMAN_H
#define _DMAN_H

#include <graphics/gfx.h>
#include <graphics/rastport.h>
#include "misc/systemdefs.h"
#include "output.h"

#define NECK		0
#define L_ELBOW 	1
#define R_ELBOW 	2
#define L_WRIST 	3
#define R_WRIST 	4
#define HIP			5
#define L_KNEE		6
#define R_KNEE		7
#define L_ANKLE	8
#define R_ANKLE	9
#define L_FOOT		10
#define R_FOOT		11

#define DANCER_UP 	0x01
#define DANCER_DOWN 	0x02
#define DANCER_LEFT	0x04
#define DANCER_RIGHT	0x08

class Dancer: public OmegaOutput{
private:
	UBYTE *bgBuffer;
	UINT bgX, bgY;
	
	Point Head;
	Point Body[12][3];
	UBYTE curState[12];
	BOOL curDir[12];
		
	void MoveHead(UINT, UINT);		// x,y - New location
	void LoadBG();
	
	void DrawFig();
	void RestoreBody();
	UBYTE blitOnce;
public:
	Dancer(UINT, UINT);
	~Dancer();
	
	BOOL StartUp();
	void DrawNextFrame(UINT);
	void OnBeat();
	void OnStart();
};

#endif
		