Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reimplemented io support for basic types #144

Merged
merged 7 commits into from
Jun 19, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion glm/core/func_exponential.inl
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,11 @@ namespace detail
genType xhalf(tmp * genType(0.5f));
genUType i = *reinterpret_cast<genUType*>(const_cast<genType*>(&v));
i = genUType(0x5f375a86) - (i >> genUType(1));
tmp = *reinterpret_cast<genType*>(&i);
// tmp = *reinterpret_cast<genType*>(&i);
{
genType* ptr(reinterpret_cast<genType*>(&i));
tmp = *ptr;
}
tmp = tmp * (genType(1.5f) - xhalf * tmp * tmp);
return tmp;
}
Expand Down
5 changes: 3 additions & 2 deletions glm/core/func_integer.inl
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ namespace glm

uint64 Value64 = static_cast<uint64>(x) * static_cast<uint64>(y);
msb = *(reinterpret_cast<uint32*>(&Value64) + 1);
lsb = reinterpret_cast<uint32&>(Value64);
//lsb = reinterpret_cast<uint32&>(Value64);
lsb = *(reinterpret_cast<uint32*>(Value64));
}

template <>
Expand Down Expand Up @@ -231,7 +232,7 @@ namespace glm

int64 Value64 = static_cast<int64>(x) * static_cast<int64>(y);
msb = *(reinterpret_cast<int32*>(&Value64) + 1);
lsb = reinterpret_cast<int32&>(Value64);
// lsb = reinterpret_cast<int32&>(Value64);
}

template <>
Expand Down
12 changes: 9 additions & 3 deletions glm/core/func_packing.inl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ namespace glm
GLM_FUNC_QUALIFIER uint packUnorm2x16(vec2 const & v)
{
u16vec2 Topack(round(clamp(v, 0.0f, 1.0f) * 65535.0f));
return reinterpret_cast<uint&>(Topack);
// return reinterpret_cast<uint&>(Topack);
uint* ptr(reinterpret_cast<uint*>(&Topack));
return *ptr;
}

GLM_FUNC_QUALIFIER vec2 unpackUnorm2x16(uint const & p)
Expand All @@ -47,7 +49,9 @@ namespace glm
GLM_FUNC_QUALIFIER uint packSnorm2x16(vec2 const & v)
{
i16vec2 Topack(round(clamp(v ,-1.0f, 1.0f) * 32767.0f));
return reinterpret_cast<uint32&>(Topack);
// return reinterpret_cast<uint32&>(Topack);
uint* ptr(reinterpret_cast<uint*>(&Topack));
return *ptr;
}

GLM_FUNC_QUALIFIER vec2 unpackSnorm2x16(uint const & p)
Expand Down Expand Up @@ -100,7 +104,9 @@ namespace glm
detail::toFloat16(v.x),
detail::toFloat16(v.y));

return *reinterpret_cast<uint*>(&Unpack);
//return *reinterpret_cast<uint*>(&Unpack);
uint* ptr(reinterpret_cast<uint*>(&Unpack));
return *ptr;
}

GLM_FUNC_QUALIFIER vec2 unpackHalf2x16(uint const & v)
Expand Down
4 changes: 2 additions & 2 deletions glm/ext.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@
#include "./gtc/quaternion.hpp"
#include "./gtc/random.hpp"
#include "./gtc/reciprocal.hpp"
#include "./gtc/swizzle.hpp"
// #include "./gtc/swizzle.hpp"
#include "./gtc/type_precision.hpp"
#include "./gtc/type_ptr.hpp"
#include "./gtc/ulp.hpp"

#include "./gtx/associated_min_max.hpp"
#include "./gtx/bit.hpp"
#include "./gtx/closest_point.hpp"
#include "./gtx/color_cast.hpp"
// #include "./gtx/color_cast.hpp"
#include "./gtx/color_space.hpp"
#include "./gtx/color_space_YCoCg.hpp"
#include "./gtx/compatibility.hpp"
Expand Down
1 change: 1 addition & 0 deletions glm/gtc/quaternion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ namespace detail
{
enum ctor{null};

typedef T value_type;
typedef tvec4<bool, P> bool_type;

public:
Expand Down
Loading