mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-22 13:50:53 +00:00
backup
WeakRefBase is now threadsafe and uses an actual weak_ptr to drive its logic, strongrefbase is next.
This commit is contained in:
parent
1fed963d82
commit
f1f09efbfa
6 changed files with 120 additions and 62 deletions
|
|
@ -290,6 +290,7 @@ static void initRoot()
|
|||
gNameDictionary = new SimManagerNameDictionary;
|
||||
sgStreamingInstance = new SceneStreaming;
|
||||
sgStreamingInstance->smStreaming = false;
|
||||
|
||||
gRootGroup = new SimGroup();
|
||||
gRootGroup->incRefCount();
|
||||
|
||||
|
|
@ -631,20 +632,28 @@ void SimDataBlockGroup::sort()
|
|||
|
||||
void SceneStreaming::processTick()
|
||||
{
|
||||
if (true)
|
||||
if (smPendingRegister.empty())
|
||||
return;
|
||||
|
||||
U32 start = Platform::getRealMilliseconds();
|
||||
|
||||
while (!smPendingRegister.empty())
|
||||
{
|
||||
for (U32 i = 0; i < mMaxObjects && !smPendingRegister.empty(); i++)
|
||||
{
|
||||
SimObject* obj = smPendingRegister.first();
|
||||
smPendingRegister.pop_front();
|
||||
SimObject* obj = smPendingRegister.first();
|
||||
smPendingRegister.pop_front();
|
||||
|
||||
Sim::gIdDictionary->insert(obj);
|
||||
Sim::gIdDictionary->insert(obj);
|
||||
|
||||
Sim::gNameDictionary->insert(obj);
|
||||
Sim::gNameDictionary->insert(obj);
|
||||
|
||||
|
||||
if (!obj->onAdd())
|
||||
obj->unregisterObject();
|
||||
}
|
||||
if (!obj->onAdd())
|
||||
obj->unregisterObject();
|
||||
|
||||
U32 now = Platform::getRealMilliseconds();
|
||||
if ((now - start) >= 2)
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@
|
|||
#include "scene/sceneObject.h"
|
||||
#include "T3D/camera.h"
|
||||
#include "T3D/player.h"
|
||||
#include "T3D/gameBase/gameConnection.h"
|
||||
|
||||
ImplementBitfieldType(GameTypeMasksType,
|
||||
"The type of animation effect to apply to this material.\n"
|
||||
|
|
@ -725,9 +726,7 @@ bool SimObject::registerObject()
|
|||
AssertFatal(Sim::gIdDictionary && Sim::gNameDictionary,
|
||||
"SimObject::registerObject - tried to register an object before Sim::init()!");
|
||||
|
||||
|
||||
if (true && dynamic_cast<SceneObject*>(this) &&
|
||||
!(dynamic_cast<Camera*>(this) || dynamic_cast<Player*>(this)) &&
|
||||
if (Sim::sgStreamingInstance->smStreaming && dynamic_cast<SceneObject*>(this) &&
|
||||
!gEditingMission
|
||||
)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -609,6 +609,7 @@ class SimObject: public ConsoleObject, public TamlCallbacks
|
|||
|
||||
/// @name Events
|
||||
/// @{
|
||||
//virtual void onPrepare();
|
||||
|
||||
/// Called when the object is added to the sim.
|
||||
virtual bool onAdd();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue