==================
*/
-vector HUD_Get_Num_Color (float x, float maxvalue)
+vector HUD_Get_Num_Color (float hp, float maxvalue)
{
float blinkingamt;
vector color;
- if(x >= maxvalue) {
+ if(hp >= maxvalue) {
color.x = sin(2*M_PI*time);
color.y = 1;
color.z = sin(2*M_PI*time);
}
- else if(x > maxvalue * 0.75) {
- color.x = 0.4 - (x-150)*0.02 * 0.4; //red value between 0.4 -> 0
- color.y = 0.9 + (x-150)*0.02 * 0.1; // green value between 0.9 -> 1
+ else if(hp > maxvalue * 0.75) {
+ color.x = 0.4 - (hp-150)*0.02 * 0.4; //red value between 0.4 -> 0
+ color.y = 0.9 + (hp-150)*0.02 * 0.1; // green value between 0.9 -> 1
color.z = 0;
}
- else if(x > maxvalue * 0.5) {
- color.x = 1 - (x-100)*0.02 * 0.6; //red value between 1 -> 0.4
- color.y = 1 - (x-100)*0.02 * 0.1; // green value between 1 -> 0.9
- color.z = 1 - (x-100)*0.02; // blue value between 1 -> 0
+ else if(hp > maxvalue * 0.5) {
+ color.x = 1 - (hp-100)*0.02 * 0.6; //red value between 1 -> 0.4
+ color.y = 1 - (hp-100)*0.02 * 0.1; // green value between 1 -> 0.9
+ color.z = 1 - (hp-100)*0.02; // blue value between 1 -> 0
}
- else if(x > maxvalue * 0.25) {
+ else if(hp > maxvalue * 0.25) {
color.x = 1;
color.y = 1;
- color.z = 0.2 + (x-50)*0.02 * 0.8; // blue value between 0.2 -> 1
+ color.z = 0.2 + (hp-50)*0.02 * 0.8; // blue value between 0.2 -> 1
}
- else if(x > maxvalue * 0.1) {
+ else if(hp > maxvalue * 0.1) {
color.x = 1;
- color.y = (x-20)*90/27/100; // green value between 0 -> 1
- color.z = (x-20)*90/27/100 * 0.2; // blue value between 0 -> 0.2
+ color.y = (hp-20)*90/27/100; // green value between 0 -> 1
+ color.z = (hp-20)*90/27/100 * 0.2; // blue value between 0 -> 0.2
}
else {
color.x = 1;
color.z = 0;
}
- blinkingamt = (1 - x/maxvalue/0.25);
+ blinkingamt = (1 - hp/maxvalue/0.25);
if(blinkingamt > 0)
{
color.x = color.x - color.x * blinkingamt * sin(2*M_PI*time);
drawsubpic(pos + eX * mySize.x - eX * min(mySize.x * 0.5, mySize.y), eX * min(mySize.x * 0.5, mySize.y) + eY * mySize.y, pic, '0.75 0 0', '0.25 1 0', color, theAlpha, drawflag);
}
-void DrawNumIcon_expanding(vector myPos, vector mySize, float x, string icon, bool vertical, int icon_right_align, vector color, float theAlpha, float fadelerp)
+void DrawNumIcon_expanding(vector myPos, vector mySize, float theTime, string icon, bool vertical, int icon_right_align, vector color, float theAlpha, float fadelerp)
{
TC(bool, vertical); TC(int, icon_right_align);
vector newPos = '0 0 0', newSize = '0 0 0';
// reduce only y to draw numbers with different number of digits with the same y size
numpos.y += newSize.y * ((1 - 0.7) / 2);
newSize.y *= 0.7;
- drawstring_aspect(numpos, ftos(x), newSize, color, panel_fg_alpha * theAlpha, DRAWFLAG_NORMAL);
+ drawstring_aspect(numpos, ftos(theTime), newSize, color, panel_fg_alpha * theAlpha, DRAWFLAG_NORMAL);
return;
}
// NOTE: newSize_x is always equal to 3 * mySize_y so we can use
// '2 1 0' * newSize_y instead of eX * (2/3) * newSize_x + eY * newSize_y
- drawstring_aspect_expanding(numpos, ftos(x), '2 1 0' * newSize.y, color, panel_fg_alpha * theAlpha, DRAWFLAG_NORMAL, fadelerp);
+ drawstring_aspect_expanding(numpos, ftos(theTime), '2 1 0' * newSize.y, color, panel_fg_alpha * theAlpha, DRAWFLAG_NORMAL, fadelerp);
drawpic_aspect_skin_expanding(picpos, icon, '1 1 0' * newSize.y, '1 1 1', panel_fg_alpha * theAlpha, DRAWFLAG_NORMAL, fadelerp);
}
-void DrawNumIcon(vector myPos, vector mySize, float x, string icon, bool vertical, int icon_right_align, vector color, float theAlpha)
+void DrawNumIcon(vector myPos, vector mySize, float theTime, string icon, bool vertical, int icon_right_align, vector color, float theAlpha)
{
TC(bool, vertical); TC(int, icon_right_align);
- DrawNumIcon_expanding(myPos, mySize, x, icon, vertical, icon_right_align, color, theAlpha, 0);
+ DrawNumIcon_expanding(myPos, mySize, theTime, icon, vertical, icon_right_align, color, theAlpha, 0);
}
/*
void HUD_Radar_Hide_Maximized();
float HUD_GetRowCount(int item_count, vector size, float item_aspect);
-vector HUD_Get_Num_Color (float x, float maxvalue);
-void DrawNumIcon(vector myPos, vector mySize, float x, string icon, bool vertical, bool icon_right_align, vector color, float theAlpha);
-void DrawNumIcon_expanding(vector myPos, vector mySize, float x, string icon, bool vertical, int icon_right_align, vector color, float theAlpha, float fadelerp);
+vector HUD_Get_Num_Color (float hp, float maxvalue);
+void DrawNumIcon(vector myPos, vector mySize, float theTime, string icon, bool vertical, bool icon_right_align, vector color, float theAlpha);
+void DrawNumIcon_expanding(vector myPos, vector mySize, float theTime, string icon, bool vertical, int icon_right_align, vector color, float theAlpha, float fadelerp);
void HUD_Panel_DrawHighlight(vector pos, vector mySize, vector color, float theAlpha, int drawflag);
vector HUD_GetTableSize_BestItemAR(int item_count, vector psize, float item_aspect);
vector v;
v = healtharmor_maxdamage(health, armor, armorblockpercent, DEATH_WEAPON.m_id);
- float x;
- x = floor(v.x + 1);
+ float hp = floor(v.x + 1);
float maxtotal = maxhealth + maxarmor;
string biggercount;
{
biggercount = "health";
if(autocvar_hud_panel_healtharmor_progressbar)
- HUD_Panel_DrawProgressBar(pos, mySize, autocvar_hud_panel_healtharmor_progressbar_health, x/maxtotal, 0, (baralign == 1 || baralign == 2), autocvar_hud_progressbar_health_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(pos, mySize, autocvar_hud_panel_healtharmor_progressbar_health, hp/maxtotal, 0, (baralign == 1 || baralign == 2), autocvar_hud_progressbar_health_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
if(armor)
if(autocvar_hud_panel_healtharmor_text)
drawpic_aspect_skin(pos + eX * mySize.x - eX * 0.5 * mySize.y, "armor", '0.5 0.5 0' * mySize.y, '1 1 1', panel_fg_alpha * armor / health, DRAWFLAG_NORMAL);
{
biggercount = "armor";
if(autocvar_hud_panel_healtharmor_progressbar)
- HUD_Panel_DrawProgressBar(pos, mySize, autocvar_hud_panel_healtharmor_progressbar_armor, x/maxtotal, 0, (baralign == 1 || baralign == 2), autocvar_hud_progressbar_armor_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+ HUD_Panel_DrawProgressBar(pos, mySize, autocvar_hud_panel_healtharmor_progressbar_armor, hp/maxtotal, 0, (baralign == 1 || baralign == 2), autocvar_hud_progressbar_armor_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
if(health)
if(autocvar_hud_panel_healtharmor_text)
drawpic_aspect_skin(pos + eX * mySize.x - eX * 0.5 * mySize.y, "health", '0.5 0.5 0' * mySize.y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
}
if(autocvar_hud_panel_healtharmor_text)
- DrawNumIcon(pos, mySize, x, biggercount, 0, iconalign, HUD_Get_Num_Color(x, maxtotal), 1);
+ DrawNumIcon(pos, mySize, hp, biggercount, 0, iconalign, HUD_Get_Num_Color(hp, maxtotal), 1);
if(fuel)
HUD_Panel_DrawProgressBar(pos, eX * mySize.x + eY * 0.2 * mySize.y, "progressbar", fuel/100, 0, (baralign == 1 || baralign == 3), autocvar_hud_progressbar_fuel_color, panel_fg_alpha * 0.8, DRAWFLAG_NORMAL);
void DrawCircleClippedPic(vector centre, float radi, string pic, float f, vector rgb, float a, float drawflag)
{
- float x, y, q, d;
+ float d;
vector ringsize, v, t;
ringsize = radi * '1 1 0';
- x = cos(f * 2 * M_PI);
- y = sin(f * 2 * M_PI);
- q = fabs(x) + fabs(y);
- x /= q;
- y /= q;
+ float co = cos(f * 2 * M_PI);
+ float si = sin(f * 2 * M_PI);
+ float q = fabs(co) + fabs(si);
+ co /= q;
+ si /= q;
if(f >= 1)
{
if(d > 0)
{
v = centre; t = '0.5 0.5 0';
- v.x += x * 0.5 * ringsize.x; t += x * '0.5 0.5 0';
- v.y += y * 0.5 * ringsize.y; t += y * '0.5 -0.5 0';
+ v.x += co * 0.5 * ringsize.x; t += co * '0.5 0.5 0';
+ v.y += si * 0.5 * ringsize.y; t += si * '0.5 -0.5 0';
R_PolygonVertex(v, t, rgb, a);
R_EndPolygon();
}
return out;
}
-vector teamradar_texcoord_to_3dcoord(vector in,float z)
+vector teamradar_texcoord_to_3dcoord(vector in,float oz)
{
vector out;
out_x = in_x * (mi_picmax_x - mi_picmin_x) + mi_picmin_x;
out_y = in_y * (mi_picmax_y - mi_picmin_y) + mi_picmin_y;
- out_z = z;
+ out_z = oz;
return out;
}
vector teamradar_texcoord_to_2dcoord(vector in);
-vector teamradar_texcoord_to_3dcoord(vector in,float z);
+vector teamradar_texcoord_to_3dcoord(vector in,float oz);
void draw_teamradar_background(float fg);
float a = autocvar_cl_hitsound_max_pitch;
float b = autocvar_cl_hitsound_min_pitch;
float c = autocvar_cl_hitsound_nom_damage;
- float x = unaccounted_damage;
- float pitch_shift = (b*x*(a-1) + a*c*(1-b)) / (x*(a-1) + c*(1-b));
+ float d = unaccounted_damage;
+ float pitch_shift = (b*d*(a-1) + a*c*(1-b)) / (d*(a-1) + c*(1-b));
// if sound variation is disabled, set pitch_shift to 1
if (autocvar_cl_hitsound == 1)
case 2: // crosshair_color_by_health
{
- float x = health_stat;
+ float hp = health_stat;
//x = red
//y = green
wcross_color.z = 0;
- if(x > 200)
+ if(hp > 200)
{
wcross_color.x = 0;
wcross_color.y = 1;
}
- else if(x > 150)
+ else if(hp > 150)
{
- wcross_color.x = 0.4 - (x-150)*0.02 * 0.4;
- wcross_color.y = 0.9 + (x-150)*0.02 * 0.1;
+ wcross_color.x = 0.4 - (hp-150)*0.02 * 0.4;
+ wcross_color.y = 0.9 + (hp-150)*0.02 * 0.1;
}
- else if(x > 100)
+ else if(hp > 100)
{
- wcross_color.x = 1 - (x-100)*0.02 * 0.6;
- wcross_color.y = 1 - (x-100)*0.02 * 0.1;
- wcross_color.z = 1 - (x-100)*0.02;
+ wcross_color.x = 1 - (hp-100)*0.02 * 0.6;
+ wcross_color.y = 1 - (hp-100)*0.02 * 0.1;
+ wcross_color.z = 1 - (hp-100)*0.02;
}
- else if(x > 50)
+ else if(hp > 50)
{
wcross_color.x = 1;
wcross_color.y = 1;
- wcross_color.z = 0.2 + (x-50)*0.02 * 0.8;
+ wcross_color.z = 0.2 + (hp-50)*0.02 * 0.8;
}
- else if(x > 20)
+ else if(hp > 20)
{
wcross_color.x = 1;
- wcross_color.y = (x-20)*90/27/100;
- wcross_color.z = (x-20)*90/27/100 * 0.2;
+ wcross_color.y = (hp-20)*90/27/100;
+ wcross_color.z = (hp-20)*90/27/100 * 0.2;
}
else
{
});
}
-float buff_Inferno_CalculateTime(float x, float offset_x, float offset_y, float intersect_x, float intersect_y, float base)
+float buff_Inferno_CalculateTime(float damg, float offset_x, float offset_y, float intersect_x, float intersect_y, float base)
{
- return offset_y + (intersect_y - offset_y) * logn(((x - offset_x) * ((base - 1) / intersect_x)) + 1, base);
+ return offset_y + (intersect_y - offset_y) * logn(((damg - offset_x) * ((base - 1) / intersect_x)) + 1, base);
}
// mutator hooks
{
v_forward = v_right = v_up = '0 0 0';
- float y = myangles.y * (M_PI * 2 / 360);
- float sy = sin(y);
- float cy = cos(y);
+ float yy = myangles.y * (M_PI * 2 / 360);
+ float sy = sin(yy);
+ float cy = cos(yy);
float p = myangles.x * (M_PI * 2 / 360);
float sp = sin(p);
float cp = cos(p);
void Dump_Turret_Settings()
{
- float x, totalsettings = 0;
+ int totalsettings = 0;
FOREACH(Turrets, it != TUR_Null, {
// step 1: clear the queue
TUR_CONFIG_COUNT = 0;
- for(x = 0; x <= MAX_TUR_CONFIG; ++x)
- { tur_config_queue[x] = string_null; }
+ for(int j = 0; j <= MAX_TUR_CONFIG; ++j)
+ { tur_config_queue[j] = string_null; }
// step 2: build new queue
it.tr_config(it);
// step 4: write queue
TUR_CONFIG_WRITETOFILE(sprintf("// {{{ #%d: %s\n", i, it.turret_name))
- for(x = 0; x <= TUR_CONFIG_COUNT; ++x)
- { TUR_CONFIG_WRITETOFILE(tur_config_queue[x]) }
+ for(int j = 0; j <= TUR_CONFIG_COUNT; ++j)
+ { TUR_CONFIG_WRITETOFILE(tur_config_queue[j]) }
TUR_CONFIG_WRITETOFILE("// }}}\n")
// step 5: debug info
// clear queue now that we're finished
TUR_CONFIG_COUNT = 0;
- for(x = 0; x <= MAX_TUR_CONFIG; ++x)
- { tur_config_queue[x] = string_null; }
+ for(int j = 0; j <= MAX_TUR_CONFIG; ++j)
+ { tur_config_queue[j] = string_null; }
// extra information
LOG_INFO(sprintf("Totals: %d turrets, %d settings\n", (Turrets_COUNT - 1), totalsettings));
float lengthLogTable[128];
-float invertLengthLog(float x)
+float invertLengthLog(float dist)
{
int l, r, m;
- if(x >= lengthLogTable[127])
+ if(dist >= lengthLogTable[127])
return 127;
- if(x <= lengthLogTable[0])
+ if(dist <= lengthLogTable[0])
return 0;
l = 0;
while(r - l > 1)
{
m = floor((l + r) / 2);
- if(lengthLogTable[m] < x)
+ if(lengthLogTable[m] < dist)
l = m;
else
r = m;
}
// now: r is >=, l is <
- float lerr = (x - lengthLogTable[l]);
- float rerr = (lengthLogTable[r] - x);
+ float lerr = (dist - lengthLogTable[l]);
+ float rerr = (lengthLogTable[r] - dist);
if(lerr < rerr)
return l;
return r;
if(data == 0)
return '0 0 0';
float p = (data & 0xF000) / 0x1000;
- float y = (data & 0x0F80) / 0x80;
+ float q = (data & 0x0F80) / 0x80;
int len = (data & 0x007F);
- //print("\ndecompress: p ", ftos(p)); print("y ", ftos(y)); print("len ", ftos(len), "\n");
+ //print("\ndecompress: p ", ftos(p)); print("q ", ftos(q)); print("len ", ftos(len), "\n");
if(p == 0)
{
out.x = 0;
out.y = 0;
- if(y == 31)
+ if(q == 31)
out.z = -1;
else
out.z = +1;
}
else
{
- y = .19634954084936207740 * y;
+ q = .19634954084936207740 * q;
p = .19634954084936207740 * p - 1.57079632679489661922;
- out.x = cos(y) * cos(p);
- out.y = sin(y) * cos(p);
+ out.x = cos(q) * cos(p);
+ out.y = sin(q) * cos(p);
out.z = -sin(p);
}
float compressShotOrigin(vector v)
{
- float x, y, z;
- x = rint(v.x * 2);
- y = rint(v.y * 4) + 128;
- z = rint(v.z * 4) + 128;
- if(x > 255 || x < 0)
+ float rx = rint(v.x * 2);
+ float ry = rint(v.y * 4) + 128;
+ float rz = rint(v.z * 4) + 128;
+ if(rx > 255 || rx < 0)
{
LOG_INFO("shot origin ", vtos(v), " x out of bounds\n");
- x = bound(0, x, 255);
+ rx = bound(0, rx, 255);
}
- if(y > 255 || y < 0)
+ if(ry > 255 || ry < 0)
{
LOG_INFO("shot origin ", vtos(v), " y out of bounds\n");
- y = bound(0, y, 255);
+ ry = bound(0, ry, 255);
}
- if(z > 255 || z < 0)
+ if(rz > 255 || rz < 0)
{
LOG_INFO("shot origin ", vtos(v), " z out of bounds\n");
- z = bound(0, z, 255);
+ rz = bound(0, rz, 255);
}
- return x * 0x10000 + y * 0x100 + z;
+ return rx * 0x10000 + ry * 0x100 + rz;
}
vector decompressShotOrigin(int f)
{
float almost_in_bounds(float a, float b, float c);
float power2of(float e);
-float log2of(float x);
+float log2of(float e);
vector rgb_to_hsl(vector rgb);
vector hsl_to_rgb(vector hsl);
// f(1) = 1
// f'(0) = startspeedfactor
// f'(1) = endspeedfactor
-float cubic_speedfunc(float startspeedfactor, float endspeedfactor, float x);
+float cubic_speedfunc(float startspeedfactor, float endspeedfactor, float spd);
// checks whether f'(x) = 0 anywhere from 0 to 1
// because if this is the case, the function is not usable for platforms
+ (b - a) * 2;
}
-float cubic_speedfunc(float startspeedfactor, float endspeedfactor, float x)
+float cubic_speedfunc(float startspeedfactor, float endspeedfactor, float spd)
{
return (((startspeedfactor + endspeedfactor - 2
- ) * x - 2 * startspeedfactor - endspeedfactor + 3
- ) * x + startspeedfactor
- ) * x;
+ ) * spd - 2 * startspeedfactor - endspeedfactor + 3
+ ) * spd + startspeedfactor
+ ) * spd;
}
bool cubic_speedfunc_is_sane(float startspeedfactor, float endspeedfactor)
return pow(2, e);
}
-float log2of(float x)
+float log2of(float e)
{
// NOTE: generated code
- if (x > 2048)
- if (x > 131072)
- if (x > 1048576)
- if (x > 4194304) return 23;
+ if (e > 2048)
+ if (e > 131072)
+ if (e > 1048576)
+ if (e > 4194304) return 23;
else
- if (x > 2097152) return 22;
+ if (e > 2097152) return 22;
else return 21;
else
- if (x > 524288) return 20;
+ if (e > 524288) return 20;
else
- if (x > 262144) return 19;
+ if (e > 262144) return 19;
else return 18;
else
- if (x > 16384)
- if (x > 65536) return 17;
+ if (e > 16384)
+ if (e > 65536) return 17;
else
- if (x > 32768) return 16;
+ if (e > 32768) return 16;
else return 15;
else
- if (x > 8192) return 14;
+ if (e > 8192) return 14;
else
- if (x > 4096) return 13;
+ if (e > 4096) return 13;
else return 12;
else
- if (x > 32)
- if (x > 256)
- if (x > 1024) return 11;
+ if (e > 32)
+ if (e > 256)
+ if (e > 1024) return 11;
else
- if (x > 512) return 10;
+ if (e > 512) return 10;
else return 9;
else
- if (x > 128) return 8;
+ if (e > 128) return 8;
else
- if (x > 64) return 7;
+ if (e > 64) return 7;
else return 6;
else
- if (x > 4)
- if (x > 16) return 5;
+ if (e > 4)
+ if (e > 16) return 5;
else
- if (x > 8) return 4;
+ if (e > 8) return 4;
else return 3;
else
- if (x > 2) return 2;
+ if (e > 2) return 2;
else
- if (x > 1) return 1;
+ if (e > 1) return 1;
else return 0;
}
#elif defined(SVQC)
#endif
-int fpclassify(float x)
+int fpclassify(float e)
{
- if(isnan(x))
+ if(isnan(e))
return FP_NAN;
- if(isinf(x))
+ if(isinf(e))
return FP_INFINITE;
- if(x == 0)
+ if(e == 0)
return FP_ZERO;
return FP_NORMAL;
}
-bool isfinite(float x)
+bool isfinite(float e)
{
- return !(isnan(x) || isinf(x));
+ return !(isnan(e) || isinf(e));
}
-bool isinf(float x)
+bool isinf(float e)
{
- return (x != 0) && (x + x == x);
+ return (e != 0) && (e + e == e);
}
-bool isnan(float x)
+bool isnan(float e)
{
- float y;
- y = x;
- return (x != y);
+ float f = e;
+ return (e != f);
}
-bool isnormal(float x)
+bool isnormal(float e)
{
- return isfinite(x);
+ return isfinite(e);
}
-bool signbit(float x)
+bool signbit(float e)
{
- return (x < 0);
+ return (e < 0);
}
-float acosh(float x)
+float acosh(float e)
{
- return log(x + sqrt(x*x - 1));
+ return log(e + sqrt(e*e - 1));
}
-float asinh(float x)
+float asinh(float e)
{
- return log(x + sqrt(x*x + 1));
+ return log(e + sqrt(e*e + 1));
}
-float atanh(float x)
+float atanh(float e)
{
- return 0.5 * log((1+x) / (1-x));
+ return 0.5 * log((1+e) / (1-e));
}
-float cosh(float x)
+float cosh(float e)
{
- return 0.5 * (exp(x) + exp(-x));
+ return 0.5 * (exp(e) + exp(-e));
}
-float sinh(float x)
+float sinh(float e)
{
- return 0.5 * (exp(x) - exp(-x));
+ return 0.5 * (exp(e) - exp(-e));
}
-float tanh(float x)
+float tanh(float e)
{
- return sinh(x) / cosh(x);
+ return sinh(e) / cosh(e);
}
-float exp(float x)
+float exp(float e)
{
- return pow(M_E, x);
+ return pow(M_E, e);
}
-float exp2(float x)
+float exp2(float e)
{
- return pow(2, x);
+ return pow(2, e);
}
-float expm1(float x)
+float expm1(float e)
{
- return exp(x) - 1;
+ return exp(e) - 1;
}
-vector frexp(float x)
+vector frexp(float e)
{
vector v;
v.z = 0;
- v.y = ilogb(x) + 1;
- v.x = x / exp2(v.y);
+ v.y = ilogb(e) + 1;
+ v.x = e / exp2(v.y);
return v;
}
-int ilogb(float x)
+int ilogb(float e)
{
- return floor(log2(fabs(x)));
+ return floor(log2(fabs(e)));
}
-float ldexp(float x, int e)
+float ldexp(float e, int e)
{
- return x * pow(2, e);
+ return e * pow(2, e);
}
-float logn(float x, float base)
+float logn(float e, float base)
{
- return log(x) / log(base);
+ return log(e) / log(base);
}
-float log10(float x)
+float log10(float e)
{
- return log(x) * M_LOG10E;
+ return log(e) * M_LOG10E;
}
-float log1p(float x)
+float log1p(float e)
{
- return log(x + 1);
+ return log(e + 1);
}
-float log2(float x)
+float log2(float e)
{
- return log(x) * M_LOG2E;
+ return log(e) * M_LOG2E;
}
-float logb(float x)
+float logb(float e)
{
- return floor(log2(fabs(x)));
+ return floor(log2(fabs(e)));
}
vector modf(float f)
{
return '1 0 0' * (f - trunc(f)) + '0 1 0' * trunc(f);
}
-float scalbn(float x, int n)
+float scalbn(float e, int n)
{
- return x * pow(2, n);
+ return e * pow(2, n);
}
-float cbrt(float x)
+float cbrt(float e)
{
- return copysign(pow(fabs(x), 1.0/3.0), x);
+ return copysign(pow(fabs(e), 1.0/3.0), e);
}
-float hypot(float x, float y)
+float hypot(float e, float f)
{
- return sqrt(x*x + y*y);
+ return sqrt(e*e + f*f);
}
-float erf(float x)
+float erf(float e)
{
// approximation taken from wikipedia
- float y;
- y = x*x;
- return copysign(sqrt(1 - exp(-y * (1.273239544735163 + 0.14001228868667 * y) / (1 + 0.14001228868667 * y))), x);
+ float f;
+ f = e*e;
+ return copysign(sqrt(1 - exp(-f * (1.273239544735163 + 0.14001228868667 * f) / (1 + 0.14001228868667 * f))), e);
}
-float erfc(float x)
+float erfc(float e)
{
- return 1.0 - erf(x);
+ return 1.0 - erf(e);
}
-vector lgamma(float x)
+vector lgamma(float e)
{
// TODO improve accuracy
- if(!isfinite(x))
- return fabs(x) * '1 0 0' + copysign(1, x) * '0 1 0';
- if(x < 1 && x == floor(x))
+ if(!isfinite(e))
+ return fabs(e) * '1 0 0' + copysign(1, e) * '0 1 0';
+ if(e < 1 && e == floor(e))
return nan("gamma") * '1 1 1';
- if(x < 0.1)
+ if(e < 0.1)
{
vector v;
- v = lgamma(1.0 - x);
+ v = lgamma(1.0 - e);
// reflection formula:
// gamma(1-z) * gamma(z) = pi / sin(pi*z)
// lgamma(1-z) + lgamma(z) = log(pi) - log(sin(pi*z))
// sign of gamma(1-z) = sign of gamma(z) * sign of sin(pi*z)
- v.z = sin(M_PI * x);
+ v.z = sin(M_PI * e);
v.x = log(M_PI) - log(fabs(v.z)) - v.x;
if(v.z < 0)
v.y = -v.y;
v.z = 0;
return v;
}
- if(x < 1.1)
- return lgamma(x + 1) - log(x) * '1 0 0';
- x -= 1;
- return (0.5 * log(2 * M_PI * x) + x * (log(x) - 1)) * '1 0 0' + '0 1 0';
+ if(e < 1.1)
+ return lgamma(e + 1) - log(e) * '1 0 0';
+ e -= 1;
+ return (0.5 * log(2 * M_PI * e) + e * (log(e) - 1)) * '1 0 0' + '0 1 0';
}
-float tgamma(float x)
+float tgamma(float e)
{
vector v;
- v = lgamma(x);
+ v = lgamma(e);
return exp(v.x) * v.y;
}
* 1 % -2 == -1
* -1 % -2 == -1
*/
-float pymod(float x, float y)
+float pymod(float e, float f)
{
- return x - y * floor(x / y);
+ return e - f * floor(e / f);
}
-float nearbyint(float x)
+float nearbyint(float e)
{
- return rint(x);
+ return rint(e);
}
-float trunc(float x)
+float trunc(float e)
{
- return (x>=0) ? floor(x) : ceil(x);
+ return (e>=0) ? floor(e) : ceil(e);
}
-float fmod(float x, float y)
+float fmod(float e, float f)
{
- return x - y * trunc(x / y);
+ return e - f * trunc(e / f);
}
-float remainder(float x, float y)
+float remainder(float e, float f)
{
- return x - y * rint(x / y);
+ return e - f * rint(e / f);
}
-vector remquo(float x, float y)
+vector remquo(float e, float f)
{
vector v;
v.z = 0;
- v.y = rint(x / y);
- v.x = x - y * v.y;
+ v.y = rint(e / f);
+ v.x = e - f * v.y;
return v;
}
-float copysign(float x, float y)
+float copysign(float e, float f)
{
- return fabs(x) * ((y>0) ? 1 : -1);
+ return fabs(e) * ((f>0) ? 1 : -1);
}
float nan(string tag)
{
return sqrt(-1);
}
-float nextafter(float x, float y)
+float nextafter(float e, float f)
{
// TODO very crude
- if(x == y)
+ if(e == f)
return nan("nextafter");
- if(x > y)
- return -nextafter(-x, -y);
- // now we know that x < y
- // so we need the next number > x
+ if(e > f)
+ return -nextafter(-e, -f);
+ // now we know that e < f
+ // so we need the next number > e
float d, a, b;
- d = max(fabs(x), 0.00000000000000000000001);
- a = x + d;
+ d = max(fabs(e), 0.00000000000000000000001);
+ a = e + d;
do
{
d *= 0.5;
b = a;
- a = x + d;
+ a = e + d;
}
- while(a != x);
+ while(a != e);
return b;
}
-float nexttoward(float x, float y)
+float nexttoward(float e, float f)
{
- return nextafter(x, y);
+ return nextafter(e, f);
}
-float fdim(float x, float y)
+float fdim(float e, float f)
{
- return max(x-y, 0);
+ return max(e-f, 0);
}
-float fmax(float x, float y)
+float fmax(float e, float f)
{
- return max(x, y);
+ return max(e, f);
}
-float fmin(float x, float y)
+float fmin(float e, float f)
{
- return min(x, y);
+ return min(e, f);
}
-float fma(float x, float y, float z)
+float fma(float e, float f, float g)
{
- return x * y + z;
+ return e * f + g;
}
-int isgreater(float x, float y)
+int isgreater(float e, float f)
{
- return x > y;
+ return e > f;
}
-int isgreaterequal(float x, float y)
+int isgreaterequal(float e, float f)
{
- return x >= y;
+ return e >= f;
}
-int isless(float x, float y)
+int isless(float e, float f)
{
- return x < y;
+ return e < f;
}
-int islessequal(float x, float y)
+int islessequal(float e, float f)
{
- return x <= y;
+ return e <= f;
}
-int islessgreater(float x, float y)
+int islessgreater(float e, float f)
{
- return x < y || x > y;
+ return e < f || e > f;
}
-int isunordered(float x, float y)
+int isunordered(float e, float f)
{
- return !(x < y || x == y || x > y);
+ return !(e < f || e == f || e > f);
}
const int FP_ZERO = 2;
const int FP_SUBNORMAL = 3;
const int FP_NORMAL = 4;
-int fpclassify(float x);
-bool isfinite(float x);
-bool isinf(float x);
-bool isnan(float x);
-bool isnormal(float x);
-bool signbit(float x);
-
-//float acos(float x);
-//float asin(float x);
-//float atan(float x);
-//float atan2(float y, float x);
-//float cos(float x);
-//float sin(float x);
-//float tan(float x);
-
-float acosh(float x);
-float asinh(float x);
-float atanh(float x);
-float cosh(float x);
-float sinh(float x);
-float tanh(float x);
-
-float exp(float x);
-float exp2(float x);
-float expm1(float x);
-
-vector frexp(float x); // returns mantissa as _x, exponent as _y
-int ilogb(float x);
-float ldexp(float x, int e);
-//float log(float x);
-float logn(float x, float base);
-float log10(float x);
-float log1p(float x);
-float log2(float x);
-float logb(float x);
+int fpclassify(float e);
+bool isfinite(float e);
+bool isinf(float e);
+bool isnan(float e);
+bool isnormal(float e);
+bool signbit(float e);
+
+//float acos(float e);
+//float asin(float e);
+//float atan(float e);
+//float atan2(float f, float e);
+//float cos(float e);
+//float sin(float e);
+//float tan(float e);
+
+float acosh(float e);
+float asinh(float e);
+float atanh(float e);
+float cosh(float e);
+float sinh(float e);
+float tanh(float e);
+
+float exp(float e);
+float exp2(float e);
+float expm1(float e);
+
+vector frexp(float e); // returns mantissa as _x, exponent as _y
+int ilogb(float e);
+float ldexp(float e, int e);
+//float log(float e);
+float logn(float e, float base);
+float log10(float e);
+float log1p(float e);
+float log2(float e);
+float logb(float e);
vector modf(float f); // fraction as _x, integer as _y
-float scalbn(float x, int n);
+float scalbn(float e, int n);
-float cbrt(float x);
-//float fabs(float x);
-float hypot(float x, float y);
-//float pow(float x, float y);
-//float sqrt(float x, float y);
+float cbrt(float e);
+//float fabs(float e);
+float hypot(float e, float f);
+//float pow(float e, float f);
+//float sqrt(float e, float f);
-float erf(float x);
-float erfc(float x);
-vector lgamma(float x); // value in _x, sign in _y
-float tgamma(float x);
+float erf(float e);
+float erfc(float e);
+vector lgamma(float e); // value in _x, sign in _y
+float tgamma(float e);
/**
* Pythonic mod:
* 1 % -2 == -1
* -1 % -2 == -1
*/
-float pymod(float x, float y);
+float pymod(float e, float f);
-//float ceil(float x);
-//float floor(float x);
-float nearbyint(float x);
-//float rint(float x);
-//float round(float x);
-float trunc(float x);
+//float ceil(float e);
+//float floor(float e);
+float nearbyint(float e);
+//float rint(float e);
+//float round(float e);
+float trunc(float e);
-float fmod(float x, float y);
-float remainder(float x, float y);
-vector remquo(float x, float y);
+float fmod(float e, float f);
+float remainder(float e, float f);
+vector remquo(float e, float f);
-float copysign(float x, float y);
+float copysign(float e, float f);
float nan(string tag);
-float nextafter(float x, float y);
-float nexttoward(float x, float y);
-
-float fdim(float x, float y);
-float fmax(float x, float y);
-float fmin(float x, float y);
-float fma(float x, float y, float z);
-
-int isgreater(float x, float y);
-int isgreaterequal(float x, float y);
-int isless(float x, float y);
-int islessequal(float x, float y);
-int islessgreater(float x, float y);
-int isunordered(float x, float y);
+float nextafter(float e, float f);
+float nexttoward(float e, float f);
+
+float fdim(float e, float f);
+float fmax(float e, float f);
+float fmin(float e, float f);
+float fma(float e, float f, float g);
+
+int isgreater(float e, float f);
+int isgreaterequal(float e, float f);
+int isless(float e, float f);
+int islessequal(float e, float f);
+int islessgreater(float e, float f);
+int isunordered(float e, float f);
const float M_E = 2.7182818284590452354; /* e */
const float M_LOG2E = 1.4426950408889634074; /* log_2 e */
}
return 1;
}
- void Image_setZoom(entity me, float z, float atMousePosition)
+ void Image_setZoom(entity me, float newzoom, float atMousePosition)
{
float prev_zoomFactor;
prev_zoomFactor = me.zoomFactor;
- if (z < 0) // multiply by the current zoomFactor (but can also snap to real dimensions or to box)
+ if (newzoom < 0) // multiply by the current zoomFactor (but can also snap to real dimensions or to box)
{
- me.zoomFactor *= -z;
+ me.zoomFactor *= -newzoom;
float realSize_in_the_middle, boxSize_in_the_middle;
realSize_in_the_middle = ((prev_zoomFactor - 1) * (me.zoomFactor - 1) < 0);
boxSize_in_the_middle = (me.zoomBox > 0 && (prev_zoomFactor - me.zoomBox) * (me.zoomFactor - me.zoomBox) < 0);
me.zoomFactor = me.zoomBox; // snap to box
}
}
- else if (z == 0) // reset (no zoom)
+ else if (newzoom == 0) // reset (no zoom)
{
if (me.zoomBox > 0) me.zoomFactor = me.zoomBox;
else me.zoomFactor = 1;
}
else // directly set
{
- me.zoomFactor = z;
+ me.zoomFactor = newzoom;
}
me.zoomFactor = bound(1 / 16, me.zoomFactor, 16);
if (me.zoomMax > 0 && me.zoomFactor > me.zoomMax) me.zoomFactor = me.zoomMax;
oldshift = draw_shift;
oldscale = draw_scale;
- float y;
i = me.getItemAtPos(me, me.scrollPos);
- y = me.getItemStart(me, i) - me.scrollPos;
- for ( ; i < me.nItems && y < 1; ++i)
+ float j = me.getItemStart(me, i) - me.scrollPos;
+ for ( ; i < me.nItems && j < 1; ++i)
{
- draw_shift = boxToGlobal(eY * y, oldshift, oldscale);
+ draw_shift = boxToGlobal(eY * j, oldshift, oldscale);
vector relSize = eX * (1 - me.controlWidth) + eY * me.getItemHeight(me, i);
absSize = boxToGlobalSize(relSize, me.size);
draw_scale = boxToGlobalSize(relSize, oldscale);
me.drawListBoxItem(me, i, absSize, (me.selectedItem == i), (me.focusedItem == i));
- y += relSize.y;
+ j += relSize.y;
}
draw_ClearClip();
entity makeXonoticCheckBox_T(float isInverted, string theCvar, string theText, string theTooltip)
{
- float y, n;
+ float m, n;
if(isInverted > 1)
{
n = isInverted - 1;
- y = -n;
+ m = -n;
}
else if(isInverted < -1)
{
n = isInverted + 1;
- y = -n;
+ m = -n;
}
else if(isInverted == 1)
{
n = 1;
- y = 0;
+ m = 0;
}
else
{
n = 0;
- y = 1;
+ m = 1;
}
- return makeXonoticCheckBoxEx_T(y, n, theCvar, theText, theTooltip);
+ return makeXonoticCheckBoxEx_T(m, n, theCvar, theText, theTooltip);
}
entity makeXonoticCheckBox(float isInverted, string theCvar, string theText)
{
if (time < me.zoomTime + 2) // 1 seconds at full alpha, 1 second fading out
{
string zoomString;
- float z;
- z = me.zoomFactor * 100;
- if (z - floor(z) == 0)
- zoomString = sprintf("%d%%", z);
+ float myzoom = me.zoomFactor * 100;
+ if (myzoom - floor(myzoom) == 0)
+ zoomString = sprintf("%d%%", myzoom);
else
- zoomString = sprintf("%.2f%%", z);
+ zoomString = sprintf("%.2f%%", myzoom);
theAlpha = (2 - (time - me.zoomTime));
draw_Text('0.05 0.95 0', zoomString, me.realFontSize, '1 1 1', theAlpha, false);
}
// entire list, otherwise there is no way to know which item is first in its category.
// binary search method suggested by div
- float x;
float begin = 0;
- for(x = 1; x <= category_ent_count; ++x) {
+ for(int j = 1; j <= category_ent_count; ++j) {
float first = begin;
float last = (itemcount - 1);
if (first > last) {
}
float catf = gethostcachenumber(SLIST_FIELD_CATEGORY, first);
float catl = gethostcachenumber(SLIST_FIELD_CATEGORY, last);
- if (catf > x) {
- // The first one is already > x.
- // Therefore, category x does not exist.
+ if (catf > j) {
+ // The first one is already > j.
+ // Therefore, category j does not exist.
// Higher numbered categories do exist though.
- } else if (catl < x) {
- // The last one is < x.
+ } else if (catl < j) {
+ // The last one is < j.
// Thus this category - and any following -
// don't exist.
break;
- } else if (catf == x) {
+ } else if (catf == j) {
// Starts at first. This breaks the loop
// invariant in the binary search and thus has
// to be handled separately.
- if(gethostcachenumber(SLIST_FIELD_CATEGORY, first) != x)
+ if(gethostcachenumber(SLIST_FIELD_CATEGORY, first) != j)
error("Category mismatch I");
if(first > 0)
- if(gethostcachenumber(SLIST_FIELD_CATEGORY, first - 1) == x)
+ if(gethostcachenumber(SLIST_FIELD_CATEGORY, first - 1) == j)
error("Category mismatch II");
- category_name[category_draw_count] = x;
+ category_name[category_draw_count] = j;
category_item[category_draw_count] = first;
++category_draw_count;
begin = first + 1;
} else {
- // At this point, catf <= x < catl, thus
+ // At this point, catf <= j < catl, thus
// catf < catl, thus first < last.
// INVARIANTS:
// last - first >= 1
// catf == gethostcachenumber(SLIST_FIELD_CATEGORY(first)
// catl == gethostcachenumber(SLIST_FIELD_CATEGORY(last)
- // catf < x
- // catl >= x
+ // catf < j
+ // catl >= j
while (last - first > 1) {
float middle = floor((first + last) / 2);
// By loop condition, middle != first && middle != last.
float cat = gethostcachenumber(SLIST_FIELD_CATEGORY, middle);
- if (cat >= x) {
+ if (cat >= j) {
last = middle;
catl = cat;
} else {
catf = cat;
}
}
- if (catl == x) {
- if(gethostcachenumber(SLIST_FIELD_CATEGORY, last) != x)
+ if (catl == j) {
+ if(gethostcachenumber(SLIST_FIELD_CATEGORY, last) != j)
error("Category mismatch III");
if(last > 0)
- if(gethostcachenumber(SLIST_FIELD_CATEGORY, last - 1) == x)
+ if(gethostcachenumber(SLIST_FIELD_CATEGORY, last - 1) == j)
error("Category mismatch IV");
- category_name[category_draw_count] = x;
+ category_name[category_draw_count] = j;
category_item[category_draw_count] = last;
++category_draw_count;
begin = last + 1; // already scanned through these, skip 'em
{
// linear scale part
float t = 1 / A + mi;
- float y = exp(1 + A * mi);
- if(f <= y)
- return mi + (t - mi) * (f / y);
+ float u = exp(1 + A * mi);
+ if(f <= u)
+ return mi + (t - mi) * (f / u);
}
return log(f) / A;
}
{
// linear scale part
float t = 1 / A + mi;
- float y = exp(1 + A * mi);
+ float u = exp(1 + A * mi);
if(f <= t)
- return y * ((f - mi) / (t - mi));
+ return u * ((f - mi) / (t - mi));
}
return exp(A * f);
}
}
bool zoomstate_set;
-void SetZoomState(entity this, float z)
+void SetZoomState(entity this, float newzoom)
{
- if(z != this.zoomstate)
+ if(newzoom != this.zoomstate)
{
- this.zoomstate = z;
+ this.zoomstate = newzoom;
ClientData_Touch(this);
}
zoomstate_set = true;
return white / (black + white);
}
-float RadarMapAtPoint_Trace(float x, float y, float w, float h, float zmin, float zsize, float q)
+float RadarMapAtPoint_Trace(float e, float f, float w, float h, float zmin, float zsize, float q)
{
vector a, b, mi, ma;
mi = '0 0 0';
ma = '1 0 0' * w + '0 1 0' * h;
- a = '1 0 0' * x + '0 1 0' * y + '0 0 1' * zmin;
- b = '1 0 0' * x + '0 1 0' * y + '0 0 1' * (zsize + zmin);
+ a = '1 0 0' * e + '0 1 0' * f + '0 0 1' * zmin;
+ b = '1 0 0' * e + '0 1 0' * f + '0 0 1' * (zsize + zmin);
return FullTraceFraction(a, mi, ma, b);
}
-float RadarMapAtPoint_LineBlock(float x, float y, float w, float h, float zmin, float zsize, float q)
+float RadarMapAtPoint_LineBlock(float e, float f, float w, float h, float zmin, float zsize, float q)
{
vector o, mi, ma;
float i, r;
mi = '0 0 0';
dz = (zsize / q) * '0 0 1';
ma = '1 0 0' * w + '0 1 0' * h + dz;
- o = '1 0 0' * x + '0 1 0' * y + '0 0 1' * zmin;
+ o = '1 0 0' * e + '0 1 0' * f + '0 0 1' * zmin;
- if (x < world.absmin.x - w) return 0;
- if (y < world.absmin.y - h) return 0;
- if (x > world.absmax.x) return 0;
- if (y > world.absmax.y) return 0;
+ if (e < world.absmin.x - w) return 0;
+ if (f < world.absmin.y - h) return 0;
+ if (e > world.absmax.x) return 0;
+ if (f > world.absmax.y) return 0;
r = 0;
for (i = 0; i < q; ++i)
}
return r / q;
}
-float RadarMapAtPoint_Block(float x, float y, float w, float h, float zmin, float zsize, float q)
+float RadarMapAtPoint_Block(float e, float f, float w, float h, float zmin, float zsize, float q)
{
vector o, mi, ma;
float i, r;
mi = '0 0 0';
dz = (zsize / q) * '0 0 1';
ma = '1 0 0' * w + '0 1 0' * h + dz;
- o = '1 0 0' * x + '0 1 0' * y + '0 0 1' * zmin;
+ o = '1 0 0' * e + '0 1 0' * f + '0 0 1' * zmin;
- if (x < world.absmin.x - w) return 0;
- if (y < world.absmin.y - h) return 0;
- if (x > world.absmax.x) return 0;
- if (y > world.absmax.y) return 0;
+ if (e < world.absmin.x - w) return 0;
+ if (f < world.absmin.y - h) return 0;
+ if (e > world.absmax.x) return 0;
+ if (f > world.absmax.y) return 0;
r = 0;
for (i = 0; i < q; ++i)
}
return r / q;
}
-float RadarMapAtPoint_Sample(float x, float y, float w, float h, float zmin, float zsize, float q)
+float RadarMapAtPoint_Sample(float e, float f, float w, float h, float zmin, float zsize, float q)
{
vector a, b, mi, ma;
mi = '0 0 0';
ma = '1 0 0' * w + '0 1 0' * h;
- a = '1 0 0' * x + '0 1 0' * y + '0 0 1' * zmin;
+ a = '1 0 0' * e + '0 1 0' * f + '0 0 1' * zmin;
b = '1 0 0' * w + '0 1 0' * h + '0 0 1' * zsize;
float c, i;
return c / q;
}
-void sharpen_set(int x, float v)
+void sharpen_set(int b, float v)
{
- sharpen_buffer[x + 2 * RADAR_WIDTH_MAX] = v;
+ sharpen_buffer[b + 2 * RADAR_WIDTH_MAX] = v;
}
-float sharpen_getpixel(int x, int y)
+float sharpen_getpixel(int b, int c)
{
- if (x < 0) return 0;
- if (x >= RADAR_WIDTH_MAX) return 0;
- if (y < 0) return 0;
- if (y > 2) return 0;
- return sharpen_buffer[x + y * RADAR_WIDTH_MAX];
+ if (b < 0) return 0;
+ if (b >= RADAR_WIDTH_MAX) return 0;
+ if (c < 0) return 0;
+ if (c > 2) return 0;
+ return sharpen_buffer[b + c * RADAR_WIDTH_MAX];
}
-float sharpen_get(float x, float a)
+float sharpen_get(float b, float a)
{
- float sum = sharpen_getpixel(x, 1);
+ float sum = sharpen_getpixel(b, 1);
if (a == 0) return sum;
sum *= (8 + 1 / a);
- sum -= sharpen_getpixel(x - 1, 0);
- sum -= sharpen_getpixel(x - 1, 1);
- sum -= sharpen_getpixel(x - 1, 2);
- sum -= sharpen_getpixel(x + 1, 0);
- sum -= sharpen_getpixel(x + 1, 1);
- sum -= sharpen_getpixel(x + 1, 2);
- sum -= sharpen_getpixel(x, 0);
- sum -= sharpen_getpixel(x, 2);
+ sum -= sharpen_getpixel(b - 1, 0);
+ sum -= sharpen_getpixel(b - 1, 1);
+ sum -= sharpen_getpixel(b - 1, 2);
+ sum -= sharpen_getpixel(b + 1, 0);
+ sum -= sharpen_getpixel(b + 1, 1);
+ sum -= sharpen_getpixel(b + 1, 2);
+ sum -= sharpen_getpixel(b, 0);
+ sum -= sharpen_getpixel(b, 2);
return bound(0, sum * a, 1);
}
void sharpen_shift(int w)
{
if (teamplay)
{
- float x, t_teams, t_players, team_color;
+ float t_teams, t_players, team_color;
// count the total amount of players and total amount of teams
t_players = 0;
for (int i = 1; i <= t_teams; ++i)
{
// find out how many players to assign to this team
- x = (t_players / t_teams);
- x = ((i == 1) ? ceil(x) : floor(x));
+ int pnum = (t_players / t_teams);
+ pnum = ((i == 1) ? ceil(pnum) : floor(pnum));
team_color = Team_NumberToTeam(i);
// sort through the random list of players made earlier
for (int z = 1; z <= maxclients; ++z)
{
- if (!(shuffleteams_teams[i] >= x))
+ if (!(shuffleteams_teams[i] >= pnum))
{
if (!(shuffleteams_players[z])) continue; // not a player, move on to next random slot
}
-float Cosine_Interpolate(float a, float b, float x)
+float Cosine_Interpolate(float a, float b, float c)
{
float ft,f;
- ft = x * 3.1415927;
+ ft = c * 3.1415927;
f = (1 - cos(ft)) * 0.5;
return a*(1-f) + b*f;