#ifndef _TRACKMAP_H
#define _TRACKMAP_H

#include <SDL/SDL.h>
#include "track.h"
#include "textures.h"
#include "vamos/geometry/Three_Vector.h"

#define MAP_WIDTH 256
#define MAP_HEIGHT 256

class TRACKMAP
{
private:
	TRACK* track;

	//track map size in real world 
	float map_w, map_h;
	float map_w_min, map_w_max;
	float map_h_min, map_h_max;
	float scale;

	//screen size
	float screen_w, screen_h;

	//position of the trackmap on screen
	float position_x, position_y;

	//size of the trackmap on screen
	float width, height;

	//size of the car dot on screen
	float dot_w_half, dot_h_half;

	SDL_Surface* surface;
	TEXTURE_HANDLE track_map;
	TEXTURE_HANDLE cardot0;
	TEXTURE_HANDLE cardot1;

public:
	TRACKMAP(TRACK* track);
	~TRACKMAP();
	void CalcPosition();
	void BuildMap(); 
	void DrawMap() { utility.Draw2D(position_x, position_y, position_x + width, position_y + height, &track_map); }
	void DrawCarDot(int car_index, Vamos_Geometry::Three_Vector position);
};

#endif //_TRACKMAP_H
