From 2732d4bae574b71e3a071b6d0e60961d454dc123 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 1 Aug 2011 14:10:02 +0100 Subject: [PATCH] Fixed ticket #116, missing bit mask --- glm/gtx/color_cast.inl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/glm/gtx/color_cast.inl b/glm/gtx/color_cast.inl index 5236869b..fe36dd22 100644 --- a/glm/gtx/color_cast.inl +++ b/glm/gtx/color_cast.inl @@ -356,10 +356,10 @@ template <> GLM_FUNC_QUALIFIER detail::tvec4 f32_bgra_cast(uint32 color) { detail::tvec4 result; - result.x = static_cast(color >> 16) / static_cast(255); - result.y = static_cast(color >> 8) / static_cast(255); - result.z = static_cast(color >> 0) / static_cast(255); - result.w = static_cast(color >> 24) / static_cast(255); + result.x = static_cast((color >> 16) & 0xFF) / static_cast(255); + result.y = static_cast((color >> 8) & 0xFF) / static_cast(255); + result.z = static_cast((color >> 0) & 0xFF) / static_cast(255); + result.w = static_cast((color >> 24) & 0xFF) / static_cast(255); return result; }