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

Method registerObject

Engine/source/console/simObject.cpp:642–674  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

640//-----------------------------------------------------------------------------
641
642bool SimObject::registerObject()
643{
644 AssertFatal( !mFlags.test( Added ), "reigsterObject - Object already registered!");
645 mFlags.clear(Deleted | Removed);
646
647 if(smForceId)
648 {
649 setId(smForcedId);
650 smForceId = false;
651 }
652
653 if( !mId )
654 {
655 mId = Sim::gNextObjectId++;
656 dSprintf( mIdString, sizeof( mIdString ), "%u", mId );
657 }
658
659 AssertFatal(Sim::gIdDictionary && Sim::gNameDictionary,
660 "SimObject::registerObject - tried to register an object before Sim::init()!");
661
662 Sim::gIdDictionary->insert(this);
663
664 Sim::gNameDictionary->insert(this);
665
666 // Notify object
667 bool ret = onAdd();
668
669 if(!ret)
670 unregisterObject();
671
672 AssertFatal(!ret || isProperlyAdded(), "Object did not call SimObject::onAdd()");
673 return ret;
674}
675
676//-----------------------------------------------------------------------------
677

Callers 10

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

Calls 5

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

Tested by 2

TESTFunction · 0.36
TESTFunction · 0.36