mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-05 13:30:34 +00:00
simset::objectList to simset::mObjectList
This commit is contained in:
parent
886dcbaac5
commit
9298d889b3
5 changed files with 47 additions and 47 deletions
|
|
@ -612,6 +612,6 @@ void SimDataBlockGroup::sort()
|
|||
if(mLastModifiedKey != SimDataBlock::getNextModifiedKey())
|
||||
{
|
||||
mLastModifiedKey = SimDataBlock::getNextModifiedKey();
|
||||
dQsort(objectList.address(),objectList.size(),sizeof(SimObject *),compareModifiedKey);
|
||||
dQsort(mObjectList.address(), mObjectList.size(),sizeof(SimObject *),compareModifiedKey);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ IMPLEMENT_CALLBACK( SimSet, onObjectRemoved, void, ( SimObject* object ), ( obje
|
|||
|
||||
SimSet::SimSet()
|
||||
{
|
||||
VECTOR_SET_ASSOCIATION( objectList );
|
||||
VECTOR_SET_ASSOCIATION(mObjectList);
|
||||
mMutex = Mutex::createMutex();
|
||||
}
|
||||
|
||||
|
|
@ -139,7 +139,7 @@ void SimSet::addObject( SimObject* obj )
|
|||
|
||||
lock();
|
||||
|
||||
const bool added = objectList.pushBack( obj );
|
||||
const bool added = mObjectList.pushBack( obj );
|
||||
if( added )
|
||||
deleteNotify( obj );
|
||||
|
||||
|
|
@ -159,7 +159,7 @@ void SimSet::removeObject( SimObject* obj )
|
|||
{
|
||||
lock();
|
||||
|
||||
const bool removed = objectList.remove( obj );
|
||||
const bool removed = mObjectList.remove( obj );
|
||||
if( removed )
|
||||
clearNotify( obj );
|
||||
|
||||
|
|
@ -182,7 +182,7 @@ void SimSet::pushObject( SimObject* obj )
|
|||
|
||||
lock();
|
||||
|
||||
bool added = objectList.pushBackForce( obj );
|
||||
bool added = mObjectList.pushBackForce( obj );
|
||||
if( added )
|
||||
deleteNotify( obj );
|
||||
|
||||
|
|
@ -200,15 +200,15 @@ void SimSet::pushObject( SimObject* obj )
|
|||
|
||||
void SimSet::popObject()
|
||||
{
|
||||
if( objectList.empty() )
|
||||
if(mObjectList.empty() )
|
||||
{
|
||||
AssertWarn(false, "Stack underflow in SimSet::popObject");
|
||||
return;
|
||||
}
|
||||
|
||||
lock();
|
||||
SimObject* object = objectList.last();
|
||||
objectList.pop_back();
|
||||
SimObject* object = mObjectList.last();
|
||||
mObjectList.pop_back();
|
||||
|
||||
clearNotify( object );
|
||||
unlock();
|
||||
|
|
@ -223,7 +223,7 @@ void SimSet::popObject()
|
|||
void SimSet::scriptSort( const String &scriptCallbackFn )
|
||||
{
|
||||
lock();
|
||||
objectList.scriptSort( scriptCallbackFn );
|
||||
mObjectList.scriptSort( scriptCallbackFn );
|
||||
unlock();
|
||||
}
|
||||
|
||||
|
|
@ -303,8 +303,8 @@ bool SimSet::reOrder( SimObject *obj, SimObject *target )
|
|||
if ( itrS != (end()-1) )
|
||||
{
|
||||
// remove object from its current location and push to back of list
|
||||
objectList.erase(itrS);
|
||||
objectList.push_back(obj);
|
||||
mObjectList.erase(itrS);
|
||||
mObjectList.push_back(obj);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -314,12 +314,12 @@ bool SimSet::reOrder( SimObject *obj, SimObject *target )
|
|||
// target must be in list
|
||||
return false;
|
||||
|
||||
objectList.erase(itrS);
|
||||
mObjectList.erase(itrS);
|
||||
|
||||
// once itrS has been erased, itrD won't be pointing at the
|
||||
// same place anymore - re-find...
|
||||
itrD = find(begin(),end(),target);
|
||||
objectList.insert(itrD, obj);
|
||||
mObjectList.insert(itrD, obj);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
@ -340,15 +340,15 @@ void SimSet::onRemove()
|
|||
MutexHandle handle;
|
||||
handle.lock( mMutex );
|
||||
|
||||
if( !objectList.empty() )
|
||||
if( !mObjectList.empty() )
|
||||
{
|
||||
objectList.sortId();
|
||||
mObjectList.sortId();
|
||||
|
||||
// This backwards iterator loop doesn't work if the
|
||||
// list is empty, check the size first.
|
||||
|
||||
for( SimObjectList::iterator ptr = objectList.end() - 1;
|
||||
ptr >= objectList.begin(); ptr -- )
|
||||
for( SimObjectList::iterator ptr = mObjectList.end() - 1;
|
||||
ptr >= mObjectList.begin(); ptr -- )
|
||||
clearNotify( *ptr );
|
||||
}
|
||||
|
||||
|
|
@ -417,8 +417,8 @@ void SimSet::deleteAllObjects()
|
|||
lock();
|
||||
while( !empty() )
|
||||
{
|
||||
SimObject* object = objectList.last();
|
||||
objectList.pop_back();
|
||||
SimObject* object = mObjectList.last();
|
||||
mObjectList.pop_back();
|
||||
|
||||
object->deleteObject();
|
||||
}
|
||||
|
|
@ -536,7 +536,7 @@ SimObject* SimSet::findObjectByLineNumber(const char* fileName, S32 declarationL
|
|||
SimObject* SimSet::getRandom()
|
||||
{
|
||||
if (size() > 0)
|
||||
return objectList[mRandI(0, size() - 1)];
|
||||
return mObjectList[mRandI(0, size() - 1)];
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -640,7 +640,7 @@ void SimGroup::_addObject( SimObject* obj, bool forcePushBack )
|
|||
if( obj->getGroup() )
|
||||
obj->getGroup()->removeObject( obj );
|
||||
|
||||
if( forcePushBack ? objectList.pushBack( obj ) : objectList.pushBackForce( obj ) )
|
||||
if( forcePushBack ? mObjectList.pushBack( obj ) : mObjectList.pushBackForce( obj ) )
|
||||
{
|
||||
mNameDictionary.insert( obj );
|
||||
obj->mGroup = this;
|
||||
|
|
@ -685,7 +685,7 @@ void SimGroup::_removeObjectNoLock( SimObject* obj )
|
|||
obj->onGroupRemove();
|
||||
|
||||
mNameDictionary.remove( obj );
|
||||
objectList.remove( obj );
|
||||
mObjectList.remove( obj );
|
||||
obj->mGroup = 0;
|
||||
|
||||
getSetModificationSignal().trigger( SetObjectRemoved, this, obj );
|
||||
|
|
@ -709,14 +709,14 @@ void SimGroup::popObject()
|
|||
MutexHandle handle;
|
||||
handle.lock( mMutex );
|
||||
|
||||
if( objectList.empty() )
|
||||
if(mObjectList.empty() )
|
||||
{
|
||||
AssertWarn( false, "SimGroup::popObject - Stack underflow" );
|
||||
return;
|
||||
}
|
||||
|
||||
SimObject* object = objectList.last();
|
||||
objectList.pop_back();
|
||||
SimObject* object = mObjectList.last();
|
||||
mObjectList.pop_back();
|
||||
|
||||
object->onGroupRemove();
|
||||
object->mGroup = NULL;
|
||||
|
|
@ -736,9 +736,9 @@ void SimGroup::popObject()
|
|||
void SimGroup::onRemove()
|
||||
{
|
||||
lock();
|
||||
if( !objectList.empty() )
|
||||
if( !mObjectList.empty() )
|
||||
{
|
||||
objectList.sortId();
|
||||
mObjectList.sortId();
|
||||
clear();
|
||||
}
|
||||
SimObject::onRemove();
|
||||
|
|
@ -752,10 +752,10 @@ void SimGroup::clear()
|
|||
lock();
|
||||
while( size() > 0 )
|
||||
{
|
||||
SimObject* object = objectList.last();
|
||||
SimObject* object = mObjectList.last();
|
||||
object->onGroupRemove();
|
||||
|
||||
objectList.pop_back();
|
||||
mObjectList.pop_back();
|
||||
mNameDictionary.remove( object );
|
||||
object->mGroup = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ class SimSet : public SimObject, public TamlChildren
|
|||
|
||||
protected:
|
||||
|
||||
SimObjectList objectList;
|
||||
SimObjectList mObjectList;
|
||||
void *mMutex;
|
||||
|
||||
/// Signal that is triggered when objects are added or removed from the set.
|
||||
|
|
@ -144,14 +144,14 @@ class SimSet : public SimObject, public TamlChildren
|
|||
///
|
||||
typedef SimObjectList::iterator iterator;
|
||||
typedef SimObjectList::value_type value;
|
||||
SimObject* front() { return objectList.front(); }
|
||||
SimObject* first() { return objectList.first(); }
|
||||
SimObject* last() { return objectList.last(); }
|
||||
bool empty() const { return objectList.empty(); }
|
||||
S32 size() const { return objectList.size(); }
|
||||
iterator begin() { return objectList.begin(); }
|
||||
iterator end() { return objectList.end(); }
|
||||
value operator[] (S32 index) { return objectList[U32(index)]; }
|
||||
SimObject* front() { return mObjectList.front(); }
|
||||
SimObject* first() { return mObjectList.first(); }
|
||||
SimObject* last() { return mObjectList.last(); }
|
||||
bool empty() const { return mObjectList.empty(); }
|
||||
S32 size() const { return mObjectList.size(); }
|
||||
iterator begin() { return mObjectList.begin(); }
|
||||
iterator end() { return mObjectList.end(); }
|
||||
value operator[] (S32 index) { return mObjectList[U32(index)]; }
|
||||
|
||||
inline iterator find( iterator first, iterator last, SimObject *obj)
|
||||
{ return ::find(first, last, obj); }
|
||||
|
|
@ -163,7 +163,7 @@ class SimSet : public SimObject, public TamlChildren
|
|||
virtual bool reOrder( SimObject *obj, SimObject *target=0 );
|
||||
|
||||
/// Return the object at the given index.
|
||||
SimObject* at(S32 index) const { return objectList.at(index); }
|
||||
SimObject* at(S32 index) const { return mObjectList.at(index); }
|
||||
|
||||
/// Remove all objects from this set.
|
||||
virtual void clear();
|
||||
|
|
@ -263,7 +263,7 @@ class SimSet : public SimObject, public TamlChildren
|
|||
#ifdef TORQUE_DEBUG_GUARD
|
||||
inline void _setVectorAssoc( const char *file, const U32 line )
|
||||
{
|
||||
objectList.setFileAssociation( file, line );
|
||||
mObjectList.setFileAssociation( file, line );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -324,9 +324,9 @@ void SimSet::findObjectByType( Vector<T*> &foundObjects )
|
|||
|
||||
// Loop through our child objects.
|
||||
|
||||
SimObjectList::iterator itr = objectList.begin();
|
||||
SimObjectList::iterator itr = mObjectList.begin();
|
||||
|
||||
for ( ; itr != objectList.end(); itr++ )
|
||||
for ( ; itr != mObjectList.end(); itr++ )
|
||||
{
|
||||
curObj = dynamic_cast<T*>( *itr );
|
||||
curSet = dynamic_cast<SimSet*>( *itr );
|
||||
|
|
@ -358,9 +358,9 @@ void SimSet::findObjectByCallback( bool ( *fn )( T* ), Vector<T*> &foundObjects
|
|||
|
||||
// Loop through our child objects.
|
||||
|
||||
SimObjectList::iterator itr = objectList.begin();
|
||||
SimObjectList::iterator itr = mObjectList.begin();
|
||||
|
||||
for ( ; itr != objectList.end(); itr++ )
|
||||
for ( ; itr != mObjectList.end(); itr++ )
|
||||
{
|
||||
curObj = dynamic_cast<T*>( *itr );
|
||||
curSet = dynamic_cast<SimSet*>( *itr );
|
||||
|
|
|
|||
|
|
@ -172,8 +172,8 @@ SimGroup* ForestBrush::getGroup()
|
|||
|
||||
bool ForestBrush::containsItemData( const ForestItemData *inData )
|
||||
{
|
||||
SimObjectList::iterator iter = objectList.begin();
|
||||
for ( ; iter != objectList.end(); iter++ )
|
||||
SimObjectList::iterator iter = mObjectList.begin();
|
||||
for ( ; iter != mObjectList.end(); iter++ )
|
||||
{
|
||||
ForestBrushElement *pElement = dynamic_cast<ForestBrushElement*>(*iter);
|
||||
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ void Path::onRemove()
|
|||
/// Sort the markers objects into sequence order
|
||||
void Path::sortMarkers()
|
||||
{
|
||||
dQsort(objectList.address(), objectList.size(), sizeof(SimObject*), cmpPathObject);
|
||||
dQsort(mObjectList.address(), mObjectList.size(), sizeof(SimObject*), cmpPathObject);
|
||||
}
|
||||
|
||||
void Path::updatePath()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue