Commit cdc60059 authored by Jan Möbius's avatar Jan Möbius

Fixed bug with increment operator for drawmodes (shift in underlying bitset)

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@9432 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 90dc2f48
......@@ -133,8 +133,8 @@ DrawMode& DrawMode::operator++() {
if ( modeFlags_.count() != 1 ) {
std::cerr << "Operator ++ for drawMode which is not atomic!!" << std::endl;
}
modeFlags_ << 1;
modeFlags_ <<= 1;
return (*this);
}
......@@ -317,24 +317,21 @@ bool addDrawMode( const std::string & _name, DrawMode & _newId )
{
/// \todo Create a new DrawMode correctly
// check if mode exists already
VecDrawModes::iterator modeIter, modeEnd( currentDrawModes_.end() );
for( modeIter = currentDrawModes_.begin();
modeIter != modeEnd;
++modeIter )
{
if( _name == modeIter->name_ )
return modeIter->id_;
}
// check if mode exists already
VecDrawModes::iterator modeIter, modeEnd( currentDrawModes_.end() );
for( modeIter = currentDrawModes_.begin(); modeIter != modeEnd; ++modeIter ) {
if( _name == modeIter->name_ )
return modeIter->id_;
}
// add new mode
_newId = firstFreeID_;
currentDrawModes_.push_back( DrawModeInternal( _name, _newId ) );
++firstFreeID_;
return true;
// add new mode
_newId = firstFreeID_;
currentDrawModes_.push_back( DrawModeInternal( _name, _newId ) );
++firstFreeID_;
return true;
}
......
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