From e38f47d7e0a7c7248e13aa1d156b344141485893 Mon Sep 17 00:00:00 2001 From: Martin Taibr Date: Sun, 24 Sep 2017 21:21:54 +0200 Subject: [PATCH] Revert "s/EXP/POW" This reverts commit fd32dde2a91fb757d8a3e1d74be60462a3200118. --- qcsrc/client/hud/panel/physics.qc | 2 +- qcsrc/client/hud/panel/score.qc | 2 +- qcsrc/client/view.qc | 4 ++-- qcsrc/common/command/rpn.qc | 2 +- qcsrc/common/mutators/mutator/bugrigs/bugrigs.qc | 4 ++-- qcsrc/common/mutators/mutator/nades/nades.qc | 2 +- .../mutator/waypoints/waypointsprites.qc | 8 ++++---- qcsrc/common/physics/player.qc | 4 ++-- qcsrc/common/triggers/trigger/impulse.qc | 4 ++-- qcsrc/common/turrets/cl_turrets.qc | 6 +++--- qcsrc/common/util.qc | 2 +- qcsrc/common/weapons/all.qc | 6 +++--- qcsrc/common/weapons/weapon/crylink.qc | 4 ++-- qcsrc/common/weapons/weapon/hook.qc | 2 +- qcsrc/common/weapons/weapon/tuba.qc | 8 ++++---- qcsrc/lib/math.qh | 16 ++++++++-------- qcsrc/lib/noise.qh | 8 ++++---- qcsrc/lib/warpzone/mathlib.qc | 12 ++++++------ qcsrc/menu/xonotic/slider_picmip.qc | 4 ++-- qcsrc/server/bot/default/aim.qc | 2 +- qcsrc/server/bot/default/bot.qc | 2 +- qcsrc/server/bot/default/havocbot/havocbot.qc | 4 ++-- qcsrc/server/bot/default/scripting.qc | 2 +- qcsrc/server/cheats.qc | 4 ++-- qcsrc/server/g_damage.qc | 2 +- qcsrc/server/g_world.qc | 2 +- qcsrc/server/miscfunctions.qc | 2 +- .../server/mutators/mutator/gamemode_keyhunt.qc | 6 +++--- qcsrc/server/scores.qc | 10 +++++----- qcsrc/server/spawnpoints.qc | 2 +- 30 files changed, 69 insertions(+), 69 deletions(-) diff --git a/qcsrc/client/hud/panel/physics.qc b/qcsrc/client/hud/panel/physics.qc index f58b442bc..a480674c9 100644 --- a/qcsrc/client/hud/panel/physics.qc +++ b/qcsrc/client/hud/panel/physics.qc @@ -89,7 +89,7 @@ void HUD_Physics() if(time > physics_update_time) { // workaround for ftos_decimals returning a negative 0 - if(discrete_acceleration > -1 / POW(10, acc_decimals) && discrete_acceleration < 0) + if(discrete_acceleration > -1 / EXP(10, acc_decimals) && discrete_acceleration < 0) discrete_acceleration = 0; discrete_acceleration = acceleration; discrete_speed = speed; diff --git a/qcsrc/client/hud/panel/score.qc b/qcsrc/client/hud/panel/score.qc index d4abbe0c5..3371c2a22 100644 --- a/qcsrc/client/hud/panel/score.qc +++ b/qcsrc/client/hud/panel/score.qc @@ -184,7 +184,7 @@ void HUD_Score() // distribution display distribution = me.(scores(ps_primary)) - pl.(scores(ps_primary)); - distrtimer = ftos_decimals(fabs(distribution/POW(10, TIME_DECIMALS)), TIME_DECIMALS); + distrtimer = ftos_decimals(fabs(distribution/EXP(10, TIME_DECIMALS)), TIME_DECIMALS); if (distribution <= 0) { distribution_color = '0 1 0'; diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index cf5d4569e..b70109d92 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -518,7 +518,7 @@ vector GetCurrentFov(float fov) current_zoomfraction = (current_viewzoom - 1) / (1/zoomfactor - 1); if(zoomsensitivity < 1) - setsensitivityscale(POW(current_viewzoom, (1 - zoomsensitivity))); + setsensitivityscale(EXP(current_viewzoom, (1 - zoomsensitivity))); else setsensitivityscale(1); @@ -1816,7 +1816,7 @@ void CSQC_UpdateView(entity this, float w, float h) t = (time - blurtest_time0) / (blurtest_time1 - blurtest_time0); r = t * blurtest_radius; - f = 1 / POW(t, blurtest_power) - 1; + f = 1 / EXP(t, blurtest_power) - 1; cvar_set("r_glsl_postprocess", "1"); cvar_set("r_glsl_postprocess_uservec1", strcat(ftos(r), " ", ftos(f), " 0 0")); diff --git a/qcsrc/common/command/rpn.qc b/qcsrc/common/command/rpn.qc index c02b7cf5a..318416058 100644 --- a/qcsrc/common/command/rpn.qc +++ b/qcsrc/common/command/rpn.qc @@ -164,7 +164,7 @@ void GenericCommand_rpn(float request, float argc, string command) rpn_setf(f2 - f * floor(f2 / f)); } else if(rpncmd == "pow" || rpncmd == "**") { f = rpn_popf(); - rpn_setf(POW(rpn_getf(), f)); + rpn_setf(EXP(rpn_getf(), f)); } else if(rpncmd == "bitand" || rpncmd == "&") { f = rpn_popf(); rpn_setf(rpn_getf() & f); diff --git a/qcsrc/common/mutators/mutator/bugrigs/bugrigs.qc b/qcsrc/common/mutators/mutator/bugrigs/bugrigs.qc index 83d8be101..e4227c493 100644 --- a/qcsrc/common/mutators/mutator/bugrigs/bugrigs.qc +++ b/qcsrc/common/mutators/mutator/bugrigs/bugrigs.qc @@ -115,7 +115,7 @@ void RaceCarPhysics(entity this, float dt) float upspeed = this.velocity * v_up; // responsiveness factor for steering and acceleration - float f = 1 / (1 + POW((max(-myspeed, myspeed) / PHYS_BUGRIGS_SPEED_REF(this)), PHYS_BUGRIGS_SPEED_POW(this))); + float f = 1 / (1 + EXP((max(-myspeed, myspeed) / PHYS_BUGRIGS_SPEED_REF(this)), PHYS_BUGRIGS_SPEED_POW(this))); //MAXIMA: f(v) := 1 / (1 + (v / PHYS_BUGRIGS_SPEED_REF(this)) ^ PHYS_BUGRIGS_SPEED_POW(this)); float steerfactor; @@ -172,7 +172,7 @@ void RaceCarPhysics(entity this, float dt) float myspeed = vlen(this.velocity); // responsiveness factor for steering and acceleration - float f = 1 / (1 + POW(max(0, myspeed / PHYS_BUGRIGS_SPEED_REF(this)), PHYS_BUGRIGS_SPEED_POW(this))); + float f = 1 / (1 + EXP(max(0, myspeed / PHYS_BUGRIGS_SPEED_REF(this)), PHYS_BUGRIGS_SPEED_POW(this))); float steerfactor = -myspeed * f; this.angles_y += steer * dt * steerfactor; // apply steering diff --git a/qcsrc/common/mutators/mutator/nades/nades.qc b/qcsrc/common/mutators/mutator/nades/nades.qc index c0f0fc280..cb52656ed 100644 --- a/qcsrc/common/mutators/mutator/nades/nades.qc +++ b/qcsrc/common/mutators/mutator/nades/nades.qc @@ -577,7 +577,7 @@ void nade_entrap_touch(entity this, entity toucher) if(!pushdeltatime) return; // div0: ticrate independent, 1 = identity (not 20) - toucher.velocity = toucher.velocity * POW(autocvar_g_nades_entrap_strength, pushdeltatime); + toucher.velocity = toucher.velocity * EXP(autocvar_g_nades_entrap_strength, pushdeltatime); #ifdef SVQC UpdateCSQCProjectile(toucher); diff --git a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc index 69b82bf26..0703fd3a9 100644 --- a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc +++ b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc @@ -460,7 +460,7 @@ vector fixrgbexcess(vector rgb) void Draw_WaypointSprite(entity this) { if (this.lifetime > 0) - this.alpha = POW(bound(0, (this.fadetime - time) / this.lifetime, 1), waypointsprite_timealphaexponent); + this.alpha = EXP(bound(0, (this.fadetime - time) / this.lifetime, 1), waypointsprite_timealphaexponent); else this.alpha = 1; @@ -522,9 +522,9 @@ void Draw_WaypointSprite(entity this) float a = this.alpha * autocvar_hud_panel_fg_alpha; if (this.maxdistance > waypointsprite_normdistance) - a *= POW(bound(0, (this.maxdistance - dist) / (this.maxdistance - waypointsprite_normdistance), 1), waypointsprite_distancealphaexponent); + a *= EXP(bound(0, (this.maxdistance - dist) / (this.maxdistance - waypointsprite_normdistance), 1), waypointsprite_distancealphaexponent); else if (this.maxdistance > 0) - a *= POW(bound(0, (waypointsprite_fadedistance - dist) / (waypointsprite_fadedistance - waypointsprite_normdistance), 1), waypointsprite_distancealphaexponent) * (1 - waypointsprite_minalpha) + waypointsprite_minalpha; + a *= EXP(bound(0, (waypointsprite_fadedistance - dist) / (waypointsprite_fadedistance - waypointsprite_normdistance), 1), waypointsprite_distancealphaexponent) * (1 - waypointsprite_minalpha) + waypointsprite_minalpha; vector rgb = spritelookupcolor(this, spriteimage, this.teamradar_color); if (rgb == '0 0 0') @@ -611,7 +611,7 @@ void Draw_WaypointSprite(entity this) (vid_conwidth - (vid_conwidth * waypointsprite_edgeoffset_right)) - o.x, (vid_conheight - (vid_conheight * waypointsprite_edgeoffset_bottom)) - o.y); - float crosshairdistance = sqrt(POW((o.x - vid_conwidth/2), 2) + POW((o.y - vid_conheight/2), 2) ); + float crosshairdistance = sqrt(EXP((o.x - vid_conwidth/2), 2) + EXP((o.y - vid_conheight/2), 2) ); t = waypointsprite_scale; a *= waypointsprite_alpha; diff --git a/qcsrc/common/physics/player.qc b/qcsrc/common/physics/player.qc index 9b6157cca..2647798ea 100644 --- a/qcsrc/common/physics/player.qc +++ b/qcsrc/common/physics/player.qc @@ -92,7 +92,7 @@ float GeomLerp(float a, float _lerp, float b) { return a == 0 ? (_lerp < 1 ? 0 : b) : b == 0 ? (_lerp > 0 ? 0 : a) - : a * POW(fabs(b / a), _lerp); + : a * EXP(fabs(b / a), _lerp); } void PM_ClientMovement_UpdateStatus(entity this) @@ -165,7 +165,7 @@ void CPM_PM_Aircontrol(entity this, float dt, vector wishdir, float wishspeed) if (dot > 0) // we can't change direction while slowing down { - k *= POW(dot, PHYS_AIRCONTROL_POWER(this)) * dt; + k *= EXP(dot, PHYS_AIRCONTROL_POWER(this)) * dt; xyspeed = max(0, xyspeed - PHYS_AIRCONTROL_PENALTY(this) * sqrt(max(0, 1 - dot*dot)) * k/32); k *= PHYS_AIRCONTROL(this); this.velocity = normalize(this.velocity * xyspeed + wishdir * k); diff --git a/qcsrc/common/triggers/trigger/impulse.qc b/qcsrc/common/triggers/trigger/impulse.qc index 62793e470..1424da981 100644 --- a/qcsrc/common/triggers/trigger/impulse.qc +++ b/qcsrc/common/triggers/trigger/impulse.qc @@ -74,7 +74,7 @@ void trigger_impulse_touch2(entity this, entity toucher) if(!pushdeltatime) return; // div0: ticrate independent, 1 = identity (not 20) - toucher.velocity = toucher.velocity * POW(this.strength, pushdeltatime); + toucher.velocity = toucher.velocity * EXP(this.strength, pushdeltatime); #ifdef SVQC UpdateCSQCProjectile(toucher); @@ -181,7 +181,7 @@ spawnfunc(trigger_impulse) else { if(!this.strength) this.strength = 0.9; - this.strength = POW(this.strength, autocvar_g_triggerimpulse_accel_power) * autocvar_g_triggerimpulse_accel_multiplier; + this.strength = EXP(this.strength, autocvar_g_triggerimpulse_accel_power) * autocvar_g_triggerimpulse_accel_multiplier; settouch(this, trigger_impulse_touch2); } } diff --git a/qcsrc/common/turrets/cl_turrets.qc b/qcsrc/common/turrets/cl_turrets.qc index 5dd9ed901..ff664e676 100644 --- a/qcsrc/common/turrets/cl_turrets.qc +++ b/qcsrc/common/turrets/cl_turrets.qc @@ -105,9 +105,9 @@ void turret_draw2d(entity this) if(this.maxdistance > waypointsprite_normdistance) - a *= POW(bound(0, (this.maxdistance - dist) / (this.maxdistance - waypointsprite_normdistance), 1), waypointsprite_distancealphaexponent); + a *= EXP(bound(0, (this.maxdistance - dist) / (this.maxdistance - waypointsprite_normdistance), 1), waypointsprite_distancealphaexponent); else if(this.maxdistance > 0) - a *= POW(bound(0, (waypointsprite_fadedistance - dist) / (waypointsprite_fadedistance - waypointsprite_normdistance), 1), waypointsprite_distancealphaexponent) * (1 - waypointsprite_minalpha) + waypointsprite_minalpha; + a *= EXP(bound(0, (waypointsprite_fadedistance - dist) / (waypointsprite_fadedistance - waypointsprite_normdistance), 1), waypointsprite_distancealphaexponent) * (1 - waypointsprite_minalpha) + waypointsprite_minalpha; if(rgb == '0 0 0') { @@ -161,7 +161,7 @@ void turret_draw2d(entity this) (vid_conwidth - (vid_conwidth * waypointsprite_edgeoffset_right)) - o_x, (vid_conheight - (vid_conheight * waypointsprite_edgeoffset_bottom)) - o_y); - float crosshairdistance = sqrt( POW((o.x - vid_conwidth/2), 2) + POW((o.y - vid_conheight/2), 2) ); + float crosshairdistance = sqrt( EXP((o.x - vid_conwidth/2), 2) + EXP((o.y - vid_conheight/2), 2) ); t = waypointsprite_scale; a *= waypointsprite_alpha; diff --git a/qcsrc/common/util.qc b/qcsrc/common/util.qc index 33835748f..8a2c809d3 100644 --- a/qcsrc/common/util.qc +++ b/qcsrc/common/util.qc @@ -326,7 +326,7 @@ float compressShortVector(vector vec) STATIC_INIT(compressShortVector) { float l = 1; - float f = POW(2, (1/8)); + float f = EXP(2, (1/8)); int i; for(i = 0; i < 128; ++i) { diff --git a/qcsrc/common/weapons/all.qc b/qcsrc/common/weapons/all.qc index 1b2dce600..381bf0ba8 100644 --- a/qcsrc/common/weapons/all.qc +++ b/qcsrc/common/weapons/all.qc @@ -67,11 +67,11 @@ WepSet _WepSet_FromWeapon(int a) if (a >= 24) { a -= 24; - return '0 0 1' * POW(2, a); + return '0 0 1' * EXP(2, a); } - return '0 1 0' * POW(2, a); + return '0 1 0' * EXP(2, a); } - return '1 0 0' * POW(2, a); + return '1 0 0' * EXP(2, a); } #ifdef SVQC void WriteWepSet(float dst, WepSet w) diff --git a/qcsrc/common/weapons/weapon/crylink.qc b/qcsrc/common/weapons/weapon/crylink.qc index cf8c17036..1ad3a7a43 100644 --- a/qcsrc/common/weapons/weapon/crylink.qc +++ b/qcsrc/common/weapons/weapon/crylink.qc @@ -110,9 +110,9 @@ vector W_Crylink_LinkJoin(entity e, float jspeed) return avg_origin; // nothing to do // yes, mathematically we can do this in ONE step, but beware of 32bit floats... - avg_dist = POW(vlen(e.origin - avg_origin), 2); + avg_dist = EXP(vlen(e.origin - avg_origin), 2); for(p = e; (p = p.queuenext) != e; ) - avg_dist += POW(vlen(WarpZone_RefSys_TransformOrigin(p, e, p.origin) - avg_origin), 2); + avg_dist += EXP(vlen(WarpZone_RefSys_TransformOrigin(p, e, p.origin) - avg_origin), 2); avg_dist *= (1.0 / n); avg_dist = sqrt(avg_dist); diff --git a/qcsrc/common/weapons/weapon/hook.qc b/qcsrc/common/weapons/weapon/hook.qc index 04383716a..4a217d6f5 100644 --- a/qcsrc/common/weapons/weapon/hook.qc +++ b/qcsrc/common/weapons/weapon/hook.qc @@ -9,7 +9,7 @@ void W_Hook_ExplodeThink(entity this) float dt, dmg_remaining_next, f; dt = time - this.teleport_time; - dmg_remaining_next = POW(bound(0, 1 - dt / this.dmg_duration, 1), this.dmg_power); + dmg_remaining_next = EXP(bound(0, 1 - dt / this.dmg_duration, 1), this.dmg_power); f = this.dmg_last - dmg_remaining_next; this.dmg_last = dmg_remaining_next; diff --git a/qcsrc/common/weapons/weapon/tuba.qc b/qcsrc/common/weapons/weapon/tuba.qc index 7d46d6d18..6eb6a8215 100644 --- a/qcsrc/common/weapons/weapon/tuba.qc +++ b/qcsrc/common/weapons/weapon/tuba.qc @@ -450,23 +450,23 @@ void tubasound(entity e, bool restart) if (restart) { snd1 = TUBA_STARTNOTE(e.tuba_instrument, e.note - m + Tuba_PitchStep); } - speed1 = POW(2.0, ((m - Tuba_PitchStep) / 12.0)); + speed1 = EXP(2.0, ((m - Tuba_PitchStep) / 12.0)); } else if (e.note - m + Tuba_PitchStep > TUBA_MAX) { if (restart) { snd1 = TUBA_STARTNOTE(e.tuba_instrument, e.note - m); } - speed1 = POW(2.0, (m / 12.0)); + speed1 = EXP(2.0, (m / 12.0)); } else { if (restart) { snd1 = TUBA_STARTNOTE(e.tuba_instrument, e.note - m); } vol1 = cos(M_PI_2 * m / Tuba_PitchStep); - speed1 = POW(2.0, (m / 12.0)); + speed1 = EXP(2.0, (m / 12.0)); if (restart) { snd2 = TUBA_STARTNOTE(e.tuba_instrument, e.note - m + Tuba_PitchStep); } vol2 = sin(M_PI_2 * m / Tuba_PitchStep); - speed2 = POW(2.0, ((m - Tuba_PitchStep) / 12.0)); + speed2 = EXP(2.0, ((m - Tuba_PitchStep) / 12.0)); } } else if (restart) { snd1 = TUBA_STARTNOTE(e.tuba_instrument, e.note); diff --git a/qcsrc/lib/math.qh b/qcsrc/lib/math.qh index 00d08bdcd..3c7ecabe1 100644 --- a/qcsrc/lib/math.qh +++ b/qcsrc/lib/math.qh @@ -4,15 +4,15 @@ // uncrustify doesn't like the ** operator so let's wrap it in this wonderful macro // *INDENT-OFF* -#define POW(a, e) ((a) ** (e)) +#define EXP(a, e) ((a) ** (e)) // *INDENT-ON* ERASEABLE void mean_accumulate(entity e, .float a, .float c, float mean, float value, float weight) { if (weight == 0) return; - if (mean == 0) e.(a) *= POW(value, weight); - else e.(a) += POW(value, mean) * weight; + if (mean == 0) e.(a) *= EXP(value, weight); + else e.(a) += EXP(value, mean) * weight; e.(c) += weight; } @@ -20,8 +20,8 @@ ERASEABLE float mean_evaluate(entity e, .float a, .float c, float mean) { if (e.(c) == 0) return 0; - if (mean == 0) return POW(e.(a), (1.0 / e.(c))); - else return POW((e.(a) / e.(c)), (1.0 / mean)); + if (mean == 0) return EXP(e.(a), (1.0 / e.(c))); + else return EXP((e.(a) / e.(c)), (1.0 / mean)); } #define MEAN_ACCUMULATE(s, prefix, v, w) mean_accumulate(s, prefix##_accumulator, prefix##_count, prefix##_mean, v, w) @@ -215,12 +215,12 @@ float almost_in_bounds(float a, float b, float c) ERASEABLE float ExponentialFalloff(float mindist, float maxdist, float halflifedist, float d) { - if (halflifedist > 0) return POW(0.5, ((bound(mindist, d, maxdist) - mindist) / halflifedist)); - else if (halflifedist < 0) return POW(0.5, ((bound(mindist, d, maxdist) - maxdist) / halflifedist)); + if (halflifedist > 0) return EXP(0.5, ((bound(mindist, d, maxdist) - mindist) / halflifedist)); + else if (halflifedist < 0) return EXP(0.5, ((bound(mindist, d, maxdist) - maxdist) / halflifedist)); else return 1; } -#define power2of(e) POW(2, e) +#define power2of(e) EXP(2, e) ERASEABLE float log2of(float e) diff --git a/qcsrc/lib/noise.qh b/qcsrc/lib/noise.qh index 53026be4d..dd31e9492 100644 --- a/qcsrc/lib/noise.qh +++ b/qcsrc/lib/noise.qh @@ -20,9 +20,9 @@ float Noise_Pink(entity e, float dt) float f; f = dt * 60; // http://home.earthlink.net/~ltrammell/tech/pinkalg.htm - if (random() > POW(0.3190, f)) e.noise_paccum = 0.34848 * (2 * random() - 1); - if (random() > POW(0.7756, f)) e.noise_paccum2 = 0.28768 * (2 * random() - 1); - if (random() > POW(0.9613, f)) e.noise_paccum3 = 0.43488 * (2 * random() - 1); + if (random() > EXP(0.3190, f)) e.noise_paccum = 0.34848 * (2 * random() - 1); + if (random() > EXP(0.7756, f)) e.noise_paccum2 = 0.28768 * (2 * random() - 1); + if (random() > EXP(0.9613, f)) e.noise_paccum3 = 0.43488 * (2 * random() - 1); return e.noise_paccum + e.noise_paccum2 + e.noise_paccum3; } ERASEABLE @@ -34,6 +34,6 @@ float Noise_White(entity e, float dt) ERASEABLE float Noise_Burst(entity e, float dt, float p) { - if (random() > POW(p, dt)) e.noise_bstate = !e.noise_bstate; + if (random() > EXP(p, dt)) e.noise_bstate = !e.noise_bstate; return 2 * e.noise_bstate - 1; } diff --git a/qcsrc/lib/warpzone/mathlib.qc b/qcsrc/lib/warpzone/mathlib.qc index 71fc25858..aae3b9181 100644 --- a/qcsrc/lib/warpzone/mathlib.qc +++ b/qcsrc/lib/warpzone/mathlib.qc @@ -61,11 +61,11 @@ float tanh(float e) float exp(float e) { - return POW(M_E, e); + return EXP(M_E, e); } float exp2(float e) { - return POW(2, e); + return EXP(2, e); } float expm1(float e) { @@ -77,7 +77,7 @@ vector frexp(float e) vector v; v.z = 0; v.y = ilogb(e) + 1; - v.x = e / POW(2, v.y); + v.x = e / EXP(2, v.y); return v; } int ilogb(float e) @@ -86,7 +86,7 @@ int ilogb(float e) } float ldexp(float e, int e) { - return e * POW(2, e); + return e * EXP(2, e); } float logn(float e, float base) { @@ -115,12 +115,12 @@ vector modf(float f) float scalbn(float e, int n) { - return e * POW(2, n); + return e * EXP(2, n); } float cbrt(float e) { - return copysign(POW(fabs(e), (1.0/3.0)), e); + return copysign(EXP(fabs(e), (1.0/3.0)), e); } float hypot(float e, float f) { diff --git a/qcsrc/menu/xonotic/slider_picmip.qc b/qcsrc/menu/xonotic/slider_picmip.qc index 561107933..d8cc7a2f2 100644 --- a/qcsrc/menu/xonotic/slider_picmip.qc +++ b/qcsrc/menu/xonotic/slider_picmip.qc @@ -18,8 +18,8 @@ float texmemsize(float s3tc) { return ( - 2500 * POW(0.25, max(0, cvar("gl_picmip") + cvar("gl_picmip_other"))) - + 1500 * POW(0.25, max(0, cvar("gl_picmip") + cvar("gl_picmip_world"))) + 2500 * EXP(0.25, max(0, cvar("gl_picmip") + cvar("gl_picmip_other"))) + + 1500 * EXP(0.25, max(0, cvar("gl_picmip") + cvar("gl_picmip_world"))) ) * ((s3tc && (cvar("r_texture_dds_load") || cvar("gl_texturecompression"))) ? 0.2 : 1.0); // TC: normalmaps 50%, other 25%, few incompressible, guessing 40% as conservative average } void XonoticPicmipSlider_autofix(entity me) diff --git a/qcsrc/server/bot/default/aim.qc b/qcsrc/server/bot/default/aim.qc index ddd0afa82..12066f780 100644 --- a/qcsrc/server/bot/default/aim.qc +++ b/qcsrc/server/bot/default/aim.qc @@ -283,7 +283,7 @@ float bot_aimdir(entity this, vector v, float maxfiredeviation) blendrate = autocvar_bot_ai_aimskill_blendrate; r = max(fixedrate, blendrate); //this.v_angle = this.v_angle + diffang * bound(frametime, r * frametime * (2+skill*skill*0.05-random()*0.05*(10-skill)), 1); - this.v_angle = this.v_angle + diffang * bound(delta_t, r * delta_t * (2 + POW((skill + this.bot_mouseskill), 3) * 0.005 - random()), 1); + this.v_angle = this.v_angle + diffang * bound(delta_t, r * delta_t * (2 + EXP((skill + this.bot_mouseskill), 3) * 0.005 - random()), 1); this.v_angle = this.v_angle * bound(0,autocvar_bot_ai_aimskill_mouse,1) + desiredang * bound(0,(1-autocvar_bot_ai_aimskill_mouse),1); //this.v_angle = this.v_angle + diffang * bound(0, r * frametime * (skill * 0.5 + 2), 1); //this.v_angle = this.v_angle + diffang * (1/ blendrate); diff --git a/qcsrc/server/bot/default/bot.qc b/qcsrc/server/bot/default/bot.qc index bbf35b4f7..3d00b3a90 100644 --- a/qcsrc/server/bot/default/bot.qc +++ b/qcsrc/server/bot/default/bot.qc @@ -72,7 +72,7 @@ void bot_think(entity this) if(autocvar_bot_god) this.flags |= FL_GODMODE; - this.bot_nextthink = max(time, this.bot_nextthink) + max(0.01, autocvar_bot_ai_thinkinterval * POW(0.5, this.bot_aiskill) * min(14 / (skill + 14), 1)); + this.bot_nextthink = max(time, this.bot_nextthink) + max(0.01, autocvar_bot_ai_thinkinterval * EXP(0.5, this.bot_aiskill) * min(14 / (skill + 14), 1)); //if (this.bot_painintensity > 0) // this.bot_painintensity = this.bot_painintensity - (skill + 1) * 40 * frametime; diff --git a/qcsrc/server/bot/default/havocbot/havocbot.qc b/qcsrc/server/bot/default/havocbot/havocbot.qc index 9c17ce011..77bf8bb91 100644 --- a/qcsrc/server/bot/default/havocbot/havocbot.qc +++ b/qcsrc/server/bot/default/havocbot/havocbot.qc @@ -471,7 +471,7 @@ void havocbot_movetogoal(entity this) dxy = this.origin - ( ( this.goalcurrent.absmin + this.goalcurrent.absmax ) * 0.5 ); dxy.z = 0; d = vlen(dxy); v = vlen(this.velocity - this.velocity.z * '0 0 1'); - db = (POW(v, 2) / (autocvar_g_jetpack_acceleration_side * 2)) + 100; + db = (EXP(v, 2) / (autocvar_g_jetpack_acceleration_side * 2)) + 100; // dprint("distance ", ftos(ceil(d)), " velocity ", ftos(ceil(v)), " brake at ", ftos(ceil(db)), "\n"); if(d < db || d < 500) { @@ -1143,7 +1143,7 @@ void havocbot_chooseweapon(entity this, .entity weaponentity) this.lastcombotime = time; } - distance *= POW(2, this.bot_rangepreference); + distance *= EXP(2, this.bot_rangepreference); // Custom weapon list based on distance to the enemy if(bot_custom_weapon){ diff --git a/qcsrc/server/bot/default/scripting.qc b/qcsrc/server/bot/default/scripting.qc index 3d9aa50d3..eb8335b11 100644 --- a/qcsrc/server/bot/default/scripting.qc +++ b/qcsrc/server/bot/default/scripting.qc @@ -896,7 +896,7 @@ float bot_cmd_keypress_handler(entity this, string key, float enabled) { case "all": if(enabled) - this.bot_cmd_keys = POW(2, 20) - 1; // >:) + this.bot_cmd_keys = EXP(2, 20) - 1; // >:) else this.bot_cmd_keys = BOT_CMD_KEY_NONE; case "forward": diff --git a/qcsrc/server/cheats.qc b/qcsrc/server/cheats.qc index bed06f190..b22dbccd6 100644 --- a/qcsrc/server/cheats.qc +++ b/qcsrc/server/cheats.qc @@ -886,7 +886,7 @@ void Drag_Begin(entity dragger, entity draggee, vector touchpoint) dragger.dragdistance = vlen(touchpoint - dragger.origin - dragger.view_ofs); dragger.draglocalangle = draggee.angles.y - dragger.v_angle.y; touchpoint = touchpoint - gettaginfo(draggee, 0); - tagscale = POW(vlen(v_forward), -2); + tagscale = EXP(vlen(v_forward), -2); dragger.draglocalvector_x = touchpoint * v_forward * tagscale; dragger.draglocalvector_y = touchpoint * v_right * tagscale; dragger.draglocalvector_z = touchpoint * v_up * tagscale; @@ -968,7 +968,7 @@ void Drag_MoveForward(entity dragger) void Drag_SetSpeed(entity dragger, float s) { - dragger.dragspeed = POW(2, s); + dragger.dragspeed = EXP(2, s); } void Drag_MoveBackward(entity dragger) diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index 2fd467984..fc105afd9 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -1026,7 +1026,7 @@ float RadiusDamageForSource (entity inflictor, vector inflictororigin, vector in LOG_INFOF("THROUGHFLOOR: D=%f F=%f max(dD)=1/%f max(dF)=1/%f", finaldmg, vlen(force), mininv_d, mininv_f); - total = 0.25 * POW(max(mininv_f, mininv_d), 2); + total = 0.25 * EXP(max(mininv_f, mininv_d), 2); if(autocvar_g_throughfloor_debug) LOG_INFOF(" steps=%f", total); diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index a669bf614..c784e11ce 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -1157,7 +1157,7 @@ float(float exponent) MaplistMethod_Shuffle = // more clever shuffling string newlist; // now reinsert this at another position - insertpos = POW(random(), (1 / exponent)); // ]0, 1] + insertpos = EXP(random(), (1 / exponent)); // ]0, 1] insertpos = insertpos * (Map_Count - 1); // ]0, Map_Count - 1] insertpos = ceil(insertpos) + 1; // {2, 3, 4, ..., Map_Count} LOG_TRACE("SHUFFLE: insert pos = ", ftos(insertpos)); diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index c3580d83e..6799aa4d3 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -1315,7 +1315,7 @@ void attach_sameorigin(entity e, entity to, string tag) float tagscale; org = e.origin - gettaginfo(to, gettagindex(to, tag)); - tagscale = POW(vlen(v_forward), -2); // undo a scale on the tag + tagscale = EXP(vlen(v_forward), -2); // undo a scale on the tag t_forward = v_forward * tagscale; t_left = v_right * -tagscale; t_up = v_up * tagscale; diff --git a/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc b/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc index 443c8feec..db3413364 100644 --- a/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc +++ b/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc @@ -130,7 +130,7 @@ void kh_update_state() f = key.team; else f = 30; - s |= POW(32, key.count) * f; + s |= EXP(32, key.count) * f; } FOREACH_CLIENT(true, { it.kh_state = s; }); @@ -138,7 +138,7 @@ void kh_update_state() FOR_EACH_KH_KEY(key) { if(key.owner) - key.owner.kh_state |= POW(32, key.count) * 31; + key.owner.kh_state |= EXP(32, key.count) * 31; } //print(ftos((nextent(NULL)).kh_state), "\n"); } @@ -863,7 +863,7 @@ int kh_GetMissingTeams() ++players; }); if (!players) - missing_teams |= POW(2, i); + missing_teams |= EXP(2, i); } return missing_teams; } diff --git a/qcsrc/server/scores.qc b/qcsrc/server/scores.qc index 7951a12e8..227d168d7 100644 --- a/qcsrc/server/scores.qc +++ b/qcsrc/server/scores.qc @@ -119,7 +119,7 @@ float TeamScore_AddToTeam(float t, float scorefield, float score) } if(score) if(teamscores_label(scorefield) != "") - s.SendFlags |= POW(2, scorefield); + s.SendFlags |= EXP(2, scorefield); return (s.(teamscores(scorefield)) += score); } @@ -266,7 +266,7 @@ float PlayerScore_Clear(entity player) FOREACH(Scores, true, { if(sk.(scores(it)) != 0) if(scores_label(it) != "") - sk.SendFlags |= POW(2, (i % 16)); + sk.SendFlags |= EXP(2, (i % 16)); if(i != SP_ELO.m_id) sk.(scores(it)) = 0; }); @@ -284,7 +284,7 @@ void Score_ClearAll() FOREACH(Scores, true, { if(sk.(scores(it)) != 0) if(scores_label(it) != "") - sk.SendFlags |= POW(2, (i % 16)); + sk.SendFlags |= EXP(2, (i % 16)); if(i != SP_ELO.m_id) sk.(scores(it)) = 0; }); @@ -298,7 +298,7 @@ void Score_ClearAll() { if(sk.(teamscores(j)) != 0) if(teamscores_label(j) != "") - sk.SendFlags |= POW(2, j); + sk.SendFlags |= EXP(2, j); sk.(teamscores(j)) = 0; } } @@ -345,7 +345,7 @@ float PlayerScore_Add(entity player, PlayerScoreField scorefield, float score) return s.(scores(scorefield)); } if(scores_label(scorefield) != "") - s.SendFlags |= POW(2, (scorefield.m_id % 16)); + s.SendFlags |= EXP(2, (scorefield.m_id % 16)); if(!warmup_stage) PS_GR_P_ADDVAL(s.owner, strcat(PLAYERSTATS_TOTAL, scores_label(scorefield)), score); s.(scores(scorefield)) += score; diff --git a/qcsrc/server/spawnpoints.qc b/qcsrc/server/spawnpoints.qc index 220cb551f..6cbde5505 100644 --- a/qcsrc/server/spawnpoints.qc +++ b/qcsrc/server/spawnpoints.qc @@ -320,7 +320,7 @@ entity Spawn_WeightedPoint(entity firstspot, float lower, float upper, float exp RandomSelection_Init(); for(spot = firstspot; spot; spot = spot.chain) - RandomSelection_AddEnt(spot, POW(bound(lower, spot.spawnpoint_score.y, upper), exponent) * spot.cnt, (spot.spawnpoint_score.y >= lower) * 0.5 + spot.spawnpoint_score.x); + RandomSelection_AddEnt(spot, EXP(bound(lower, spot.spawnpoint_score.y, upper), exponent) * spot.cnt, (spot.spawnpoint_score.y >= lower) * 0.5 + spot.spawnpoint_score.x); return RandomSelection_chosen_ent; } -- 2.39.2