From d5f51270eb7f4cfa0df4b7e585cab31b59058f96 Mon Sep 17 00:00:00 2001 From: Marc Chapman Date: Thu, 27 Jul 2017 00:21:47 +0100 Subject: [PATCH] process-order -- code to help positioning of objects in the process lists. --- Engine/source/T3D/gameBase/processList.cpp | 20 ++++++++++++++++++++ Engine/source/T3D/gameBase/processList.h | 8 ++++++++ 2 files changed, 28 insertions(+) diff --git a/Engine/source/T3D/gameBase/processList.cpp b/Engine/source/T3D/gameBase/processList.cpp index 8e524a205..1fef84fc2 100644 --- a/Engine/source/T3D/gameBase/processList.cpp +++ b/Engine/source/T3D/gameBase/processList.cpp @@ -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& 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; +} diff --git a/Engine/source/T3D/gameBase/processList.h b/Engine/source/T3D/gameBase/processList.h index 67c769e70..0ac4ecb2c 100644 --- a/Engine/source/T3D/gameBase/processList.h +++ b/Engine/source/T3D/gameBase/processList.h @@ -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& objs) const; }; #endif // _PROCESSLIST_H_ \ No newline at end of file