# HG changeset patch # User Teemu Piippo # Date 1583939968 -7200 # Node ID 97c3ce5aa498ec41a6e88fbcceec8a0acbd5ecbc # Parent 028798a7259128a8325162ff59da47f7a312fcf6 fixed signed vs unsigned nonsense in gl::Compiler::idFromColor diff -r 028798a72591 -r 97c3ce5aa498 src/gl/compiler.cpp --- a/src/gl/compiler.cpp Mon Mar 09 23:42:26 2020 +0200 +++ b/src/gl/compiler.cpp Wed Mar 11 17:19:28 2020 +0200 @@ -237,7 +237,7 @@ return gl::ArrayClass::Lines; } -ldraw::id_t gl::Compiler::idFromColor(const std::array& data) +ldraw::id_t gl::Compiler::idFromColor(const std::array& data) { return {data[0] * std::int32_t{0x10000} + data[1] * std::int32_t{0x100} + data[2]}; } diff -r 028798a72591 -r 97c3ce5aa498 src/gl/compiler.h --- a/src/gl/compiler.h Mon Mar 09 23:42:26 2020 +0200 +++ b/src/gl/compiler.h Wed Mar 11 17:19:28 2020 +0200 @@ -63,7 +63,7 @@ void buildShaders(int arrayId); void setSelectedObjects(const QSet ids); - static ldraw::id_t idFromColor(const std::array& data); + static ldraw::id_t idFromColor(const std::array& data); template void setUniform(const char* uniformName, T&& value) diff -r 028798a72591 -r 97c3ce5aa498 src/gl/partrenderer.cpp --- a/src/gl/partrenderer.cpp Mon Mar 09 23:42:26 2020 +0200 +++ b/src/gl/partrenderer.cpp Wed Mar 11 17:19:28 2020 +0200 @@ -341,7 +341,7 @@ this->renderPreferences.style = gl::RenderStyle::PickScene; this->makeCurrent(); this->renderScene(); - std::array data; + std::array data; this->checkForGLErrors(); glReadPixels(where.x(), this->height() - where.y(), 1, 1, GL_RGB, GL_UNSIGNED_BYTE, &data[0]); this->checkForGLErrors();