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>
|
||||
// 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)
|
||||
{
|
||||
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
|
||||
// ce code décompose les nombres plus grands en nombres 32 bits par masquage et bit shifting
|
||||
// Masking and shifting bits to the right (to bring it back to 32 bits)
|
||||
|
||||
// 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))
|
||||
{
|
||||
// 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 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);
|
||||
if (log2)
|
||||
return log2 + i*8;
|
||||
|
|
@ -75,20 +76,20 @@ namespace Nz
|
|||
}
|
||||
|
||||
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)
|
||||
{
|
||||
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
|
||||
// ce code décompose les nombres plus grands en nombres 32 bits par masquage et bit shifting
|
||||
// The algorithm for logarithm in base 2 only works with numbers greather than 32 bits
|
||||
// This code subdivides the biggest number into 32 bits ones
|
||||
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;
|
||||
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);
|
||||
if (log2 || val == 1)
|
||||
return log2 + i*8;
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ namespace Nz
|
|||
}
|
||||
|
||||
/*!
|
||||
* \brief Initializes the sprite librairies
|
||||
* \brief Initializes the sprite library
|
||||
* \return true If successful
|
||||
*
|
||||
* \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()
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
{
|
||||
if (!TileMapLibrary::Initialize())
|
||||
|
|
@ -101,6 +108,10 @@ namespace Nz
|
|||
return true;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Uninitializes the tilemap library
|
||||
*/
|
||||
|
||||
void TileMap::Uninitialize()
|
||||
{
|
||||
TileMapLibrary::Uninitialize();
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ namespace Nz
|
|||
}
|
||||
|
||||
/*!
|
||||
* \brief Uninitializes the Core module
|
||||
* \brief Uninitializes the Network module
|
||||
*
|
||||
* \remark Produces a NazaraNotice
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue