From: Mario Date: Tue, 30 Oct 2018 22:53:58 +0000 (+1000) Subject: Replace some makevectors calls with the MAKEVECTORS macro X-Git-Tag: xonotic-v0.8.5~1735 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=3d15d86bfbdc911960d48ba1bb68060abe7d93f7 Replace some makevectors calls with the MAKEVECTORS macro --- diff --git a/qcsrc/client/csqcmodel_hooks.qc b/qcsrc/client/csqcmodel_hooks.qc index 0b62704c5b..961fc77572 100644 --- a/qcsrc/client/csqcmodel_hooks.qc +++ b/qcsrc/client/csqcmodel_hooks.qc @@ -541,7 +541,7 @@ void CSQCModel_Effects_Apply(entity this) if(this.csqcmodel_modelflags & MF_ROTATE) { this.renderflags |= RF_USEAXIS; - makevectors(this.angles + '0 100 0' * fmod(time, 3.6)); + MAKEVECTORS(makevectors, this.angles + '0 100 0' * fmod(time, 3.6), v_forward, v_right, v_up); } if(this.csqcmodel_modelflags & MF_TRACER) tref = EFFECT_TR_WIZSPIKE.m_id; diff --git a/qcsrc/client/teamradar.qc b/qcsrc/client/teamradar.qc index 5d40dbe04e..26de41e724 100644 --- a/qcsrc/client/teamradar.qc +++ b/qcsrc/client/teamradar.qc @@ -93,18 +93,19 @@ void draw_teamradar_player(vector coord3d, vector pangles, vector rgb) coord = teamradar_texcoord_to_2dcoord(teamradar_3dcoord_to_texcoord(coord3d)); - makevectors(pangles - '0 1 0' * teamradar_angle); + vector forward = '0 0 0', right = '0 0 0', up = '0 0 0'; + MAKEVECTORS(makevectors, pangles - '0 1 0' * teamradar_angle, forward, right, up); if(v_flipped) { - v_forward.x = -v_forward.x; - v_right.x = -v_right.x; - v_up.x = -v_up.x; + forward.x = -forward.x; + right.x = -right.x; + up.x = -up.x; // TODO: unused! } - v_forward.z = 0; - v_forward = normalize(v_forward); - v_forward.y *= -1.0; - v_right.x = -v_forward.y; - v_right.y = v_forward.x; + forward.z = 0; + forward = normalize(forward); + forward.y *= -1.0; + right.x = -forward.y; + right.y = forward.x; if(rgb == '1 1 1') rgb2 = '0 0 0'; @@ -112,17 +113,17 @@ void draw_teamradar_player(vector coord3d, vector pangles, vector rgb) rgb2 = '1 1 1'; R_BeginPolygon("", 0); - R_PolygonVertex(coord+v_forward*3, '0 0 0', rgb2, panel_fg_alpha); - R_PolygonVertex(coord+v_right*4-v_forward*2.5, '0 1 0', rgb2, panel_fg_alpha); - R_PolygonVertex(coord-v_forward*2, '1 0 0', rgb2, panel_fg_alpha); - R_PolygonVertex(coord-v_right*4-v_forward*2.5, '1 1 0', rgb2, panel_fg_alpha); + R_PolygonVertex(coord+forward*3, '0 0 0', rgb2, panel_fg_alpha); + R_PolygonVertex(coord+right*4-forward*2.5, '0 1 0', rgb2, panel_fg_alpha); + R_PolygonVertex(coord-forward*2, '1 0 0', rgb2, panel_fg_alpha); + R_PolygonVertex(coord-right*4-forward*2.5, '1 1 0', rgb2, panel_fg_alpha); R_EndPolygon(); R_BeginPolygon("", 0); - R_PolygonVertex(coord+v_forward*2, '0 0 0', rgb, panel_fg_alpha); - R_PolygonVertex(coord+v_right*3-v_forward*2, '0 1 0', rgb, panel_fg_alpha); - R_PolygonVertex(coord-v_forward, '1 0 0', rgb, panel_fg_alpha); - R_PolygonVertex(coord-v_right*3-v_forward*2, '1 1 0', rgb, panel_fg_alpha); + R_PolygonVertex(coord+forward*2, '0 0 0', rgb, panel_fg_alpha); + R_PolygonVertex(coord+right*3-forward*2, '0 1 0', rgb, panel_fg_alpha); + R_PolygonVertex(coord-forward, '1 0 0', rgb, panel_fg_alpha); + R_PolygonVertex(coord-right*3-forward*2, '1 1 0', rgb, panel_fg_alpha); R_EndPolygon(); } diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index 8fba190c64..ffab462363 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -1946,10 +1946,7 @@ void CSQC_UpdateView(entity this, float w, float h) // Render the Scene view_origin = getpropertyvec(VF_ORIGIN); view_angles = getpropertyvec(VF_ANGLES); - makevectors(view_angles); - view_forward = v_forward; - view_right = v_right; - view_up = v_up; + MAKEVECTORS(makevectors, view_angles, view_forward, view_right, view_up); #ifdef BLURTEST if(time > blurtest_time0 && time < blurtest_time1)