From 398a5655f42378176a1e596af6d399a180ffb733 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Mon, 3 Jul 2023 08:51:42 +1000 Subject: Add Drawable <-> Lua conversion to LuaGameConverters --- source/core/StarLua.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/core/StarLua.hpp') diff --git a/source/core/StarLua.hpp b/source/core/StarLua.hpp index 2c108ef..41310a3 100644 --- a/source/core/StarLua.hpp +++ b/source/core/StarLua.hpp @@ -505,7 +505,7 @@ public: LuaString createString(String const& str); LuaString createString(char const* str); - LuaTable createTable(); + LuaTable createTable(int narr = 0, int nrec = 0); template LuaTable createTable(Container const& map); @@ -1890,7 +1890,7 @@ T LuaEngine::luaTo(LuaValue const& v) { template LuaTable LuaEngine::createTable(Container const& map) { - auto table = createTable(); + auto table = createTable(0, map.size()); for (auto const& p : map) table.set(p.first, p.second); return table; @@ -1898,7 +1898,7 @@ LuaTable LuaEngine::createTable(Container const& map) { template LuaTable LuaEngine::createArrayTable(Container const& array) { - auto table = createTable(); + auto table = createTable(array.size(), 0); int i = 1; for (auto const& elem : array) { table.set(LuaInt(i), elem); -- cgit v1.2.3