MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / registerObject

Method registerObject

Engine/source/console/simObject.cpp:592–624  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

590//-----------------------------------------------------------------------------
591
592bool SimObject::registerObject()
593{
594 AssertFatal( !mFlags.test( Added ), "reigsterObject - Object already registered!");
595 mFlags.clear(Deleted | Removed);
596
597 if(smForceId)
598 {
599 setId(smForcedId);
600 smForceId = false;
601 }
602
603 if( !mId )
604 {
605 mId = Sim::gNextObjectId++;
606 dSprintf( mIdString, sizeof( mIdString ), "%u", mId );
607 }
608
609 AssertFatal(Sim::gIdDictionary && Sim::gNameDictionary,
610 "SimObject::registerObject - tried to register an object before Sim::init()!");
611
612 Sim::gIdDictionary->insert(this);
613
614 Sim::gNameDictionary->insert(this);
615
616 // Notify object
617 bool ret = onAdd();
618
619 if(!ret)
620 unregisterObject();
621
622 AssertFatal(!ret || isProperlyAdded(), "Object did not call SimObject::onAdd()");
623 return ret;
624}
625
626//-----------------------------------------------------------------------------
627

Callers 11

cloneMethod · 0.45
simObject.cppFile · 0.45
execMethod · 0.45
exportXMLMethod · 0.45
loadObjectStreamFunction · 0.45
SimObjectClass · 0.45
initRootFunction · 0.45
initFunction · 0.45
TESTFunction · 0.45
TESTFunction · 0.45

Calls 4

dSprintfFunction · 0.85
testMethod · 0.45
clearMethod · 0.45
insertMethod · 0.45

Tested by 2

TESTFunction · 0.36
TESTFunction · 0.36