summaryrefslogtreecommitdiffstats
path: root/src/Bindings/gen_LuaState_Call.lua
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-08-26 16:09:16 +0200
committerMattes D <github@xoft.cz>2014-08-26 16:09:16 +0200
commit98974412fa6d7662b84555e079a6306dd4d90db3 (patch)
tree733c745ef60441671524169c1bdff022dbf86867 /src/Bindings/gen_LuaState_Call.lua
parentProfiling: Added profiling script for x64 executable. (diff)
parentMerge pull request #1290 from mc-server/Ranks (diff)
downloadcuberite-98974412fa6d7662b84555e079a6306dd4d90db3.tar
cuberite-98974412fa6d7662b84555e079a6306dd4d90db3.tar.gz
cuberite-98974412fa6d7662b84555e079a6306dd4d90db3.tar.bz2
cuberite-98974412fa6d7662b84555e079a6306dd4d90db3.tar.lz
cuberite-98974412fa6d7662b84555e079a6306dd4d90db3.tar.xz
cuberite-98974412fa6d7662b84555e079a6306dd4d90db3.tar.zst
cuberite-98974412fa6d7662b84555e079a6306dd4d90db3.zip
Diffstat (limited to 'src/Bindings/gen_LuaState_Call.lua')
-rw-r--r--src/Bindings/gen_LuaState_Call.lua27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/Bindings/gen_LuaState_Call.lua b/src/Bindings/gen_LuaState_Call.lua
index 13ef8b882..2d8630d12 100644
--- a/src/Bindings/gen_LuaState_Call.lua
+++ b/src/Bindings/gen_LuaState_Call.lua
@@ -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()