fixed merge conflicts

stl_dim
Marius Kintel 2011-07-31 01:09:16 +02:00
commit dd9dfcb4ec
2 changed files with 18 additions and 20 deletions

View File

@ -25,8 +25,7 @@
*/
#include "GLView.h"
// FIXME: Reenable/rewrite - don't be dependant on GUI
//#include "Preferences.h"
#include "Preferences.h"
#include <QApplication>
#include <QWheelEvent>
@ -251,10 +250,10 @@ void GLView::display_opengl20_warning()
// action
connect(buttonbox, SIGNAL(accepted()), dialog, SLOT(accept()));
// connect(checkbox, SIGNAL(clicked(bool)),
// Preferences::inst()->OpenGL20WarningCheckbox, SLOT(setChecked(bool)));
// connect(checkbox, SIGNAL(clicked(bool)),
// Preferences::inst(), SLOT(OpenGL20WarningChanged(bool)));
connect(checkbox, SIGNAL(clicked(bool)),
Preferences::inst()->OpenGL20WarningCheckbox, SLOT(setChecked(bool)));
connect(checkbox, SIGNAL(clicked(bool)),
Preferences::inst(), SLOT(OpenGL20WarningChanged(bool)));
dialog->exec();
}
#endif
@ -271,9 +270,7 @@ void GLView::resizeGL(int w, int h)
void GLView::paintGL()
{
// FIXME: Reenable/rewrite - don't be dependant on GUI
// const QColor &bgcol = Preferences::inst()->color(Preferences::BACKGROUND_COLOR);
const QColor &bgcol = QColor(0xff, 0xff, 0xe5);
const QColor &bgcol = Preferences::inst()->color(Preferences::BACKGROUND_COLOR);
glClearColor(bgcol.redF(), bgcol.greenF(), bgcol.blueF(), 0.0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
@ -316,8 +313,7 @@ void GLView::paintGL()
if (showcrosshairs)
{
glLineWidth(3);
// const QColor &col = Preferences::inst()->color(Preferences::CROSSHAIR_COLOR);
const QColor &col = QColor(0x80, 0x00, 0x00);
const QColor &col = Preferences::inst()->color(Preferences::CROSSHAIR_COLOR);
glColor3f(col.redF(), col.greenF(), col.blueF());
glBegin(GL_LINES);
for (double xf = -1; xf <= +1; xf += 2)

View File

@ -109,7 +109,7 @@ AbstractNode *TransformModule::evaluate(const Context *ctx, const ModuleInstanti
argnames = QVector<QString>() << "m";
break;
case COLOR:
argnames = QVector<QString>() << "c";
argnames = QVector<QString>() << "c" << "alpha";
break;
default:
assert(false);
@ -251,23 +251,25 @@ AbstractNode *TransformModule::evaluate(const Context *ctx, const ModuleInstanti
// FIXME: Port to non-Qt
#if 0
} else if (v.type == Value::STRING) {
double alpha = 1.0;
vector<string> chunks = split(v.text, ",");
string colorname = chunks[0];
if (chunks.size() < 2 || !from_string(alpha, chunks[1])) alpha = 1.0;
QString colorname = v.text;
QColor color;
color.setNamedColor(colorname);
if (color.isValid()) {
node->m[16+0] = color.redF();
node->m[16+1] = color.greenF();
node->m[16+2] = color.blueF();
node->m[16+3] = alpha;
node->matrix[16+0] = color.redF();
node->matrix[16+1] = color.greenF();
node->matrix[16+2] = color.blueF();
} else {
PRINTF_NOCACHE("WARNING: Color name \"%s\" unknown. Please see",v.text.toUtf8().data());
PRINTF_NOCACHE("WARNING: http://en.wikipedia.org/wiki/Web_colors");
}
#endif
}
Value alpha = c.lookup_variable("alpha");
if (alpha.type == Value::NUMBER) {
node->matrix[16+3] = alpha.num;
} else {
node->matrix[16+3] = 1.0;
}
}
foreach (ModuleInstantiation *v, inst->children) {