#pragma once

const int MAX_TEAMRADAR_TIMES = 32;

entityclass(TeamRadar);
// to make entities have dots on the team radar
classfield(TeamRadar) .float teamradar_icon;
classfield(TeamRadar) .float teamradar_times[MAX_TEAMRADAR_TIMES];
classfield(TeamRadar) .int teamradar_time_index;
classfield(TeamRadar) .vector teamradar_color;

float teamradar_angle; // player yaw angle (in radians to optimize code)
vector teamradar_origin3d_in_texcoord; // player origin
vector teamradar_origin2d; // 2D origin
vector teamradar_size2d; // 2D size
vector teamradar_extraclip_mins, teamradar_extraclip_maxs; // for non-centered radar display
float teamradar_size; // 2D scale factor
float v_flipped;

float hud_panel_radar_scale; // window size = ...qu
float hud_panel_radar_foreground_alpha;
int hud_panel_radar_rotation;
vector hud_panel_radar_size;
int hud_panel_radar_zoommode;
int hud_panel_radar_maximized_zoommode;
int hud_panel_radar_maximized_rotation;


vector teamradar_2dcoord_to_texcoord(vector in);

vector teamradar_3dcoord_to_texcoord(vector in);

vector teamradar_texcoord_to_2dcoord(vector in);

vector teamradar_texcoord_to_3dcoord(vector in,float oz);

void draw_teamradar_background(float fg);

void draw_teamradar_player(vector coord3d, vector pangles, vector rgb);

void draw_teamradar_icon(vector coord, entity icon, entity pingdata, vector rgb, float a);

void draw_teamradar_link(vector start, vector end, int colors);

void teamradar_loadcvars();
