expose audio to twnlua
This commit is contained in:
@ -34,7 +34,7 @@ def default(parameter):
|
||||
def to_table(typedesc, variable, indent = 0):
|
||||
binding = ' ' * indent + "lua_createtable(L, 0, %i);\n" % len(typedesc["fields"])
|
||||
for field in typedesc["fields"]:
|
||||
if field["type"] == "float":
|
||||
if field["type"] == "float" or field["type"] == "uint8_t":
|
||||
binding += ' ' * indent + "lua_pushnumber(L, (double)(%s));\n" % (variable + ".%s" % field["name"])
|
||||
elif field["type"] == "bool":
|
||||
binding += ' ' * indent + "lua_pushboolean(L, (%s));\n" % (variable + ".%s" % field["name"])
|
||||
@ -50,8 +50,8 @@ def from_table(typedesc, variable, indent = 0):
|
||||
binding = ""
|
||||
for field in typedesc["fields"]:
|
||||
binding += ' ' * indent + "lua_getfield(L, -1, \"%s\");\n" % field["name"]
|
||||
if field["type"] == "float":
|
||||
binding += ' ' * indent + "%s = (float)lua_tonumber(L, -1);\n" % (variable + ".%s" % field["name"])
|
||||
if field["type"] == "float" or field["type"] == "uint8_t":
|
||||
binding += ' ' * indent + "%s = (%s)lua_tonumber(L, -1);\n" % (variable + ".%s" % field["name"], field["type"])
|
||||
elif field["type"] == "bool":
|
||||
binding += ' ' * indent + "%s = lua_toboolean(L, -1);\n" % (variable + ".%s" % field["name"])
|
||||
elif field["type"] in api["types"]:
|
||||
|
Reference in New Issue
Block a user