process-order -- code to help positioning of objects in the process lists.

This commit is contained in:
Marc Chapman 2017-07-27 00:21:47 +01:00
parent 62500487f1
commit 8c65467697
2 changed files with 28 additions and 0 deletions

View file

@ -20,6 +20,11 @@
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
// Arcane-FX for MIT Licensed Open Source version of Torque 3D from GarageGames
// Copyright (C) 2015 Faust Logic, Inc.
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
#include "platform/platform.h"
#include "T3D/gameBase/processList.h"
@ -284,5 +289,20 @@ void ProcessList::advanceObjects()
PROFILE_END();
}
ProcessObject* ProcessList::findNearestToEnd(Vector<ProcessObject*>& objs) const
{
if (objs.empty())
return 0;
for (ProcessObject* obj = mHead.mProcessLink.prev; obj != &mHead; obj = obj->mProcessLink.prev)
{
for (S32 i = 0; i < objs.size(); i++)
{
if (obj == objs[i])
return obj;
}
}
return 0;
}

View file

@ -20,6 +20,11 @@
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
// Arcane-FX for MIT Licensed Open Source version of Torque 3D from GarageGames
// Copyright (C) 2015 Faust Logic, Inc.
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
#ifndef _PROCESSLIST_H_
#define _PROCESSLIST_H_
@ -188,6 +193,9 @@ protected:
PreTickSignal mPreTick;
PostTickSignal mPostTick;
// JTF: still needed?
public:
ProcessObject* findNearestToEnd(Vector<ProcessObject*>& objs) const;
};
#endif // _PROCESSLIST_H_