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

Function sResolve

Engine/source/sfx/sfxTypes.cpp:72–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70}
71template< class T >
72inline bool sResolve( T** ptr, String& errorString )
73{
74 if( !*ptr )
75 return true;
76 else if( *reinterpret_cast< U32* >( ptr ) & 0x1 )
77 {
78 U32 id = *reinterpret_cast< U32* >( ptr ) >> 1;
79
80 T* p;
81 if( !Sim::findObject( id, p ) )
82 {
83 errorString = String::ToString( "sfxResolve - Could not resolve networked %s datalock with id '%i'",
84 T::getStaticClassRep()->getClassName(), id );
85 *ptr = NULL;
86 return false;
87 }
88
89 *ptr = p;
90 }
91 else
92 {
93 StringTableEntry name = *( ( StringTableEntry* ) ptr );
94
95 T* p;
96 if( !Sim::findObject( name, p ) )
97 {
98 errorString = String::ToString( "sfxResolve - Could not resolve local %s datablock with name '%s'",
99 T::getStaticClassRep()->getClassName(), name );
100 *ptr = NULL;
101 return false;
102 }
103
104 *ptr = p;
105 }
106
107 return true;
108}
109
110
111//=============================================================================

Callers 1

sfxResolveFunction · 0.85

Calls 2

findObjectFunction · 0.50
getClassNameMethod · 0.45

Tested by

no test coverage detected