#ifndef _PRIMITIVES_H_
#define _PRIMITIVES_H_

#include "PS2Defines.h"

class PS2Sprite 
{
public:

	PS2Sprite();
	
	PS2Sprite(const float x, const float y);
	
	~PS2Sprite();
	
	virtual void Render(void) const;
	
	void MoveTo(const float x, const float y);
	
	void MoveDeltaX(const float x);
	
	void MoveDeltaY(const float y);
	
	void Move(void);
	
	void Scale(const float s);
	
	void ScaleX(const float s);
	
	void ScaleY(const float s);
	
	void Rotate(const float a);
	
	float GetX(void) const {return m_x;}
	
	float GetY(void) const {return m_y;}
	
protected:

	void Initialise(void);		// Initialise variables

	float m_x, m_y;				// position on screen
	float m_z;					// z depth (big = near)
	float m_w, m_h;				// width and height
	uint8 m_r, m_g, m_b, m_a;	// colour and alpha
	float m_Vx, m_Vy;			// velocity vector
	
	struct Vector2				// Local Space
	{							// Vertex coordinates
		float x, y;
	}m_TopLeft, m_BottomLeft, m_TopRight, m_BottomRight;
	
	float m_ScreenW;
	float m_ScreenH;
};

class PS2SpriteT : public PS2Sprite
{
public:
	
	PS2SpriteT();
	
	PS2SpriteT(const float x, const float y);
	
	~PS2SpriteT();
	
	void Render(void) const;
	
	
protected:
	
	int m_tu, m_tv;				// Texture coordinates (top left)
	int m_tw, m_th;				// Texture coordinates (width and height)
};

#endif