Merge 0.9.7

This commit is contained in:
Christophe Riccio
2016-04-29 17:37:27 +02:00
parent 79643cf4fa
commit b3cae39ea6
3 changed files with 78 additions and 7 deletions

View File

@@ -30,8 +30,9 @@
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm
{
#include "../detail/func_integer.hpp"
namespace glm{
namespace detail
{
template <typename T, precision P, template <typename, precision> class vecType, bool compute = false>
@@ -275,7 +276,7 @@ namespace detail
template <typename genType>
GLM_FUNC_QUALIFIER genType floorPowerOfTwo(genType value)
{
return isPowerOfTwo(value) ? value : highestBitValue(value);
return isPowerOfTwo(value) ? value : static_cast<genType>(1) << findMSB(value);
}
template <typename T, precision P, template <typename, precision> class vecType>
@@ -293,8 +294,8 @@ namespace detail
if(isPowerOfTwo(value))
return value;
genIUType const prev = highestBitValue(value);
genIUType const next = prev << 1;
genIUType const prev = static_cast<genIUType>(1) << findMSB(value);
genIUType const next = prev << static_cast<genIUType>(1);
return (next - value) < (value - prev) ? next : prev;
}