MCPcopy Create free account
hub / github.com/defold/defold / LuaLoad

Function LuaLoad

engine/gameobject/src/gameobject/gameobject_script_util.cpp:70–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68 }
69
70 Result LuaLoad(dmResource::HFactory factory, dmScript::HContext context, dmLuaDDF::LuaModule* module)
71 {
72 if (!dmGameObject::RegisterSubModules(factory, context, module) ) {
73 dmLogError("Failed to load sub modules to module %s", module->m_Source.m_Filename);
74 return dmGameObject::RESULT_COMPONENT_NOT_FOUND;
75 }
76
77 lua_State* L = dmScript::GetLuaState(context);
78 int ret = dmScript::LuaLoad(L, &module->m_Source);
79 if (ret != 0)
80 return dmGameObject::RESULT_UNKNOWN_ERROR;
81
82 dmScript::PCall(L, 0, 0);
83 return dmGameObject::RESULT_OK;
84 }
85
86 static int ParsePropertyOptionKey(lua_State* L, int index, PropertyOptions* options, bool* did_parse)
87 {

Callers 3

LoadScriptFunction · 0.70
SetScriptFunction · 0.50
RunFileFunction · 0.50

Calls 3

RegisterSubModulesFunction · 0.85
PCallFunction · 0.85
GetLuaStateFunction · 0.70

Tested by 1

RunFileFunction · 0.40