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

Method process

Engine/source/console/simEvents.cpp:51–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

advanceToTimeFunction · 0.45

Calls 9

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

Tested by

no test coverage detected