From a869dd0fee895fd9bc528c6eb6163a18e7182129 Mon Sep 17 00:00:00 2001 From: Will Date: Sun, 1 Dec 2013 00:43:49 +0100 Subject: [PATCH] Tweak to see if we can get the new colour picking code working --- source/shared_lib/include/graphics/model.h | 4 ++-- source/shared_lib/sources/graphics/model.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/source/shared_lib/include/graphics/model.h b/source/shared_lib/include/graphics/model.h index 5c6bed450..2e89cd497 100644 --- a/source/shared_lib/include/graphics/model.h +++ b/source/shared_lib/include/graphics/model.h @@ -278,8 +278,8 @@ public: private: unsigned char uniqueColorID[COLOR_COMPONENTS]; - static int nextColorID; - static const int k, p; + static unsigned nextColorID; + static const unsigned k, p; static Mutex mutexNextColorID; static auto_ptr pbo; diff --git a/source/shared_lib/sources/graphics/model.cpp b/source/shared_lib/sources/graphics/model.cpp index fdc14c76f..6b3ff0b09 100644 --- a/source/shared_lib/sources/graphics/model.cpp +++ b/source/shared_lib/sources/graphics/model.cpp @@ -1826,9 +1826,9 @@ PixelBufferWrapper::~PixelBufferWrapper() { cleanup(); } -const int BaseColorPickEntity::p = 64007; -const int BaseColorPickEntity::k = 43067; -int BaseColorPickEntity::nextColorID = BaseColorPickEntity::k; +const unsigned BaseColorPickEntity::p = 64007; +const unsigned BaseColorPickEntity::k = 43067; +unsigned BaseColorPickEntity::nextColorID = BaseColorPickEntity::k; Mutex BaseColorPickEntity::mutexNextColorID; auto_ptr BaseColorPickEntity::pbo; @@ -1845,7 +1845,7 @@ void BaseColorPickEntity::assign_color() { // nextColorID is a 16-bit (hi)colour (for players with 16-bit display depths) // we expand it to true-color for use with OpenGL - const int + const unsigned r = (nextColorID >> 11) & ((1<<5)-1), g = (nextColorID >> 5) & ((1<<6)-1), b = nextColorID & ((1<<5)-1);