From 3d051b2d6f41136a13847dc57bf3c0c3336dd2c0 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 1 Jan 2016 16:01:03 +0100 Subject: [PATCH] Changed: Added set8888() method to CGRBA --- code/nel/include/nel/misc/rgba.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/code/nel/include/nel/misc/rgba.h b/code/nel/include/nel/misc/rgba.h index 7929b4545..e4fc6b61e 100644 --- a/code/nel/include/nel/misc/rgba.h +++ b/code/nel/include/nel/misc/rgba.h @@ -177,6 +177,17 @@ public: B= (B<<3) + (B>>2); } + /** + * Set the RGBA fields with a 32 bits 8888 pixel. + */ + void set8888(uint32 col) + { + R = col & 255; + G = (col >> 8) & 255; + B = (col >> 16) & 255; + A = (col >> 24) & 255; + } + /** * Compute in this the average of 2 RGBA.