MCPcopy Create free account
hub / github.com/crownengine/crown / call_global

Method call_global

src/lua/lua_environment.cpp:491–508  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

489}
490
491void LuaEnvironment::call_global(const char *func, ArgType::Enum *arg_types, Arg *args, int narg, int nres)
492{
493 int status;
494 LuaStack stack(L, +nres);
495 CE_ENSURE(NULL != func);
496
497 lua_getglobal(L, func);
498
499 stack.push_args(arg_types, args, narg);
500
501 status = call(narg, nres);
502 if (status != LUA_OK) {
503 report(L, status);
504 device()->pause();
505 }
506
507 CE_ASSERT(lua_gettop(L) == 0, "Stack not clean");
508}
509
510LuaStack LuaEnvironment::get_global(const char *global)
511{

Callers 2

frameMethod · 0.80
main_loopMethod · 0.80

Calls 5

deviceFunction · 0.85
push_argsMethod · 0.80
reportFunction · 0.70
lua_gettopFunction · 0.50
pauseMethod · 0.45

Tested by

no test coverage detected