From 68f2f4a8b3267b652089bc8ce86375c9830ee06b Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Fri, 11 Oct 2013 21:38:28 -0400 Subject: [PATCH] If the intensity is greater than one, then we're treating it as a float value, so when packing it into a pixel, just pack the value instead of scaling it to 255... --- Base/src/IPixel.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Base/src/IPixel.cpp b/Base/src/IPixel.cpp index 9919a85..78e5ae3 100644 --- a/Base/src/IPixel.cpp +++ b/Base/src/IPixel.cpp @@ -62,7 +62,11 @@ namespace FasTC { uint32 IPixel::Pack() const { uint32 ret = 0xFF << 24; for(uint32 i = 0; i < 3; i++) { - ret |= static_cast((255.0 * vec[0]) + 0.5f) << i*8; + if(vec[0] > 1.0) { + ret |= static_cast(vec[0]) << i*8; + } else { + ret |= static_cast((255.0 * vec[0]) + 0.5f) << i*8; + } } return ret; }