From 7ce447294f5dcfd4e0977a8685ca6fd9514e1fff Mon Sep 17 00:00:00 2001 From: Piroska Gabor Date: Tue, 24 May 2022 19:47:24 +0200 Subject: [PATCH] I ran into an error while processing colored binary stl. Just a type but better be fixed. --- code/AssetLib/STL/STLLoader.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/code/AssetLib/STL/STLLoader.cpp b/code/AssetLib/STL/STLLoader.cpp index 8de57f1ee..826e0678f 100644 --- a/code/AssetLib/STL/STLLoader.cpp +++ b/code/AssetLib/STL/STLLoader.cpp @@ -517,13 +517,13 @@ bool STLImporter::LoadBinaryFile() { const ai_real invVal((ai_real)1.0 / (ai_real)31.0); if (bIsMaterialise) // this is reversed { - clr->r = (color & 0x31u) * invVal; - clr->g = ((color & (0x31u << 5)) >> 5u) * invVal; - clr->b = ((color & (0x31u << 10)) >> 10u) * invVal; + clr->r = (color & 31u) * invVal; + clr->g = ((color & (31u << 5)) >> 5u) * invVal; + clr->b = ((color & (31u << 10)) >> 10u) * invVal; } else { - clr->b = (color & 0x31u) * invVal; - clr->g = ((color & (0x31u << 5)) >> 5u) * invVal; - clr->r = ((color & (0x31u << 10)) >> 10u) * invVal; + clr->b = (color & 31u) * invVal; + clr->g = ((color & (31u << 5)) >> 5u) * invVal; + clr->r = ((color & (31u << 10)) >> 10u) * invVal; } // assign the color to all vertices of the face *(clr + 1) = *clr;