Lua/LuaClass: Fix argument count via GetStackTop (Close #75)
Former-commit-id: 3a0e60a6e7ec7c85ff5f179cc84a468d8c0682f4 [formerly f0712658e69c7ced1fa46f8878f96776d6b36567] [formerly 3035b072473d17863c3c0f6950451ccf582c107e [formerly fe3cbf8a2cf87cf6cc3d3e8577011159bff04387]] Former-commit-id: df8812d712d28efc2bc83258df53dcb21bbb4b2d [formerly 6d2d8773c96d406690bd5cfc19cef7d1706ff6fc] Former-commit-id: 461fec0cc2dd99690a3de10436730514712beb73
This commit is contained in:
@@ -13,7 +13,7 @@ namespace Ndk
|
||||
void LuaBinding::BindCore()
|
||||
{
|
||||
/*********************************** Nz::Clock **********************************/
|
||||
clockClass.SetConstructor([](Nz::LuaInstance& lua, Nz::Clock* clock)
|
||||
clockClass.SetConstructor([](Nz::LuaInstance& lua, Nz::Clock* clock, std::size_t argumentCount)
|
||||
{
|
||||
int argIndex = 1;
|
||||
Nz::Int64 startingValue = lua.Check<Nz::Int64>(&argIndex, 0);
|
||||
@@ -44,9 +44,9 @@ namespace Ndk
|
||||
});
|
||||
|
||||
/********************************* Nz::Directory ********************************/
|
||||
directoryClass.SetConstructor([](Nz::LuaInstance& lua, Nz::Directory* directory)
|
||||
directoryClass.SetConstructor([](Nz::LuaInstance& lua, Nz::Directory* directory, std::size_t argumentCount)
|
||||
{
|
||||
unsigned int argCount = std::min(lua.GetStackTop(), 1U);
|
||||
std::size_t argCount = std::min<std::size_t>(argumentCount, 1U);
|
||||
|
||||
int argIndex = 1;
|
||||
switch (argCount)
|
||||
@@ -138,9 +138,9 @@ namespace Ndk
|
||||
/*********************************** Nz::File ***********************************/
|
||||
fileClass.Inherit(streamClass);
|
||||
|
||||
fileClass.SetConstructor([](Nz::LuaInstance& lua, Nz::File* file)
|
||||
fileClass.SetConstructor([] (Nz::LuaInstance& lua, Nz::File* file, std::size_t argumentCount)
|
||||
{
|
||||
unsigned int argCount = std::min(lua.GetStackTop(), 2U);
|
||||
std::size_t argCount = std::min<std::size_t>(argumentCount, 1U);
|
||||
|
||||
int argIndex = 1;
|
||||
switch (argCount)
|
||||
|
||||
Reference in New Issue
Block a user