From cec8665d16489722d7b069baf549f9d5cedb8e4e Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Wed, 21 Sep 2011 10:50:54 +0100 Subject: [PATCH 1/2] Fixed ticket #128, bitfield based on vec types --- glm/core/func_integer.inl | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/glm/core/func_integer.inl b/glm/core/func_integer.inl index 0e30aa2a..fb046708 100644 --- a/glm/core/func_integer.inl +++ b/glm/core/func_integer.inl @@ -285,8 +285,8 @@ namespace glm ) { return detail::tvec2( - bitfieldExtract(Value[0]), - bitfieldExtract(Value[1])); + bitfieldExtract(Value[0], Offset, Bits), + bitfieldExtract(Value[1], Offset, Bits)); } template @@ -298,9 +298,9 @@ namespace glm ) { return detail::tvec3( - bitfieldExtract(Value[0]), - bitfieldExtract(Value[1]), - bitfieldExtract(Value[2])); + bitfieldExtract(Value[0], Offset, Bits), + bitfieldExtract(Value[1], Offset, Bits), + bitfieldExtract(Value[2], Offset, Bits)); } template @@ -312,10 +312,10 @@ namespace glm ) { return detail::tvec4( - bitfieldExtract(Value[0]), - bitfieldExtract(Value[1]), - bitfieldExtract(Value[2]), - bitfieldExtract(Value[3])); + bitfieldExtract(Value[0], Offset, Bits), + bitfieldExtract(Value[1], Offset, Bits), + bitfieldExtract(Value[2], Offset, Bits), + bitfieldExtract(Value[3], Offset, Bits)); } // bitfieldInsert From 64453fd44eb27d37bbd41e61e54adb432492b51f Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Wed, 21 Sep 2011 10:53:10 +0100 Subject: [PATCH 2/2] Fixed half vectors on VC + MS lang ext --- glm/core/type_vec2.hpp | 2 +- glm/core/type_vec3.hpp | 2 +- glm/core/type_vec4.hpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/glm/core/type_vec2.hpp b/glm/core/type_vec2.hpp index b8d47b7b..ae266e15 100644 --- a/glm/core/type_vec2.hpp +++ b/glm/core/type_vec2.hpp @@ -48,9 +48,9 @@ namespace detail # elif(GLM_COMPONENT == GLM_COMPONENT_MS_EXT) union { - struct{value_type x, y;}; struct{value_type r, g;}; struct{value_type s, t;}; + struct{value_type x, y;}; }; # else//(GLM_COMPONENT == GLM_COMPONENT_GLSL_NAMES) union {value_type x, r, s;}; diff --git a/glm/core/type_vec3.hpp b/glm/core/type_vec3.hpp index 7b568789..1afb844f 100644 --- a/glm/core/type_vec3.hpp +++ b/glm/core/type_vec3.hpp @@ -48,9 +48,9 @@ namespace detail # elif(GLM_COMPONENT == GLM_COMPONENT_MS_EXT) union { - struct{value_type x, y, z;}; struct{value_type r, g, b;}; struct{value_type s, t, p;}; + struct{value_type x, y, z;}; }; # else//(GLM_COMPONENT == GLM_COMPONENT_GLSL_NAMES) union {value_type x, r, s;}; diff --git a/glm/core/type_vec4.hpp b/glm/core/type_vec4.hpp index 940b5c19..9ea08606 100644 --- a/glm/core/type_vec4.hpp +++ b/glm/core/type_vec4.hpp @@ -48,9 +48,9 @@ namespace detail # elif(GLM_COMPONENT == GLM_COMPONENT_MS_EXT) union { - struct{value_type x, y, z, w;}; struct{value_type r, g, b, a;}; struct{value_type s, t, p, q;}; + struct{value_type x, y, z, w;}; }; # else//(GLM_COMPONENT == GLM_COMPONENT_GLSL_NAMES) union {value_type x, r, s;};