Commit b2f1b52f authored by Jan Möbius's avatar Jan Möbius
Browse files

On switch texture only switch if not in a texturing mode

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@5636 383ad7c9-94d9-4d36-a494-682f7c89f535
parent e2a53956
......@@ -340,6 +340,7 @@ void TextureControlPlugin::slotObjectUpdated(int _identifier)
// ================================================================================
// TODO : if not in the texture rendering mode, do not emit update
// Involves adding a interface part to react on draw mode changes
// basic check implemented
for ( uint i = 0; i < texData->textures().size(); ++i ) {
texData->textures()[i].dirty = true;
......@@ -653,7 +654,6 @@ void TextureControlPlugin::slotSwitchTexture( QString _textureName ) {
// ================================================================================
// Update texture map from meshNode and activate it
// ================================================================================
//
if( o_it->dataType( DATA_TRIANGLE_MESH ) ){
doUpdateTexture(texData->texture(_textureName), *PluginFunctions::triMeshObject(o_it)->mesh());
PluginFunctions::triMeshObject(o_it)->textureNode()->activateTexture( texData->texture( _textureName ).glName );
......@@ -670,8 +670,16 @@ void TextureControlPlugin::slotSwitchTexture( QString _textureName ) {
}
// ================================================================================
// Switch to a texture drawMode
//TODO: dont switch if in SOLID_TEXTURED
// ================================================================================
bool textureMode = false;
for ( int j = 0 ; j < PluginFunctions::viewers() ; ++j ) {
textureMode |= ( PluginFunctions::drawMode(j) == ACG::SceneGraph::DrawModes::SOLID_TEXTURED );
textureMode |= ( PluginFunctions::drawMode(j) == ACG::SceneGraph::DrawModes::SOLID_TEXTURED_SHADED );
}
if ( !textureMode )
PluginFunctions::setDrawMode( ACG::SceneGraph::DrawModes::SOLID_TEXTURED_SHADED );
emit updateView();
......
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