summaryrefslogtreecommitdiffstats
path: root/src/Bindings/gen_LuaState_Call.lua
diff options
context:
space:
mode:
authorMasy98 <masy@antheruscraft.de>2014-08-30 21:31:51 +0200
committerMasy98 <masy@antheruscraft.de>2014-08-30 21:31:51 +0200
commit2d5a38bd61aa9436f2944f26344b14f92e30f025 (patch)
treed1caaf6446574ffdf676c272e39404ed8184a33b /src/Bindings/gen_LuaState_Call.lua
parentFixed slab name (diff)
parentcChunk: Fixed the Coords param. (diff)
downloadcuberite-2d5a38bd61aa9436f2944f26344b14f92e30f025.tar
cuberite-2d5a38bd61aa9436f2944f26344b14f92e30f025.tar.gz
cuberite-2d5a38bd61aa9436f2944f26344b14f92e30f025.tar.bz2
cuberite-2d5a38bd61aa9436f2944f26344b14f92e30f025.tar.lz
cuberite-2d5a38bd61aa9436f2944f26344b14f92e30f025.tar.xz
cuberite-2d5a38bd61aa9436f2944f26344b14f92e30f025.tar.zst
cuberite-2d5a38bd61aa9436f2944f26344b14f92e30f025.zip
Diffstat (limited to 'src/Bindings/gen_LuaState_Call.lua')
-rw-r--r--src/Bindings/gen_LuaState_Call.lua29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/Bindings/gen_LuaState_Call.lua b/src/Bindings/gen_LuaState_Call.lua
index c1d1af771..2d8630d12 100644
--- a/src/Bindings/gen_LuaState_Call.lua
+++ b/src/Bindings/gen_LuaState_Call.lua
@@ -54,9 +54,9 @@ local Combinations =
{9, 2},
-- Special combinations:
+ {5, 5},
{7, 3},
{8, 3},
- {5, 5},
{9, 5},
}
@@ -183,6 +183,33 @@ for _, combination in ipairs(Combinations) do
WriteOverload(f, combination[1], combination[2])
end
+-- Generate the cLuaState::GetStackValues() multi-param templates:
+for i = 2, 6 do
+ f:write("/** Reads ", i, " consecutive values off the stack */\ntemplate <\n")
+
+ -- Write the template function header:
+ local txt = {}
+ for idx = 1, i do
+ table.insert(txt, "\ttypename ArgT" .. idx)
+ end
+ f:write(table.concat(txt, ",\n"))
+
+ -- Write the argument declarations:
+ txt = {}
+ f:write("\n>\nvoid GetStackValues(\n\tint a_BeginPos,\n")
+ for idx = 1, i do
+ table.insert(txt, "\tArgT" .. idx .. " & Arg" .. idx)
+ end
+ f:write(table.concat(txt, ",\n"))
+
+ -- Write the function body:
+ f:write("\n)\n{\n")
+ for idx = 1, i do
+ f:write("\tGetStackValue(a_BeginPos + ", idx - 1, ", Arg", idx, ");\n")
+ end
+ f:write("}\n\n\n\n\n\n")
+end
+
-- Close the generated file
f:close()