
Moderators: Nexuiz Moderators, Moderators
if(last_weapon != activeweapon) {
wcross_wep = ""; // not sure if this is needed.. did not take a closer look at the code right before..
if(cvar("crosshair_custom")) // IMO a bad name, crosshair_per_weapon or _per_gun might be better?
e = get_weaponinfo(activeweapon);
wcross_wep = strcat("_", e.netname);
}
wcross_style = cvar(strcat("crosshair", wcross_wep));
wcross_color_x = cvar(strcat("crosshair", wcross_wep, "_color_red"));
wcross_color_y = cvar(strcat("crosshair", wcross_wep, "_color_green"));
wcross_color_z = cvar(strcat("crosshair", wcross_wep, "_color_blue"));
wcross_size_x = cvar(strcat("crosshair", wcross_wep, "_size")) * 24;
wcross_size_y = wcross_size_x;
wcross_size_z = 0;
wcross_alpha = cvar(strcat("crosshair", wcross_wep, "_color_alpha"));
weapontime = time;
last_weapon = activeweapon;
void draw_crosshair()
{ // not all crosshair images are square ;)
vector ch_position, ch_colour;
vector ch_size;
string ch_name;
float ch_alpha;
ch_name = strcat("gfx/crosshair", ftos(cvar("crosshair")));
ch_size = drawgetimagesize(ch_name) * cvar("crosshair_size");
ch_position_x = (vid_conwidth - ch_size_x) * 0.5;
ch_position_y = (vid_conheight - ch_size_y) * 0.5;
ch_colour_x = cvar("crosshair_color_red");
ch_colour_y = cvar("crosshair_color_green");
ch_colour_z = cvar("crosshair_color_blue");
ch_alpha = cvar("crosshair_color_alpha");
drawpic(ch_position, ch_name, ch_size, ch_colour, ch_alpha, 0);
}
victim wrote:cleaned the code 'couldn't resist the urge to self-destruct', commented a few unneeded lines - need to confirm that they are unwanted
Return to Nexuiz - Development
Users browsing this forum: No registered users and 1 guest