mirror of https://github.com/axmolengine/axmol.git
fix compiling error after fixing conflicts
This commit is contained in:
parent
040c42ebfd
commit
16efe94946
|
@ -51,7 +51,7 @@ void AutoreleasePool::removeObject(Object* object)
|
||||||
{
|
{
|
||||||
for (unsigned int i = 0; i < object->_autoReleaseCount; ++i)
|
for (unsigned int i = 0; i < object->_autoReleaseCount; ++i)
|
||||||
{
|
{
|
||||||
_managedObjectArray.erase(object, false);
|
_managedObjectArray.eraseObject(object, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,13 +37,41 @@ template<class T>
|
||||||
class CC_DLL Vector
|
class CC_DLL Vector
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
// ------------------------------------------
|
||||||
|
// Iterators
|
||||||
|
// ------------------------------------------
|
||||||
|
typedef typename std::vector<T>::iterator iterator;
|
||||||
|
typedef typename std::vector<T>::const_iterator const_iterator;
|
||||||
|
|
||||||
|
typedef typename std::vector<T>::reverse_iterator reverse_iterator;
|
||||||
|
typedef typename std::vector<T>::const_reverse_iterator const_reverse_iterator;
|
||||||
|
|
||||||
|
iterator begin() { return _data.begin(); }
|
||||||
|
const_iterator begin() const { return _data.begin(); }
|
||||||
|
|
||||||
|
iterator end() { return _data.end(); }
|
||||||
|
const_iterator end() const { return _data.end(); }
|
||||||
|
|
||||||
|
const_iterator cbegin() const { return _data.cbegin(); }
|
||||||
|
const_iterator cend() const { return _data.cend(); }
|
||||||
|
|
||||||
|
reverse_iterator rbegin() { return _data.rbegin(); }
|
||||||
|
const_reverse_iterator rbegin() const { return _data.rbegin(); }
|
||||||
|
|
||||||
|
reverse_iterator rend() { return _data.rend(); }
|
||||||
|
const_reverse_iterator rend() const { return _data.rend(); }
|
||||||
|
|
||||||
|
const_reverse_iterator crbegin() const { return _data.crbegin(); }
|
||||||
|
const_reverse_iterator crend() const { return _data.crend(); }
|
||||||
|
|
||||||
|
/** Constructor */
|
||||||
Vector<T>()
|
Vector<T>()
|
||||||
: _data()
|
: _data()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** creates an emptry Vector */
|
/** Constructor with a capacity */
|
||||||
explicit Vector<T>(ssize_t capacity)
|
explicit Vector<T>(ssize_t capacity)
|
||||||
: _data()
|
: _data()
|
||||||
{
|
{
|
||||||
|
@ -51,12 +79,14 @@ public:
|
||||||
reserve(capacity);
|
reserve(capacity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Destructor */
|
||||||
~Vector<T>()
|
~Vector<T>()
|
||||||
{
|
{
|
||||||
CCLOGINFO("In the destructor of Vector.");
|
CCLOGINFO("In the destructor of Vector.");
|
||||||
clear();
|
clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Copy constructor */
|
||||||
Vector<T>(const Vector<T>& other)
|
Vector<T>(const Vector<T>& other)
|
||||||
{
|
{
|
||||||
CCLOGINFO("In the copy constructor!");
|
CCLOGINFO("In the copy constructor!");
|
||||||
|
@ -71,6 +101,7 @@ public:
|
||||||
_data = std::move(other._data);
|
_data = std::move(other._data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Copy assignment operator */
|
||||||
Vector<T>& operator=(const Vector<T>& other)
|
Vector<T>& operator=(const Vector<T>& other)
|
||||||
{
|
{
|
||||||
CCLOGINFO("In the copy assignment operator!");
|
CCLOGINFO("In the copy assignment operator!");
|
||||||
|
@ -80,6 +111,7 @@ public:
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Move assignment operator */
|
||||||
Vector<T>& operator=(Vector<T>&& other)
|
Vector<T>& operator=(Vector<T>&& other)
|
||||||
{
|
{
|
||||||
CCLOGINFO("In the move assignment operator!");
|
CCLOGINFO("In the move assignment operator!");
|
||||||
|
@ -98,65 +130,93 @@ public:
|
||||||
// return _data[index];
|
// return _data[index];
|
||||||
// }
|
// }
|
||||||
|
|
||||||
/** Sets capacity of current array */
|
/** @brief Request a change in capacity
|
||||||
void reserve(ssize_t capacity)
|
* @param capacity Minimum capacity for the vector.
|
||||||
|
* If n is greater than the current vector capacity,
|
||||||
|
* the function causes the container to reallocate its storage increasing its capacity to n (or greater).
|
||||||
|
*/
|
||||||
|
void reserve(ssize_t n)
|
||||||
{
|
{
|
||||||
_data.reserve(capacity);
|
_data.reserve(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns capacity of the array */
|
/** @brief Returns the size of the storage space currently allocated for the vector, expressed in terms of elements.
|
||||||
|
* @note This capacity is not necessarily equal to the vector size.
|
||||||
|
* It can be equal or greater, with the extra space allowing to accommodate for growth without the need to reallocate on each insertion.
|
||||||
|
* @return The size of the currently allocated storage capacity in the vector, measured in terms of the number elements it can hold.
|
||||||
|
*/
|
||||||
ssize_t capacity() const
|
ssize_t capacity() const
|
||||||
{
|
{
|
||||||
return _data.capacity();
|
return _data.capacity();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Querying an Array
|
/** @brief Returns the number of elements in the vector.
|
||||||
|
* @note This is the number of actual objects held in the vector, which is not necessarily equal to its storage capacity.
|
||||||
/** Returns element count of the array */
|
* @return The number of elements in the container.
|
||||||
|
*/
|
||||||
ssize_t size() const
|
ssize_t size() const
|
||||||
{
|
{
|
||||||
return _data.size();
|
return _data.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @brief Returns whether the vector is empty (i.e. whether its size is 0).
|
||||||
|
* @note This function does not modify the container in any way. To clear the content of a vector, see Vector<T>::clear.
|
||||||
|
*/
|
||||||
bool empty() const
|
bool empty() const
|
||||||
{
|
{
|
||||||
return _data.empty();
|
return _data.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Returns the maximum number of elements that the vector can hold. */
|
||||||
|
ssize_t max_size() const
|
||||||
|
{
|
||||||
|
return _data.max_size();
|
||||||
|
}
|
||||||
|
|
||||||
/** Returns index of a certain object, return UINT_MAX if doesn't contain the object */
|
/** Returns index of a certain object, return UINT_MAX if doesn't contain the object */
|
||||||
ssize_t getIndex(T object) const
|
ssize_t getIndex(T object) const
|
||||||
{
|
{
|
||||||
ssize_t i = 0;
|
auto iter = std::find(_data.begin(), _data.end(), object);
|
||||||
for (auto it = _data.begin(); it != _data.end(); ++it, ++i)
|
if (iter != _data.end())
|
||||||
{
|
return iter - _data.begin();
|
||||||
if (*it == object)
|
|
||||||
{
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns an element with a certain index */
|
/** @brief Find the object in the vector.
|
||||||
|
* @return Returns an iterator to the first element in the range [first,last) that compares equal to val.
|
||||||
|
* If no such element is found, the function returns last.
|
||||||
|
*/
|
||||||
|
const_iterator find(T object) const
|
||||||
|
{
|
||||||
|
return std::find(_data.begin(), _data.end(), object);
|
||||||
|
}
|
||||||
|
|
||||||
|
iterator find(T object)
|
||||||
|
{
|
||||||
|
return std::find(_data.begin(), _data.end(), object);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Returns the element at position 'index' in the vector. */
|
||||||
T at(ssize_t index) const
|
T at(ssize_t index) const
|
||||||
{
|
{
|
||||||
CCASSERT( index >= 0 && index < size(), "index out of range in getObjectAtIndex()");
|
CCASSERT( index >= 0 && index < size(), "index out of range in getObjectAtIndex()");
|
||||||
return _data[index];
|
return _data[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Returns the first element in the vector. */
|
||||||
T front() const
|
T front() const
|
||||||
{
|
{
|
||||||
return _data.front();
|
return _data.front();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns the last element of the array */
|
/** Returns the last element of the vector. */
|
||||||
T back() const
|
T back() const
|
||||||
{
|
{
|
||||||
return _data.back();
|
return _data.back();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns a random element */
|
/** Returns a random element of the vector. */
|
||||||
T getRandomObject() const
|
T getRandomObject() const
|
||||||
{
|
{
|
||||||
if (!_data.empty())
|
if (!_data.empty())
|
||||||
|
@ -167,13 +227,13 @@ public:
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns a Boolean value that indicates whether object is present in array. */
|
/** Returns a Boolean value that indicates whether object is present in vector. */
|
||||||
bool contains(T object) const
|
bool contains(T object) const
|
||||||
{
|
{
|
||||||
return( std::find(_data.begin(), _data.end(), object) != _data.end() );
|
return( std::find(_data.begin(), _data.end(), object) != _data.end() );
|
||||||
}
|
}
|
||||||
|
|
||||||
/** returns true if the the arrays are equal */
|
/** Returns true if the two vectors are equal */
|
||||||
bool equals(const Vector<T> &other)
|
bool equals(const Vector<T> &other)
|
||||||
{
|
{
|
||||||
ssize_t s = this->size();
|
ssize_t s = this->size();
|
||||||
|
@ -190,9 +250,13 @@ public:
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Adding Objects
|
// Adds objects
|
||||||
|
|
||||||
/** Add a certain object */
|
/** @brief Adds a new element at the end of the vector, after its current last element.
|
||||||
|
* @note This effectively increases the container size by one,
|
||||||
|
* which causes an automatic reallocation of the allocated storage space
|
||||||
|
* if -and only if- the new vector size surpasses the current vector capacity.
|
||||||
|
*/
|
||||||
void pushBack(T object)
|
void pushBack(T object)
|
||||||
{
|
{
|
||||||
CCASSERT(object != nullptr, "The object should not be nullptr");
|
CCASSERT(object != nullptr, "The object should not be nullptr");
|
||||||
|
@ -200,7 +264,7 @@ public:
|
||||||
object->retain();
|
object->retain();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Add all elements of an existing array */
|
/** Inserts all elements of an existing vector */
|
||||||
void insert(const Vector<T>& other)
|
void insert(const Vector<T>& other)
|
||||||
{
|
{
|
||||||
for( auto it = other.begin(); it != other.end(); ++it ) {
|
for( auto it = other.begin(); it != other.end(); ++it ) {
|
||||||
|
@ -209,7 +273,12 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Insert a certain object at a certain index */
|
/** @brief Insert a certain object at a certain index
|
||||||
|
* @note The vector is extended by inserting new elements before the element at the specified 'index',
|
||||||
|
* effectively increasing the container size by the number of elements inserted.
|
||||||
|
* This causes an automatic reallocation of the allocated storage space
|
||||||
|
* if -and only if- the new vector size surpasses the current vector capacity.
|
||||||
|
*/
|
||||||
void insert(ssize_t index, T object)
|
void insert(ssize_t index, T object)
|
||||||
{
|
{
|
||||||
CCASSERT(index >= 0 && index <= size(), "Invalid index!");
|
CCASSERT(index >= 0 && index <= size(), "Invalid index!");
|
||||||
|
@ -218,9 +287,11 @@ public:
|
||||||
object->retain();
|
object->retain();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Removing Objects
|
// Removes Objects
|
||||||
|
|
||||||
/** Remove last object */
|
/** Removes the last element in the vector,
|
||||||
|
* effectively reducing the container size by one, decrease the referece count of the deleted object.
|
||||||
|
*/
|
||||||
void popBack()
|
void popBack()
|
||||||
{
|
{
|
||||||
CCASSERT(!_data.empty(), "no objects added");
|
CCASSERT(!_data.empty(), "no objects added");
|
||||||
|
@ -228,9 +299,12 @@ public:
|
||||||
_data.pop_back();
|
_data.pop_back();
|
||||||
last->release();
|
last->release();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Remove a certain object */
|
/** @brief Remove a certain object.
|
||||||
void removeObject(T object, bool toRelease = true)
|
* @param object The object to be removed.
|
||||||
|
* @param toRelease Whether to decrease the referece count of the deleted object.
|
||||||
|
*/
|
||||||
|
void eraseObject(T object, bool toRelease = true)
|
||||||
{
|
{
|
||||||
CCASSERT(object != nullptr, "The object should not be nullptr");
|
CCASSERT(object != nullptr, "The object should not be nullptr");
|
||||||
auto iter = std::find(_data.begin(), _data.end(), object);
|
auto iter = std::find(_data.begin(), _data.end(), object);
|
||||||
|
@ -240,16 +314,50 @@ public:
|
||||||
object->release();
|
object->release();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Removes an element with a certain index */
|
/** @brief Removes from the vector with an iterator.
|
||||||
void remove(ssize_t index)
|
* @param position Iterator pointing to a single element to be removed from the vector.
|
||||||
|
* @return An iterator pointing to the new location of the element that followed the last element erased by the function call.
|
||||||
|
* This is the container end if the operation erased the last element in the sequence.
|
||||||
|
*/
|
||||||
|
iterator erase(iterator position)
|
||||||
|
{
|
||||||
|
CCASSERT(position >= _data.begin() && position < _data.end(), "Invalid position!");
|
||||||
|
(*position)->release();
|
||||||
|
return _data.erase(position);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @brief Removes from the vector with a range of elements ( [first, last) ).
|
||||||
|
* @param first The beginning of the range
|
||||||
|
* @param last The end of the range, the 'last' will not used, it's only for indicating the end of range.
|
||||||
|
* @return An iterator pointing to the new location of the element that followed the last element erased by the function call.
|
||||||
|
* This is the container end if the operation erased the last element in the sequence.
|
||||||
|
*/
|
||||||
|
iterator erase(const_iterator first, const_iterator last)
|
||||||
|
{
|
||||||
|
for (auto iter = first; iter != last; ++iter)
|
||||||
|
{
|
||||||
|
(*iter)->release();
|
||||||
|
}
|
||||||
|
|
||||||
|
return _data.erase(first, last);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @brief Removes from the vector with an index.
|
||||||
|
* @param index The index of the element to be removed from the vector.
|
||||||
|
* @return An iterator pointing to the new location of the element that followed the last element erased by the function call.
|
||||||
|
* This is the container end if the operation erased the last element in the sequence.
|
||||||
|
*/
|
||||||
|
iterator erase(ssize_t index)
|
||||||
{
|
{
|
||||||
CCASSERT(!_data.empty() && index >=0 && index < size(), "Invalid index!");
|
CCASSERT(!_data.empty() && index >=0 && index < size(), "Invalid index!");
|
||||||
auto it = std::next( begin(), index );
|
auto it = std::next( begin(), index );
|
||||||
(*it)->release();
|
(*it)->release();
|
||||||
_data.erase(it);
|
return _data.erase(it);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Removes all objects */
|
/** @brief Removes all elements from the vector (which are destroyed), leaving the container with a size of 0.
|
||||||
|
* @note All the elements in the vector will be released (referece count will be decreased).
|
||||||
|
*/
|
||||||
void clear()
|
void clear()
|
||||||
{
|
{
|
||||||
for( auto it = std::begin(_data); it != std::end(_data); ++it ) {
|
for( auto it = std::begin(_data); it != std::end(_data); ++it ) {
|
||||||
|
@ -263,8 +371,8 @@ public:
|
||||||
/** Swap two elements */
|
/** Swap two elements */
|
||||||
void swap(T object1, T object2)
|
void swap(T object1, T object2)
|
||||||
{
|
{
|
||||||
auto idx1 = getIndex(object1);
|
ssize_t idx1 = getIndex(object1);
|
||||||
auto idx2 = getIndex(object2);
|
ssize_t idx2 = getIndex(object2);
|
||||||
|
|
||||||
CCASSERT(idx1>=0 && idx2>=0, "invalid object index");
|
CCASSERT(idx1>=0 && idx2>=0, "invalid object index");
|
||||||
|
|
||||||
|
@ -290,18 +398,19 @@ public:
|
||||||
object->retain();
|
object->retain();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** reverses the array */
|
/** reverses the vector */
|
||||||
void reverse()
|
void reverse()
|
||||||
{
|
{
|
||||||
std::reverse( std::begin(_data), std::end(_data) );
|
std::reverse( std::begin(_data), std::end(_data) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Shrinks the array so the memory footprint corresponds with the number of items */
|
/** Shrinks the vector so the memory footprint corresponds with the number of items */
|
||||||
void shrinkToFit()
|
void shrinkToFit()
|
||||||
{
|
{
|
||||||
_data.shrink_to_fit();
|
_data.shrink_to_fit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Traverses through the vector and applys the callback function for each element */
|
||||||
void forEach(const std::function<void(T)>& callback)
|
void forEach(const std::function<void(T)>& callback)
|
||||||
{
|
{
|
||||||
if (empty())
|
if (empty())
|
||||||
|
@ -312,6 +421,7 @@ public:
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Traverses through the vector and applys the callback function for each element */
|
||||||
void forEach(const std::function<void(T)>& callback) const
|
void forEach(const std::function<void(T)>& callback) const
|
||||||
{
|
{
|
||||||
if (empty())
|
if (empty())
|
||||||
|
@ -322,6 +432,7 @@ public:
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Traverses through the vector in reversed order and applys the callback function for each element */
|
||||||
void forEachReverse(const std::function<void(T)>& callback)
|
void forEachReverse(const std::function<void(T)>& callback)
|
||||||
{
|
{
|
||||||
if (empty())
|
if (empty())
|
||||||
|
@ -332,6 +443,7 @@ public:
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Traverses through the vector in reversed order and applys the callback function for each element */
|
||||||
void forEachReverse(const std::function<void(T)>& callback) const
|
void forEachReverse(const std::function<void(T)>& callback) const
|
||||||
{
|
{
|
||||||
if (empty())
|
if (empty())
|
||||||
|
@ -342,6 +454,11 @@ public:
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @brief Sorts all elements in the vector according the binary callback function.
|
||||||
|
* @param callback Binary function that accepts two elements in the vector as arguments,
|
||||||
|
* and returns a value convertible to bool.
|
||||||
|
* The value returned indicates whether the element passed as first argument is considered to go before the second in the specific strict weak ordering it defines.
|
||||||
|
*/
|
||||||
void sort(const std::function<bool(T, T)>& callback)
|
void sort(const std::function<bool(T, T)>& callback)
|
||||||
{
|
{
|
||||||
if (empty())
|
if (empty())
|
||||||
|
@ -352,35 +469,9 @@ public:
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------
|
|
||||||
// Iterators
|
|
||||||
// ------------------------------------------
|
|
||||||
typedef typename std::vector<T>::iterator iterator;
|
|
||||||
typedef typename std::vector<T>::const_iterator const_iterator;
|
|
||||||
|
|
||||||
typedef typename std::vector<T>::reverse_iterator reverse_iterator;
|
|
||||||
typedef typename std::vector<T>::const_reverse_iterator const_reverse_iterator;
|
|
||||||
|
|
||||||
iterator begin() { return _data.begin(); }
|
|
||||||
const_iterator begin() const { return _data.begin(); }
|
|
||||||
|
|
||||||
iterator end() { return _data.end(); }
|
|
||||||
const_iterator end() const { return _data.end(); }
|
|
||||||
|
|
||||||
const_iterator cbegin() const { return _data.cbegin(); }
|
|
||||||
const_iterator cend() const { return _data.cend(); }
|
|
||||||
|
|
||||||
reverse_iterator rbegin() { return _data.rbegin(); }
|
|
||||||
const_reverse_iterator rbegin() const { return _data.rbegin(); }
|
|
||||||
|
|
||||||
reverse_iterator rend() { return _data.rend(); }
|
|
||||||
const_reverse_iterator rend() const { return _data.rend(); }
|
|
||||||
|
|
||||||
const_reverse_iterator crbegin() const { return _data.crbegin(); }
|
|
||||||
const_reverse_iterator crend() const { return _data.crend(); }
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
/** Retains all the objects in the vector */
|
||||||
void addRefForAllObjects()
|
void addRefForAllObjects()
|
||||||
{
|
{
|
||||||
std::for_each(_data.begin(), _data.end(), [](T obj){
|
std::for_each(_data.begin(), _data.end(), [](T obj){
|
||||||
|
|
|
@ -312,7 +312,7 @@ void Armature::changeBoneParent(Bone *bone, const char *parentName)
|
||||||
|
|
||||||
if(bone->getParentBone())
|
if(bone->getParentBone())
|
||||||
{
|
{
|
||||||
bone->getParentBone()->getChildren().erase(bone);
|
bone->getParentBone()->getChildren().eraseObject(bone);
|
||||||
bone->setParentBone(nullptr);
|
bone->setParentBone(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -334,7 +334,7 @@ void Bone::removeChildBone(Bone *bone, bool recursion)
|
||||||
|
|
||||||
bone->getDisplayManager()->setCurrentDecorativeDisplay(nullptr);
|
bone->getDisplayManager()->setCurrentDecorativeDisplay(nullptr);
|
||||||
|
|
||||||
_children.erase(bone);
|
_children.eraseObject(bone);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -672,7 +672,7 @@ void PhysicsBody::removeShape(PhysicsShape* shape, bool reduceMassAndMoment/* =
|
||||||
// set shape->_body = nullptr make the shape->setBody will not trigger the _body->removeShape function call.
|
// set shape->_body = nullptr make the shape->setBody will not trigger the _body->removeShape function call.
|
||||||
shape->_body = nullptr;
|
shape->_body = nullptr;
|
||||||
shape->setBody(nullptr);
|
shape->setBody(nullptr);
|
||||||
_shapes.erase(shape);
|
_shapes.eraseObject(shape);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -714,7 +714,7 @@ void PhysicsWorld::removeBody(PhysicsBody* body)
|
||||||
body->_joints.clear();
|
body->_joints.clear();
|
||||||
|
|
||||||
removeBodyOrDelay(body);
|
removeBodyOrDelay(body);
|
||||||
_bodies.erase(body);
|
_bodies.eraseObject(body);
|
||||||
body->_world = nullptr;
|
body->_world = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -723,7 +723,7 @@ void PhysicsWorld::removeBodyOrDelay(PhysicsBody* body)
|
||||||
{
|
{
|
||||||
if (_delayAddBodies.getIndex(body) != CC_INVALID_INDEX)
|
if (_delayAddBodies.getIndex(body) != CC_INVALID_INDEX)
|
||||||
{
|
{
|
||||||
_delayAddBodies.erase(body);
|
_delayAddBodies.eraseObject(body);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -207,7 +207,7 @@ void Control::removeTargetWithActionForControlEvent(Object* target, Handler acti
|
||||||
// Remove the corresponding invocation object
|
// Remove the corresponding invocation object
|
||||||
if (shouldBeRemoved)
|
if (shouldBeRemoved)
|
||||||
{
|
{
|
||||||
eventInvocationList.erase(invocation, bDeleteObjects);
|
eventInvocationList.eraseObject(invocation, bDeleteObjects);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -397,7 +397,7 @@ void TableView::_moveCellOutOfSight(TableViewCell *cell)
|
||||||
}
|
}
|
||||||
|
|
||||||
_cellsFreed.pushBack(cell);
|
_cellsFreed.pushBack(cell);
|
||||||
_cellsUsed.erase(cell);
|
_cellsUsed.eraseObject(cell);
|
||||||
_isUsedCellsDirty = true;
|
_isUsedCellsDirty = true;
|
||||||
|
|
||||||
_indices->erase(cell->getIdx());
|
_indices->erase(cell->getIdx());
|
||||||
|
|
Loading…
Reference in New Issue