src/glCompiler.cpp

changeset 970
c8aae45afd85
parent 968
4b93b7963456
child 971
c00f9665a9f8
equal deleted inserted replaced
969:b1742ee91d5b 970:c8aae45afd85
43 { GL_OUT_OF_MEMORY, "Out of memory" }, 43 { GL_OUT_OF_MEMORY, "Out of memory" },
44 { GL_STACK_UNDERFLOW, "The operation would have caused an underflow" }, 44 { GL_STACK_UNDERFLOW, "The operation would have caused an underflow" },
45 { GL_STACK_OVERFLOW, "The operation would have caused an overflow" }, 45 { GL_STACK_OVERFLOW, "The operation would have caused an overflow" },
46 }; 46 };
47 47
48 CFGENTRY (String, SelectColorBlend, "#0080FF") 48 ConfigOption (QString SelectColorBlend = "#0080FF")
49 EXTERN_CFGENTRY (Bool, BlackEdges)
50 EXTERN_CFGENTRY (String, BackgroundColor)
51 49
52 static QList<int> g_warnedColors; 50 static QList<int> g_warnedColors;
53 static const QColor g_BFCFrontColor (64, 192, 80); 51 static const QColor g_BFCFrontColor (64, 192, 80);
54 static const QColor g_BFCBackColor (208, 64, 64); 52 static const QColor g_BFCBackColor (208, 64, 64);
55 53
78 } 76 }
79 77
80 // ============================================================================= 78 // =============================================================================
81 // 79 //
82 GLCompiler::GLCompiler (GLRenderer* renderer) : 80 GLCompiler::GLCompiler (GLRenderer* renderer) :
81 HierarchyElement (parent),
83 m_renderer (renderer) 82 m_renderer (renderer)
84 { 83 {
85 needMerge(); 84 needMerge();
86 memset (m_vboSizes, 0, sizeof m_vboSizes); 85 memset (m_vboSizes, 0, sizeof m_vboSizes);
87 } 86 }
166 else 165 else
167 qcol = topobj->color().faceColor(); 166 qcol = topobj->color().faceColor();
168 } 167 }
169 else if (poly.color == EdgeColor) 168 else if (poly.color == EdgeColor)
170 { 169 {
171 qcol = Luma (QColor (cfg::BackgroundColor)) > 40 ? Qt::black : Qt::white; 170 qcol = Luma (QColor (m_config->backgroundColor)) > 40 ? Qt::black : Qt::white;
172 } 171 }
173 else 172 else
174 { 173 {
175 LDColor col = poly.color; 174 LDColor col = poly.color;
176 175
206 else if (topobj == m_renderer->objectAtCursor()) 205 else if (topobj == m_renderer->objectAtCursor())
207 blendAlpha = 0.5; 206 blendAlpha = 0.5;
208 207
209 if (blendAlpha != 0.0) 208 if (blendAlpha != 0.0)
210 { 209 {
211 QColor selcolor (cfg::SelectColorBlend); 210 QColor selcolor (m_config->selectColorBlend);
212 double denom = blendAlpha + 1.0; 211 double denom = blendAlpha + 1.0;
213 qcol.setRed ((qcol.red() + (selcolor.red() * blendAlpha)) / denom); 212 qcol.setRed ((qcol.red() + (selcolor.red() * blendAlpha)) / denom);
214 qcol.setGreen ((qcol.green() + (selcolor.green() * blendAlpha)) / denom); 213 qcol.setGreen ((qcol.green() + (selcolor.green() * blendAlpha)) / denom);
215 qcol.setBlue ((qcol.blue() + (selcolor.blue() * blendAlpha)) / denom); 214 qcol.setBlue ((qcol.blue() + (selcolor.blue() * blendAlpha)) / denom);
216 } 215 }

mercurial