Fix documentation
Former-commit-id: d43e254a2b72c53f09058ececd3bb449a9db9b37 [formerly 6351dd5b08b135d781a4ef646801ecf264cd3158] [formerly d43cdee4a57da3c91eb04f07e8b6cd8ab6311bb1 [formerly d22dfb0c17d68a4b4d4f21cd4c302b01d2340c92]] Former-commit-id: 09aca89659ff3eaf9a62d81458e055af07db19f7 [formerly d76a23b823cd559549b3e71a67b5fe18f9130869] Former-commit-id: a4180f4dabc413916bef4c102d414a03aa9c3d97
This commit is contained in:
parent
95689f46fb
commit
27d1fb048f
|
|
@ -45,20 +45,21 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
// Les parenthèses autour de la condition sont nécesaires pour que GCC compile ça
|
// The parentheses are needed for GCC
|
||||||
typename std::enable_if<(sizeof(T) > sizeof(UInt32)), unsigned int>::type IntegralLog2(T number)
|
typename std::enable_if<(sizeof(T) > sizeof(UInt32)), unsigned int>::type IntegralLog2(T number)
|
||||||
{
|
{
|
||||||
static_assert(sizeof(T) % sizeof(UInt32) == 0, "Assertion failed");
|
static_assert(sizeof(T) % sizeof(UInt32) == 0, "Assertion failed");
|
||||||
|
|
||||||
// L'algorithme pour le logarithme base 2 (au dessus) ne fonctionne qu'avec des nombres au plus 32bits
|
// Masking and shifting bits to the right (to bring it back to 32 bits)
|
||||||
// ce code décompose les nombres plus grands en nombres 32 bits par masquage et bit shifting
|
|
||||||
|
// Call of the function with 32 bits number, if the result is non-null we have our answer
|
||||||
for (int i = sizeof(T)-sizeof(UInt32); i >= 0; i -= sizeof(UInt32))
|
for (int i = sizeof(T)-sizeof(UInt32); i >= 0; i -= sizeof(UInt32))
|
||||||
{
|
{
|
||||||
// Le masque 32 bits sur la partie du nombre qu'on traite actuellement
|
// The 32 bits mask on the part we are treating
|
||||||
T mask = T(std::numeric_limits<UInt32>::max()) << i*8;
|
T mask = T(std::numeric_limits<UInt32>::max()) << i*8;
|
||||||
T val = (number & mask) >> i*8; // Masquage et shifting des bits vers la droite (pour le ramener sur 32bits)
|
T val = (number & mask) >> i*8; // Masking and shifting bits to the right (to bring it back to 32 bits)
|
||||||
|
|
||||||
// Appel de la fonction avec le nombre 32bits, si le résultat est non-nul nous avons la réponse
|
// Call of the function with 32 bits number, if the result is non-null we have our answer
|
||||||
unsigned int log2 = IntegralLog2<UInt32>(val);
|
unsigned int log2 = IntegralLog2<UInt32>(val);
|
||||||
if (log2)
|
if (log2)
|
||||||
return log2 + i*8;
|
return log2 + i*8;
|
||||||
|
|
@ -75,20 +76,20 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
// Les parenthèses autour de la condition sont nécesaires pour que GCC compile ça
|
// The parentheses are needed for GCC
|
||||||
typename std::enable_if<(sizeof(T) > sizeof(UInt32)), unsigned int>::type IntegralLog2Pot(T number)
|
typename std::enable_if<(sizeof(T) > sizeof(UInt32)), unsigned int>::type IntegralLog2Pot(T number)
|
||||||
{
|
{
|
||||||
static_assert(sizeof(T) % sizeof(UInt32) == 0, "Assertion failed");
|
static_assert(sizeof(T) % sizeof(UInt32) == 0, "Assertion failed");
|
||||||
|
|
||||||
// L'algorithme pour le logarithme base 2 (au dessus) ne fonctionne qu'avec des nombres au plus 32bits
|
// The algorithm for logarithm in base 2 only works with numbers greather than 32 bits
|
||||||
// ce code décompose les nombres plus grands en nombres 32 bits par masquage et bit shifting
|
// This code subdivides the biggest number into 32 bits ones
|
||||||
for (int i = sizeof(T)-sizeof(UInt32); i >= 0; i -= sizeof(UInt32))
|
for (int i = sizeof(T)-sizeof(UInt32); i >= 0; i -= sizeof(UInt32))
|
||||||
{
|
{
|
||||||
// Le masque 32 bits sur la partie du nombre qu'on traite actuellement
|
// The 32 bits mask on the part we are treating
|
||||||
T mask = T(std::numeric_limits<UInt32>::max()) << i*8;
|
T mask = T(std::numeric_limits<UInt32>::max()) << i*8;
|
||||||
UInt32 val = UInt32((number & mask) >> i*8); // Masquage et shifting des bits vers la droite (pour le ramener sur 32bits)
|
UInt32 val = UInt32((number & mask) >> i*8); // Masking and shifting bits to the right (to bring it back to 32 bits)
|
||||||
|
|
||||||
// Appel de la fonction avec le nombre 32bits, si le résultat est non-nul nous avons la réponse
|
// Call of the function with 32 bits number, if the result is non-null we have our answer
|
||||||
unsigned int log2 = IntegralLog2Pot<UInt32>(val);
|
unsigned int log2 = IntegralLog2Pot<UInt32>(val);
|
||||||
if (log2 || val == 1)
|
if (log2 || val == 1)
|
||||||
return log2 + i*8;
|
return log2 + i*8;
|
||||||
|
|
@ -99,7 +100,7 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \ingroup math
|
* \ingroup math
|
||||||
* \brief Approaches the objective, beginning with value and with increment
|
* \brief Approaches the objective, beginning with value and with increment
|
||||||
* \return The nearest value of the objective you can get with the value and the increment for one step
|
* \return The nearest value of the objective you can get with the value and the increment for one step
|
||||||
*
|
*
|
||||||
|
|
@ -121,7 +122,7 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \ingroup math
|
* \ingroup math
|
||||||
* \brief Clamps value between min and max and returns the expected value
|
* \brief Clamps value between min and max and returns the expected value
|
||||||
* \return If value is not in the interval of min..max, value obtained is the nearest limit of this interval
|
* \return If value is not in the interval of min..max, value obtained is the nearest limit of this interval
|
||||||
*
|
*
|
||||||
|
|
@ -137,7 +138,7 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \ingroup math
|
* \ingroup math
|
||||||
* \brief Gets number of bits set in the number
|
* \brief Gets number of bits set in the number
|
||||||
* \return The number of bits set to 1
|
* \return The number of bits set to 1
|
||||||
*
|
*
|
||||||
|
|
@ -160,7 +161,7 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \ingroup math
|
* \ingroup math
|
||||||
* \brief Converts degree to radian
|
* \brief Converts degree to radian
|
||||||
* \return The representation in radian of the angle in degree (0..2*pi)
|
* \return The representation in radian of the angle in degree (0..2*pi)
|
||||||
*
|
*
|
||||||
|
|
@ -174,7 +175,7 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \ingroup math
|
* \ingroup math
|
||||||
* \brief Gets the unit from degree and convert it according to NAZARA_MATH_ANGLE_RADIAN
|
* \brief Gets the unit from degree and convert it according to NAZARA_MATH_ANGLE_RADIAN
|
||||||
* \return Express the degrees
|
* \return Express the degrees
|
||||||
*
|
*
|
||||||
|
|
@ -192,7 +193,7 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \ingroup math
|
* \ingroup math
|
||||||
* \brief Gets the unit from radian and convert it according to NAZARA_MATH_ANGLE_RADIAN
|
* \brief Gets the unit from radian and convert it according to NAZARA_MATH_ANGLE_RADIAN
|
||||||
* \return Express the radians
|
* \return Express the radians
|
||||||
*
|
*
|
||||||
|
|
@ -210,7 +211,7 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \ingroup math
|
* \ingroup math
|
||||||
* \brief Gets the nearest power of two for the number
|
* \brief Gets the nearest power of two for the number
|
||||||
* \return First power of two containing the number
|
* \return First power of two containing the number
|
||||||
*
|
*
|
||||||
|
|
@ -229,7 +230,7 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \ingroup math
|
* \ingroup math
|
||||||
* \brief Gets the number of digits to represent the number in base 10
|
* \brief Gets the number of digits to represent the number in base 10
|
||||||
* \return Number of digits
|
* \return Number of digits
|
||||||
*
|
*
|
||||||
|
|
@ -257,7 +258,7 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \ingroup math
|
* \ingroup math
|
||||||
* \brief Gets the number of digits to represent the number in base 10
|
* \brief Gets the number of digits to represent the number in base 10
|
||||||
* \return Number of digits
|
* \return Number of digits
|
||||||
*
|
*
|
||||||
|
|
@ -279,7 +280,7 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \ingroup math
|
* \ingroup math
|
||||||
* \brief Gets the number of digits to represent the number in base 10
|
* \brief Gets the number of digits to represent the number in base 10
|
||||||
* \return Number of digits
|
* \return Number of digits
|
||||||
*
|
*
|
||||||
|
|
@ -295,7 +296,7 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \ingroup math
|
* \ingroup math
|
||||||
* \brief Gets the number of digits to represent the number in base 10
|
* \brief Gets the number of digits to represent the number in base 10
|
||||||
* \return Number of digits
|
* \return Number of digits
|
||||||
*
|
*
|
||||||
|
|
@ -312,7 +313,7 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \ingroup math
|
* \ingroup math
|
||||||
* \brief Gets the number of digits to represent the number in base 10
|
* \brief Gets the number of digits to represent the number in base 10
|
||||||
* \return Number of digits
|
* \return Number of digits
|
||||||
*
|
*
|
||||||
|
|
@ -328,7 +329,7 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \ingroup math
|
* \ingroup math
|
||||||
* \brief Gets the number of digits to represent the number in base 10
|
* \brief Gets the number of digits to represent the number in base 10
|
||||||
* \return Number of digits
|
* \return Number of digits
|
||||||
*
|
*
|
||||||
|
|
@ -345,7 +346,7 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \ingroup math
|
* \ingroup math
|
||||||
* \brief Gets the number of digits to represent the number in base 10
|
* \brief Gets the number of digits to represent the number in base 10
|
||||||
* \return Number of digits + 1 for the dot
|
* \return Number of digits + 1 for the dot
|
||||||
*
|
*
|
||||||
|
|
@ -360,7 +361,7 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \ingroup math
|
* \ingroup math
|
||||||
* \brief Gets the number of digits to represent the number in base 10
|
* \brief Gets the number of digits to represent the number in base 10
|
||||||
* \return Number of digits + 1 for the dot
|
* \return Number of digits + 1 for the dot
|
||||||
*
|
*
|
||||||
|
|
@ -375,7 +376,7 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \ingroup math
|
* \ingroup math
|
||||||
* \brief Gets the number of digits to represent the number in base 10
|
* \brief Gets the number of digits to represent the number in base 10
|
||||||
* \return Number of digits + 1 for the dot
|
* \return Number of digits + 1 for the dot
|
||||||
*
|
*
|
||||||
|
|
@ -390,7 +391,7 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \ingroup math
|
* \ingroup math
|
||||||
* \brief Gets the log in base 2 of integral number
|
* \brief Gets the log in base 2 of integral number
|
||||||
* \return Log of the number (floor)
|
* \return Log of the number (floor)
|
||||||
*
|
*
|
||||||
|
|
@ -408,7 +409,7 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \ingroup math
|
* \ingroup math
|
||||||
* \brief Gets the log in base 2 of integral number, only works for power of two !
|
* \brief Gets the log in base 2 of integral number, only works for power of two !
|
||||||
* \return Log of the number
|
* \return Log of the number
|
||||||
*
|
*
|
||||||
|
|
@ -426,7 +427,7 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \ingroup math
|
* \ingroup math
|
||||||
* \brief Gets the power of integrals
|
* \brief Gets the power of integrals
|
||||||
* \return base^exponent for integral
|
* \return base^exponent for integral
|
||||||
*
|
*
|
||||||
|
|
@ -445,7 +446,7 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \ingroup math
|
* \ingroup math
|
||||||
* \brief Interpolates the value to other one with a factor of interpolation
|
* \brief Interpolates the value to other one with a factor of interpolation
|
||||||
* \return A new value which is the interpolation of two values
|
* \return A new value which is the interpolation of two values
|
||||||
*
|
*
|
||||||
|
|
@ -466,7 +467,7 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \ingroup math
|
* \ingroup math
|
||||||
* \brief Multiplies X and Y, then add Z
|
* \brief Multiplies X and Y, then add Z
|
||||||
* \return The result of X * Y + Z
|
* \return The result of X * Y + Z
|
||||||
*
|
*
|
||||||
|
|
@ -508,7 +509,7 @@ namespace Nz
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \ingroup math
|
* \ingroup math
|
||||||
* \brief Normalizes the angle
|
* \brief Normalizes the angle
|
||||||
* \return Normalized value between 0..2*(pi if radian or 180 if degrees)
|
* \return Normalized value between 0..2*(pi if radian or 180 if degrees)
|
||||||
*
|
*
|
||||||
|
|
@ -534,7 +535,7 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \ingroup math
|
* \ingroup math
|
||||||
* \brief Checks whether two numbers are equal
|
* \brief Checks whether two numbers are equal
|
||||||
* \return true if they are equal within a certain epsilon
|
* \return true if they are equal within a certain epsilon
|
||||||
*
|
*
|
||||||
|
|
@ -550,7 +551,7 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \ingroup math
|
* \ingroup math
|
||||||
* \brief Checks whether two numbers are equal
|
* \brief Checks whether two numbers are equal
|
||||||
* \return true if they are equal within the max difference
|
* \return true if they are equal within the max difference
|
||||||
*
|
*
|
||||||
|
|
@ -571,7 +572,7 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \ingroup math
|
* \ingroup math
|
||||||
* \brief Converts the number to String
|
* \brief Converts the number to String
|
||||||
* \return String representation of the number
|
* \return String representation of the number
|
||||||
*
|
*
|
||||||
|
|
@ -623,7 +624,7 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \ingroup math
|
* \ingroup math
|
||||||
* \brief Converts radian to degree
|
* \brief Converts radian to degree
|
||||||
* \return The representation in degree of the angle in radian (0..360)
|
* \return The representation in degree of the angle in radian (0..360)
|
||||||
*
|
*
|
||||||
|
|
@ -637,7 +638,7 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \ingroup math
|
* \ingroup math
|
||||||
* \brief Converts the string to number
|
* \brief Converts the string to number
|
||||||
* \return Number which is represented by the string
|
* \return Number which is represented by the string
|
||||||
*
|
*
|
||||||
|
|
@ -699,7 +700,7 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \ingroup math
|
* \ingroup math
|
||||||
* \brief Gets the degree from unit and convert it according to NAZARA_MATH_ANGLE_RADIAN
|
* \brief Gets the degree from unit and convert it according to NAZARA_MATH_ANGLE_RADIAN
|
||||||
* \return Express in degrees
|
* \return Express in degrees
|
||||||
*
|
*
|
||||||
|
|
@ -717,7 +718,7 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \ingroup math
|
* \ingroup math
|
||||||
* \brief Gets the radian from unit and convert it according to NAZARA_MATH_ANGLE_RADIAN
|
* \brief Gets the radian from unit and convert it according to NAZARA_MATH_ANGLE_RADIAN
|
||||||
* \return Express in radians
|
* \return Express in radians
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Initializes the sprite librairies
|
* \brief Initializes the sprite library
|
||||||
* \return true If successful
|
* \return true If successful
|
||||||
*
|
*
|
||||||
* \remark Produces a NazaraError if the sprite library failed to be initialized
|
* \remark Produces a NazaraError if the sprite library failed to be initialized
|
||||||
|
|
@ -93,7 +93,7 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Uninitializes the sprite librairies
|
* \brief Uninitializes the sprite library
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void Sprite::Uninitialize()
|
void Sprite::Uninitialize()
|
||||||
|
|
|
||||||
|
|
@ -90,6 +90,13 @@ namespace Nz
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Initializes the tilemap library
|
||||||
|
* \return true If successful
|
||||||
|
*
|
||||||
|
* \remark Produces a NazaraError if the tilemap library failed to be initialized
|
||||||
|
*/
|
||||||
|
|
||||||
bool TileMap::Initialize()
|
bool TileMap::Initialize()
|
||||||
{
|
{
|
||||||
if (!TileMapLibrary::Initialize())
|
if (!TileMapLibrary::Initialize())
|
||||||
|
|
@ -101,6 +108,10 @@ namespace Nz
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Uninitializes the tilemap library
|
||||||
|
*/
|
||||||
|
|
||||||
void TileMap::Uninitialize()
|
void TileMap::Uninitialize()
|
||||||
{
|
{
|
||||||
TileMapLibrary::Uninitialize();
|
TileMapLibrary::Uninitialize();
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Uninitializes the Core module
|
* \brief Uninitializes the Network module
|
||||||
*
|
*
|
||||||
* \remark Produces a NazaraNotice
|
* \remark Produces a NazaraNotice
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue