MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / CallScriptFunction

Method CallScriptFunction

Source/Scripting/angelscript/ascontext.cpp:377–396  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

375}
376
377bool ASContext::CallScriptFunction(ASFunctionHandle handle, const ASArglist *args, ASArg *return_val) {
378 if (handle >= 0) {
379 asIScriptFunction *func = expected_functions[handle].func_ptr;
380 const std::string &definition = expected_functions[handle].definition;
381 if (func) {
382 profiler.CallScriptFunction(definition.c_str());
383 run(func, args, return_val);
384 profiler.LeaveScriptFunction();
385 return true;
386 } else {
387 if (expected_functions[handle].unloaded) {
388 LOGE << "Expected function " << expected_functions[handle].definition << " was not pre-loaded." << std::endl;
389 }
390 return false;
391 }
392 } else {
393 LOGF << "Invalid handle" << std::endl;
394 return false;
395 }
396}
397
398bool ASContext::HasFunction(const std::string &function_definition) {
399 asIScriptFunction *func = module.GetFunctionID(function_definition);

Callers 15

UpdateMethod · 0.45
UpdateLayersMethod · 0.45
UpdateMethod · 0.45
PreDrawFrameMethod · 0.45
UpdateMethod · 0.45
InvalidatedItemMethod · 0.45
HandleAnimationEventsMethod · 0.45
UpdatePausedMethod · 0.45
AboutToBeHitByItemMethod · 0.45
PreDrawFrameMethod · 0.45
ActualPreDrawMethod · 0.45

Calls 7

LeaveScriptFunctionMethod · 0.80
GetFunctionIDMethod · 0.80
GetFullPathMethod · 0.80
SourceChangedMethod · 0.80
runFunction · 0.50
DisplayErrorFunction · 0.50
c_strMethod · 0.45

Tested by

no test coverage detected