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:
Lynix
2016-04-24 19:54:46 +02:00
parent 6d66063b2c
commit 24a8fcee01
11 changed files with 190 additions and 107 deletions

View File

@@ -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);