Skip to content

Commit

Permalink
Main: ControllerManager - use std::vector for ControllerList
Browse files Browse the repository at this point in the history
  • Loading branch information
paroj committed Nov 11, 2023
1 parent 356ee5e commit f7cd9dd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion OgreMain/include/OgreControllerManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ namespace Ogre {
class _OgreExport ControllerManager : public Singleton<ControllerManager>, public ControllerAlloc
{
private:
typedef std::set<ControllerFloat*> ControllerList;
typedef std::vector<ControllerFloat*> ControllerList;
ControllerList mControllers;

/// Global predefined controller
Expand Down
7 changes: 4 additions & 3 deletions OgreMain/src/OgreControllerManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ namespace Ogre {
{
ControllerFloat* c = OGRE_NEW ControllerFloat(src, dest, func);

mControllers.insert(c);
mControllers.push_back(c);
return c;
}
//-----------------------------------------------------------------------
Expand Down Expand Up @@ -206,10 +206,11 @@ namespace Ogre {
//-----------------------------------------------------------------------
void ControllerManager::destroyController(ControllerFloat* controller)
{
ControllerList::iterator i = mControllers.find(controller);
ControllerList::iterator i = std::find(mControllers.begin(), mControllers.end(), controller);
if (i != mControllers.end())
{
mControllers.erase(i);
std::swap(*i, mControllers.back());
mControllers.pop_back();
OGRE_DELETE controller;
}
}
Expand Down

0 comments on commit f7cd9dd

Please sign in to comment.