Sdk: Remake LuaAPI internal

Former-commit-id: 297c30dbeca443d934edfd8d889cd7a6c725d0e1
This commit is contained in:
Lynix
2016-03-31 22:51:10 +02:00
parent 1ecc52c718
commit 6808d60cc1
15 changed files with 553 additions and 329 deletions

View File

@@ -0,0 +1,47 @@
// This file is part of the "Nazara Development Kit"
// For conditions of distribution and use, see copyright notice in Prerequesites.hpp
#include <NDK/LuaBinding.hpp>
#include <NDK/LuaAPI.hpp>
namespace Ndk
{
void LuaBinding::BindGraphics()
{
/*********************************** Nz::InstancedRenderable ***********************************/
/*********************************** Nz::Model ***********************************/
modelClass.Inherit<Nz::InstancedRenderableRef>(instancedRenderable, [] (Nz::ModelRef* model) -> Nz::InstancedRenderableRef*
{
return reinterpret_cast<Nz::InstancedRenderableRef*>(model); //TODO: Make a ObjectRefCast
});
modelClass.SetConstructor([] (Nz::LuaInstance& lua) -> Nz::ModelRef*
{
return new Nz::ModelRef(new Nz::Model);
});
//modelClass.SetMethod("GetMaterial", &Nz::Model::GetMaterial);
modelClass.SetMethod("GetMaterialCount", &Nz::Model::GetMaterialCount);
//modelClass.SetMethod("GetMesh", &Nz::Model::GetMesh);
modelClass.SetMethod("GetSkin", &Nz::Model::GetSkin);
modelClass.SetMethod("GetSkinCount", &Nz::Model::GetSkinCount);
modelClass.SetMethod("IsAnimated", &Nz::Model::IsAnimated);
modelClass.SetMethod("LoadFromFile", &Nz::Model::LoadFromFile, Nz::ModelParameters());
modelClass.SetMethod("Reset", &Nz::Model::Reset);
//modelClass.SetMethod("SetMaterial", &Nz::Model::SetMaterial);
//modelClass.SetMethod("SetMesh", &Nz::Model::SetMesh);
//modelClass.SetMethod("SetSequence", &Nz::Model::SetSequence);
modelClass.SetMethod("SetSkin", &Nz::Model::SetSkin);
modelClass.SetMethod("SetSkinCount", &Nz::Model::SetSkinCount);
}
void LuaBinding::RegisterGraphics(Nz::LuaInstance& instance)
{
instancedRenderable.Register(instance);
modelClass.Register(instance);
}
}