summaryrefslogtreecommitdiff
path: root/src/primitives.c
diff options
context:
space:
mode:
authorsanine-a <sanine.not@pm.me>2020-11-29 16:26:12 -0600
committersanine-a <sanine.not@pm.me>2020-11-29 16:26:12 -0600
commit65f1870eaa68cd18f2136bd112c042728855af03 (patch)
treed76e307f867b8e7a8439ce1bb8f3bb30a63e3526 /src/primitives.c
parentf9f3ab244d12e6c7f38bf56dcf22c6a4913dc0f6 (diff)
refactor all files to use new argument parsing and table building functions
Diffstat (limited to 'src/primitives.c')
-rw-r--r--src/primitives.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/primitives.c b/src/primitives.c
index d499248..c2f6c9e 100644
--- a/src/primitives.c
+++ b/src/primitives.c
@@ -33,12 +33,11 @@ static int honey_mesh_lua_cube(lua_State* L)
void honey_setup_primitives(lua_State* L)
{
- honey_lua_element primitive_elements[] = {
- { "plane", HONEY_FUNCTION, { .function = honey_mesh_lua_plane } },
- { "cube", HONEY_FUNCTION, { .function = honey_mesh_lua_cube } },
- };
-
- honey_lua_create_table(L, primitive_elements, 2);
+ honey_lua_create_table
+ (L, 2,
+ HONEY_FUNCTION, "plane", honey_mesh_lua_plane,
+ HONEY_FUNCTION, "cube", honey_mesh_lua_cube);
+ lua_setfield(L, -2, "primitives");
}
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */