diff --git a/src/fgt/render_rfx/rfx_colorbox.h b/src/fgt/render_rfx/rfx_colorbox.h index 40c838398..f3385b61e 100644 --- a/src/fgt/render_rfx/rfx_colorbox.h +++ b/src/fgt/render_rfx/rfx_colorbox.h @@ -37,6 +37,7 @@ #include #include #include +#include #include "rfx_dialog.h" class RfxColorBox : public QWidget @@ -51,15 +52,9 @@ public: Returns the current color as an array of float value between 0 and 1. @return the current color as float array. */ - float* getColorf(){ - float r, g, b, a; - r = this->_redS->value() / 255.0f; - g = this->_greenS->value() / 255.0f; - b = this->_blueS->value() / 255.0f; - a = this->_alphaS->value() / 255.0f; - - float vals[4] = {r, g, b, a}; - return vals; + inline vcg::Color4f getColorf(){ + vcg::Color4f c(_redS->value() / 255.0f,_greenS->value() / 255.0f,_blueS->value() / 255.0f,_alphaS->value() / 255.0f); + return c; } public slots: diff --git a/src/fgt/render_rfx/rfx_dialog.cpp b/src/fgt/render_rfx/rfx_dialog.cpp index 63e68499f..a351d026b 100644 --- a/src/fgt/render_rfx/rfx_dialog.cpp +++ b/src/fgt/render_rfx/rfx_dialog.cpp @@ -552,11 +552,11 @@ void RfxDialog::ChangeValue(const QString& val) } else { RfxColorBox *cBox = dynamic_cast(sender); if (cBox != NULL) { - float* newVal = cBox->getColorf(); - oldVal[0] = newVal[0]; - oldVal[1] = newVal[1]; - oldVal[2] = newVal[2]; - oldVal[3] = newVal[3]; + vcg::Color4f newVal = cBox->getColorf(); + oldVal[0] = newVal.X(); + oldVal[1] = newVal.Y(); + oldVal[2] = newVal.Z(); + oldVal[3] = newVal.W(); uni->PassToShader(); mGLWin->updateGL(); return;