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

Method process

Engine/source/console/simEvents.cpp:58–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58void SimConsoleEvent::process(SimObject* object)
59{
60 // #ifdef DEBUG
61 // Con::printf("Executing schedule: %d", sequenceCount);
62 // #endif
63 if(mOnObject)
64 Con::execute(object, mArgc, mArgv );
65 else
66 {
67 // Grab the function name. If '::' doesn't exist, then the schedule is
68 // on a global function.
69 char funcName[256];
70 dStrncpy(funcName, (const char*)mArgv[0], 256);
71 char* func = dStrstr( funcName, (char*)"::" );
72 if( func )
73 {
74 // Set the first colon to NULL, so we can reference the namespace.
75 // This is okay because events are deleted immediately after
76 // processing. Maybe a bad idea anyway?
77 func[0] = '\0';
78
79 // Move the pointer forward to the function name.
80 func += 2;
81
82 // Lookup the namespace and function entry.
83 Namespace* ns = Namespace::find( StringTable->insert( funcName ) );
84 if( ns )
85 {
86 Namespace::Entry* nse = ns->lookup( StringTable->insert( func ) );
87 if( nse )
88 // Execute.
89 nse->execute( mArgc, mArgv, &gEvalState );
90 }
91 }
92
93 else
94 Con::execute(mArgc, mArgv );
95 }
96}
97
98void SimConsoleEvent::populateArgs(ConsoleValueRef *argv)
99{

Callers 1

advanceToTimeFunction · 0.45

Calls 8

executeFunction · 0.85
dStrncpyFunction · 0.85
dStrstrFunction · 0.85
findFunction · 0.85
insertMethod · 0.45
lookupMethod · 0.45
executeMethod · 0.45
handleCallbackMethod · 0.45

Tested by

no test coverage detected