Fixed initializer test implementation, simplified packing implementation

This commit is contained in:
Christophe Riccio
2013-10-05 20:06:56 +02:00
parent b47a0a212f
commit eb59cb9af6
8 changed files with 33 additions and 23 deletions

View File

@@ -61,7 +61,7 @@ namespace glm
GLM_FUNC_QUALIFIER uint packUnorm4x8(vec4 const & v)
{
u8vec4 Topack(round(clamp(v, 0.0f, 1.0f) * 255.0f));
return reinterpret_cast<uint&>(&Topack);
return reinterpret_cast<uint&>(Topack);
}
GLM_FUNC_QUALIFIER vec4 unpackUnorm4x8(uint const & p)

View File

@@ -230,7 +230,7 @@ namespace detail
GLM_FUNC_QUALIFIER float unpackUnorm1x8(uint8 const & p)
{
float Unpack(static_cast<float>(*const_cast<uint8*>(&p)));
float Unpack(static_cast<float>(p));
return Unpack * float(0.0039215686274509803921568627451); // 1 / 255
}

View File

@@ -92,7 +92,7 @@ namespace detail
z(static_cast<T>(l.begin()[2])),
w(static_cast<T>(l.begin()[3]))
{
assert(v.size() >= this->length());
assert(l.size() >= this->length());
}
#endif//GLM_HAS_INITIALIZER_LISTS