]> git.lizzy.rs Git - irrlicht.git/commitdiff
Remove core::list and replace uses with std::list (#105)
authorparadust7 <102263465+paradust7@users.noreply.github.com>
Sat, 21 May 2022 22:00:32 +0000 (15:00 -0700)
committerGitHub <noreply@github.com>
Sat, 21 May 2022 22:00:32 +0000 (00:00 +0200)
15 files changed:
include/IGUIElement.h
include/ISceneNode.h
include/irrList.h [deleted file]
include/irrlicht.h
source/Irrlicht/CBoneSceneNode.cpp
source/Irrlicht/CFileSystem.cpp
source/Irrlicht/CGUIEnvironment.cpp
source/Irrlicht/CGUIModalScreen.cpp
source/Irrlicht/CGUIToolBar.cpp
source/Irrlicht/CGUITreeView.cpp
source/Irrlicht/CGUITreeView.h
source/Irrlicht/CIrrDeviceOSX.mm
source/Irrlicht/CIrrDeviceSDL.cpp
source/Irrlicht/CIrrDeviceWin32.cpp
source/Irrlicht/CSceneManager.cpp

index 2e76a0f8de893f0e1250db2a16d511618226925c..2efeb05c213062f66026f90f2ae1286a05db60c6 100644 (file)
@@ -6,7 +6,6 @@
 #define __I_GUI_ELEMENT_H_INCLUDED__\r
 \r
 #include "IReferenceCounted.h"\r
-#include "irrList.h"\r
 #include "rect.h"\r
 #include "irrString.h"\r
 #include "IEventReceiver.h"\r
 #include "EGUIAlignment.h"\r
 #include "IAttributes.h"\r
 #include "IGUIEnvironment.h"\r
+#include <cassert>\r
+#include <algorithm>\r
+#include <list>\r
+#include <vector>\r
 \r
 namespace irr\r
 {\r
@@ -50,12 +53,9 @@ public:
        //! Destructor\r
        virtual ~IGUIElement()\r
        {\r
-               // delete all children\r
-               core::list<IGUIElement*>::Iterator it = Children.begin();\r
-               for (; it != Children.end(); ++it)\r
-               {\r
-                       (*it)->Parent = 0;\r
-                       (*it)->drop();\r
+               for (auto child : Children) {\r
+                       child->Parent = nullptr;\r
+                       child->drop();\r
                }\r
        }\r
 \r
@@ -239,10 +239,9 @@ public:
                recalculateAbsolutePosition(false);\r
 \r
                // update all children\r
-               core::list<IGUIElement*>::Iterator it = Children.begin();\r
-               for (; it != Children.end(); ++it)\r
+               for (auto child : Children)\r
                {\r
-                       (*it)->updateAbsolutePosition();\r
+                       child->updateAbsolutePosition();\r
                }\r
        }\r
 \r
@@ -263,20 +262,19 @@ public:
        {\r
                IGUIElement* target = 0;\r
 \r
-               // we have to search from back to front, because later children\r
-               // might be drawn over the top of earlier ones.\r
-\r
-               core::list<IGUIElement*>::ConstIterator it = Children.getLast();\r
-\r
                if (isVisible())\r
                {\r
-                       while(it != Children.end())\r
+                       // we have to search from back to front, because later children\r
+                       // might be drawn over the top of earlier ones.\r
+                       auto it = Children.rbegin();\r
+                       auto ie = Children.rend();\r
+                       while (it != ie)\r
                        {\r
                                target = (*it)->getElementFromPoint(point);\r
                                if (target)\r
                                        return target;\r
 \r
-                               --it;\r
+                               ++it;\r
                        }\r
                }\r
 \r
@@ -308,17 +306,19 @@ public:
        //! Removes a child.\r
        virtual void removeChild(IGUIElement* child)\r
        {\r
-               core::list<IGUIElement*>::Iterator it = Children.begin();\r
-               for (; it != Children.end(); ++it)\r
-                       if ((*it) == child)\r
-                       {\r
-                               (*it)->Parent = 0;\r
-                               (*it)->drop();\r
-                               Children.erase(it);\r
-                               return;\r
-                       }\r
+               assert(child->Parent == this);\r
+               Children.erase(child->ParentPos);\r
+               child->Parent = nullptr;\r
+               child->drop();\r
        }\r
 \r
+       //! Removes all children.\r
+       virtual void removeAllChildren() {\r
+               while (!Children.empty()) {\r
+                       auto child = Children.back();\r
+                       child->remove();\r
+               }\r
+       }\r
 \r
        //! Removes this element from its parent.\r
        virtual void remove()\r
@@ -333,9 +333,8 @@ public:
        {\r
                if ( isVisible() )\r
                {\r
-                       core::list<IGUIElement*>::Iterator it = Children.begin();\r
-                       for (; it != Children.end(); ++it)\r
-                               (*it)->draw();\r
+                       for (auto child : Children)\r
+                               child->draw();\r
                }\r
        }\r
 \r
@@ -345,9 +344,8 @@ public:
        {\r
                if ( isVisible() )\r
                {\r
-                       core::list<IGUIElement*>::Iterator it = Children.begin();\r
-                       for (; it != Children.end(); ++it)\r
-                               (*it)->OnPostRender( timeMs );\r
+                       for (auto child : Children)\r
+                               child->OnPostRender( timeMs );\r
                }\r
        }\r
 \r
@@ -555,20 +553,15 @@ public:
 \r
        //! Brings a child to front\r
        /** \return True if successful, false if not. */\r
-       virtual bool bringToFront(IGUIElement* element)\r
+       virtual bool bringToFront(IGUIElement* child)\r
        {\r
-               core::list<IGUIElement*>::Iterator it = Children.begin();\r
-               for (; it != Children.end(); ++it)\r
-               {\r
-                       if (element == (*it))\r
-                       {\r
-                               Children.erase(it);\r
-                               Children.push_back(element);\r
-                               return true;\r
-                       }\r
-               }\r
-\r
-               return false;\r
+               if (child->Parent != this)\r
+                       return false;\r
+               if (std::next(child->ParentPos) == Children.end()) // already there\r
+                       return true;\r
+               Children.erase(child->ParentPos);\r
+               child->ParentPos = Children.insert(Children.end(), child);\r
+               return true;\r
        }\r
 \r
 \r
@@ -576,24 +569,17 @@ public:
        /** \return True if successful, false if not. */\r
        virtual bool sendToBack(IGUIElement* child)\r
        {\r
-               core::list<IGUIElement*>::Iterator it = Children.begin();\r
-               if (child == (*it)) // already there\r
+               if (child->Parent != this)\r
+                       return false;\r
+               if (child->ParentPos == Children.begin()) // already there\r
                        return true;\r
-               for (; it != Children.end(); ++it)\r
-               {\r
-                       if (child == (*it))\r
-                       {\r
-                               Children.erase(it);\r
-                               Children.push_front(child);\r
-                               return true;\r
-                       }\r
-               }\r
-\r
-               return false;\r
+               Children.erase(child->ParentPos);\r
+               child->ParentPos = Children.insert(Children.begin(), child);\r
+               return true;\r
        }\r
 \r
        //! Returns list with children of this element\r
-       virtual const core::list<IGUIElement*>& getChildren() const\r
+       virtual const std::list<IGUIElement*>& getChildren() const\r
        {\r
                return Children;\r
        }\r
@@ -610,14 +596,13 @@ public:
        {\r
                IGUIElement* e = 0;\r
 \r
-               core::list<IGUIElement*>::ConstIterator it = Children.begin();\r
-               for (; it != Children.end(); ++it)\r
+               for (auto child : Children)\r
                {\r
-                       if ((*it)->getID() == id)\r
-                               return (*it);\r
+                       if (child->getID() == id)\r
+                               return child;\r
 \r
                        if (searchchildren)\r
-                               e = (*it)->getElementFromId(id, true);\r
+                               e = child->getElementFromId(id, true);\r
 \r
                        if (e)\r
                                return e;\r
@@ -663,7 +648,7 @@ public:
                if (wanted==-2)\r
                        wanted = 1073741824; // maximum s32\r
 \r
-               core::list<IGUIElement*>::ConstIterator it = Children.begin();\r
+               auto it = Children.begin();\r
 \r
                s32 closestOrder, currentOrder;\r
 \r
@@ -806,10 +791,40 @@ protected:
                        child->remove(); // remove from old parent\r
                        child->LastParentRect = getAbsolutePosition();\r
                        child->Parent = this;\r
-                       Children.push_back(child);\r
+                       child->ParentPos = Children.insert(Children.end(), child);\r
                }\r
        }\r
 \r
+#ifndef NDEBUG\r
+       template<typename Iterator>\r
+       static size_t _fastSetChecksum(Iterator begin, Iterator end) {\r
+               std::hash<typename Iterator::value_type> hasher;\r
+               size_t checksum = 0;\r
+               for (Iterator it = begin; it != end; ++it) {\r
+                       size_t h = hasher(*it);\r
+                       checksum ^= 966073049 + (h * 3432918353) + ((h >> 16) * 461845907);\r
+               }\r
+               return checksum;\r
+       }\r
+#endif\r
+\r
+       // Reorder children [from, to) to the order given by `neworder`\r
+       void reorderChildren(\r
+               std::list<IGUIElement*>::iterator from,\r
+               std::list<IGUIElement*>::iterator to,\r
+               const std::vector<IGUIElement*> &neworder)\r
+       {\r
+               assert(_fastSetChecksum(from, to) == _fastSetChecksum(neworder.begin(), neworder.end()));\r
+               for (auto e : neworder)\r
+               {\r
+                       *from = e;\r
+                       e->ParentPos = from;\r
+                       ++from;\r
+               }\r
+               assert(from == to);\r
+       }\r
+\r
+\r
        // not virtual because needed in constructor\r
        void recalculateAbsolutePosition(bool recursive)\r
        {\r
@@ -931,10 +946,9 @@ protected:
                if ( recursive )\r
                {\r
                        // update all children\r
-                       core::list<IGUIElement*>::Iterator it = Children.begin();\r
-                       for (; it != Children.end(); ++it)\r
+                       for (auto child : Children)\r
                        {\r
-                               (*it)->recalculateAbsolutePosition(recursive);\r
+                               child->recalculateAbsolutePosition(recursive);\r
                        }\r
                }\r
        }\r
@@ -942,11 +956,14 @@ protected:
 protected:\r
 \r
        //! List of all children of this element\r
-       core::list<IGUIElement*> Children;\r
+       std::list<IGUIElement*> Children;\r
 \r
        //! Pointer to the parent\r
        IGUIElement* Parent;\r
 \r
+       //! Our position in the parent list. Only valid when Parent != nullptr\r
+       std::list<IGUIElement*>::iterator ParentPos;\r
+\r
        //! relative rect of element\r
        core::rect<s32> RelativeRect;\r
 \r
index 3f50c6e965ec5a4358b3e1abb6644e201f142b75..1f8c2c6b5c72dfe27fa37dc26f9e9e68188d5883 100644 (file)
@@ -13,8 +13,8 @@
 #include "irrString.h"\r
 #include "aabbox3d.h"\r
 #include "matrix4.h"\r
-#include "irrList.h"\r
 #include "IAttributes.h"\r
+#include <list>\r
 \r
 namespace irr\r
 {\r
@@ -24,7 +24,7 @@ namespace scene
        class ISceneManager;\r
 \r
        //! Typedef for list of scene nodes\r
-       typedef core::list<ISceneNode*> ISceneNodeList;\r
+       typedef std::list<ISceneNode*> ISceneNodeList;\r
 \r
        //! Scene node interface.\r
        /** A scene node is a node in the hierarchical scene graph. Every scene\r
@@ -81,7 +81,7 @@ namespace scene
                {\r
                        if (IsVisible)\r
                        {\r
-                               ISceneNodeList::Iterator it = Children.begin();\r
+                               ISceneNodeList::iterator it = Children.begin();\r
                                for (; it != Children.end(); ++it)\r
                                        (*it)->OnRegisterSceneNode();\r
                        }\r
@@ -103,7 +103,7 @@ namespace scene
 \r
                                // perform the post render process on all children\r
 \r
-                               ISceneNodeList::Iterator it = Children.begin();\r
+                               ISceneNodeList::iterator it = Children.begin();\r
                                for (; it != Children.end(); ++it)\r
                                        (*it)->OnAnimate(timeMs);\r
                        }\r
@@ -289,7 +289,7 @@ namespace scene
                e.g. because it couldn't be found in the children list. */\r
                virtual bool removeChild(ISceneNode* child)\r
                {\r
-                       ISceneNodeList::Iterator it = Children.begin();\r
+                       ISceneNodeList::iterator it = Children.begin();\r
                        for (; it != Children.end(); ++it)\r
                                if ((*it) == child)\r
                                {\r
@@ -309,7 +309,7 @@ namespace scene
                */\r
                virtual void removeAll()\r
                {\r
-                       ISceneNodeList::Iterator it = Children.begin();\r
+                       ISceneNodeList::iterator it = Children.begin();\r
                        for (; it != Children.end(); ++it)\r
                        {\r
                                (*it)->Parent = 0;\r
@@ -519,7 +519,7 @@ namespace scene
 \r
                //! Returns a const reference to the list of all children.\r
                /** \return The list of all children of this node. */\r
-               const core::list<ISceneNode*>& getChildren() const\r
+               const std::list<ISceneNode*>& getChildren() const\r
                {\r
                        return Children;\r
                }\r
@@ -611,7 +611,7 @@ namespace scene
 \r
                        // clone children\r
 \r
-                       ISceneNodeList::Iterator it = toCopyFrom->Children.begin();\r
+                       ISceneNodeList::iterator it = toCopyFrom->Children.begin();\r
                        for (; it != toCopyFrom->Children.end(); ++it)\r
                                (*it)->clone(this, newManager);\r
                }\r
@@ -622,7 +622,7 @@ namespace scene
                {\r
                        SceneManager = newManager;\r
 \r
-                       ISceneNodeList::Iterator it = Children.begin();\r
+                       ISceneNodeList::iterator it = Children.begin();\r
                        for (; it != Children.end(); ++it)\r
                                (*it)->setSceneManager(newManager);\r
                }\r
@@ -646,7 +646,7 @@ namespace scene
                ISceneNode* Parent;\r
 \r
                //! List of all children of this node\r
-               core::list<ISceneNode*> Children;\r
+               std::list<ISceneNode*> Children;\r
 \r
                //! Pointer to the scene manager\r
                ISceneManager* SceneManager;\r
diff --git a/include/irrList.h b/include/irrList.h
deleted file mode 100644 (file)
index 27044a4..0000000
+++ /dev/null
@@ -1,414 +0,0 @@
-// Copyright (C) 2002-2012 Nikolaus Gebhardt\r
-// This file is part of the "Irrlicht Engine".\r
-// For conditions of distribution and use, see copyright notice in irrlicht.h\r
-\r
-#ifndef __IRR_LIST_H_INCLUDED__\r
-#define __IRR_LIST_H_INCLUDED__\r
-\r
-#include "irrTypes.h"\r
-#include "irrAllocator.h"\r
-#include "irrMath.h"\r
-\r
-namespace irr\r
-{\r
-namespace core\r
-{\r
-\r
-\r
-//! Doubly linked list template.\r
-template <class T>\r
-class list\r
-{\r
-private:\r
-\r
-       //! List element node with pointer to previous and next element in the list.\r
-       struct SKListNode\r
-       {\r
-               SKListNode(const T& e) : Next(0), Prev(0), Element(e) {}\r
-\r
-               SKListNode* Next;\r
-               SKListNode* Prev;\r
-               T Element;\r
-       };\r
-\r
-public:\r
-       class ConstIterator;\r
-\r
-       //! List iterator.\r
-       class Iterator\r
-       {\r
-       public:\r
-               Iterator() : Current(0) {}\r
-\r
-               Iterator& operator ++()    { Current = Current->Next; return *this; }\r
-               Iterator& operator --()    { Current = Current->Prev; return *this; }\r
-               Iterator  operator ++(s32) { Iterator tmp = *this; Current = Current->Next; return tmp; }\r
-               Iterator  operator --(s32) { Iterator tmp = *this; Current = Current->Prev; return tmp; }\r
-\r
-               Iterator& operator +=(s32 num)\r
-               {\r
-                       if(num > 0)\r
-                       {\r
-                               while (num-- && this->Current != 0) ++(*this);\r
-                       }\r
-                       else\r
-                       {\r
-                               while(num++ && this->Current != 0) --(*this);\r
-                       }\r
-                       return *this;\r
-               }\r
-\r
-               Iterator  operator + (s32 num) const { Iterator tmp = *this; return tmp += num; }\r
-               Iterator& operator -=(s32 num) { return (*this)+=(-num); }\r
-               Iterator  operator - (s32 num) const { return (*this)+ (-num); }\r
-\r
-               bool operator ==(const Iterator&      other) const { return Current == other.Current; }\r
-               bool operator !=(const Iterator&      other) const { return Current != other.Current; }\r
-               bool operator ==(const ConstIterator& other) const { return Current == other.Current; }\r
-               bool operator !=(const ConstIterator& other) const { return Current != other.Current; }\r
-\r
-               T & operator * () { return Current->Element; }\r
-               T * operator ->() { return &Current->Element; }\r
-\r
-       private:\r
-               explicit Iterator(SKListNode* begin) : Current(begin) {}\r
-\r
-               SKListNode* Current;\r
-\r
-               friend class list<T>;\r
-               friend class ConstIterator;\r
-       };\r
-\r
-       //! List iterator for const access.\r
-       class ConstIterator\r
-       {\r
-       public:\r
-\r
-               ConstIterator() : Current(0) {}\r
-               ConstIterator(const Iterator& iter) : Current(iter.Current)  {}\r
-\r
-               ConstIterator& operator ++()    { Current = Current->Next; return *this; }\r
-               ConstIterator& operator --()    { Current = Current->Prev; return *this; }\r
-               ConstIterator  operator ++(s32) { ConstIterator tmp = *this; Current = Current->Next; return tmp; }\r
-               ConstIterator  operator --(s32) { ConstIterator tmp = *this; Current = Current->Prev; return tmp; }\r
-\r
-               ConstIterator& operator +=(s32 num)\r
-               {\r
-                       if(num > 0)\r
-                       {\r
-                               while(num-- && this->Current != 0) ++(*this);\r
-                       }\r
-                       else\r
-                       {\r
-                               while(num++ && this->Current != 0) --(*this);\r
-                       }\r
-                       return *this;\r
-               }\r
-\r
-               ConstIterator  operator + (s32 num) const { ConstIterator tmp = *this; return tmp += num; }\r
-               ConstIterator& operator -=(s32 num) { return (*this)+=(-num); }\r
-               ConstIterator  operator - (s32 num) const { return (*this)+ (-num); }\r
-\r
-               bool operator ==(const ConstIterator& other) const { return Current == other.Current; }\r
-               bool operator !=(const ConstIterator& other) const { return Current != other.Current; }\r
-               bool operator ==(const Iterator&      other) const { return Current == other.Current; }\r
-               bool operator !=(const Iterator&      other) const { return Current != other.Current; }\r
-\r
-               const T & operator * () { return Current->Element; }\r
-               const T * operator ->() { return &Current->Element; }\r
-\r
-               ConstIterator & operator =(const Iterator & iterator) { Current = iterator.Current; return *this; }\r
-\r
-       private:\r
-               explicit ConstIterator(SKListNode* begin) : Current(begin) {}\r
-\r
-               SKListNode* Current;\r
-\r
-               friend class Iterator;\r
-               friend class list<T>;\r
-       };\r
-\r
-       //! Default constructor for empty list.\r
-       list()\r
-               : First(0), Last(0), Size(0) {}\r
-\r
-\r
-       //! Copy constructor.\r
-       list(const list<T>& other) : First(0), Last(0), Size(0)\r
-       {\r
-               *this = other;\r
-       }\r
-\r
-\r
-       //! Destructor\r
-       ~list()\r
-       {\r
-               clear();\r
-       }\r
-\r
-\r
-       //! Assignment operator\r
-       void operator=(const list<T>& other)\r
-       {\r
-               if(&other == this)\r
-               {\r
-                       return;\r
-               }\r
-\r
-               clear();\r
-\r
-               SKListNode* node = other.First;\r
-               while(node)\r
-               {\r
-                       push_back(node->Element);\r
-                       node = node->Next;\r
-               }\r
-       }\r
-\r
-\r
-       //! Returns amount of elements in list.\r
-       /** \return Amount of elements in the list. */\r
-       u32 size() const\r
-       {\r
-               return Size;\r
-       }\r
-       u32 getSize() const\r
-       {\r
-               return Size;\r
-       }\r
-\r
-\r
-       //! Clears the list, deletes all elements in the list.\r
-       /** All existing iterators of this list will be invalid. */\r
-       void clear()\r
-       {\r
-               while(First)\r
-               {\r
-                       SKListNode * next = First->Next;\r
-                       allocator.destruct(First);\r
-                       allocator.deallocate(First);\r
-                       First = next;\r
-               }\r
-\r
-               //First = 0; handled by loop\r
-               Last = 0;\r
-               Size = 0;\r
-       }\r
-\r
-\r
-       //! Checks for empty list.\r
-       /** \return True if the list is empty and false if not. */\r
-       bool empty() const\r
-       {\r
-               return (First == 0);\r
-       }\r
-\r
-\r
-       //! Adds an element at the end of the list.\r
-       /** \param element Element to add to the list. */\r
-       void push_back(const T& element)\r
-       {\r
-               SKListNode* node = allocator.allocate(1);\r
-               allocator.construct(node, element);\r
-\r
-               ++Size;\r
-\r
-               if (First == 0)\r
-                       First = node;\r
-\r
-               node->Prev = Last;\r
-\r
-               if (Last != 0)\r
-                       Last->Next = node;\r
-\r
-               Last = node;\r
-       }\r
-\r
-\r
-       //! Adds an element at the begin of the list.\r
-       /** \param element: Element to add to the list. */\r
-       void push_front(const T& element)\r
-       {\r
-               SKListNode* node = allocator.allocate(1);\r
-               allocator.construct(node, element);\r
-\r
-               ++Size;\r
-\r
-               if (First == 0)\r
-               {\r
-                       Last = node;\r
-                       First = node;\r
-               }\r
-               else\r
-               {\r
-                       node->Next = First;\r
-                       First->Prev = node;\r
-                       First = node;\r
-               }\r
-       }\r
-\r
-\r
-       //! Gets first node.\r
-       /** \return A list iterator pointing to the beginning of the list. */\r
-       Iterator begin()\r
-       {\r
-               return Iterator(First);\r
-       }\r
-\r
-\r
-       //! Gets first node.\r
-       /** \return A const list iterator pointing to the beginning of the list. */\r
-       ConstIterator begin() const\r
-       {\r
-               return ConstIterator(First);\r
-       }\r
-\r
-\r
-       //! Gets end node.\r
-       /** \return List iterator pointing to null. */\r
-       Iterator end()\r
-       {\r
-               return Iterator(0);\r
-       }\r
-\r
-\r
-       //! Gets end node.\r
-       /** \return Const list iterator pointing to null. */\r
-       ConstIterator end() const\r
-       {\r
-               return ConstIterator(0);\r
-       }\r
-\r
-\r
-       //! Gets last element.\r
-       /** \return List iterator pointing to the last element of the list. */\r
-       Iterator getLast()\r
-       {\r
-               return Iterator(Last);\r
-       }\r
-\r
-\r
-       //! Gets last element.\r
-       /** \return Const list iterator pointing to the last element of the list. */\r
-       ConstIterator getLast() const\r
-       {\r
-               return ConstIterator(Last);\r
-       }\r
-\r
-\r
-       //! Inserts an element after an element.\r
-       /** \param it Iterator pointing to element after which the new element\r
-       should be inserted.\r
-       \param element The new element to be inserted into the list.\r
-       */\r
-       void insert_after(const Iterator& it, const T& element)\r
-       {\r
-               SKListNode* node = allocator.allocate(1);\r
-               allocator.construct(node, element);\r
-\r
-               node->Next = it.Current->Next;\r
-\r
-               if (it.Current->Next)\r
-                       it.Current->Next->Prev = node;\r
-\r
-               node->Prev = it.Current;\r
-               it.Current->Next = node;\r
-               ++Size;\r
-\r
-               if (it.Current == Last)\r
-                       Last = node;\r
-       }\r
-\r
-\r
-       //! Inserts an element before an element.\r
-       /** \param it Iterator pointing to element before which the new element\r
-       should be inserted.\r
-       \param element The new element to be inserted into the list.\r
-       */\r
-       void insert_before(const Iterator& it, const T& element)\r
-       {\r
-               SKListNode* node = allocator.allocate(1);\r
-               allocator.construct(node, element);\r
-\r
-               node->Prev = it.Current->Prev;\r
-\r
-               if (it.Current->Prev)\r
-                       it.Current->Prev->Next = node;\r
-\r
-               node->Next = it.Current;\r
-               it.Current->Prev = node;\r
-               ++Size;\r
-\r
-               if (it.Current == First)\r
-                       First = node;\r
-       }\r
-\r
-\r
-       //! Erases an element.\r
-       /** \param it Iterator pointing to the element which shall be erased.\r
-       \return Iterator pointing to next element. */\r
-       Iterator erase(Iterator& it)\r
-       {\r
-               // suggest changing this to a const Iterator& and\r
-               // working around line: it.Current = 0 (possibly with a mutable, or just let it be garbage?)\r
-\r
-               Iterator returnIterator(it);\r
-               ++returnIterator;\r
-\r
-               if(it.Current == First)\r
-               {\r
-                       First = it.Current->Next;\r
-               }\r
-               else\r
-               {\r
-                       it.Current->Prev->Next = it.Current->Next;\r
-               }\r
-\r
-               if(it.Current == Last)\r
-               {\r
-                       Last = it.Current->Prev;\r
-               }\r
-               else\r
-               {\r
-                       it.Current->Next->Prev = it.Current->Prev;\r
-               }\r
-\r
-               allocator.destruct(it.Current);\r
-               allocator.deallocate(it.Current);\r
-               it.Current = 0;\r
-               --Size;\r
-\r
-               return returnIterator;\r
-       }\r
-\r
-       //! Swap the content of this list container with the content of another list\r
-       /** Afterward this object will contain the content of the other object and the other\r
-       object will contain the content of this object. Iterators will afterward be valid for\r
-       the swapped object.\r
-       \param other Swap content with this object */\r
-       void swap(list<T>& other)\r
-       {\r
-               core::swap(First, other.First);\r
-               core::swap(Last, other.Last);\r
-               core::swap(Size, other.Size);\r
-               core::swap(allocator, other.allocator); // memory is still released by the same allocator used for allocation\r
-       }\r
-\r
-       typedef T value_type;\r
-       typedef u32 size_type;\r
-\r
-private:\r
-\r
-       SKListNode* First;\r
-       SKListNode* Last;\r
-       u32 Size;\r
-       irrAllocator<SKListNode> allocator;\r
-\r
-};\r
-\r
-\r
-} // end namespace core\r
-}// end namespace irr\r
-\r
-#endif\r
-\r
index 978643625c9a5365d7920740cf7cfb55e676c5af..4773e437437f371a6a6884d4153a068be88ded0f 100644 (file)
 #include "IRandomizer.h"\r
 #include "IRenderTarget.h"\r
 #include "IrrlichtDevice.h"\r
-#include "irrList.h"\r
 #include "irrMath.h"\r
 #include "irrString.h"\r
 #include "irrTypes.h"\r
index ccce982067f8275d3cd56c4d98e3c793e3dc8585..04ef8c7de2a96ff895e7b5b359a7f4f040a78894 100644 (file)
@@ -71,7 +71,7 @@ void CBoneSceneNode::OnAnimate(u32 timeMs)
                //updateAbsolutePosition();\r
 \r
                // perform the post render process on all children\r
-               ISceneNodeList::Iterator it = Children.begin();\r
+               ISceneNodeList::iterator it = Children.begin();\r
                for (; it != Children.end(); ++it)\r
                        (*it)->OnAnimate(timeMs);\r
        }\r
@@ -82,7 +82,7 @@ void CBoneSceneNode::helper_updateAbsolutePositionOfAllChildren(ISceneNode *Node
 {\r
        Node->updateAbsolutePosition();\r
 \r
-       ISceneNodeList::ConstIterator it = Node->getChildren().begin();\r
+       ISceneNodeList::const_iterator it = Node->getChildren().begin();\r
        for (; it != Node->getChildren().end(); ++it)\r
        {\r
                helper_updateAbsolutePositionOfAllChildren( (*it) );\r
index e1d02484e5fb436d843b800f52c138ebcb19dc13..2adbe63b1636ac9aa60d326a9ab35aea7521214a 100644 (file)
@@ -16,7 +16,7 @@
 #include "CMemoryFile.h"\r
 #include "CLimitReadFile.h"\r
 #include "CWriteFile.h"\r
-#include "irrList.h"\r
+#include <list>\r
 \r
 #if defined (__STRICT_ANSI__)\r
     #error Compiling with __STRICT_ANSI__ not supported. g++ does set this when compiling with -std=c++11 or -std=c++0x. Use instead -std=gnu++11 or -std=gnu++0x. Or use -U__STRICT_ANSI__ to disable strict ansi.\r
@@ -714,11 +714,10 @@ path CFileSystem::getRelativeFilename(const path& filename, const path& director
        io::path path1, file, ext;\r
        core::splitFilename(getAbsolutePath(filename), &path1, &file, &ext);\r
        io::path path2(getAbsolutePath(directory));\r
-       core::list<io::path> list1, list2;\r
+       std::list<io::path> list1, list2;\r
        path1.split(list1, _IRR_TEXT("/\\"), 2);\r
        path2.split(list2, _IRR_TEXT("/\\"), 2);\r
-       u32 i=0;\r
-       core::list<io::path>::ConstIterator it1,it2;\r
+       std::list<io::path>::const_iterator it1,it2;\r
        it1=list1.begin();\r
        it2=list2.begin();\r
 \r
@@ -742,19 +741,19 @@ path CFileSystem::getRelativeFilename(const path& filename, const path& director
        #endif\r
 \r
 \r
-       for (; i<list1.size() && i<list2.size()\r
+       for (; it1 != list1.end() && it2 != list2.end()\r
 #if defined (_IRR_WINDOWS_API_)\r
                && (io::path(*it1).make_lower()==io::path(*it2).make_lower())\r
 #else\r
                && (*it1==*it2)\r
 #endif\r
-               ; ++i)\r
+               ;)\r
        {\r
                ++it1;\r
                ++it2;\r
        }\r
        path1=_IRR_TEXT("");\r
-       for (; i<list2.size(); ++i)\r
+       for (; it2 != list2.end(); ++it2)\r
                path1 += _IRR_TEXT("../");\r
        while (it1 != list1.end())\r
        {\r
index 040cbff1f6ddaef1fb57638fe556963c7ecb228c..0a12af35cc0d3b61f3f0804cae02ef466f421693 100644 (file)
@@ -387,11 +387,7 @@ void CGUIEnvironment::clear()
                HoveredNoSubelement = 0;\r
        }\r
 \r
-       // get the root's children in case the root changes in future\r
-       const core::list<IGUIElement*>& children = getRootGUIElement()->getChildren();\r
-\r
-       while (!children.empty())\r
-               (*children.getLast())->remove();\r
+       getRootGUIElement()->removeAllChildren();\r
 }\r
 \r
 \r
index ce8b32e18b7f6b45b706f34c7dbc18afbede2cb6..5318d55b236fcfd47a9543081082d9f52a942a62 100644 (file)
@@ -57,17 +57,12 @@ bool CGUIModalScreen::isVisible() const
     }\r
 \r
     // any child visible?\r
-    bool visible = false;\r
-    core::list<IGUIElement*>::ConstIterator it = Children.begin();\r
-    for (; it != Children.end(); ++it)\r
+    for (const auto& child : Children)\r
     {\r
-        if ( (*it)->isVisible() )\r
-        {\r
-            visible = true;\r
-            break;\r
-        }\r
+        if ( child->isVisible() )\r
+            return true;\r
     }\r
-    return visible;\r
+    return false;\r
 }\r
 \r
 bool CGUIModalScreen::isPointInside(const core::position2d<s32>& point) const\r
@@ -98,7 +93,7 @@ bool CGUIModalScreen::OnEvent(const SEvent& event)
                        if ( !canTakeFocus(event.GUIEvent.Caller))\r
                        {\r
                                if ( !Children.empty() )\r
-                                       Environment->setFocus(*(Children.begin()));\r
+                                       Environment->setFocus(Children.front());\r
                                else\r
                                        Environment->setFocus(this);\r
                        }\r
@@ -110,7 +105,7 @@ bool CGUIModalScreen::OnEvent(const SEvent& event)
                if ( isMyChild(event.GUIEvent.Caller) )\r
                                {\r
                                        if ( !Children.empty() )\r
-                                               Environment->setFocus(*(Children.begin()));\r
+                                               Environment->setFocus(Children.front());\r
                                        else\r
                                                Environment->setFocus(this);\r
                                }\r
@@ -171,15 +166,14 @@ void CGUIModalScreen::draw()
        u32 now = os::Timer::getTime();\r
        if (BlinkMode && now - MouseDownTime < 300 && (now / 70)%2)\r
        {\r
-               core::list<IGUIElement*>::Iterator it = Children.begin();\r
                core::rect<s32> r;\r
                video::SColor c = Environment->getSkin()->getColor(gui::EGDC_3D_HIGH_LIGHT);\r
 \r
-               for (; it != Children.end(); ++it)\r
+               for (auto child : Children)\r
                {\r
-                       if ((*it)->isVisible())\r
+                       if (child->isVisible())\r
                        {\r
-                               r = (*it)->getAbsolutePosition();\r
+                               r = child->getAbsolutePosition();\r
                                r.LowerRightCorner.X += 1;\r
                                r.LowerRightCorner.Y += 1;\r
                                r.UpperLeftCorner.X -= 1;\r
index 2f4bf4ec528f81f233c486c1065571e7fc309a21..6d4cf93c1c4f765db46ac60cf31bd1463ab7c3f1 100644 (file)
@@ -34,11 +34,8 @@ CGUIToolBar::CGUIToolBar(IGUIEnvironment* environment, IGUIElement* parent, s32
                parentwidth = Parent->getAbsolutePosition().getWidth();\r
                s32 parentheight = Parent->getAbsolutePosition().getHeight();\r
 \r
-               const core::list<IGUIElement*>& children = parent->getChildren();\r
-               core::list<IGUIElement*>::ConstIterator it = children.begin();\r
-               for (; it != children.end(); ++it)\r
+               for (const auto& e : parent->getChildren())\r
                {\r
-                       const IGUIElement* e = *it;\r
                        if (    e->hasType(EGUIET_CONTEXT_MENU) \r
                                ||      e->hasType(EGUIET_MENU) \r
                                ||      e->hasType(EGUIET_TOOL_BAR)  )\r
index b348a79195ca86b233122911afaa8ee5cd713c6b..5c082e02c224b0676f97a3da65527b2d1e4e7dad 100644 (file)
@@ -66,11 +66,10 @@ void CGUITreeViewNode::setIcon( const wchar_t* icon )
 \r
 void CGUITreeViewNode::clearChildren()\r
 {\r
-       core::list<CGUITreeViewNode*>::Iterator it;\r
-\r
-       for( it = Children.begin(); it != Children.end(); it++ )\r
+       for (auto child : Children)\r
        {\r
-               ( *it )->drop();\r
+               child->Parent = nullptr;\r
+               child->drop();\r
        }\r
        Children.clear();\r
 }\r
@@ -83,9 +82,8 @@ IGUITreeViewNode* CGUITreeViewNode::addChildBack(
        void*                                   data /*= 0*/,\r
        IReferenceCounted*                      data2 /*= 0*/ )\r
 {\r
-       CGUITreeViewNode*       newChild = new CGUITreeViewNode( Owner, this );\r
-\r
-       Children.push_back( newChild );\r
+       auto newChild = new CGUITreeViewNode( Owner, this );\r
+       newChild->ParentPos = Children.insert(Children.end(), newChild);\r
        newChild->Text = text;\r
        newChild->Icon = icon;\r
        newChild->ImageIndex = imageIndex;\r
@@ -107,9 +105,8 @@ IGUITreeViewNode* CGUITreeViewNode::addChildFront(
        void*                                   data /*= 0*/,\r
        IReferenceCounted*                      data2 /*= 0*/ )\r
 {\r
-       CGUITreeViewNode*       newChild = new CGUITreeViewNode( Owner, this );\r
-\r
-       Children.push_front( newChild );\r
+       auto newChild = new CGUITreeViewNode( Owner, this );\r
+       newChild->ParentPos = Children.insert(Children.begin(), newChild);\r
        newChild->Text = text;\r
        newChild->Icon = icon;\r
        newChild->ImageIndex = imageIndex;\r
@@ -124,7 +121,7 @@ IGUITreeViewNode* CGUITreeViewNode::addChildFront(
 }\r
 \r
 IGUITreeViewNode* CGUITreeViewNode::insertChildAfter(\r
-       IGUITreeViewNode*       other,\r
+       IGUITreeViewNode*       iother,\r
        const wchar_t*          text,\r
        const wchar_t*          icon /*= 0*/,\r
        s32                                     imageIndex /*= -1*/,\r
@@ -132,33 +129,27 @@ IGUITreeViewNode* CGUITreeViewNode::insertChildAfter(
        void*                                   data /*= 0*/,\r
        IReferenceCounted*                      data2/* = 0*/ )\r
 {\r
-       core::list<CGUITreeViewNode*>::Iterator itOther;\r
-       CGUITreeViewNode*                                                                       newChild = 0;\r
-\r
-       for( itOther = Children.begin(); itOther != Children.end(); itOther++ )\r
-       {\r
-               if( other == *itOther )\r
-               {\r
-                       newChild = new CGUITreeViewNode( Owner, this );\r
-                       newChild->Text = text;\r
-                       newChild->Icon = icon;\r
-                       newChild->ImageIndex = imageIndex;\r
-                       newChild->SelectedImageIndex = selectedImageIndex;\r
-                       newChild->Data = data;\r
-                       newChild->Data2 = data2;\r
-                       if( data2 )\r
-                       {\r
-                               data2->grab();\r
-                       }\r
-                       Children.insert_after( itOther, newChild );\r
-                       break;\r
-               }\r
-       }\r
+       // This cast is needed to access the ParentPos member of `other`.\r
+       // The abstraction was already broken, because Children is a list of\r
+       // CGUITreeViewNode, not IGUITreeViewNode. The existing code was\r
+       // implicitly casting through pointer comparison.\r
+       auto other = static_cast<CGUITreeViewNode*>(iother);\r
+       assert(other->Parent == this);\r
+       auto newChild = new CGUITreeViewNode( Owner, this );\r
+       newChild->ParentPos = Children.insert(std::next(other->ParentPos), newChild);\r
+       newChild->Text = text;\r
+       newChild->Icon = icon;\r
+       newChild->ImageIndex = imageIndex;\r
+       newChild->SelectedImageIndex = selectedImageIndex;\r
+       newChild->Data = data;\r
+       newChild->Data2 = data2;\r
+       if( data2 )\r
+               data2->grab();\r
        return newChild;\r
 }\r
 \r
 IGUITreeViewNode* CGUITreeViewNode::insertChildBefore(\r
-       IGUITreeViewNode*       other,\r
+       IGUITreeViewNode*       iother,\r
        const wchar_t*          text,\r
        const wchar_t*          icon /*= 0*/,\r
        s32                                     imageIndex /*= -1*/,\r
@@ -166,28 +157,18 @@ IGUITreeViewNode* CGUITreeViewNode::insertChildBefore(
        void*                                   data /*= 0*/,\r
        IReferenceCounted*                      data2/* = 0*/ )\r
 {\r
-       core::list<CGUITreeViewNode*>::Iterator itOther;\r
-       CGUITreeViewNode*                                                                       newChild = 0;\r
-\r
-       for( itOther = Children.begin(); itOther != Children.end(); itOther++ )\r
-       {\r
-               if( other == *itOther )\r
-               {\r
-                       newChild = new CGUITreeViewNode( Owner, this );\r
-                       newChild->Text = text;\r
-                       newChild->Icon = icon;\r
-                       newChild->ImageIndex = imageIndex;\r
-                       newChild->SelectedImageIndex = selectedImageIndex;\r
-                       newChild->Data = data;\r
-                       newChild->Data2 = data2;\r
-                       if( data2 )\r
-                       {\r
-                               data2->grab();\r
-                       }\r
-                       Children.insert_before( itOther, newChild );\r
-                       break;\r
-               }\r
-       }\r
+       auto other = static_cast<CGUITreeViewNode*>(iother);\r
+       assert(other->Parent == this);\r
+       auto newChild = new CGUITreeViewNode( Owner, this );\r
+       newChild->ParentPos = Children.insert(other->ParentPos, newChild);\r
+       newChild->Text = text;\r
+       newChild->Icon = icon;\r
+       newChild->ImageIndex = imageIndex;\r
+       newChild->SelectedImageIndex = selectedImageIndex;\r
+       newChild->Data = data;\r
+       newChild->Data2 = data2;\r
+       if( data2 )\r
+               data2->grab();\r
        return newChild;\r
 }\r
 \r
@@ -199,7 +180,7 @@ IGUITreeViewNode* CGUITreeViewNode::getFirstChild() const
        }\r
        else\r
        {\r
-               return *( Children.begin() );\r
+               return Children.front();\r
        }\r
 }\r
 \r
@@ -211,54 +192,25 @@ IGUITreeViewNode* CGUITreeViewNode::getLastChild() const
        }\r
        else\r
        {\r
-               return *( Children.getLast() );\r
+               return Children.back();\r
        }\r
 }\r
 \r
 IGUITreeViewNode* CGUITreeViewNode::getPrevSibling() const\r
 {\r
-       core::list<CGUITreeViewNode*>::Iterator itThis;\r
-       core::list<CGUITreeViewNode*>::Iterator itOther;\r
-       CGUITreeViewNode*                                                                       other = 0;\r
-\r
-       if( Parent )\r
-       {\r
-               for( itThis = Parent->Children.begin(); itThis != Parent->Children.end(); itThis++ )\r
-               {\r
-                       if( this == *itThis )\r
-                       {\r
-                               if( itThis != Parent->Children.begin() )\r
-                               {\r
-                                       other = *itOther;\r
-                               }\r
-                               break;\r
-                       }\r
-                       itOther = itThis;\r
-               }\r
-       }\r
-       return other;\r
+       if (!Parent || ParentPos == Parent->Children.begin())\r
+               return nullptr;\r
+       return *std::prev(ParentPos);\r
 }\r
 \r
 IGUITreeViewNode* CGUITreeViewNode::getNextSibling() const\r
 {\r
-       core::list<CGUITreeViewNode*>::Iterator itThis;\r
-       CGUITreeViewNode*                                                                       other = 0;\r
-\r
-       if( Parent )\r
-       {\r
-               for( itThis = Parent->Children.begin(); itThis != Parent->Children.end(); itThis++ )\r
-               {\r
-                       if( this == *itThis )\r
-                       {\r
-                               if( itThis != Parent->Children.getLast() )\r
-                               {\r
-                                       other = *( ++itThis );\r
-                               }\r
-                               break;\r
-                       }\r
-               }\r
-       }\r
-       return other;\r
+       if (!Parent)\r
+               return nullptr;\r
+       auto nextIt = std::next(ParentPos);\r
+       if (nextIt == Parent->Children.end())\r
+               return nullptr;\r
+       return *nextIt;\r
 }\r
 \r
 IGUITreeViewNode* CGUITreeViewNode::getNextVisible() const\r
@@ -286,73 +238,40 @@ IGUITreeViewNode* CGUITreeViewNode::getNextVisible() const
        return next;\r
 }\r
 \r
-bool CGUITreeViewNode::deleteChild( IGUITreeViewNode* child )\r
+bool CGUITreeViewNode::deleteChild( IGUITreeViewNode* ichild )\r
 {\r
-       core::list<CGUITreeViewNode*>::Iterator itChild;\r
-       bool    deleted = false;\r
-\r
-       for( itChild = Children.begin(); itChild != Children.end(); itChild++ )\r
-       {\r
-               if( child == *itChild )\r
-               {\r
-                       child->drop();\r
-                       Children.erase( itChild );\r
-                       deleted = true;\r
-                       break;\r
-               }\r
-       }\r
-       return deleted;\r
+       auto child = static_cast<CGUITreeViewNode*>(ichild);\r
+       assert(child->Parent == this);\r
+       Children.erase(child->ParentPos);\r
+       child->Parent = nullptr;\r
+       child->drop();\r
+       return true;\r
 }\r
 \r
-bool CGUITreeViewNode::moveChildUp( IGUITreeViewNode* child )\r
+bool CGUITreeViewNode::moveChildUp( IGUITreeViewNode* ichild )\r
 {\r
-       core::list<CGUITreeViewNode*>::Iterator itChild;\r
-       core::list<CGUITreeViewNode*>::Iterator itOther;\r
-       CGUITreeViewNode*                                                                       nodeTmp;\r
-       bool                                                                                                    moved = false;\r
-\r
-       for( itChild = Children.begin(); itChild != Children.end(); itChild++ )\r
-       {\r
-               if( child == *itChild )\r
-               {\r
-                       if( itChild != Children.begin() )\r
-                       {\r
-                               nodeTmp = *itChild;\r
-                               *itChild = *itOther;\r
-                               *itOther = nodeTmp;\r
-                               moved = true;\r
-                       }\r
-                       break;\r
-               }\r
-               itOther = itChild;\r
-       }\r
-       return moved;\r
+       auto child = static_cast<CGUITreeViewNode*>(ichild);\r
+       assert(child->Parent == this);\r
+       if (child->ParentPos == Children.begin())\r
+               return false;\r
+       auto curPos = child->ParentPos;\r
+       auto prevPos = std::prev(child->ParentPos);\r
+       std::swap(*curPos, *prevPos);\r
+       std::swap((*curPos)->ParentPos, (*prevPos)->ParentPos);\r
+       return true;\r
 }\r
 \r
-bool CGUITreeViewNode::moveChildDown( IGUITreeViewNode* child )\r
+bool CGUITreeViewNode::moveChildDown( IGUITreeViewNode* ichild )\r
 {\r
-       core::list<CGUITreeViewNode*>::Iterator itChild;\r
-       core::list<CGUITreeViewNode*>::Iterator itOther;\r
-       CGUITreeViewNode*                                                                       nodeTmp;\r
-       bool                                                                                                    moved = false;\r
-\r
-       for( itChild = Children.begin(); itChild != Children.end(); itChild++ )\r
-       {\r
-               if( child == *itChild )\r
-               {\r
-                       if( itChild != Children.getLast() )\r
-                       {\r
-                               itOther = itChild;\r
-                               ++itOther;\r
-                               nodeTmp = *itChild;\r
-                               *itChild = *itOther;\r
-                               *itOther = nodeTmp;\r
-                               moved = true;\r
-                       }\r
-                       break;\r
-               }\r
-       }\r
-       return moved;\r
+       auto child = static_cast<CGUITreeViewNode*>(ichild);\r
+       assert(child->Parent == this);\r
+       auto nextPos = std::next(child->ParentPos);\r
+       if (nextPos == Children.end())\r
+               return false;\r
+       auto curPos = child->ParentPos;\r
+       std::swap(*curPos, *nextPos);\r
+       std::swap((*curPos)->ParentPos, (*nextPos)->ParentPos);\r
+       return true;\r
 }\r
 \r
 void CGUITreeViewNode::setExpanded( bool expanded )\r
index bdcf035e10d4ae8701816df4c4ae4c54fa587c88..1c34eb56c75d1ea31fde27a8e3777910a80a262c 100644 (file)
@@ -5,7 +5,6 @@
 #define __C_GUI_TREE_VIEW_H_INCLUDED__\r
 \r
 #include "IGUITreeView.h"\r
-#include "irrList.h"\r
 \r
 \r
 namespace irr\r
@@ -93,7 +92,7 @@ namespace gui
 \r
                //! returns the child item count\r
                virtual u32 getChildCount() const _IRR_OVERRIDE_\r
-               { return Children.getSize(); }\r
+               { return Children.size(); }\r
 \r
                //! removes all children (recursive) from this node\r
                virtual void clearChildren() _IRR_OVERRIDE_;\r
@@ -231,7 +230,10 @@ namespace gui
                void*                           Data;\r
                IReferenceCounted*              Data2;\r
                bool                            Expanded;\r
-               core::list<CGUITreeViewNode*>   Children;\r
+               std::list<CGUITreeViewNode*>    Children;\r
+               // Position of this node in Parent->Children.\r
+               // Only valid when Parent != NULL\r
+               std::list<CGUITreeViewNode*>::iterator ParentPos;\r
        };\r
 \r
 \r
index 066539ca9d32d98d15e564c5e0721cb7848738fe..eb3f81635c5eab00bac84018fdf6fb8bdf04fae0 100644 (file)
@@ -14,7 +14,6 @@
 #include "CIrrDeviceOSX.h"
 
 #include "IEventReceiver.h"
-#include "irrList.h"
 #include "os.h"
 #include "CTimer.h"
 #include "irrString.h"
index c66cfda79744947101f8de8e9728f530ef7099b7..6a31ee74588cc7273e0dc6e9a08e011fc35d21c6 100644 (file)
@@ -8,7 +8,6 @@
 \r
 #include "CIrrDeviceSDL.h"\r
 #include "IEventReceiver.h"\r
-#include "irrList.h"\r
 #include "os.h"\r
 #include "CTimer.h"\r
 #include "irrString.h"\r
index 0bb8c1f766af534c6f0b8fac97cf40220082e85f..0ea188b1f2418761542f5b1aed1a589f68e6b588 100644 (file)
@@ -12,7 +12,6 @@
 \r
 #include "CIrrDeviceWin32.h"\r
 #include "IEventReceiver.h"\r
-#include "irrList.h"\r
 #include "os.h"\r
 \r
 #include "CTimer.h"\r
index e0a208414e9133f35a6b77b96f56f6f52c7b56a4..0e497893420b4428130dd89b83f7002ea68384e2 100644 (file)
@@ -855,7 +855,7 @@ ISceneNode* CSceneManager::getSceneNodeFromName(const char* name, ISceneNode* st
        ISceneNode* node = 0;\r
 \r
        const ISceneNodeList& list = start->getChildren();\r
-       ISceneNodeList::ConstIterator it = list.begin();\r
+       ISceneNodeList::const_iterator it = list.begin();\r
        for (; it!=list.end(); ++it)\r
        {\r
                node = getSceneNodeFromName(name, *it);\r
@@ -879,7 +879,7 @@ ISceneNode* CSceneManager::getSceneNodeFromId(s32 id, ISceneNode* start)
        ISceneNode* node = 0;\r
 \r
        const ISceneNodeList& list = start->getChildren();\r
-       ISceneNodeList::ConstIterator it = list.begin();\r
+       ISceneNodeList::const_iterator it = list.begin();\r
        for (; it!=list.end(); ++it)\r
        {\r
                node = getSceneNodeFromId(id, *it);\r
@@ -903,7 +903,7 @@ ISceneNode* CSceneManager::getSceneNodeFromType(scene::ESCENE_NODE_TYPE type, IS
        ISceneNode* node = 0;\r
 \r
        const ISceneNodeList& list = start->getChildren();\r
-       ISceneNodeList::ConstIterator it = list.begin();\r
+       ISceneNodeList::const_iterator it = list.begin();\r
        for (; it!=list.end(); ++it)\r
        {\r
                node = getSceneNodeFromType(type, *it);\r
@@ -925,7 +925,7 @@ void CSceneManager::getSceneNodesFromType(ESCENE_NODE_TYPE type, core::array<sce
                outNodes.push_back(start);\r
 \r
        const ISceneNodeList& list = start->getChildren();\r
-       ISceneNodeList::ConstIterator it = list.begin();\r
+       ISceneNodeList::const_iterator it = list.begin();\r
 \r
        for (; it!=list.end(); ++it)\r
        {\r