Removed multiple component selection code

This commit is contained in:
Christophe Riccio
2013-08-27 11:35:58 +02:00
parent 4dd2b6893e
commit bc72fafdd9
7 changed files with 6 additions and 66 deletions

View File

@@ -605,49 +605,6 @@
# endif//GLM_ARCH
#endif//GLM_MESSAGE
///////////////////////////////////////////////////////////////////////////////////////////////////
// Support check macros
#define GLM_SUPPORT_ANONYMOUS_UNION() \
(GLM_LANG & GLM_LANG_CXX98_FLAG)
#define GLM_SUPPORT_ANONYMOUS_UNION_OF_STRUCTURE() \
((GLM_LANG & GLM_LANG_CXXMS_FLAG) && (GLM_COMPILER & GLM_COMPILER_VC))
#define GLM_SUPPORT_SWIZZLE_OPERATOR() \
(defined(GLM_SWIZZLE) && GLM_SUPPORT_ANONYMOUS_UNION_OF_STRUCTURE())
#define GLM_SUPPORT_SWIZZLE_FUNCTION() defined(GLM_SWIZZLE)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Components
//#define GLM_FORCE_ONLY_XYZW
#define GLM_COMPONENT_ONLY_XYZW 0 // To disable multiple vector component names access.
#define GLM_COMPONENT_CXX98 1 //
#define GLM_COMPONENT_CXXMS 2 // To use anonymous union to provide multiple component names access for class valType. Visual C++ only.
#if(GLM_SUPPORT_ANONYMOUS_UNION_OF_STRUCTURE() && !defined(GLM_FORCE_ONLY_XYZW))
# define GLM_COMPONENT GLM_COMPONENT_CXXMS
#elif(GLM_SUPPORT_ANONYMOUS_UNION() && !defined(GLM_FORCE_ONLY_XYZW))
# define GLM_COMPONENT GLM_COMPONENT_CXX98
#else
# define GLM_COMPONENT GLM_COMPONENT_ONLY_XYZW
#endif
#if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_COMPONENT_DISPLAYED))
# define GLM_MESSAGE_COMPONENT_DISPLAYED
# if(GLM_COMPONENT == GLM_COMPONENT_CXX98)
# pragma message("GLM: x,y,z,w; r,g,b,a; s,t,p,q component names except of half based vector types")
# elif(GLM_COMPONENT == GLM_COMPONENT_ONLY_XYZW)
# pragma message("GLM: x,y,z,w component names for all vector types")
# elif(GLM_COMPONENT == GLM_COMPONENT_CXXMS)
# pragma message("GLM: x,y,z,w; r,g,b,a; s,t,p,q component names for all vector types")
# else
# error "GLM: GLM_COMPONENT value unknown"
# endif//GLM_MESSAGE_COMPONENT_DISPLAYED
#endif//GLM_MESSAGE
///////////////////////////////////////////////////////////////////////////////////////////////////
// Radians
@@ -710,10 +667,8 @@
#if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_SWIZZLE_DISPLAYED))
# define GLM_MESSAGE_SWIZZLE_DISPLAYED
# if(GLM_SUPPORT_SWIZZLE_OPERATOR())
# if defined(GLM_SWIZZLE)
# pragma message("GLM: Swizzling operators enabled")
# elif(GLM_SUPPORT_SWIZZLE_FUNCTION())
# pragma message("GLM: Swizzling operators supported through swizzling functions")
# else
# pragma message("GLM: Swizzling operators disabled")
# endif
@@ -736,7 +691,7 @@
# define GLM_RESTRICT
# define GLM_RESTRICT_VAR __restrict
# define GLM_CONSTEXPR
#elif(((GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_LLVM_GCC)) && (GLM_COMPILER >= GLM_COMPILER_GCC31)) || (GLM_COMPILER & GLM_COMPILER_CLANG))
#elif(((GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_LLVM_GCC)) && (GLM_COMPILER >= GLM_COMPILER_GCC34)) || (GLM_COMPILER & GLM_COMPILER_CLANG))
# define GLM_DEPRECATED __attribute__((__deprecated__))
# define GLM_ALIGN(x) __attribute__((aligned(x)))
# define GLM_ALIGNED_STRUCT(x) struct __attribute__((aligned(x)))

View File

@@ -22,7 +22,7 @@
///
/// @ref core
/// @file glm/core/type_vec2.hpp
/// @date 2008-08-18 / 2011-06-15
/// @date 2008-08-18 / 2013-08-27
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
@@ -54,11 +54,10 @@ namespace detail
union {value_type x, r, s;};
union {value_type y, g, t;};
# if(defined(GLM_SWIZZLE))
// Defines all he swizzle operator as functions
# ifdef GLM_SWIZZLE
GLM_SWIZZLE_GEN_REF_FROM_VEC2(value_type, P, detail::tvec2, detail::tref2)
GLM_SWIZZLE_GEN_VEC_FROM_VEC2(value_type, P, detail::tvec2, detail::tvec2, detail::tvec3, detail::tvec4)
# endif//(defined(GLM_SWIZZLE))
# endif//GLM_SWIZZLE
//////////////////////////////////////
// Accesses

View File

@@ -56,7 +56,6 @@ namespace detail
union {value_type z, b, p;};
# if(defined(GLM_SWIZZLE))
// Defines all he swizzle operator as functions
GLM_SWIZZLE_GEN_REF_FROM_VEC3(T, P, detail::tvec3, detail::tref2, detail::tref3)
GLM_SWIZZLE_GEN_VEC_FROM_VEC3(T, P, detail::tvec3, detail::tvec2, detail::tvec3, detail::tvec4)
# endif//(defined(GLM_SWIZZLE))

View File

@@ -57,7 +57,6 @@ namespace detail
union {value_type w, a, q;};
# if(defined(GLM_SWIZZLE))
// Defines all he swizzle operator as functions
GLM_SWIZZLE_GEN_REF_FROM_VEC4(T, P, detail::tvec4, detail::tref2, detail::tref3, detail::tref4)
GLM_SWIZZLE_GEN_VEC_FROM_VEC4(T, P, detail::tvec4, detail::tvec2, detail::tvec3, detail::tvec4)
# endif//(defined(GLM_SWIZZLE))

View File

@@ -134,7 +134,6 @@
////////////////////
// check type sizes
#ifndef GLM_STATIC_ASSERT_NULL
GLM_STATIC_ASSERT(sizeof(glm::float16) == 2, "float16 size isn't 2 bytes on this platform");
GLM_STATIC_ASSERT(sizeof(glm::float32) == 4, "float32 size isn't 4 bytes on this platform");
GLM_STATIC_ASSERT(sizeof(glm::float64) == 8, "float64 size isn't 8 bytes on this platform");
#endif//GLM_STATIC_ASSERT_NULL