Updated includes and spcomp to SourceMod 1.9
This commit is contained in:
Vendored
+72
-77
@@ -42,7 +42,7 @@
|
||||
* @param value Integer to convert.
|
||||
* @return Floating point value.
|
||||
*/
|
||||
native Float:float(value);
|
||||
native float float(int value);
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -52,7 +52,7 @@ native Float:float(value);
|
||||
* @param oper2 Second value.
|
||||
* @return oper1*oper2.
|
||||
*/
|
||||
native Float:FloatMul(Float:oper1, Float:oper2);
|
||||
native float FloatMul(float oper1, float oper2);
|
||||
|
||||
/**
|
||||
* Divides the dividend by the divisor.
|
||||
@@ -61,7 +61,7 @@ native Float:FloatMul(Float:oper1, Float:oper2);
|
||||
* @param divisor Second value.
|
||||
* @return dividend/divisor.
|
||||
*/
|
||||
native Float:FloatDiv(Float:dividend, Float:divisor);
|
||||
native float FloatDiv(float dividend, float divisor);
|
||||
|
||||
/**
|
||||
* Adds two floats together.
|
||||
@@ -70,7 +70,7 @@ native Float:FloatDiv(Float:dividend, Float:divisor);
|
||||
* @param oper2 Second value.
|
||||
* @return oper1+oper2.
|
||||
*/
|
||||
native Float:FloatAdd(Float:oper1, Float:oper2);
|
||||
native float FloatAdd(float oper1, float oper2);
|
||||
|
||||
/**
|
||||
* Subtracts oper2 from oper1.
|
||||
@@ -79,7 +79,7 @@ native Float:FloatAdd(Float:oper1, Float:oper2);
|
||||
* @param oper2 Second value.
|
||||
* @return oper1-oper2.
|
||||
*/
|
||||
native Float:FloatSub(Float:oper1, Float:oper2);
|
||||
native float FloatSub(float oper1, float oper2);
|
||||
|
||||
/**
|
||||
* Returns the decimal part of a float.
|
||||
@@ -87,7 +87,7 @@ native Float:FloatSub(Float:oper1, Float:oper2);
|
||||
* @param value Input value.
|
||||
* @return Decimal part.
|
||||
*/
|
||||
native Float:FloatFraction(Float:value);
|
||||
native float FloatFraction(float value);
|
||||
|
||||
/**
|
||||
* Rounds a float to the closest integer to zero.
|
||||
@@ -95,7 +95,7 @@ native Float:FloatFraction(Float:value);
|
||||
* @param value Input value to be rounded.
|
||||
* @return Rounded value.
|
||||
*/
|
||||
native RoundToZero(Float:value);
|
||||
native int RoundToZero(float value);
|
||||
|
||||
/**
|
||||
* Rounds a float to the next highest integer value.
|
||||
@@ -103,7 +103,7 @@ native RoundToZero(Float:value);
|
||||
* @param value Input value to be rounded.
|
||||
* @return Rounded value.
|
||||
*/
|
||||
native RoundToCeil(Float:value);
|
||||
native int RoundToCeil(float value);
|
||||
|
||||
/**
|
||||
* Rounds a float to the next lowest integer value.
|
||||
@@ -111,7 +111,7 @@ native RoundToCeil(Float:value);
|
||||
* @param value Input value to be rounded.
|
||||
* @return Rounded value.
|
||||
*/
|
||||
native RoundToFloor(Float:value);
|
||||
native int RoundToFloor(float value);
|
||||
|
||||
/**
|
||||
* Standard IEEE rounding.
|
||||
@@ -119,7 +119,7 @@ native RoundToFloor(Float:value);
|
||||
* @param value Input value to be rounded.
|
||||
* @return Rounded value.
|
||||
*/
|
||||
native RoundToNearest(Float:value);
|
||||
native int RoundToNearest(float value);
|
||||
|
||||
/**
|
||||
* Compares two floats.
|
||||
@@ -130,7 +130,7 @@ native RoundToNearest(Float:value);
|
||||
* Returns -1 if the first argument is smaller than the second argument.
|
||||
* Returns 0 if both arguments are equal.
|
||||
*/
|
||||
native FloatCompare(Float:fOne, Float:fTwo);
|
||||
native int FloatCompare(float fOne, float fTwo);
|
||||
|
||||
/**
|
||||
* Returns the square root of the input value, equivalent to floatpower(value, 0.5).
|
||||
@@ -138,7 +138,7 @@ native FloatCompare(Float:fOne, Float:fTwo);
|
||||
* @param value Input value.
|
||||
* @return Square root of the value.
|
||||
*/
|
||||
native Float:SquareRoot(Float:value);
|
||||
native float SquareRoot(float value);
|
||||
|
||||
/**
|
||||
* Returns the value raised to the power of the exponent.
|
||||
@@ -147,7 +147,7 @@ native Float:SquareRoot(Float:value);
|
||||
* @param exponent Value to raise the base.
|
||||
* @return value^exponent.
|
||||
*/
|
||||
native Float:Pow(Float:value, Float:exponent);
|
||||
native float Pow(float value, float exponent);
|
||||
|
||||
/**
|
||||
* Returns the value of raising the input by e.
|
||||
@@ -155,7 +155,7 @@ native Float:Pow(Float:value, Float:exponent);
|
||||
* @param value Input value.
|
||||
* @return exp(value).
|
||||
*/
|
||||
native Float:Exponential(Float:value);
|
||||
native float Exponential(float value);
|
||||
|
||||
/**
|
||||
* Returns the logarithm of any base specified.
|
||||
@@ -164,7 +164,7 @@ native Float:Exponential(Float:value);
|
||||
* @param base Logarithm base to use, default is 10.
|
||||
* @return log(value)/log(base).
|
||||
*/
|
||||
native Float:Logarithm(Float:value, Float:base=10.0);
|
||||
native float Logarithm(float value, float base=10.0);
|
||||
|
||||
/**
|
||||
* Returns the sine of the argument.
|
||||
@@ -172,7 +172,7 @@ native Float:Logarithm(Float:value, Float:base=10.0);
|
||||
* @param value Input value in radians.
|
||||
* @return sin(value).
|
||||
*/
|
||||
native Float:Sine(Float:value);
|
||||
native float Sine(float value);
|
||||
|
||||
/**
|
||||
* Returns the cosine of the argument.
|
||||
@@ -180,7 +180,7 @@ native Float:Sine(Float:value);
|
||||
* @param value Input value in radians.
|
||||
* @return cos(value).
|
||||
*/
|
||||
native Float:Cosine(Float:value);
|
||||
native float Cosine(float value);
|
||||
|
||||
/**
|
||||
* Returns the tangent of the argument.
|
||||
@@ -188,7 +188,7 @@ native Float:Cosine(Float:value);
|
||||
* @param value Input value in radians.
|
||||
* @return tan(value).
|
||||
*/
|
||||
native Float:Tangent(Float:value);
|
||||
native float Tangent(float value);
|
||||
|
||||
/**
|
||||
* Returns an absolute value.
|
||||
@@ -196,7 +196,7 @@ native Float:Tangent(Float:value);
|
||||
* @param value Input value.
|
||||
* @return Absolute value of the input.
|
||||
*/
|
||||
native Float:FloatAbs(Float:value);
|
||||
native float FloatAbs(float value);
|
||||
|
||||
/**
|
||||
* Returns the arctangent of the input value.
|
||||
@@ -204,7 +204,7 @@ native Float:FloatAbs(Float:value);
|
||||
* @param angle Input value.
|
||||
* @return atan(value) in radians.
|
||||
*/
|
||||
native Float:ArcTangent(Float:angle);
|
||||
native float ArcTangent(float angle);
|
||||
|
||||
/**
|
||||
* Returns the arccosine of the input value.
|
||||
@@ -212,7 +212,7 @@ native Float:ArcTangent(Float:angle);
|
||||
* @param angle Input value.
|
||||
* @return acos(value) in radians.
|
||||
*/
|
||||
native Float:ArcCosine(Float:angle);
|
||||
native float ArcCosine(float angle);
|
||||
|
||||
/**
|
||||
* Returns the arcsine of the input value.
|
||||
@@ -220,7 +220,7 @@ native Float:ArcCosine(Float:angle);
|
||||
* @param angle Input value.
|
||||
* @return asin(value) in radians.
|
||||
*/
|
||||
native Float:ArcSine(Float:angle);
|
||||
native float ArcSine(float angle);
|
||||
|
||||
/**
|
||||
* Returns the arctangent2 of the input values.
|
||||
@@ -229,7 +229,7 @@ native Float:ArcSine(Float:angle);
|
||||
* @param y Vertical value.
|
||||
* @return atan2(value) in radians.
|
||||
*/
|
||||
native Float:ArcTangent2(Float:x, Float:y);
|
||||
native float ArcTangent2(float x, float y);
|
||||
|
||||
/**
|
||||
* Rounds a floating point number using the "round to nearest" algorithm.
|
||||
@@ -237,140 +237,138 @@ native Float:ArcTangent2(Float:x, Float:y);
|
||||
* @param value Floating point value to round.
|
||||
* @return The value rounded to the nearest integer.
|
||||
*/
|
||||
stock RoundFloat(Float:value)
|
||||
stock int RoundFloat(float value)
|
||||
{
|
||||
return RoundToNearest(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* User defined operators.
|
||||
*
|
||||
*/
|
||||
#if !defined __sourcepawn2__
|
||||
#pragma rational Float
|
||||
|
||||
native bool:__FLOAT_GT__(Float:a, Float:b);
|
||||
native bool:__FLOAT_GE__(Float:a, Float:b);
|
||||
native bool:__FLOAT_LT__(Float:a, Float:b);
|
||||
native bool:__FLOAT_LE__(Float:a, Float:b);
|
||||
native bool:__FLOAT_EQ__(Float:a, Float:b);
|
||||
native bool:__FLOAT_NE__(Float:a, Float:b);
|
||||
native bool:__FLOAT_NOT__(Float:a);
|
||||
native bool __FLOAT_GT__(float a, float b);
|
||||
native bool __FLOAT_GE__(float a, float b);
|
||||
native bool __FLOAT_LT__(float a, float b);
|
||||
native bool __FLOAT_LE__(float a, float b);
|
||||
native bool __FLOAT_EQ__(float a, float b);
|
||||
native bool __FLOAT_NE__(float a, float b);
|
||||
native bool __FLOAT_NOT__(float a);
|
||||
|
||||
native Float:operator*(Float:oper1, Float:oper2) = FloatMul;
|
||||
native Float:operator/(Float:oper1, Float:oper2) = FloatDiv;
|
||||
native Float:operator+(Float:oper1, Float:oper2) = FloatAdd;
|
||||
native Float:operator-(Float:oper1, Float:oper2) = FloatSub;
|
||||
native bool:operator!(Float:oper1) = __FLOAT_NOT__;
|
||||
native bool:operator>(Float:oper1, Float:oper2) = __FLOAT_GT__;
|
||||
native bool:operator>=(Float:oper1, Float:oper2) = __FLOAT_GE__;
|
||||
native bool:operator<(Float:oper1, Float:oper2) = __FLOAT_LT__;
|
||||
native bool:operator<=(Float:oper1, Float:oper2) = __FLOAT_LE__;
|
||||
native bool:operator!=(Float:oper1, Float:oper2) = __FLOAT_NE__;
|
||||
native bool:operator==(Float:oper1, Float:oper2) = __FLOAT_EQ__;
|
||||
native float operator*(float oper1, float oper2) = FloatMul;
|
||||
native float operator/(float oper1, float oper2) = FloatDiv;
|
||||
native float operator+(float oper1, float oper2) = FloatAdd;
|
||||
native float operator-(float oper1, float oper2) = FloatSub;
|
||||
native bool operator!(float oper1) = __FLOAT_NOT__;
|
||||
native bool operator>(float oper1, float oper2) = __FLOAT_GT__;
|
||||
native bool operator>=(float oper1, float oper2) = __FLOAT_GE__;
|
||||
native bool operator<(float oper1, float oper2) = __FLOAT_LT__;
|
||||
native bool operator<=(float oper1, float oper2) = __FLOAT_LE__;
|
||||
native bool operator!=(float oper1, float oper2) = __FLOAT_NE__;
|
||||
native bool operator==(float oper1, float oper2) = __FLOAT_EQ__;
|
||||
|
||||
stock Float:operator++(Float:oper)
|
||||
stock float operator++(float oper)
|
||||
{
|
||||
return oper+1.0;
|
||||
}
|
||||
|
||||
stock Float:operator--(Float:oper)
|
||||
stock float operator--(float oper)
|
||||
{
|
||||
return oper-1.0;
|
||||
}
|
||||
|
||||
stock Float:operator-(Float:oper)
|
||||
stock float operator-(float oper)
|
||||
{
|
||||
return oper^Float:cellmin; /* IEEE values are sign/magnitude */
|
||||
return oper^view_as<float>(cellmin); /* IEEE values are sign/magnitude */
|
||||
}
|
||||
|
||||
stock Float:operator*(Float:oper1, oper2)
|
||||
stock float operator*(float oper1, int oper2)
|
||||
{
|
||||
return FloatMul(oper1, float(oper2)); /* "*" is commutative */
|
||||
}
|
||||
|
||||
stock Float:operator/(Float:oper1, oper2)
|
||||
stock float operator/(float oper1, int oper2)
|
||||
{
|
||||
return FloatDiv(oper1, float(oper2));
|
||||
}
|
||||
|
||||
stock Float:operator/(oper1, Float:oper2)
|
||||
stock float operator/(int oper1, float oper2)
|
||||
{
|
||||
return FloatDiv(float(oper1), oper2);
|
||||
}
|
||||
|
||||
stock Float:operator+(Float:oper1, oper2)
|
||||
stock float operator+(float oper1, int oper2)
|
||||
{
|
||||
return FloatAdd(oper1, float(oper2)); /* "+" is commutative */
|
||||
}
|
||||
|
||||
stock Float:operator-(Float:oper1, oper2)
|
||||
stock float operator-(float oper1, int oper2)
|
||||
{
|
||||
return FloatSub(oper1, float(oper2));
|
||||
}
|
||||
|
||||
stock Float:operator-(oper1, Float:oper2)
|
||||
stock float operator-(int oper1, float oper2)
|
||||
{
|
||||
return FloatSub(float(oper1), oper2);
|
||||
}
|
||||
|
||||
stock bool:operator==(Float:oper1, oper2)
|
||||
stock bool operator==(float oper1, int oper2)
|
||||
{
|
||||
return __FLOAT_EQ__(oper1, float(oper2));
|
||||
}
|
||||
|
||||
stock bool:operator!=(Float:oper1, oper2)
|
||||
stock bool operator!=(float oper1, int oper2)
|
||||
{
|
||||
return __FLOAT_NE__(oper1, float(oper2));
|
||||
}
|
||||
|
||||
stock bool:operator>(Float:oper1, oper2)
|
||||
stock bool operator>(float oper1, int oper2)
|
||||
{
|
||||
return __FLOAT_GT__(oper1, float(oper2));
|
||||
}
|
||||
|
||||
stock bool:operator>(oper1, Float:oper2)
|
||||
stock bool operator>(int oper1, float oper2)
|
||||
{
|
||||
return __FLOAT_GT__(float(oper1), oper2);
|
||||
}
|
||||
|
||||
stock bool:operator>=(Float:oper1, oper2)
|
||||
stock bool operator>=(float oper1, int oper2)
|
||||
{
|
||||
return __FLOAT_GE__(oper1, float(oper2));
|
||||
}
|
||||
|
||||
stock bool:operator>=(oper1, Float:oper2)
|
||||
stock bool operator>=(int oper1, float oper2)
|
||||
{
|
||||
return __FLOAT_GE__(float(oper1), oper2);
|
||||
}
|
||||
|
||||
stock bool:operator<(Float:oper1, oper2)
|
||||
stock bool operator<(float oper1, int oper2)
|
||||
{
|
||||
return __FLOAT_LT__(oper1, float(oper2));
|
||||
}
|
||||
|
||||
stock bool:operator<(oper1, Float:oper2)
|
||||
stock bool operator<(int oper1, float oper2)
|
||||
{
|
||||
return __FLOAT_LT__(float(oper1), oper2);
|
||||
}
|
||||
|
||||
stock bool:operator<=(Float:oper1, oper2)
|
||||
stock bool operator<=(float oper1, int oper2)
|
||||
{
|
||||
return __FLOAT_LE__(oper1, float(oper2));
|
||||
}
|
||||
|
||||
stock bool:operator<=(oper1, Float:oper2)
|
||||
stock bool operator<=(int oper1, float oper2)
|
||||
{
|
||||
return __FLOAT_LE__(float(oper1), oper2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Forbidden operators.
|
||||
*
|
||||
*/
|
||||
forward operator%(Float:oper1, Float:oper2);
|
||||
forward operator%(Float:oper1, oper2);
|
||||
forward operator%(oper1, Float:oper2);
|
||||
forward operator%(float oper1, float oper2);
|
||||
forward operator%(float oper1, int oper2);
|
||||
forward operator%(int oper1, float oper2);
|
||||
#endif // __sourcepawn2__
|
||||
|
||||
#define FLOAT_PI 3.1415926535897932384626433832795
|
||||
@@ -381,7 +379,7 @@ forward operator%(oper1, Float:oper2);
|
||||
* @param angle Degrees.
|
||||
* @return Radians.
|
||||
*/
|
||||
stock Float:DegToRad(Float:angle)
|
||||
stock float DegToRad(float angle)
|
||||
{
|
||||
return (angle*FLOAT_PI)/180;
|
||||
}
|
||||
@@ -392,7 +390,7 @@ stock Float:DegToRad(Float:angle)
|
||||
* @param angle Radians.
|
||||
* @return Degrees.
|
||||
*/
|
||||
stock Float:RadToDeg(Float:angle)
|
||||
stock float RadToDeg(float angle)
|
||||
{
|
||||
return (angle*180)/FLOAT_PI;
|
||||
}
|
||||
@@ -404,7 +402,7 @@ stock Float:RadToDeg(Float:angle)
|
||||
*
|
||||
* @return Random integer.
|
||||
*/
|
||||
native GetURandomInt();
|
||||
native int GetURandomInt();
|
||||
|
||||
/**
|
||||
* Returns a uniform random float in the range [0, 1).
|
||||
@@ -413,7 +411,7 @@ native GetURandomInt();
|
||||
*
|
||||
* @return Uniform random floating-point number.
|
||||
*/
|
||||
native Float:GetURandomFloat();
|
||||
native float GetURandomFloat();
|
||||
|
||||
/**
|
||||
* Seeds a plugin's uniform random number stream. This is done automatically,
|
||||
@@ -421,21 +419,18 @@ native Float:GetURandomFloat();
|
||||
*
|
||||
* @param seeds Array of numbers to use as seeding data.
|
||||
* @param numSeeds Number of seeds in the seeds array.
|
||||
* @noreturn
|
||||
*/
|
||||
native SetURandomSeed(const seeds[], numSeeds);
|
||||
native void SetURandomSeed(const int[] seeds, int numSeeds);
|
||||
|
||||
/**
|
||||
* Seeds a plugin's uniform random number stream. This is done automatically,
|
||||
* so normally it is totally unnecessary to call this.
|
||||
*
|
||||
* @param seed Single seed value.
|
||||
* @noreturn
|
||||
*/
|
||||
stock SetURandomSeedSimple(seed)
|
||||
stock void SetURandomSeedSimple(int seed)
|
||||
{
|
||||
new seeds[1];
|
||||
int seeds[1];
|
||||
seeds[0] = seed;
|
||||
SetURandomSeed(seeds, 1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user