- cleanup some color pick code

This commit is contained in:
Mark Vejvoda 2013-01-24 00:42:06 +00:00
parent 4cc9240996
commit bf7445903d
2 changed files with 18 additions and 2 deletions

View File

@ -253,8 +253,24 @@ public:
static const int COLOR_COMPONENTS = 4;
struct ColorPickStruct {
class ColorPickStruct {
public:
unsigned char color[COLOR_COMPONENTS];
ColorPickStruct(unsigned char newColor1,unsigned char newColor2,
unsigned char newColor3,unsigned char newColor4) {
color[0] = newColor1;
color[1] = newColor2;
color[2] = newColor3;
color[3] = newColor4;
}
ColorPickStruct() {
color[0] = 0;
color[1] = 0;
color[2] = 0;
color[3] = 0;
}
};
static void init(int bufferSize);

View File

@ -1462,7 +1462,7 @@ PixelBufferWrapper::~PixelBufferWrapper() {
const int colorSpacing = 8;
//unsigned char BaseColorPickEntity::nextColorID[COLOR_COMPONENTS] = {1, 1, 1, 1};
BaseColorPickEntity::ColorPickStruct BaseColorPickEntity::nextColorID = { colorSpacing, colorSpacing, colorSpacing };
BaseColorPickEntity::ColorPickStruct BaseColorPickEntity::nextColorID = ColorPickStruct(colorSpacing, colorSpacing, colorSpacing, colorSpacing);
vector<BaseColorPickEntity::ColorPickStruct> BaseColorPickEntity::nextColorIDReuseList;
Mutex BaseColorPickEntity::mutexNextColorID;
auto_ptr<PixelBufferWrapper> BaseColorPickEntity::pbo;