| 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 | { |