Commit 066294d4 authored by Jan Möbius's avatar Jan Möbius

Fixed warnings

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@13339 383ad7c9-94d9-4d36-a494-682f7c89f535
parent defb2ca6
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
ViewControlPlugin::ViewControlPlugin(): ViewControlPlugin::ViewControlPlugin():
viewControlMenu_(0), viewControlMenu_(0),
lastObjectId_(0),
shaderWidget_(0), shaderWidget_(0),
toolbar_(0), toolbar_(0),
toolbarViewingDirections_(0), toolbarViewingDirections_(0),
...@@ -796,61 +797,59 @@ void ViewControlPlugin::itemChanged(QTableWidgetItem* item){ ...@@ -796,61 +797,59 @@ void ViewControlPlugin::itemChanged(QTableWidgetItem* item){
} }
void ViewControlPlugin::slotSetShader(){ void ViewControlPlugin::slotSetShader()
{
//get current shader index //get current shader index
int index = -1; int index = -1;
for ( int i = 0 ; i < (int)shaderList_.size(); ++i) { for (int i = 0; i < (int) shaderList_.size(); ++i) {
if ( shaderList_[i].name == shaderWidget_->availableShaders->currentItem()->text() ) { if (shaderList_[i].name == shaderWidget_->availableShaders->currentItem()->text()) {
index = i; index = i;
break; break;
} }
} }
if ( index == -1 ) { if (index == -1) {
std::cerr << "Error: Shader Index not found! " << std::endl; std::cerr << "Error: Shader Index not found! " << std::endl;
return; return;
} }
std::vector <QString> mode; std::vector<QString> mode;
for (int i=0; i < shaderWidget_->drawModes->count(); i++) for (int i = 0; i < shaderWidget_->drawModes->count(); i++) {
{ if (shaderWidget_->drawModes->item(i)->checkState() == Qt::Checked) {
if (shaderWidget_->drawModes->item(i)->checkState() == Qt::Checked) mode.push_back(shaderWidget_->drawModes->item(i)->text());
{ setShader(lastObjectId_, descriptionsToDrawMode(mode), shaderList_[index]);
mode.push_back (shaderWidget_->drawModes->item(i)->text()); mode.clear();
setShader(lastObjectId_, descriptionsToDrawMode(mode), shaderList_[index]); } else {
mode.clear(); mode.push_back(shaderWidget_->drawModes->item(i)->text());
} disableShader(lastObjectId_, descriptionsToDrawMode(mode), &shaderList_[index]);
else mode.clear();
{ }
mode.push_back (shaderWidget_->drawModes->item(i)->text()); }
disableShader(lastObjectId_, descriptionsToDrawMode(mode), &shaderList_[index] );
mode.clear();
}
}
} }
void ViewControlPlugin::disableShader(int _objectId, ACG::SceneGraph::DrawModes::DrawMode _drawMode, ShaderInfo* _shader) { void ViewControlPlugin::disableShader(
int _objectId,
BaseObjectData* object = 0; ACG::SceneGraph::DrawModes::DrawMode _drawMode,
PluginFunctions::getObject( _objectId, object ); ShaderInfo* _shader)
{
if (object) BaseObjectData* object = 0;
{ PluginFunctions::getObject(_objectId, object);
if (!_shader)
object->shaderNode()->disableShader( _drawMode ); if (object) {
else if (!_shader)
{ object->shaderNode()->disableShader(_drawMode);
std::string shadeDir = _shader->directory.toStdString() + OpenFlipper::Options::dirSeparator().toStdString(); else {
std::string shadeDir = _shader->directory.toStdString() + OpenFlipper::Options::dirSeparator().toStdString();
if (object->shaderNode()->vertexShaderName( _drawMode ) == shadeDir + _shader->vertexShader.toStdString() &&
object->shaderNode()->fragmentShaderName( _drawMode ) == shadeDir + _shader->fragmentShader.toStdString() ) if (object->shaderNode()->vertexShaderName(_drawMode) == shadeDir + _shader->vertexShader.toStdString()
object->shaderNode()->disableShader( _drawMode ); && object->shaderNode()->fragmentShaderName(_drawMode) == shadeDir + _shader->fragmentShader.toStdString())
} object->shaderNode()->disableShader(_drawMode);
} }
}
emit updateView();
emit updateView();
} }
void ViewControlPlugin::setShader(int _id, ACG::SceneGraph::DrawModes::DrawMode _drawMode, ShaderInfo _shader) { void ViewControlPlugin::setShader(int _id, ACG::SceneGraph::DrawModes::DrawMode _drawMode, ShaderInfo _shader) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment