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

Fixed error reported by memcheck. Not sure, why memcmp works outside of the initialized memory.

closes #1176

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@15705 383ad7c9-94d9-4d36-a494-682f7c89f535
parent ac9741ec
......@@ -547,8 +547,11 @@ int DrawMode::getLayerIndex( const DrawModeProperties* _prop ) const
for (unsigned int i = 0; i < layers_.size(); ++i)
{
if (!memcmp(&layers_[i], _prop, sizeof(DrawModeProperties)))
if ( layers_[i] != *_prop )
return (int)i;
// if (!memcmp(&layers_[i], &bla, sizeof(DrawModeProperties)))
// return (int)i;
}
return -1;
}
......
......@@ -221,6 +221,26 @@ namespace DrawModes {
/// Is flat shading used (Normals per face)?
bool flatShaded() const { return normalSource_ == NORMAL_PER_FACE; }
/** @} */
//===========================================================================
/** @name Comparison functions
* @{ */
//===========================================================================
/** \brief compare two properties
*
* @param _other Right hand side
*/
bool operator!=( const DrawModeProperties _other ) const {
return ( (envMapped_ != _other.envMapped_) ||
(primitive_ != _other.primitive_) ||
(lightStage_ != _other.lightStage_) ||
(colorSource_ != _other.colorSource_) ||
(texcoordSource_ != _other.texcoordSource_) ||
(normalSource_ != _other.normalSource_)
);
}
/** @} */
......
......@@ -831,8 +831,7 @@ void CoreWidget::slotUpdateGlobalDrawMenu() {
ACG::SceneGraph::traverse( PluginFunctions::getRootNode() , actionAvailable);
availableGlobalDrawModes_ = actionAvailable.drawModes();
// Get currently active drawModes (first viewer only )
// TODO: create combination from all viewers!
// Get currently active drawModes
activeDrawModes_ = PluginFunctions::drawMode(0);
for ( int i = 1 ; i < PluginFunctions::viewers(); ++i )
activeDrawModes_ &= PluginFunctions::drawMode(i);
......
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