Optimize Lua binding
Optimize binding by removing a useless extra indirection and allowing to move replying variables Former-commit-id: 76728df1c3ab9a38a4304ae2b9f2fc6a000e0ebb
This commit is contained in:
@@ -16,9 +16,10 @@ namespace Ndk
|
||||
return reinterpret_cast<Nz::InstancedRenderableRef*>(model); //TODO: Make a ObjectRefCast
|
||||
});
|
||||
|
||||
modelClass.SetConstructor([] (Nz::LuaInstance& lua) -> Nz::ModelRef*
|
||||
modelClass.SetConstructor([] (Nz::LuaInstance& lua, Nz::ModelRef* model)
|
||||
{
|
||||
return new Nz::ModelRef(new Nz::Model);
|
||||
Nz::PlacementNew(model, Nz::Model::New());
|
||||
return true;
|
||||
});
|
||||
|
||||
//modelClass.SetMethod("GetMaterial", &Nz::Model::GetMaterial);
|
||||
|
||||
Reference in New Issue
Block a user