Sdk/Lua: Fix GraphicsComponent:Attach not taking other overloads into account

This commit is contained in:
Lynix 2016-10-25 13:52:26 +02:00
parent b5a32d7eb2
commit d6f6b4421e
1 changed files with 2 additions and 5 deletions

View File

@ -146,7 +146,7 @@ namespace Ndk
void Attach(Nz::InstancedRenderableRef renderable, const Nz::Matrix4f& localMatrix, int renderOrder = 0); void Attach(Nz::InstancedRenderableRef renderable, const Nz::Matrix4f& localMatrix, int renderOrder = 0);
*/ */
unsigned int argCount = std::min(lua.GetStackTop(), 1U); unsigned int argCount = std::min(lua.GetStackTop(), 3U);
switch (argCount) switch (argCount)
{ {
@ -171,9 +171,8 @@ namespace Ndk
else if (lua.IsOfType(index, "Matrix4")) else if (lua.IsOfType(index, "Matrix4"))
{ {
Nz::Matrix4f localMatrix = lua.Check<Nz::Matrix4f>(&index); Nz::Matrix4f localMatrix = lua.Check<Nz::Matrix4f>(&index);
int renderOrder = lua.Check<int>(&index);
gfxComponent->Attach(renderable, localMatrix, renderOrder); gfxComponent->Attach(renderable, localMatrix);
} }
else else
break; break;
@ -196,8 +195,6 @@ namespace Ndk
lua.Error("No matching overload for method GetMemoryUsage"); lua.Error("No matching overload for method GetMemoryUsage");
return 0; return 0;
}); });
graphicsComponent.BindMethod("Attach", (void(Ndk::GraphicsComponent::*)(Nz::InstancedRenderableRef, int)) &GraphicsComponent::Attach, 0);
#endif #endif