From 65f1870eaa68cd18f2136bd112c042728855af03 Mon Sep 17 00:00:00 2001 From: sanine-a Date: Sun, 29 Nov 2020 16:26:12 -0600 Subject: refactor all files to use new argument parsing and table building functions --- src/primitives.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/primitives.c') 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"); } /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -- cgit v1.2.1