From 09dd8f125cd47599d0afb2ed2b76763ae5113eb6 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Sat, 26 Nov 2011 12:10:52 +0100 Subject: [PATCH] lots of csprogdefs stuff --- qcsrc/client/Main.qc | 10 ++--- qcsrc/client/View.qc | 6 +-- qcsrc/client/announcer.qc | 4 +- qcsrc/client/csqc_builtins.qc | 4 +- qcsrc/client/csqc_constants.qc | 9 +--- qcsrc/client/ctf.qc | 24 +++++----- qcsrc/client/hud.qc | 72 +++++++++++++++--------------- qcsrc/client/hud.qh | 6 +-- qcsrc/client/hud_config.qc | 2 +- qcsrc/client/main.qh | 2 +- qcsrc/client/mapvoting.qc | 4 +- qcsrc/client/miscfunctions.qc | 6 +-- qcsrc/client/pre.qh | 5 --- qcsrc/client/progs.src | 7 ++- qcsrc/client/scoreboard.qc | 12 ++--- qcsrc/client/sortlist.qc | 8 ++-- qcsrc/client/teamplay.qc | 6 +-- qcsrc/client/teamradar.qc | 2 +- qcsrc/client/vehicles/vehicles.qc | 74 +++++++++++++++---------------- 19 files changed, 127 insertions(+), 136 deletions(-) diff --git a/qcsrc/client/Main.qc b/qcsrc/client/Main.qc index 326bae22b..1639aa822 100644 --- a/qcsrc/client/Main.qc +++ b/qcsrc/client/Main.qc @@ -78,7 +78,7 @@ void CSQC_Init(void) menu_action = menu_sub_null; for(i = 0; i < 255; ++i) - if(getplayerkey(i, "viewentity") == "") + if(getplayerkeyvalue(i, "viewentity") == "") break; maxclients = i; @@ -224,7 +224,7 @@ float SetTeam(entity o, float Team) case COLOR_TEAM4: break; default: - if(GetTeam(Team, false) == NULL) + if(GetTeam(Team, false) == world) { print(sprintf(_("trying to switch to unsupported team %d\n"), Team)); Team = COLOR_SPECTATOR; @@ -240,7 +240,7 @@ float SetTeam(entity o, float Team) case 0: break; default: - if(GetTeam(Team, false) == NULL) + if(GetTeam(Team, false) == world) { print(sprintf(_("trying to switch to unsupported team %d\n"), Team)); Team = COLOR_SPECTATOR; @@ -1057,10 +1057,10 @@ void CSQC_Parse_Print(string strMessage) print(ColorTranslateRGB(strMessage)); } -// CSQC_Parse_CenterPrint : Provides the centerprint string in the first parameter that the server provided. +// CSQC_Parse_CenterPrint : Provides the centerprint_hud string in the first parameter that the server provided. void CSQC_Parse_CenterPrint(string strMessage) { - centerprint(strMessage); + centerprint_hud(strMessage); } string notranslate_fogcmd1 = "\nfog "; diff --git a/qcsrc/client/View.qc b/qcsrc/client/View.qc index d41923811..ae1865bab 100644 --- a/qcsrc/client/View.qc +++ b/qcsrc/client/View.qc @@ -1216,7 +1216,7 @@ void CSQC_UpdateView(float w, float h) wcross_scale *= 1 - autocvar__menu_alpha; wcross_alpha *= 1 - autocvar__menu_alpha; - wcross_size = drawgetimagesize(wcross_name) * wcross_scale; + wcross_size = draw_getimagesize(wcross_name) * wcross_scale; if(wcross_scale >= 0.001 && wcross_alpha >= 0.001) { @@ -1333,7 +1333,7 @@ void CSQC_UpdateView(float w, float h) if(time < wcross_name_changedonetime && wcross_name != wcross_name_goal_prev_prev && wcross_name_goal_prev_prev) { f = (wcross_name_changedonetime - time) / (wcross_name_changedonetime - wcross_name_changestarttime); - wcross_size = drawgetimagesize(wcross_name_goal_prev_prev) * wcross_scale; + wcross_size = draw_getimagesize(wcross_name_goal_prev_prev) * wcross_scale; CROSSHAIR_DRAW(wcross_resolution_goal_prev_prev, wcross_name_goal_prev_prev, wcross_alpha * f * wcross_name_alpha_goal_prev_prev); f = 1 - f; } @@ -1343,7 +1343,7 @@ void CSQC_UpdateView(float w, float h) } wcross_name_alpha_goal_prev = f; - wcross_size = drawgetimagesize(wcross_name) * wcross_scale; + wcross_size = draw_getimagesize(wcross_name) * wcross_scale; CROSSHAIR_DRAW(wcross_resolution, wcross_name, wcross_alpha * f); if(autocvar_crosshair_dot) diff --git a/qcsrc/client/announcer.qc b/qcsrc/client/announcer.qc index c1f023d6b..3e109e780 100644 --- a/qcsrc/client/announcer.qc +++ b/qcsrc/client/announcer.qc @@ -163,11 +163,11 @@ void carrierAnnouncer() { { if (pickup) { if (autocvar_cl_notify_carried_items & 2) - centerprint(sprintf(_("You picked up the %s!"), item)); + centerprint_hud(sprintf(_("You picked up the %s!"), item)); } else { if (autocvar_cl_notify_carried_items & 1) - centerprint(sprintf(_("You got the %s!"), item)); + centerprint_hud(sprintf(_("You got the %s!"), item)); } } diff --git a/qcsrc/client/csqc_builtins.qc b/qcsrc/client/csqc_builtins.qc index 8d7e1b292..15e62170b 100644 --- a/qcsrc/client/csqc_builtins.qc +++ b/qcsrc/client/csqc_builtins.qc @@ -90,7 +90,7 @@ vector (vector v) cs_project = #311; void drawline(float width, vector pos1, vector pos2, vector rgb, float alpha, float flags) = #315; float iscachedpic(string name) = #316; string precache_pic(string name, ...) = #317; -vector drawgetimagesize(string pic) = #318; +vector draw_getimagesize(string pic) = #318; void freepic(string name) = #319; float drawcharacter(vector position, float character, vector scale, vector rgb, float alpha, float flag) = #320; float drawstring(vector position, string text, vector scale, vector rgb, float alpha, float flag) = #321; @@ -123,7 +123,7 @@ void (float scale) setsensitivityscale = #346; float (float framenum) getinputstate = #345; void (entity e) runstandardplayerphysics = #347; -string (float playernum, string key) getplayerkey = #348; +string (float playernum, string key) getplayerkeyvalue = #348; void (string cmdname) registercmd = #352; vector () getmousepos = #344; diff --git a/qcsrc/client/csqc_constants.qc b/qcsrc/client/csqc_constants.qc index f6e04e7b3..1cd7d1f3b 100644 --- a/qcsrc/client/csqc_constants.qc +++ b/qcsrc/client/csqc_constants.qc @@ -1,4 +1,4 @@ -#define NULL world +#define world world // Mask Constants (set .drawmask on entities; use R_AddEntities to add all entities based on mask) const float MASK_ENGINE = 1; @@ -152,13 +152,6 @@ const float BUTTON_14 = 65536; const float BUTTON_15 = 131072; const float BUTTON_16 = 262144; -const float DRAWFLAG_NORMAL = 0; -const float DRAWFLAG_ADDITIVE = 1; -const float DRAWFLAG_MODULATE = 2; -const float DRAWFLAG_2XMODULATE = 3; -const float DRAWFLAG_SCREEN = 4; -const float DRAWFLAG_MIPMAP = 0x100; // only for R_BeginPolygon - #define SOLID_NOT 0 // no interaction with other objects #define SOLID_TRIGGER 1 // touch on edge, but not blocking #define SOLID_BBOX 2 // touch on edge, block diff --git a/qcsrc/client/ctf.qc b/qcsrc/client/ctf.qc index 02a09ca71..5bf6639b5 100644 --- a/qcsrc/client/ctf.qc +++ b/qcsrc/client/ctf.qc @@ -29,7 +29,7 @@ void order_menu_render() ps = '0 200 0'; po = '0 8 0'; - color = getplayerkey(player_localentnum-1, "topcolor"); + color = getplayerkeyvalue(player_localentnum-1, "topcolor"); if(getstati(STAT_CTF_STATE) == CTF_STATE_COMMANDER) { drawstring(ps, _("----- Order Menu -----"), '8 8 0', '1 1 0', 1, 0); ps += po; @@ -37,10 +37,10 @@ void order_menu_render() drawcolorcodedstring(ps, _("1) ^3previous page"), '8 8 0', 1, 0); ps += po; drawcolorcodedstring(ps, _("2) ^3next page"), '8 8 0', 1, 0); ps += po; for((n = 2), (p = i = 0); i < maxclients && n > 0; ++i) { - frags = getplayerkey(i, "frags"); + frags = getplayerkeyvalue(i, "frags"); if(!frags || (i+1) == player_localentnum) continue; - if(frags == "-666" || getplayerkey(i, "topcolor") != color) // FIXME use GetPlayerTeam + if(frags == "-666" || getplayerkeyvalue(i, "topcolor") != color) // FIXME use GetPlayerTeam continue; ++p; if(p > (8*order_page)) @@ -70,27 +70,27 @@ float order_menu_action(float bInputType, float nPrimary, float nSecondary) chose = stof(chr2str(nPrimary)); //str2chr if(arg == "1") { - color = getplayerkey(player_localentnum-1, "topcolor"); + color = getplayerkeyvalue(player_localentnum-1, "topcolor"); ++order_page; for(p = i = 0; i < maxclients; ++i) { - frags = getplayerkey(i, "frags"); + frags = getplayerkeyvalue(i, "frags"); if(!frags || (i+1) == player_localentnum) continue; - if(frags == "-666" || getplayerkey(i, "topcolor") != color) // FIXME use GetPlayerTeam + if(frags == "-666" || getplayerkeyvalue(i, "topcolor") != color) // FIXME use GetPlayerTeam continue; ++p; } if(p <= (8*order_page)) // no ppl on page order_page = 0; } else if(arg == "2") { - color = getplayerkey(player_localentnum-1, "topcolor"); + color = getplayerkeyvalue(player_localentnum-1, "topcolor"); --order_page; if(order_page < 0) { for(p = i = 0; i < maxclients; ++i) { - frags = getplayerkey(i, "frags"); + frags = getplayerkeyvalue(i, "frags"); if(!frags || (i+1) == player_localentnum) continue; - if(frags == "-666" || getplayerkey(i, "topcolor") != color) // FIXME use GetPlayerTeam + if(frags == "-666" || getplayerkeyvalue(i, "topcolor") != color) // FIXME use GetPlayerTeam continue; ++p; } @@ -100,12 +100,12 @@ float order_menu_action(float bInputType, float nPrimary, float nSecondary) if(chose == 0) chose = 10; n = 2; - color = getplayerkey(player_localentnum-1, "topcolor"); + color = getplayerkeyvalue(player_localentnum-1, "topcolor"); for(p = i = 0; i < maxclients && n > 0; ++i) { - frags = getplayerkey(i, "frags"); + frags = getplayerkeyvalue(i, "frags"); if(!frags || (i+1) == player_localentnum) continue; - if(frags == "-666" || getplayerkey(i, "topcolor") != color) // FIXME use GetPlayerTeam + if(frags == "-666" || getplayerkeyvalue(i, "topcolor") != color) // FIXME use GetPlayerTeam continue; ++p; if(p > (8*order_page)) diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 7acfacb8c..5b7928a10 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -506,7 +506,7 @@ void HUD_Weapons(void) } } for(i = weapon_cnt; i < WEP_MAXCOUNT; ++i) - weaponorder[i] = NULL; + weaponorder[i] = world; heapsort(weapon_cnt, weaponorder_swap, weaponorder_cmp, world); weaponorder_cmp_str = string_null; @@ -1940,84 +1940,84 @@ void HUD_KillCenterprint(string s1, string s2, float type, float msg) gentle = (autocvar_cl_gentle || autocvar_cl_gentle_messages); if(msg == MSG_SUICIDE) { if (type == DEATH_TEAMCHANGE) { - centerprint(sprintf(_("You are now on: %s"), s1)); + centerprint_hud(sprintf(_("You are now on: %s"), s1)); } else if (type == DEATH_AUTOTEAMCHANGE) { - centerprint(sprintf(_("You have been moved into a different team to improve team balance\nYou are now on: %s"), s1)); + centerprint_hud(sprintf(_("You have been moved into a different team to improve team balance\nYou are now on: %s"), s1)); } else if (type == DEATH_CAMP) { if(gentle) - centerprint(_("^1Reconsider your tactics, camper!")); + centerprint_hud(_("^1Reconsider your tactics, camper!")); else - centerprint(_("^1Die camper!")); + centerprint_hud(_("^1Die camper!")); } else if (type == DEATH_NOAMMO) { if(gentle) - centerprint(_("^1You are reinserted into the game for running out of ammo...")); + centerprint_hud(_("^1You are reinserted into the game for running out of ammo...")); else - centerprint(_("^1You were killed for running out of ammo...")); + centerprint_hud(_("^1You were killed for running out of ammo...")); } else if (type == DEATH_ROT) { if(gentle) - centerprint(_("^1You need to preserve your health")); + centerprint_hud(_("^1You need to preserve your health")); else - centerprint(_("^1You grew too old without taking your medicine")); + centerprint_hud(_("^1You grew too old without taking your medicine")); } else if (type == KILL_TEAM_RED || type == KILL_TEAM_BLUE) { if(gentle) - centerprint(_("^1Don't go against team mates!")); + centerprint_hud(_("^1Don't go against team mates!")); else - centerprint(_("^1Don't shoot your team mates!")); + centerprint_hud(_("^1Don't shoot your team mates!")); } else if (type == DEATH_QUIET) { // do nothing } else { // generic message if(gentle) - centerprint(_("^1You need to be more careful!")); + centerprint_hud(_("^1You need to be more careful!")); else - centerprint(_("^1You killed your own dumb self!")); + centerprint_hud(_("^1You killed your own dumb self!")); } } else if(msg == MSG_KILL) { if (type == KILL_TEAM_RED || type == KILL_TEAM_BLUE) { if(gentle) { - centerprint(sprintf(_("^1Moron! You went against ^7%s^1, a team mate!"), s1)); + centerprint_hud(sprintf(_("^1Moron! You went against ^7%s^1, a team mate!"), s1)); } else { - centerprint(sprintf(_("^1Moron! You fragged ^7%s^1, a team mate!"), s1)); + centerprint_hud(sprintf(_("^1Moron! You fragged ^7%s^1, a team mate!"), s1)); } } else if (type == KILL_FIRST_BLOOD) { if(gentle) { - centerprint(_("^1First score")); + centerprint_hud(_("^1First score")); } else { - centerprint(_("^1First blood")); + centerprint_hud(_("^1First blood")); } } else if (type == KILL_FIRST_VICTIM) { if(gentle) { - centerprint(_("^1First casualty")); + centerprint_hud(_("^1First casualty")); } else { - centerprint(_("^1First victim")); + centerprint_hud(_("^1First victim")); } } else if (type == KILL_TYPEFRAG) { // s2 contains "advanced kill messages" such as ping, handicap... if(gentle) { - centerprint(strcat(sprintf(_("^1You scored against ^7%s^1 who was typing!"), s1), s2)); + centerprint_hud(strcat(sprintf(_("^1You scored against ^7%s^1 who was typing!"), s1), s2)); } else { - centerprint(strcat(sprintf(_("^1You typefragged ^7%s"), s1), s2)); + centerprint_hud(strcat(sprintf(_("^1You typefragged ^7%s"), s1), s2)); } } else if (type == KILL_TYPEFRAGGED) { if(gentle) { - centerprint(strcat(sprintf(_("^1You were scored against by ^7%s^1 while you were typing!"), s1), s2)); + centerprint_hud(strcat(sprintf(_("^1You were scored against by ^7%s^1 while you were typing!"), s1), s2)); } else { - centerprint(strcat(sprintf(_("^1You were typefragged by ^7%s"), s1), s2)); + centerprint_hud(strcat(sprintf(_("^1You were typefragged by ^7%s"), s1), s2)); } } else if (type == KILL_FRAG) { if(gentle) { - centerprint(strcat(sprintf(_("^4You scored against ^7%s"), s1), s2)); + centerprint_hud(strcat(sprintf(_("^4You scored against ^7%s"), s1), s2)); } else { - centerprint(strcat(sprintf(_("^4You fragged ^7%s"), s1), s2)); + centerprint_hud(strcat(sprintf(_("^4You fragged ^7%s"), s1), s2)); } } else { // generic message if(gentle) { - centerprint(strcat(sprintf(_("^1You were scored against by ^7%s"), s1), s2)); + centerprint_hud(strcat(sprintf(_("^1You were scored against by ^7%s"), s1), s2)); } else { - centerprint(strcat(sprintf(_("^1You were fragged by ^7%s"), s1), s2)); + centerprint_hud(strcat(sprintf(_("^1You were fragged by ^7%s"), s1), s2)); } } } else if(msg == MSG_KILL_ACTION) { // TODO: invent more centerprints here? - centerprint(_("^1Watch your step!")); + centerprint_hud(_("^1Watch your step!")); } } @@ -2494,8 +2494,8 @@ void HUD_Radar(void) c2 = rotate('1 0 0' * mi_min_x + '0 1 0' * mi_max_y, teamradar_angle * DEG2RAD); c3 = rotate('1 0 0' * mi_max_x + '0 1 0' * mi_min_y, teamradar_angle * DEG2RAD); span = '0 0 0'; - span_x = max4(c0_x, c1_x, c2_x, c3_x) - min4(c0_x, c1_x, c2_x, c3_x); - span_y = max4(c0_y, c1_y, c2_y, c3_y) - min4(c0_y, c1_y, c2_y, c3_y); + span_x = max(c0_x, c1_x, c2_x, c3_x) - min(c0_x, c1_x, c2_x, c3_x); + span_y = max(c0_y, c1_y, c2_y, c3_y) - min(c0_y, c1_y, c2_y, c3_y); // max-min distance must fit the radar in x=x, y=y bigsize = min( @@ -4555,7 +4555,7 @@ void centerprint_generic(float new_id, string strMessage, float duration, float centerprint_countdown_num[j] = countdown_num; } -void centerprint(string strMessage) +void centerprint_hud(string strMessage) { centerprint_generic(0, strMessage, autocvar_hud_panel_centerprint_time, 0); } @@ -4598,7 +4598,7 @@ void HUD_CenterPrint (void) else if (r > 0.8) centerprint_generic(0, sprintf("^1Multiline message at time %s that\n^1lasts longer than normal", seconds_tostring(time)), 20, 0); else - centerprint(sprintf("Message at time %s", seconds_tostring(time))); + centerprint_hud(sprintf("Message at time %s", seconds_tostring(time))); hud_configure_cp_generation_time = time + 1 + random()*4; } } @@ -4673,7 +4673,7 @@ void HUD_CenterPrint (void) continue; } - // fade the centerprint in/out + // fade the centerprint_hud in/out if (centerprint_time[j] < 0 || centerprint_expire_time[j] - autocvar_hud_panel_centerprint_fade_out > time) a = bound(0, (time - (centerprint_expire_time[j] - centerprint_time[j])) / max(0.0001, autocvar_hud_panel_centerprint_fade_in), 1); else if (centerprint_expire_time[j] > time) @@ -4892,7 +4892,7 @@ void HUD_Main (void) vector color; float hud_dock_color_team = autocvar_hud_dock_color_team; if((teamplay) && hud_dock_color_team) { - f = stof(getplayerkey(current_player - 1, "colors")); + f = stof(getplayerkeyvalue(current_player - 1, "colors")); color = colormapPaletteColor(mod(f, 16), 1) * hud_dock_color_team; } else if(autocvar_hud_configure_teamcolorforced && autocvar__hud_configure && hud_dock_color_team) { @@ -4902,11 +4902,11 @@ void HUD_Main (void) { string hud_dock_color = autocvar_hud_dock_color; if(hud_dock_color == "shirt") { - f = stof(getplayerkey(current_player - 1, "colors")); + f = stof(getplayerkeyvalue(current_player - 1, "colors")); color = colormapPaletteColor(floor(f / 16), 0); } else if(hud_dock_color == "pants") { - f = stof(getplayerkey(current_player - 1, "colors")); + f = stof(getplayerkeyvalue(current_player - 1, "colors")); color = colormapPaletteColor(mod(f, 16), 1); } else diff --git a/qcsrc/client/hud.qh b/qcsrc/client/hud.qh index 2491d5ca3..cc3058f9e 100644 --- a/qcsrc/client/hud.qh +++ b/qcsrc/client/hud.qh @@ -133,7 +133,7 @@ if(!autocvar__hud_configure && panel_bg_str == "0") {\ // Get value for panel_bg_color: if "" fetch default, else use panel_bg_color. Convert pants, shirt or teamcolor into a vector. #define HUD_Panel_GetColor()\ if((teamplay) && panel_bg_color_team) {\ - panel_bg_color = colormapPaletteColor(mod(stof(getplayerkey(current_player - 1, "colors")), 16), 1) * panel_bg_color_team;\ + panel_bg_color = colormapPaletteColor(mod(stof(getplayerkeyvalue(current_player - 1, "colors")), 16), 1) * panel_bg_color_team;\ } else if (autocvar_hud_configure_teamcolorforced && autocvar__hud_configure && panel_bg_color_team) {\ panel_bg_color = '1 0 0' * panel_bg_color_team;\ } else {\ @@ -141,9 +141,9 @@ if((teamplay) && panel_bg_color_team) {\ panel_bg_color = autocvar_hud_panel_bg_color;\ } else {\ if(panel_bg_color_str == "shirt") {\ - panel_bg_color = colormapPaletteColor(floor(stof(getplayerkey(current_player - 1, "colors")) / 16), 0);\ + panel_bg_color = colormapPaletteColor(floor(stof(getplayerkeyvalue(current_player - 1, "colors")) / 16), 0);\ } else if(panel_bg_color_str == "pants") {\ - panel_bg_color = colormapPaletteColor(mod(stof(getplayerkey(current_player - 1, "colors")), 16), 1);\ + panel_bg_color = colormapPaletteColor(mod(stof(getplayerkeyvalue(current_player - 1, "colors")), 16), 1);\ } else {\ panel_bg_color = stov(panel_bg_color_str);\ }\ diff --git a/qcsrc/client/hud_config.qc b/qcsrc/client/hud_config.qc index 18ff119a7..cb27567c1 100644 --- a/qcsrc/client/hud_config.qc +++ b/qcsrc/client/hud_config.qc @@ -631,7 +631,7 @@ float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary) // allow console bind to work string con_keys; float keys; - con_keys = findkeysforcommand("toggleconsole"); + con_keys = findkeysforcommand("toggleconsole", 0); keys = tokenize(con_keys); // findkeysforcommand returns data for this float hit_con_bind, i; diff --git a/qcsrc/client/main.qh b/qcsrc/client/main.qh index 6efedb7de..499e84b6e 100644 --- a/qcsrc/client/main.qh +++ b/qcsrc/client/main.qh @@ -141,7 +141,7 @@ float chase_active_backup; float camera_roll; vector camera_direction; -void centerprint(string strMessage); +void centerprint_hud(string strMessage); void centerprint_generic(float new_id, string strMessage, float duration, float countdown_num); #define ALPHA_MIN_VISIBLE 0.003 diff --git a/qcsrc/client/mapvoting.qc b/qcsrc/client/mapvoting.qc index 201d1a969..8d1194d99 100644 --- a/qcsrc/client/mapvoting.qc +++ b/qcsrc/client/mapvoting.qc @@ -358,8 +358,8 @@ void MapVote_Init() else mv_maps_mask = ReadShort(); - // Assume mv_pk3list is NULL, there should only be 1 mapvote per round - mv_pk3list = NULL; // I'm still paranoid! + // Assume mv_pk3list is world, there should only be 1 mapvote per round + mv_pk3list = world; // I'm still paranoid! for(i = 0, power = 1; i < mv_num_maps; ++i, power *= 2) { diff --git a/qcsrc/client/miscfunctions.qc b/qcsrc/client/miscfunctions.qc index 1a512c774..84b6d3da6 100644 --- a/qcsrc/client/miscfunctions.qc +++ b/qcsrc/client/miscfunctions.qc @@ -114,7 +114,7 @@ entity GetTeam(float Team, float add) if(teamslots[num]) return teamslots[num]; if not(add) - return NULL; + return world; tm = spawn(); tm.team = Team; teamslots[num] = tm; @@ -278,7 +278,7 @@ var float _drawpic_oldsz; var string _drawpic_picpath; #define drawpic_aspect(pos,pic,mySize,color,alpha,drawflag)\ do {\ - _drawpic_imgsize = drawgetimagesize(pic);\ + _drawpic_imgsize = draw_getimagesize(pic);\ _drawpic_imgaspect = _drawpic_imgsize_x/_drawpic_imgsize_y;\ _drawpic_sz = mySize;\ if(_drawpic_sz_x/_drawpic_sz_y > _drawpic_imgaspect) {\ @@ -575,7 +575,7 @@ vector getplayerorigin(float pl) string s; entity e; - s = getplayerkey(pl, "TEMPHACK_origin"); + s = getplayerkeyvalue(pl, "TEMPHACK_origin"); if(s != "") return stov(s); diff --git a/qcsrc/client/pre.qh b/qcsrc/client/pre.qh index 5b117982d..e69de29bb 100644 --- a/qcsrc/client/pre.qh +++ b/qcsrc/client/pre.qh @@ -1,5 +0,0 @@ -#ifdef USE_FTE -#pragma target FTE -#endif - -#define CSQC 1 diff --git a/qcsrc/client/progs.src b/qcsrc/client/progs.src index 5d2b5379a..f5caf74af 100644 --- a/qcsrc/client/progs.src +++ b/qcsrc/client/progs.src @@ -1,12 +1,15 @@ ../../csprogs.dat + +sys-pre.qh +../dpdefs/csprogsdefs.qc +sys-post.qh + pre.qh ../common/util-pre.qh Defs.qc -csqc_constants.qc ../dpdefs/keycodes.qc ../common/constants.qh -csqc_builtins.qc ../warpzonelib/anglestransform.qh ../warpzonelib/mathlib.qh diff --git a/qcsrc/client/scoreboard.qc b/qcsrc/client/scoreboard.qc index 9d2e8bd58..d4c2043e6 100644 --- a/qcsrc/client/scoreboard.qc +++ b/qcsrc/client/scoreboard.qc @@ -509,7 +509,7 @@ string HUD_GetField(entity pl, float field) case SP_PING: if not(pl.gotscores) return "\xEE\x82\x8D\xEE\x82\x8D\xEE\x82\x8D"; // >>> sign - //str = getplayerkey(pl.sv_entnum, "ping"); + //str = getplayerkeyvalue(pl.sv_entnum, "ping"); f = pl.ping; if(f == 0) return _("N/A"); @@ -538,7 +538,7 @@ string HUD_GetField(entity pl, float field) } else if(!teamplay) { - f = stof(getplayerkey(pl.sv_entnum, "colors")); + f = stof(getplayerkeyvalue(pl.sv_entnum, "colors")); { hud_field_icon0 = "gfx/scoreboard/playercolor_base"; hud_field_icon1 = "gfx/scoreboard/playercolor_shirt"; @@ -597,7 +597,7 @@ string HUD_FixScoreboardColumnWidth(float i, string str) if(hud_field_icon0 != "") { - sz = drawgetimagesize(hud_field_icon0); + sz = draw_getimagesize(hud_field_icon0); f = sz_x / sz_y; if(hud_fixscoreboardcolumnwidth_iconlen < f) hud_fixscoreboardcolumnwidth_iconlen = f; @@ -605,7 +605,7 @@ string HUD_FixScoreboardColumnWidth(float i, string str) if(hud_field_icon1 != "") { - sz = drawgetimagesize(hud_field_icon1); + sz = draw_getimagesize(hud_field_icon1); f = sz_x / sz_y; if(hud_fixscoreboardcolumnwidth_iconlen < f) hud_fixscoreboardcolumnwidth_iconlen = f; @@ -613,7 +613,7 @@ string HUD_FixScoreboardColumnWidth(float i, string str) if(hud_field_icon2 != "") { - sz = drawgetimagesize(hud_field_icon2); + sz = draw_getimagesize(hud_field_icon2); f = sz_x / sz_y; if(hud_fixscoreboardcolumnwidth_iconlen < f) hud_fixscoreboardcolumnwidth_iconlen = f; @@ -1225,7 +1225,7 @@ void HUD_DrawScoreboard() pos_y += sb_heading_fontsize_y + hud_fontsize_y * 0.25; // Draw the scoreboard - vector bg_size = drawgetimagesize("gfx/scoreboard/scoreboard_bg") * autocvar_scoreboard_bg_scale; + vector bg_size = draw_getimagesize("gfx/scoreboard/scoreboard_bg") * autocvar_scoreboard_bg_scale; if(teamplay) { diff --git a/qcsrc/client/sortlist.qc b/qcsrc/client/sortlist.qc index 9bf6cc84b..225df0ce0 100644 --- a/qcsrc/client/sortlist.qc +++ b/qcsrc/client/sortlist.qc @@ -5,7 +5,7 @@ entity Sort_Spawn() { entity sort; sort = spawn(); - sort.sort_next = NULL; + sort.sort_next = world; sort.chain = sort; return sort; } @@ -15,7 +15,7 @@ entity Sort_New(float(entity,entity) cmp) entity sort; sort = spawn(); sort.sort_cmp = cmp; - sort.sort_next = NULL; + sort.sort_next = world; sort.chain = sort; return sort; } @@ -58,7 +58,7 @@ void Sort_Reset(entity sort) float Sort_HasNext(entity sort) { - return (sort.chain.sort_next != NULL); + return (sort.chain.sort_next != world); } entity Sort_Next(entity sort) @@ -69,7 +69,7 @@ entity Sort_Next(entity sort) next = spawn(); sort.chain.sort_next = next; next.sort_prev = sort.chain; - next.sort_next = NULL; + next.sort_next = world; } sort.chain = next; return next; diff --git a/qcsrc/client/teamplay.qc b/qcsrc/client/teamplay.qc index bc705153a..80d89318f 100644 --- a/qcsrc/client/teamplay.qc +++ b/qcsrc/client/teamplay.qc @@ -26,14 +26,14 @@ float GetPlayerColorForce(float i) if(!teamplay) return 0; else - return stof(getplayerkey(i, "colors")) & 15; + return stof(getplayerkeyvalue(i, "colors")) & 15; } float GetPlayerColor(float i) { if not(playerslots[i].gotscores) // unconnected return COLOR_SPECTATOR; - else if(stof(getplayerkey(i, "frags")) == FRAGS_SPECTATOR) + else if(stof(getplayerkeyvalue(i, "frags")) == FRAGS_SPECTATOR) return COLOR_SPECTATOR; else return GetPlayerColorForce(i); @@ -41,7 +41,7 @@ float GetPlayerColor(float i) string GetPlayerName(float i) { - return ColorTranslateRGB(getplayerkey(i, "name")); + return ColorTranslateRGB(getplayerkeyvalue(i, "name")); } vector GetTeamRGB(float color) diff --git a/qcsrc/client/teamradar.qc b/qcsrc/client/teamradar.qc index 28c992b4d..beccbe994 100644 --- a/qcsrc/client/teamradar.qc +++ b/qcsrc/client/teamradar.qc @@ -14,7 +14,7 @@ float vlen2d(vector v) float vlen_maxnorm2d(vector v) { - return max4(v_x, v_y, -v_x, -v_y); + return max(v_x, v_y, -v_x, -v_y); } float vlen_minnorm2d(vector v) diff --git a/qcsrc/client/vehicles/vehicles.qc b/qcsrc/client/vehicles/vehicles.qc index e687ce49a..ccb9cff58 100644 --- a/qcsrc/client/vehicles/vehicles.qc +++ b/qcsrc/client/vehicles/vehicles.qc @@ -34,7 +34,7 @@ void AuxiliaryXhair_Draw2D() { vector loc, psize; - psize = self.axh_scale * drawgetimagesize(self.axh_image); + psize = self.axh_scale * draw_getimagesize(self.axh_image); loc = project_3d_to_2d(self.origin) - 0.5 * psize; if not (loc_z < 0 || loc_x < 0 || loc_y < 0 || loc_x > vid_conwidth || loc_y > vid_conheight) { @@ -189,7 +189,7 @@ void CSQC_SPIDER_HUD() // Fetch health & ammo stats HUD_GETSTATS - picsize = drawgetimagesize(hud_bg) * autocvar_cl_vehicles_hudscale; + picsize = draw_getimagesize(hud_bg) * autocvar_cl_vehicles_hudscale; hudloc_y = vid_conheight - picsize_y; hudloc_x = vid_conwidth * 0.5 - picsize_x * 0.5; @@ -205,7 +205,7 @@ void CSQC_SPIDER_HUD() vh_health *= 0.01; reload2 *= 0.01; - pic2size = drawgetimagesize(spider_ico) * (autocvar_cl_vehicles_hudscale * 0.8); + pic2size = draw_getimagesize(spider_ico) * (autocvar_cl_vehicles_hudscale * 0.8); picloc = picsize * 0.5 - pic2size * 0.5; if(vh_health < 0.25) drawpic(hudloc + picloc, spider_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); @@ -216,13 +216,13 @@ void CSQC_SPIDER_HUD() drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL); // Health bar - picsize = drawgetimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale; + picsize = draw_getimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale; picloc = '69 69 0' * autocvar_cl_vehicles_hudscale; drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - vh_health)), 0, vid_conwidth, vid_conheight); drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL); drawresetcliparea(); // .. and icon - picsize = drawgetimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale; + picsize = draw_getimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale; picloc = '37 65 0' * autocvar_cl_vehicles_hudscale; if(vh_health < 0.25) { @@ -243,14 +243,14 @@ void CSQC_SPIDER_HUD() } } // Shield bar - picsize = drawgetimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale; + picsize = draw_getimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale; picloc = '69 140 0' * autocvar_cl_vehicles_hudscale; drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - shield)), 0, vid_conwidth, vid_conheight); drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); drawresetcliparea(); // .. and icon picloc = '40 136 0' * autocvar_cl_vehicles_hudscale; - picsize = drawgetimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale; + picsize = draw_getimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale; if(shield < 0.25) { if(alarm2time < time) @@ -272,13 +272,13 @@ void CSQC_SPIDER_HUD() // Minigun bar - picsize = drawgetimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale; + picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale; picloc = '450 69 0' * autocvar_cl_vehicles_hudscale; drawsetcliparea(hudloc_x + picloc_x, picloc_y, picsize_x * ammo1, vid_conheight); drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); drawresetcliparea(); // .. and icon - picsize = drawgetimagesize(hud_ammo1_ico) * autocvar_cl_vehicles_hudscale; + picsize = draw_getimagesize(hud_ammo1_ico) * autocvar_cl_vehicles_hudscale; picloc = '664 60 0' * autocvar_cl_vehicles_hudscale; if(ammo1 < 0.2) drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); @@ -286,7 +286,7 @@ void CSQC_SPIDER_HUD() drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); // Rocket ammo bar - picsize = drawgetimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale; + picsize = draw_getimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale; ammo1 = picsize_x / 8; picloc = '450 140 0' * autocvar_cl_vehicles_hudscale; drawsetcliparea(hudloc_x + picloc_x, hudloc_y + picloc_y, picsize_x * reload2, vid_conheight); @@ -294,7 +294,7 @@ void CSQC_SPIDER_HUD() drawresetcliparea(); // .. and icons - pic2size = 0.35 * drawgetimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale; + pic2size = 0.35 * draw_getimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale; picloc_x -= pic2size_x; picloc_y += pic2size_y * 2.25; if(ammo2 == 9) @@ -313,7 +313,7 @@ void CSQC_SPIDER_HUD() drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, ((i >= ammo2) ? '1 1 1' : '0 0 0'), 0.75, DRAWFLAG_NORMAL); } } - pic2size = drawgetimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale; + pic2size = draw_getimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale; picloc = '664 130 0' * autocvar_cl_vehicles_hudscale; if(ammo2 == 9) drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); @@ -324,7 +324,7 @@ void CSQC_SPIDER_HUD() HUD_DrawScoreboard(); else { - picsize = drawgetimagesize(spider_xhair); + picsize = draw_getimagesize(spider_xhair); picsize_x *= autocvar_cl_vehicle_spiderbot_cross_size; picsize_y *= autocvar_cl_vehicle_spiderbot_cross_size; @@ -347,7 +347,7 @@ void CSQC_RAPTOR_HUD() // Fetch health & ammo stats HUD_GETSTATS - picsize = drawgetimagesize(hud_bg) * autocvar_cl_vehicles_hudscale; + picsize = draw_getimagesize(hud_bg) * autocvar_cl_vehicles_hudscale; hudloc_y = vid_conheight - picsize_y; hudloc_x = vid_conwidth * 0.5 - picsize_x * 0.5; @@ -361,7 +361,7 @@ void CSQC_RAPTOR_HUD() reload1 = reload2 * 0.01; //reload2 *= 0.01; - pic2size = drawgetimagesize(spider_ico) * (autocvar_cl_vehicles_hudscale * 0.8); + pic2size = draw_getimagesize(spider_ico) * (autocvar_cl_vehicles_hudscale * 0.8); picloc = picsize * 0.5 - pic2size * 0.5; if(vh_health < 0.25) drawpic(hudloc + picloc, raptor_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); @@ -372,13 +372,13 @@ void CSQC_RAPTOR_HUD() drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL); // Health bar - picsize = drawgetimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale; + picsize = draw_getimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale; picloc = '69 69 0' * autocvar_cl_vehicles_hudscale; drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - vh_health)), 0, vid_conwidth, vid_conheight); drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL); drawresetcliparea(); // .. and icon - picsize = drawgetimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale; + picsize = draw_getimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale; picloc = '37 65 0' * autocvar_cl_vehicles_hudscale; if(vh_health < 0.25) { @@ -401,14 +401,14 @@ void CSQC_RAPTOR_HUD() } // Shield bar - picsize = drawgetimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale; + picsize = draw_getimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale; picloc = '69 140 0' * autocvar_cl_vehicles_hudscale; drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - shield)), 0, vid_conwidth, vid_conheight); drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); drawresetcliparea(); // .. and icon picloc = '40 136 0' * autocvar_cl_vehicles_hudscale; - picsize = drawgetimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale; + picsize = draw_getimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale; if(shield < 0.25) { if(alarm2time < time) @@ -429,13 +429,13 @@ void CSQC_RAPTOR_HUD() } // Gun bar - picsize = drawgetimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale; + picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale; picloc = '450 69 0' * autocvar_cl_vehicles_hudscale; drawsetcliparea(hudloc_x + picloc_x, picloc_y, picsize_x * energy, vid_conheight); drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); drawresetcliparea(); // .. and icon - picsize = drawgetimagesize(hud_ammo1_ico) * autocvar_cl_vehicles_hudscale; + picsize = draw_getimagesize(hud_ammo1_ico) * autocvar_cl_vehicles_hudscale; picloc = '664 60 0' * autocvar_cl_vehicles_hudscale; if(energy < 0.2) drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); @@ -443,13 +443,13 @@ void CSQC_RAPTOR_HUD() drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); // Bomb bar - picsize = drawgetimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale; + picsize = draw_getimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale; picloc = '450 140 0' * autocvar_cl_vehicles_hudscale; drawsetcliparea(hudloc_x + picloc_x, hudloc_y + picloc_y, picsize_x * reload1, vid_conheight); drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); drawresetcliparea(); // .. and icon - pic2size = drawgetimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale; + pic2size = draw_getimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale; picloc = '664 130 0' * autocvar_cl_vehicles_hudscale; if(reload1 != 1) drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); @@ -475,7 +475,7 @@ void CSQC_RAPTOR_HUD() where = project_3d_to_2d(trace_endpos); setorigin(dropmark, trace_endpos); - picsize = drawgetimagesize(raptor_drop) * 0.2; + picsize = draw_getimagesize(raptor_drop) * 0.2; if not (where_z < 0 || where_x < 0 || where_y < 0 || where_x > vid_conwidth || where_y > vid_conheight) { @@ -492,7 +492,7 @@ void CSQC_RAPTOR_HUD() if(dropmark.cnt > time) { where = project_3d_to_2d(dropmark.origin); - picsize = drawgetimagesize(raptor_drop) * 0.25; + picsize = draw_getimagesize(raptor_drop) * 0.25; if not (where_z < 0 || where_x < 0 || where_y < 0 || where_x > vid_conwidth || where_y > vid_conheight) { @@ -508,7 +508,7 @@ void CSQC_RAPTOR_HUD() HUD_DrawScoreboard(); else { - picsize = drawgetimagesize(raptor_xhair); + picsize = draw_getimagesize(raptor_xhair); picsize_x *= 0.5; picsize_y *= 0.5; @@ -537,7 +537,7 @@ void CSQC_WAKIZASHI_HUD() // Fetch health & ammo stats HUD_GETSTATS - picsize = drawgetimagesize(hud_bg) * autocvar_cl_vehicles_hudscale; + picsize = draw_getimagesize(hud_bg) * autocvar_cl_vehicles_hudscale; hudloc_y = vid_conheight - picsize_y; hudloc_x = vid_conwidth * 0.5 - picsize_x * 0.5; @@ -548,7 +548,7 @@ void CSQC_WAKIZASHI_HUD() energy *= 0.01; reload1 *= 0.01; - pic2size = drawgetimagesize(spider_ico) * (autocvar_cl_vehicles_hudscale * 0.8); + pic2size = draw_getimagesize(spider_ico) * (autocvar_cl_vehicles_hudscale * 0.8); picloc = picsize * 0.5 - pic2size * 0.5; if(vh_health < 0.25) drawpic(hudloc + picloc, waki_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); @@ -560,13 +560,13 @@ void CSQC_WAKIZASHI_HUD() drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL); // Health bar - picsize = drawgetimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale; + picsize = draw_getimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale; picloc = '69 69 0' * autocvar_cl_vehicles_hudscale; drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - vh_health)), 0, vid_conwidth, vid_conheight); drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL); drawresetcliparea(); // .. and icon - picsize = drawgetimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale; + picsize = draw_getimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale; picloc = '37 65 0' * autocvar_cl_vehicles_hudscale; if(vh_health < 0.25) { @@ -590,14 +590,14 @@ void CSQC_WAKIZASHI_HUD() // Shield bar - picsize = drawgetimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale; + picsize = draw_getimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale; picloc = '69 140 0' * autocvar_cl_vehicles_hudscale; drawsetcliparea(hudloc_x + picloc_x + (picsize_x * (1 - shield)), 0, vid_conwidth, vid_conheight); drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); drawresetcliparea(); // .. and icon picloc = '40 136 0' * autocvar_cl_vehicles_hudscale; - picsize = drawgetimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale; + picsize = draw_getimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale; if(shield < 0.25) { if(alarm2time < time) @@ -618,13 +618,13 @@ void CSQC_WAKIZASHI_HUD() } // Gun bar - picsize = drawgetimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale; + picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale; picloc = '450 69 0' * autocvar_cl_vehicles_hudscale; drawsetcliparea(hudloc_x + picloc_x, picloc_y, picsize_x * energy, vid_conheight); drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); drawresetcliparea(); // .. and icon - picsize = drawgetimagesize(hud_ammo1_ico) * autocvar_cl_vehicles_hudscale; + picsize = draw_getimagesize(hud_ammo1_ico) * autocvar_cl_vehicles_hudscale; picloc = '664 60 0' * autocvar_cl_vehicles_hudscale; if(energy < 0.2) drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); @@ -632,13 +632,13 @@ void CSQC_WAKIZASHI_HUD() drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); // Bomb bar - picsize = drawgetimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale; + picsize = draw_getimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale; picloc = '450 140 0' * autocvar_cl_vehicles_hudscale; drawsetcliparea(hudloc_x + picloc_x, hudloc_y + picloc_y, picsize_x * reload1, vid_conheight); drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); drawresetcliparea(); // .. and icon - pic2size = drawgetimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale; + pic2size = draw_getimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale; picloc = '664 130 0' * autocvar_cl_vehicles_hudscale; if(reload1 != 1) drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); @@ -649,7 +649,7 @@ void CSQC_WAKIZASHI_HUD() HUD_DrawScoreboard(); else { - picsize = drawgetimagesize(waki_xhair); + picsize = draw_getimagesize(waki_xhair); picsize_x *= 0.5; picsize_y *= 0.5; -- 2.39.2