From 08ccde293764b03839033c57abb5b0d73ac9b594 Mon Sep 17 00:00:00 2001 From: MysterD Date: Tue, 25 Jan 2022 19:28:10 -0800 Subject: [PATCH] Lua: autogenerated cobjects --- .../extract_structs.cpython-39.pyc | Bin 0 -> 1158 bytes autogen/convert_functions.py | 284 ++++++++ autogen/convert_header.py | 6 +- autogen/convert_structs.py | 313 ++++++++ autogen/extract_functions.py | 68 ++ autogen/extract_structs.py | 74 ++ build-windows-visual-studio/sm64ex.vcxproj | 2 + .../sm64ex.vcxproj.filters | 6 + src/pc/lua/smlua.c | 2 +- src/pc/lua/smlua.h | 1 + src/pc/lua/smlua_cobject.c | 283 +------- src/pc/lua/smlua_cobject.h | 38 +- src/pc/lua/smlua_cobject_allowlist.c | 38 +- src/pc/lua/smlua_cobject_allowlist.h | 4 +- src/pc/lua/smlua_cobject_autogen.c | 667 ++++++++++++++++++ src/pc/lua/smlua_cobject_autogen.h | 49 ++ src/pc/lua/smlua_functions_autogen.c | 406 +++++------ src/pc/lua/smlua_utils.c | 4 +- src/pc/lua/smlua_utils.h | 4 +- 19 files changed, 1747 insertions(+), 502 deletions(-) create mode 100644 autogen/__pycache__/extract_structs.cpython-39.pyc create mode 100644 autogen/convert_functions.py create mode 100644 autogen/convert_structs.py create mode 100644 autogen/extract_functions.py create mode 100644 autogen/extract_structs.py create mode 100644 src/pc/lua/smlua_cobject_autogen.c create mode 100644 src/pc/lua/smlua_cobject_autogen.h diff --git a/autogen/__pycache__/extract_structs.cpython-39.pyc b/autogen/__pycache__/extract_structs.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000000..057647f0394c2c4f5997b418073bb272f1f89abc GIT binary patch literal 1158 zcmZ8hy>1gh5Z>9{v-b|i7!wJCgfIdj5-=uF1VJDKf{FqmfrKy#(c!rega2}ShG6b! z_^FUUJb_(;cmSS&ih_b_OQ_O-MCk@*&vq2CtJ$4z=9`(DxwHMLDUZ>5^Yyp?EyLJP z3wAC};1Y>GN(VB82CI&4s6vW)l_N*-l2rx5O*SjHh{>+kz+U5JYbcT{B-*2#5sTRi zc)LG=82T_^3BOHQCG8giSgSD4^s& z=#FzfM=ut{`V|Xed6t!AVq(uQ!n;zOB}|cV7R3zPXP@LVv9su+B(_NP98PWPdE9Mv zEZEHNAUv5e3M2MA*eFJ-@8TYWSPX=XAN7JNQL#h4+(_KmMfVY>*hZ{SrCLPK?b_~J zYN8Po_ zpZA9FtjC{`wN&aIynD|t_b!*Kr_1M7SME-f6U)a>%`MLkA?amx6n1M-Y1T8c-3eO8 z4Few=^;V#bL%w>)sGx=VNj+LOp6)d2(a7oP$Pc5D-AU~x8wQ<*UkeNm10!_zJ|$Ia z^+wS0n}Ly5Gfo;^713s7q}7dxnjORSJjsH|)LXiafpKf=e(2YtApF3>L)7PRp|V-I z5w;%&wMbWV^UPwfS+2F)or>R$+7E(OCD@E?#OkOaeX8@+?EcT@*dN#$9Sl4;#wAyf zhXdRb5+vkE=b)efd9vr|E{Yu8IpP*XKIKUAdvPtbQLfieldCount; i++) { + if (!strcmp(ot->fields[i].key, key)) { + return &ot->fields[i]; + } + } + return NULL; +} + +""" + +h_template = """#ifndef SMLUA_COBJECT_AUTOGEN_H +#define SMLUA_COBJECT_AUTOGEN_H + +$[BODY] +struct LuaObjectField* smlua_get_object_field_autogen(u16 lot, const char* key); + +#endif +""" + +override_field_names = { + "Animation": { "unk02": "animYTransDivisor", "unk04": "startFrame", "unk06": "loopStart", "unk08": "loopEnd", "unk0A": "unusedBoneCount" }, + "GraphNodeObject": { "unk38": "animInfo" }, +} + +override_field_types = { + "Surface": { "normal": "Vec3f" }, +} + +############################################################################ + +def get_path(p): + return os.path.dirname(os.path.realpath(__file__)) + '/../' + p + +def strip_internal_blocks(body): + # strip internal structs/enums/etc + tmp = body + body = '' + inside = 0 + for character in tmp: + if character == '{': + body += '{ ... }' + inside += 1 + + if inside == 0: + body += character + + if character == '}': + inside -= 1 + + return body + +def identifier_to_caps(identifier): + caps = '' + was_cap = True + for c in identifier: + if c >= 'A' and c <= 'Z': + if not was_cap: + caps += '_' + was_cap = True + else: + was_cap = False + caps += c.upper() + return caps + +def translate_type_to_lvt(ptype): + if ptype in usf_types: + return 'LVT_' + ptype.upper() + if ptype in vec3_types: + return 'LVT_COBJECT' + if ptype == 'float': + return 'LVT_F32' + if 'struct' in ptype: + if '*' in ptype: + return 'LVT_COBJECT_P' + return 'LVT_COBJECT' + return 'LVT_???' + +def translate_type_to_lot(ptype): + if '[' in ptype or '{' in ptype: + return 'LOT_???' + if ptype in usf_types: + return 'LOT_NONE' + if ptype in vec3_types: + return 'LOT_' + ptype.upper() + if ptype == 'float': + return 'LOT_NONE' + if 'struct' in ptype: + struct_id = ptype.split(' ')[1].replace('*', '') + if struct_id in exclude_structs: + return 'LOT_???' + return 'LOT_' + struct_id.upper() + + return 'LOT_???' + +def table_to_string(table): + count = 0 + columns = 0 + column_width = [] + for c in table[0]: + column_width.append(0) + columns += 1 + + for row in table: + for i in range(columns): + if len(row[i]) > column_width[i]: + column_width[i] = len(row[i]) + + s = '' + for row in table: + line = '' + for i in range(columns): + line += row[i].ljust(column_width[i]) + if '???' in line: + line = '//' + line[2:] + ' <--- UNIMPLEMENTED' + else: + count += 1 + s += line + '\n' + return s, count + +############################################################################ + +def parse_struct(struct_str): + struct = {} + identifier = struct_str.split(' ')[1] + struct['identifier'] = identifier + + body = struct_str.split('{', 1)[1].rsplit('}', 1)[0] + body = strip_internal_blocks(body) + + struct['fields'] = [] + field_strs = body.split(';') + for field_str in field_strs: + if len(field_str.strip()) == 0: + continue + + if '*' in field_str: + field_type, field_id = field_str.strip().rsplit('*', 1) + field_type = field_type.strip() + '*' + else: + field_type, field_id = field_str.strip().rsplit(' ', 1) + + if '[' in field_id: + array_str = '[' + field_id.split('[', 1)[1] + field_id = field_id.split('[', 1)[0] + if array_str != '[1]': + field_type += ' ' + array_str + + field = {} + field['type'] = field_type.strip() + field['identifier'] = field_id.strip() + field['field_str'] = field_str + + struct['fields'].append(field) + + return struct + +def parse_structs(struct_strs): + structs = [] + for struct_str in struct_strs: + structs.append(parse_struct(struct_str)) + return structs + +############################################################################ + +sLuaObjectTable = [] +sLotAutoGenList = [] + +def build_struct(struct): + sid = struct['identifier'] + + # build up table and track column width + field_table = [] + for field in struct['fields']: + fid = field['identifier'] + ftype = field['type'] + + if sid in override_field_names and fid in override_field_names[sid]: + fid = override_field_names[sid][fid] + + if sid in override_field_types and fid in override_field_types[sid]: + ftype = override_field_types[sid][fid] + + lvt = translate_type_to_lvt(ftype) + lot = translate_type_to_lot(ftype) + row = [] + row.append(' { ' ) + row.append('"%s", ' % fid ) + row.append('%s, ' % lvt ) + row.append('offsetof(struct %s, %s), ' % (sid, field['identifier']) ) + row.append('%s, ' % str(lvt == 'LVT_COBJECT').lower() ) + row.append("%s" % lot ) + row.append(' },' ) + field_table.append(row) + + field_table_str, field_count = table_to_string(field_table) + field_count_define = 'LUA_%s_FIELD_COUNT' % identifier_to_caps(sid) + struct_lot = 'LOT_%s' % sid.upper() + + s = "#define %s $[STRUCTFIELDCOUNT]\n" % field_count_define + s += "static struct LuaObjectField s%sFields[%s] = {\n" % (sid, field_count_define) + s += field_table_str + s += '};\n' + + s = s.replace('$[STRUCTFIELDCOUNT]', str(field_count)) + + global sLuaObjectTable + struct_row = [] + struct_row.append(' { ' ) + struct_row.append('%s, ' % struct_lot ) + struct_row.append('s%sFields, ' % sid ) + struct_row.append('%s ' % field_count_define ) + struct_row.append('},' ) + sLuaObjectTable.append(struct_row) + + global sLotAutoGenList + sLotAutoGenList.append(struct_lot) + + return s + +def build_structs(structs): + global sLuaObjectTable + sLuaObjectTable = [] + + global sLotAutoGenList + sLotAutoGenList = [] + + s = '' + for struct in structs: + if struct['identifier'] in exclude_structs: + continue + s += build_struct(struct) + '\n' + return s + +def build_body(parsed): + built = build_structs(parsed) + obj_table_row_built, obj_table_count = table_to_string(sLuaObjectTable) + + obj_table_built = 'struct LuaObjectTable sLuaObjectAutogenTable[LOT_AUTOGEN_MAX - LOT_AUTOGEN_MIN] = {\n' + obj_table_built += obj_table_row_built + obj_table_built += '};\n' + + return built + obj_table_built + +def build_lot_enum(): + s = 'enum LuaObjectAutogenType {\n' + s += ' LOT_AUTOGEN_MIN = 1000,\n' + + global sLotAutoGenList + for lot in sLotAutoGenList: + s += ' ' + lot + ',\n' + + s += ' LOT_AUTOGEN_MAX,\n' + s += '};\n' + return s + +def build_includes(): + s = '#include "smlua.h"\n' + for in_file in in_files: + s += '#include "%s"\n' % in_file + return s + +############################################################################ + +def build_files(): + extracted = [] + for in_file in in_files: + path = get_path(in_file) + extracted.extend(extract_structs(path)) + + parsed = parse_structs(extracted) + built_body = build_body(parsed) + built_enum = build_lot_enum() + built_include = build_includes() + + out_c_filename = get_path(smlua_cobject_autogen + '.c') + with open(out_c_filename, 'w') as out: + out.write(c_template.replace("$[BODY]", built_body).replace('$[INCLUDES]', built_include)) + + out_h_filename = get_path(smlua_cobject_autogen + '.h') + with open(out_h_filename, 'w') as out: + out.write(h_template.replace("$[BODY]", built_enum)) + +build_files() diff --git a/autogen/extract_functions.py b/autogen/extract_functions.py new file mode 100644 index 00000000..11d4b547 --- /dev/null +++ b/autogen/extract_functions.py @@ -0,0 +1,68 @@ +import os +import re +import sys + +with open('./src/audio/external.h') as file: + lines = file.readlines() + +# strip directives and comments +txt = '' +for line in lines: + if line.strip().startswith('#'): + continue + if '//' in line: + line = line.split('//', 1)[0] + txt += line + +while ('/*' in txt): + s1 = txt.split('/*', 1) + s2 = s1[1].split('*/', 1) + txt = s1[0] + s2[-1] + +# normalize newlines +txt = txt.replace('\n', ' ') +txt = txt.replace(';', ';\n') +txt = txt.replace('{', '{\n') +while (' ' in txt): + txt = txt.replace(' ', ' ') + +# strip macros +txt = re.sub(r'[^a-zA-Z0-9_][A-Z0-9_]+\(.*\)', '', txt) + +# strip blocks +tmp = txt +txt = '' +inside = 0 +for character in tmp: + if inside == 0: + txt += character + + if character == '{': + txt += '\n' + inside += 1 + + if character == '}': + inside -= 1 + +# cull obvious non-functions, statics, and externs +tmp = txt +txt = '' +for line in tmp.splitlines(): + line = line.strip() + if '(' not in line: + continue + if ')' not in line: + continue + if '=' in line: + continue + #if '{' not in line: + # continue + if line.startswith('static '): + continue + if line.startswith('extern '): + continue + txt += line + '\n' + +# normalize function ending +txt = txt.replace(' {', ';') +print('-'* 80 + '\n' + txt) diff --git a/autogen/extract_structs.py b/autogen/extract_structs.py new file mode 100644 index 00000000..a31b92f1 --- /dev/null +++ b/autogen/extract_structs.py @@ -0,0 +1,74 @@ +import os +import re +import sys + +def extract_structs(filename): + with open(filename) as file: + lines = file.readlines() + + txt = '' + # strip line continuation + for line in lines: + if line.strip().endswith('\\'): + txt += line.strip()[:-1] + ' ' + else: + txt += line + + # strip directives and comments + tmp = txt + txt = '' + for line in tmp.splitlines(): + if line.strip().startswith('#'): + continue + if '//' in line: + line = line.split('//', 1)[0] + txt += line + '\n' + + while ('/*' in txt): + s1 = txt.split('/*', 1) + s2 = s1[1].split('*/', 1) + txt = s1[0] + s2[-1] + + # normalize newlines + txt = txt.replace('\n', ' ') + txt = txt.replace(';', ';\n') + txt = txt.replace('{', '{\n') + while (' ' in txt): + txt = txt.replace(' ', ' ') + + # strip macros + txt = re.sub(r'[^a-zA-Z0-9_][A-Z0-9_]+\(.*\)', '', txt) + + # strip blocks + tmp = txt + txt = '' + inside = 0 + for character in tmp: + if character == '\n': + if inside == 0: + txt += character + else: + txt += character + + if character == '{': + inside += 1 + + if character == '}': + inside -= 1 + + # extract structs + tmp = txt + txt = '' + for line in tmp.splitlines(): + line = line.strip() + if '{' not in line: + continue + if '}' not in line: + continue + if ';' not in line: + continue + if not line.startswith('struct '): + continue + txt += line + '\n' + + return txt.splitlines() diff --git a/build-windows-visual-studio/sm64ex.vcxproj b/build-windows-visual-studio/sm64ex.vcxproj index e5f56dbc..edb9beb0 100644 --- a/build-windows-visual-studio/sm64ex.vcxproj +++ b/build-windows-visual-studio/sm64ex.vcxproj @@ -514,6 +514,7 @@ + @@ -970,6 +971,7 @@ + diff --git a/build-windows-visual-studio/sm64ex.vcxproj.filters b/build-windows-visual-studio/sm64ex.vcxproj.filters index ae381596..8cd9c3c9 100644 --- a/build-windows-visual-studio/sm64ex.vcxproj.filters +++ b/build-windows-visual-studio/sm64ex.vcxproj.filters @@ -4863,6 +4863,9 @@ Source Files\src\pc\lua + + Source Files\src\pc\lua + @@ -6007,5 +6010,8 @@ Source Files\src\pc\lua + + Source Files\src\pc\lua + \ No newline at end of file diff --git a/src/pc/lua/smlua.c b/src/pc/lua/smlua.c index f4e17d37..5a9f3fca 100644 --- a/src/pc/lua/smlua.c +++ b/src/pc/lua/smlua.c @@ -57,7 +57,7 @@ static void smlua_init_mario_states(void) { int t = lua_gettop(gLuaState); for (int i = 0; i < MAX_PLAYERS; i++) { lua_pushinteger(L, i); - smlua_push_object(L, LOT_MARIO_STATE, &gMarioStates[i]); + smlua_push_object(L, LOT_MARIOSTATE, &gMarioStates[i]); lua_settable(L, t); } lua_setglobal(L, "gMarioStates"); diff --git a/src/pc/lua/smlua.h b/src/pc/lua/smlua.h index 04e8afc0..61cc5aa6 100644 --- a/src/pc/lua/smlua.h +++ b/src/pc/lua/smlua.h @@ -10,6 +10,7 @@ #include "smlua_cobject.h" #include "smlua_cobject_allowlist.h" +#include "smlua_cobject_autogen.h" #include "smlua_utils.h" #include "smlua_functions.h" #include "smlua_functions_autogen.h" diff --git a/src/pc/lua/smlua_cobject.c b/src/pc/lua/smlua_cobject.c index 0be73cda..c17d7834 100644 --- a/src/pc/lua/smlua_cobject.c +++ b/src/pc/lua/smlua_cobject.c @@ -6,26 +6,6 @@ #include "audio/external.h" #include "object_fields.h" -enum LuaValueType { - LVT_U8, - LVT_U16, - LVT_U32, - LVT_S8, - LVT_S16, - LVT_S32, - LVT_F32, - LVT_COBJECT, - LVT_COBJECT_P, -}; - -struct LuaObjectField { - const char* key; - enum LuaValueType valueType; - size_t valueOffset; - bool immutable; - enum LuaObjectType lot; -}; - #define LUA_VEC3S_FIELD_COUNT 3 static struct LuaObjectField sVec3sFields[LUA_VEC3S_FIELD_COUNT] = { { "x", LVT_S16, sizeof(s16) * 0, false, LOT_NONE }, @@ -40,255 +20,18 @@ static struct LuaObjectField sVec3fFields[LUA_VEC3F_FIELD_COUNT] = { { "z", LVT_F32, sizeof(f32) * 2, false, LOT_NONE }, }; -#define LUA_MARIO_STATE_FIELD_COUNT 65 -static struct LuaObjectField sMarioStateFields[LUA_MARIO_STATE_FIELD_COUNT] = { - { "playerIndex", LVT_U16, offsetof(struct MarioState, playerIndex), true, LOT_NONE }, - { "input", LVT_U16, offsetof(struct MarioState, input), false, LOT_NONE }, - { "flags", LVT_U32, offsetof(struct MarioState, flags), false, LOT_NONE }, - { "particleFlags", LVT_U32, offsetof(struct MarioState, particleFlags), false, LOT_NONE }, - { "action", LVT_U32, offsetof(struct MarioState, action), false, LOT_NONE }, - { "prevAction", LVT_U32, offsetof(struct MarioState, prevAction), false, LOT_NONE }, - { "terrainSoundAddend", LVT_U32, offsetof(struct MarioState, terrainSoundAddend), false, LOT_NONE }, - { "actionState", LVT_U16, offsetof(struct MarioState, actionState), false, LOT_NONE }, - { "actionTimer", LVT_U16, offsetof(struct MarioState, actionTimer), false, LOT_NONE }, - { "actionArg", LVT_U32, offsetof(struct MarioState, actionArg), false, LOT_NONE }, - { "intendedMag", LVT_F32, offsetof(struct MarioState, intendedMag), false, LOT_NONE }, - { "intendedYaw", LVT_S16, offsetof(struct MarioState, intendedYaw), false, LOT_NONE }, - { "invincTimer", LVT_S16, offsetof(struct MarioState, invincTimer), false, LOT_NONE }, - { "framesSinceA", LVT_U8, offsetof(struct MarioState, framesSinceA), false, LOT_NONE }, - { "framesSinceB", LVT_U8, offsetof(struct MarioState, framesSinceB), false, LOT_NONE }, - { "wallKickTimer", LVT_U8, offsetof(struct MarioState, wallKickTimer), false, LOT_NONE }, - { "doubleJumpTimer", LVT_U8, offsetof(struct MarioState, doubleJumpTimer), false, LOT_NONE }, - { "faceAngle", LVT_COBJECT, offsetof(struct MarioState, faceAngle), true, LOT_VEC3S }, - { "angleVel", LVT_COBJECT, offsetof(struct MarioState, angleVel), true, LOT_VEC3S }, - { "slideYaw", LVT_S16, offsetof(struct MarioState, slideYaw), false, LOT_NONE }, - { "twirlYaw", LVT_S16, offsetof(struct MarioState, twirlYaw), false, LOT_NONE }, - { "pos", LVT_COBJECT, offsetof(struct MarioState, pos), true, LOT_VEC3F }, - { "vel", LVT_COBJECT, offsetof(struct MarioState, vel), true, LOT_VEC3F }, - { "forwardVel", LVT_F32, offsetof(struct MarioState, forwardVel), false, LOT_NONE }, - { "slideVelX", LVT_F32, offsetof(struct MarioState, slideVelX), false, LOT_NONE }, - { "slideVelZ", LVT_F32, offsetof(struct MarioState, slideVelZ), false, LOT_NONE }, - { "wall", LVT_COBJECT_P, offsetof(struct MarioState, wall), true, LOT_SURFACE }, - { "ceil", LVT_COBJECT_P, offsetof(struct MarioState, ceil), true, LOT_SURFACE }, - { "floor", LVT_COBJECT_P, offsetof(struct MarioState, floor), true, LOT_SURFACE }, - { "ceilHeight", LVT_F32, offsetof(struct MarioState, ceilHeight), false, LOT_NONE }, - { "floorHeight", LVT_F32, offsetof(struct MarioState, floorHeight), false, LOT_NONE }, - { "floorAngle", LVT_S16, offsetof(struct MarioState, floorAngle), false, LOT_NONE }, - { "waterLevel", LVT_S16, offsetof(struct MarioState, waterLevel), false, LOT_NONE }, - { "interactObj", LVT_COBJECT_P, offsetof(struct MarioState, interactObj), false, LOT_OBJECT }, - { "heldObj", LVT_COBJECT_P, offsetof(struct MarioState, heldObj), false, LOT_OBJECT }, - { "usedObj", LVT_COBJECT_P, offsetof(struct MarioState, usedObj), false, LOT_OBJECT }, - { "interactObj", LVT_COBJECT_P, offsetof(struct MarioState, interactObj), false, LOT_OBJECT }, - { "marioObj", LVT_COBJECT_P, offsetof(struct MarioState, marioObj), true, LOT_OBJECT }, - { "marioBodyState", LVT_COBJECT_P, offsetof(struct MarioState, marioBodyState), true, LOT_BODY_STATE }, - { "controller", LVT_COBJECT_P, offsetof(struct MarioState, controller), true, LOT_CONTROLLER }, - { "collidedObjInteractTypes", LVT_U32, offsetof(struct MarioState, collidedObjInteractTypes), false, LOT_NONE }, - { "numCoins", LVT_S16, offsetof(struct MarioState, numCoins), false, LOT_NONE }, - { "numStars", LVT_S16, offsetof(struct MarioState, numStars), false, LOT_NONE }, - { "mechani", LVT_S8, offsetof(struct MarioState, numKeys), false, LOT_NONE }, - { "numLives", LVT_S8, offsetof(struct MarioState, numLives), false, LOT_NONE }, - { "health", LVT_S16, offsetof(struct MarioState, health), false, LOT_NONE }, - { "unkB0", LVT_S16, offsetof(struct MarioState, unkB0), false, LOT_NONE }, - { "hurtCounter", LVT_U8, offsetof(struct MarioState, hurtCounter), false, LOT_NONE }, - { "healCounter", LVT_U8, offsetof(struct MarioState, healCounter), false, LOT_NONE }, - { "squishTimer", LVT_U8, offsetof(struct MarioState, squishTimer), false, LOT_NONE }, - { "fadeWarpOpacity", LVT_U8, offsetof(struct MarioState, fadeWarpOpacity), false, LOT_NONE }, - { "capTimer", LVT_U16, offsetof(struct MarioState, capTimer), false, LOT_NONE }, - { "prevNumStarsForDialog", LVT_S16, offsetof(struct MarioState, prevNumStarsForDialog), false, LOT_NONE }, - { "peakHeight", LVT_F32, offsetof(struct MarioState, peakHeight), false, LOT_NONE }, - { "quicksandDepth", LVT_F32, offsetof(struct MarioState, quicksandDepth), false, LOT_NONE }, - { "unkC4", LVT_F32, offsetof(struct MarioState, unkC4), false, LOT_NONE }, - { "currentRoom", LVT_S16, offsetof(struct MarioState, currentRoom), false, LOT_NONE }, - { "isSnoring", LVT_U8, offsetof(struct MarioState, isSnoring), false, LOT_NONE }, - { "freeze", LVT_U8, offsetof(struct MarioState, freeze), false, LOT_NONE }, - { "splineKeyframeFraction", LVT_F32, offsetof(struct MarioState, splineKeyframeFraction), false, LOT_NONE }, - { "splineState", LVT_S32, offsetof(struct MarioState, splineState), false, LOT_NONE }, - { "nonInstantWarpPos", LVT_COBJECT, offsetof(struct MarioState, nonInstantWarpPos), true, LOT_VEC3F }, - { "wasNetworkVisible", LVT_U8, offsetof(struct MarioState, wasNetworkVisible), false, LOT_NONE }, - { "minimumBoneY", LVT_F32, offsetof(struct MarioState, minimumBoneY), false, LOT_NONE }, - { "curAnimOffset", LVT_F32, offsetof(struct MarioState, curAnimOffset), false, LOT_NONE }, - /* TODO: implement - struct SpawnInfo *spawnInfo; - struct Area *area; - struct PlayerCameraState *statusForCamera; - struct MarioAnimation *animation; - struct Object* heldByObj; - struct Object* bubbleObj; - Vec4s* splineKeyframe; - struct Character* character; - */ -}; - -#define LUA_CONTROLLER_FIELD_COUNT 10 -static struct LuaObjectField sControllerFields[LUA_CONTROLLER_FIELD_COUNT] = { - { "rawStickX", LVT_S16, offsetof(struct Controller, rawStickX), false, LOT_NONE }, - { "rawStickY", LVT_S16, offsetof(struct Controller, rawStickY), false, LOT_NONE }, - { "stickX", LVT_F32, offsetof(struct Controller, stickX), false, LOT_NONE }, - { "stickY", LVT_F32, offsetof(struct Controller, stickY), false, LOT_NONE }, - { "stickMag", LVT_F32, offsetof(struct Controller, stickMag), false, LOT_NONE }, - { "buttonDown", LVT_U16, offsetof(struct Controller, buttonDown), false, LOT_NONE }, - { "buttonPressed", LVT_U16, offsetof(struct Controller, buttonPressed), false, LOT_NONE }, - //{ "statusData", LVT_OSCONTSTATUS, offsetof(struct Controller, statusData), false, LOT_NONE }, - //{ "controllerData", LVT_OSCONTPAD, offsetof(struct Controller, controllerData), false, LOT_NONE }, - { "port", LVT_S32, offsetof(struct Controller, port), false, LOT_NONE }, - { "extStickX", LVT_S16, offsetof(struct Controller, extStickX), false, LOT_NONE }, - { "extStickY", LVT_S16, offsetof(struct Controller, extStickY), false, LOT_NONE }, -}; - -#define LUA_BODY_STATE_FIELD_COUNT 11 -static struct LuaObjectField sMarioBodyStateFields[LUA_BODY_STATE_FIELD_COUNT] = { - { "action", LVT_U32, offsetof(struct MarioBodyState, action), false, LOT_NONE }, - { "capState", LVT_S8, offsetof(struct MarioBodyState, capState), false, LOT_NONE }, - { "eyeState", LVT_S8, offsetof(struct MarioBodyState, eyeState), false, LOT_NONE }, - { "handState", LVT_S8, offsetof(struct MarioBodyState, handState), false, LOT_NONE }, - { "wingFlutter", LVT_S8, offsetof(struct MarioBodyState, wingFlutter), false, LOT_NONE }, - { "modelState", LVT_S16, offsetof(struct MarioBodyState, modelState), false, LOT_NONE }, - { "grabPos", LVT_S8, offsetof(struct MarioBodyState, grabPos), false, LOT_NONE }, - { "punchState", LVT_U8, offsetof(struct MarioBodyState, punchState), false, LOT_NONE }, - { "torsoAngle", LVT_COBJECT, offsetof(struct MarioBodyState, torsoAngle), true, LOT_VEC3S }, - { "headAngle", LVT_COBJECT, offsetof(struct MarioBodyState, headAngle), true, LOT_VEC3S }, - { "heldObjLastPosition", LVT_COBJECT, offsetof(struct MarioBodyState, heldObjLastPosition), true, LOT_VEC3S }, -}; - -#define LUA_OBJECT_FIELD_COUNT 16 -static struct LuaObjectField sObjectFields[LUA_OBJECT_FIELD_COUNT] = { - { "header", LVT_COBJECT, offsetof(struct Object, header), true, LOT_OBJECTNODE }, - { "parentObj", LVT_COBJECT_P, offsetof(struct Object, parentObj), false, LOT_OBJECT }, - { "prevObj", LVT_COBJECT_P, offsetof(struct Object, prevObj), false, LOT_OBJECT }, - { "collidedObjInteractTypes", LVT_U32, offsetof(struct Object, collidedObjInteractTypes), false, LOT_NONE }, - { "activeFlags", LVT_S16, offsetof(struct Object, activeFlags), false, LOT_NONE }, - { "numCollidedObjs", LVT_S16, offsetof(struct Object, numCollidedObjs), false, LOT_NONE }, - { "bhvStackIndex", LVT_U32, offsetof(struct Object, bhvStackIndex), false, LOT_NONE }, - { "bhvDelayTimer", LVT_S16, offsetof(struct Object, bhvDelayTimer), false, LOT_NONE }, - { "respawnInfoType", LVT_S16, offsetof(struct Object, respawnInfoType), false, LOT_NONE }, - { "hitboxRadius", LVT_F32, offsetof(struct Object, hitboxRadius), false, LOT_NONE }, - { "hitboxHeight", LVT_F32, offsetof(struct Object, hitboxHeight), false, LOT_NONE }, - { "hurtboxRadius", LVT_F32, offsetof(struct Object, hurtboxRadius), false, LOT_NONE }, - { "hurtboxHeight", LVT_F32, offsetof(struct Object, hurtboxHeight), false, LOT_NONE }, - { "hitboxDownOffset", LVT_F32, offsetof(struct Object, hitboxDownOffset), false, LOT_NONE }, - { "heldByPlayerIndex", LVT_U32, offsetof(struct Object, heldByPlayerIndex), false, LOT_NONE }, - { "platform", LVT_COBJECT_P, offsetof(struct Object, platform), false, LOT_OBJECT }, - /* TODO: implement - struct Object *collidedObjs[4] - union rawData - const BehaviorScript *curBhvCommand - uintptr_t bhvStack[8] - const BehaviorScript *behavior - void *collisionData - Mat4 transform - void *respawnInfo - */ -}; - -#define LUA_OBJECTNODE_FIELD_COUNT 3 -static struct LuaObjectField sObjectNodeFields[LUA_OBJECTNODE_FIELD_COUNT] = { - { "gfx", LVT_COBJECT, offsetof(struct ObjectNode, gfx), true, LOT_GRAPHNODEOBJECT }, - { "next", LVT_COBJECT_P, offsetof(struct ObjectNode, next), true, LOT_OBJECTNODE }, - { "prev", LVT_COBJECT_P, offsetof(struct ObjectNode, prev), true, LOT_OBJECTNODE }, -}; - -#define LUA_GRAPHNODEOBJECT_FIELD_COUNT 14 -static struct LuaObjectField sGraphNodeObjectFields[LUA_GRAPHNODEOBJECT_FIELD_COUNT] = { - { "areaIndex", LVT_S8, offsetof(struct GraphNodeObject, unk18), false, LOT_NONE }, - { "activeAreaIndex", LVT_S8, offsetof(struct GraphNodeObject, unk19), false, LOT_NONE }, - { "angle", LVT_COBJECT, offsetof(struct GraphNodeObject, angle), false, LOT_VEC3S }, - { "pos", LVT_COBJECT, offsetof(struct GraphNodeObject, pos), false, LOT_VEC3F }, - { "prevAngle", LVT_COBJECT, offsetof(struct GraphNodeObject, prevAngle), false, LOT_VEC3S }, - { "prevPos", LVT_COBJECT, offsetof(struct GraphNodeObject, prevPos), false, LOT_VEC3F }, - { "prevTimestamp", LVT_U32, offsetof(struct GraphNodeObject, prevTimestamp), false, LOT_NONE }, - { "prevShadowPos", LVT_COBJECT, offsetof(struct GraphNodeObject, prevShadowPos), false, LOT_VEC3F }, - { "prevShadowPosTimestamp", LVT_U32, offsetof(struct GraphNodeObject, prevShadowPosTimestamp), false, LOT_NONE }, - { "scale", LVT_COBJECT, offsetof(struct GraphNodeObject, scale), false, LOT_VEC3F }, - { "prevScale", LVT_COBJECT, offsetof(struct GraphNodeObject, prevScale), false, LOT_VEC3F }, - { "prevScaleTimestamp", LVT_U32, offsetof(struct GraphNodeObject, prevScaleTimestamp), false, LOT_NONE }, - { "animInfo", LVT_COBJECT, offsetof(struct GraphNodeObject, unk38), false, LOT_GRAPHNODEOBJECTSUB }, - { "cameraToObject", LVT_COBJECT, offsetof(struct GraphNodeObject, cameraToObject), false, LOT_VEC3F }, - /* unimplemented - struct GraphNode node; - struct GraphNode *sharedChild; - struct SpawnInfo *unk4C; - Mat4 *throwMatrix; - Mat4 prevThrowMatrix; - u32 prevThrowMatrixTimestamp; - Mat4 *throwMatrixInterpolated; - u32 skipInterpolationTimestamp; - */ -}; - -#define LUA_SURFACE_FIELD_COUNT 16 -static struct LuaObjectField sSurfaceFields[LUA_SURFACE_FIELD_COUNT] = { - { "type", LVT_S16, offsetof(struct Surface, type), false, LOT_NONE }, - { "force", LVT_S16, offsetof(struct Surface, force), false, LOT_NONE }, - { "flags", LVT_S8, offsetof(struct Surface, flags), false, LOT_NONE }, - { "room", LVT_S8, offsetof(struct Surface, room), false, LOT_NONE }, - { "lowerY", LVT_S16, offsetof(struct Surface, lowerY), false, LOT_NONE }, - { "upperY", LVT_S16, offsetof(struct Surface, upperY), false, LOT_NONE }, - { "vertex1", LVT_COBJECT, offsetof(struct Surface, vertex1), false, LOT_VEC3S }, - { "vertex2", LVT_COBJECT, offsetof(struct Surface, vertex2), false, LOT_VEC3S }, - { "vertex3", LVT_COBJECT, offsetof(struct Surface, vertex3), false, LOT_VEC3S }, - { "normal", LVT_COBJECT, offsetof(struct Surface, normal), false, LOT_VEC3F }, - { "originOffset", LVT_F32, offsetof(struct Surface, originOffset), false, LOT_NONE }, - { "object", LVT_COBJECT, offsetof(struct Surface, object), false, LOT_OBJECT }, - { "prevVertex1", LVT_COBJECT, offsetof(struct Surface, prevVertex1), false, LOT_VEC3S }, - { "prevVertex2", LVT_COBJECT, offsetof(struct Surface, prevVertex2), false, LOT_VEC3S }, - { "prevVertex3", LVT_COBJECT, offsetof(struct Surface, prevVertex3), false, LOT_VEC3S }, - { "modifiedTimestamp", LVT_U32, offsetof(struct Surface, modifiedTimestamp), false, LOT_NONE }, -}; - -#define LUA_GRAPHNODEOBJECTSUB_FIELD_COUNT 11 -static struct LuaObjectField sGraphNodeObjectSubFields[LUA_GRAPHNODEOBJECTSUB_FIELD_COUNT] = { - { "animID", LVT_S16, offsetof(struct GraphNodeObject_sub, animID), false, LOT_NONE }, - { "animYTrans", LVT_S16, offsetof(struct GraphNodeObject_sub, animYTrans), false, LOT_NONE }, - { "curAnim", LVT_COBJECT_P, offsetof(struct GraphNodeObject_sub, curAnim), true, LOT_ANIMATION }, - { "animFrame", LVT_S16, offsetof(struct GraphNodeObject_sub, animFrame), false, LOT_NONE }, - { "animTimer", LVT_U16, offsetof(struct GraphNodeObject_sub, animTimer), false, LOT_NONE }, - { "animFrameAccelAssist", LVT_S32, offsetof(struct GraphNodeObject_sub, animFrameAccelAssist), false, LOT_NONE }, - { "animAccel", LVT_S32, offsetof(struct GraphNodeObject_sub, animAccel), false, LOT_NONE }, - { "prevAnimFrame", LVT_S16, offsetof(struct GraphNodeObject_sub, prevAnimFrame), false, LOT_NONE }, - { "prevAnimID", LVT_S16, offsetof(struct GraphNodeObject_sub, prevAnimID), false, LOT_NONE }, - { "prevAnimFrameTimestamp", LVT_U32, offsetof(struct GraphNodeObject_sub, prevAnimFrameTimestamp), false, LOT_NONE }, - { "prevAnimPtr", LVT_COBJECT_P, offsetof(struct GraphNodeObject_sub, prevAnimPtr), true, LOT_ANIMATION }, -}; - - -#define LUA_ANIMATION_FIELD_COUNT 7 -static struct LuaObjectField sAnimationFields[LUA_ANIMATION_FIELD_COUNT] = { - { "flags", LVT_S16, offsetof(struct Animation, flags), false, LOT_NONE }, - { "animYTransDivisor", LVT_S16, offsetof(struct Animation, unk02), false, LOT_NONE }, - { "startFrame", LVT_S16, offsetof(struct Animation, unk04), false, LOT_NONE }, - { "loopStart", LVT_S16, offsetof(struct Animation, unk06), false, LOT_NONE }, - { "loopEnd", LVT_S16, offsetof(struct Animation, unk08), false, LOT_NONE }, - { "unusedBoneCount", LVT_S16, offsetof(struct Animation, unk0A), false, LOT_NONE }, - { "length", LVT_U32, offsetof(struct Animation, length), false, LOT_NONE }, - /* - const s16 *values; - const u16 *index; - */ -}; - - -struct LuaObjectTable { - enum LuaObjectType objectType; - struct LuaObjectField* fields; - u16 fieldCount; -}; - struct LuaObjectTable sLuaObjectTable[LOT_MAX] = { { LOT_NONE, NULL, 0 }, { LOT_VEC3S, sVec3sFields, LUA_VEC3S_FIELD_COUNT }, { LOT_VEC3F, sVec3fFields, LUA_VEC3F_FIELD_COUNT }, - { LOT_MARIO_STATE, sMarioStateFields, LUA_MARIO_STATE_FIELD_COUNT }, - { LOT_CONTROLLER, sControllerFields, LUA_CONTROLLER_FIELD_COUNT }, - { LOT_BODY_STATE, sMarioBodyStateFields, LUA_BODY_STATE_FIELD_COUNT }, - { LOT_OBJECT, sObjectFields, LUA_OBJECT_FIELD_COUNT }, - { LOT_OBJECTNODE, sObjectNodeFields, LUA_OBJECTNODE_FIELD_COUNT }, - { LOT_GRAPHNODEOBJECT, sGraphNodeObjectFields, LUA_GRAPHNODEOBJECT_FIELD_COUNT }, - { LOT_SURFACE, sSurfaceFields, LUA_SURFACE_FIELD_COUNT }, - { LOT_GRAPHNODEOBJECTSUB, sGraphNodeObjectSubFields, LUA_GRAPHNODEOBJECTSUB_FIELD_COUNT }, - { LOT_ANIMATION, sAnimationFields, LUA_ANIMATION_FIELD_COUNT }, }; -static struct LuaObjectField* smlua_get_object_field(struct LuaObjectTable* ot, const char* key) { +static struct LuaObjectField* smlua_get_object_field(u16 lot, const char* key) { + if (lot > LOT_AUTOGEN_MIN) { + return smlua_get_object_field_autogen(lot, key); + } + + struct LuaObjectTable* ot = &sLuaObjectTable[lot]; // TODO: change this to binary search or hash table or something for (int i = 0; i < ot->fieldCount; i++) { if (!strcmp(ot->fields[i].key, key)) { @@ -298,6 +41,12 @@ static struct LuaObjectField* smlua_get_object_field(struct LuaObjectTable* ot, return NULL; } +bool smlua_valid_lot(u16 lot) { + if (lot > LOT_NONE && lot < LOT_MAX) { return true; } + if (lot > LOT_AUTOGEN_MIN && lot < LOT_AUTOGEN_MAX) { return true; } + return false; +} + static int smlua__get_field(lua_State* L) { enum LuaObjectType lot = smlua_to_integer(L, 1); if (!gSmLuaConvertSuccess) { return 0; } @@ -313,7 +62,7 @@ static int smlua__get_field(lua_State* L) { return 0; } - if (lot >= LOT_MAX) { + if (!smlua_valid_lot(lot)) { LOG_LUA("_get_field on invalid LOT '%u'", lot); return 0; } @@ -323,7 +72,7 @@ static int smlua__get_field(lua_State* L) { return 0; } - struct LuaObjectField* data = smlua_get_object_field(&sLuaObjectTable[lot], key); + struct LuaObjectField* data = smlua_get_object_field(lot, key); if (data == NULL) { LOG_LUA("_get_field on invalid key '%s', lot '%d'", key, lot); return 0; @@ -363,7 +112,7 @@ static int smlua__set_field(lua_State* L) { return 0; } - if (lot >= LOT_MAX) { + if (!smlua_valid_lot(lot)) { LOG_LUA("_set_field on invalid LOT '%u'", lot); return 0; } @@ -373,7 +122,7 @@ static int smlua__set_field(lua_State* L) { return 0; } - struct LuaObjectField* data = smlua_get_object_field(&sLuaObjectTable[lot], key); + struct LuaObjectField* data = smlua_get_object_field(lot, key); if (data == NULL) { LOG_LUA("_set_field on invalid key '%s'", key); return 0; diff --git a/src/pc/lua/smlua_cobject.h b/src/pc/lua/smlua_cobject.h index f214609b..dbdc2b04 100644 --- a/src/pc/lua/smlua_cobject.h +++ b/src/pc/lua/smlua_cobject.h @@ -1,22 +1,40 @@ #ifndef SMLUA_COBJECT_H #define SMLUA_COBJECT_H +enum LuaValueType { + LVT_U8, + LVT_U16, + LVT_U32, + LVT_S8, + LVT_S16, + LVT_S32, + LVT_F32, + LVT_COBJECT, + LVT_COBJECT_P, +}; + enum LuaObjectType { - LOT_NONE, + LOT_NONE = 0, LOT_VEC3S, LOT_VEC3F, - LOT_MARIO_STATE, - LOT_CONTROLLER, - LOT_BODY_STATE, - LOT_OBJECT, - LOT_OBJECTNODE, - LOT_GRAPHNODEOBJECT, - LOT_SURFACE, - LOT_GRAPHNODEOBJECTSUB, - LOT_ANIMATION, LOT_MAX, }; +struct LuaObjectField { + const char* key; + enum LuaValueType valueType; + size_t valueOffset; + bool immutable; + u16 lot; +}; + +struct LuaObjectTable { + u16 lot; + struct LuaObjectField* fields; + u16 fieldCount; +}; + +bool smlua_valid_lot(u16 lot); void smlua_bind_cobject(void); #endif \ No newline at end of file diff --git a/src/pc/lua/smlua_cobject_allowlist.c b/src/pc/lua/smlua_cobject_allowlist.c index e131a563..f24e90c6 100644 --- a/src/pc/lua/smlua_cobject_allowlist.c +++ b/src/pc/lua/smlua_cobject_allowlist.c @@ -7,15 +7,24 @@ struct CObjectAllowListNode { struct CObjectAllowListNode* next; }; -static struct CObjectAllowListNode* sAllowList[LOT_MAX] = { 0 }; -static u16 sCachedAllowed[LOT_MAX] = { 0 }; +#define LOT_COUNT (LOT_MAX + (LOT_AUTOGEN_MAX - LOT_AUTOGEN_MIN)) +static struct CObjectAllowListNode* sAllowList[LOT_COUNT] = { 0 }; +static u16 sCachedAllowed[LOT_COUNT] = { 0 }; + +static u16 smlua_lot_mapping(u16 lot) { + if (lot >= LOT_MAX) { + return LOT_MAX + (lot - LOT_AUTOGEN_MIN); + } else { + return lot; + } +} void smlua_cobject_allowlist_init(void) { smlua_cobject_allowlist_shutdown(); } void smlua_cobject_allowlist_shutdown(void) { - for (int i = 0; i < LOT_MAX; i++) { + for (int i = 0; i < LOT_COUNT; i++) { sCachedAllowed[i] = 0; struct CObjectAllowListNode* node = sAllowList[i]; while (node != NULL) { @@ -27,14 +36,15 @@ void smlua_cobject_allowlist_shutdown(void) { } } -void smlua_cobject_allowlist_add(enum LuaObjectType objectType, u64 pointer) { +void smlua_cobject_allowlist_add(u16 lot, u64 pointer) { if (pointer == 0) { return; } - if (objectType == LOT_NONE || objectType >= LOT_MAX) { return; } + if (!smlua_valid_lot(lot)) { return; } - if (sCachedAllowed[objectType] == pointer) { return; } - sCachedAllowed[objectType] = pointer; + u16 m = smlua_lot_mapping(lot); + if (sCachedAllowed[m] == pointer) { return; } + sCachedAllowed[m] = pointer; - struct CObjectAllowListNode* curNode = sAllowList[objectType]; + struct CObjectAllowListNode* curNode = sAllowList[m]; struct CObjectAllowListNode* prevNode = NULL; while (curNode != NULL) { if (pointer == curNode->pointer) { return; } @@ -47,18 +57,20 @@ void smlua_cobject_allowlist_add(enum LuaObjectType objectType, u64 pointer) { node->pointer = pointer; node->next = curNode; if (prevNode == NULL) { - sAllowList[objectType] = node; + sAllowList[m] = node; } else { prevNode->next = node; } } -bool smlua_cobject_allowlist_contains(enum LuaObjectType objectType, u64 pointer) { +bool smlua_cobject_allowlist_contains(u16 lot, u64 pointer) { if (pointer == 0) { return false; } - if (objectType == LOT_NONE || objectType >= LOT_MAX) { return false; } - if (sCachedAllowed[objectType] == pointer) { return true; } + if (!smlua_valid_lot(lot)) { return false; } - struct CObjectAllowListNode* node = sAllowList[objectType]; + u16 m = smlua_lot_mapping(lot); + if (sCachedAllowed[m] == pointer) { return true; } + + struct CObjectAllowListNode* node = sAllowList[m]; while (node != NULL) { if (pointer == node->pointer) { return true; } if (pointer < node->pointer) { return false; } diff --git a/src/pc/lua/smlua_cobject_allowlist.h b/src/pc/lua/smlua_cobject_allowlist.h index 68501991..ebdbf726 100644 --- a/src/pc/lua/smlua_cobject_allowlist.h +++ b/src/pc/lua/smlua_cobject_allowlist.h @@ -3,7 +3,7 @@ void smlua_cobject_allowlist_init(void); void smlua_cobject_allowlist_shutdown(void); -void smlua_cobject_allowlist_add(enum LuaObjectType objectType, u64 pointer); -bool smlua_cobject_allowlist_contains(enum LuaObjectType objectType, u64 pointer); +void smlua_cobject_allowlist_add(u16 lot, u64 pointer); +bool smlua_cobject_allowlist_contains(u16 lot, u64 pointer); #endif \ No newline at end of file diff --git a/src/pc/lua/smlua_cobject_autogen.c b/src/pc/lua/smlua_cobject_autogen.c new file mode 100644 index 00000000..b112f6ae --- /dev/null +++ b/src/pc/lua/smlua_cobject_autogen.c @@ -0,0 +1,667 @@ +#include "smlua.h" +#include "include/types.h" +#include "src/game/area.h" +#include "src/game/camera.h" +#include "src/game/characters.h" + +#define LUA_CONTROLLER_FIELD_COUNT 10 +static struct LuaObjectField sControllerFields[LUA_CONTROLLER_FIELD_COUNT] = { + { "rawStickX", LVT_S16, offsetof(struct Controller, rawStickX), false, LOT_NONE }, + { "rawStickY", LVT_S16, offsetof(struct Controller, rawStickY), false, LOT_NONE }, + { "stickX", LVT_F32, offsetof(struct Controller, stickX), false, LOT_NONE }, + { "stickY", LVT_F32, offsetof(struct Controller, stickY), false, LOT_NONE }, + { "stickMag", LVT_F32, offsetof(struct Controller, stickMag), false, LOT_NONE }, + { "buttonDown", LVT_U16, offsetof(struct Controller, buttonDown), false, LOT_NONE }, + { "buttonPressed", LVT_U16, offsetof(struct Controller, buttonPressed), false, LOT_NONE }, +// { "statusData", LVT_???, offsetof(struct Controller, statusData), false, LOT_??? }, <--- UNIMPLEMENTED +// { "controllerData", LVT_???, offsetof(struct Controller, controllerData), false, LOT_??? }, <--- UNIMPLEMENTED + { "port", LVT_S32, offsetof(struct Controller, port), false, LOT_NONE }, + { "extStickX", LVT_S16, offsetof(struct Controller, extStickX), false, LOT_NONE }, + { "extStickY", LVT_S16, offsetof(struct Controller, extStickY), false, LOT_NONE }, +}; + +#define LUA_ANIMATION_FIELD_COUNT 7 +static struct LuaObjectField sAnimationFields[LUA_ANIMATION_FIELD_COUNT] = { + { "flags", LVT_S16, offsetof(struct Animation, flags), false, LOT_NONE }, + { "animYTransDivisor", LVT_S16, offsetof(struct Animation, unk02), false, LOT_NONE }, + { "startFrame", LVT_S16, offsetof(struct Animation, unk04), false, LOT_NONE }, + { "loopStart", LVT_S16, offsetof(struct Animation, unk06), false, LOT_NONE }, + { "loopEnd", LVT_S16, offsetof(struct Animation, unk08), false, LOT_NONE }, + { "unusedBoneCount", LVT_S16, offsetof(struct Animation, unk0A), false, LOT_NONE }, +// { "values", LVT_???, offsetof(struct Animation, values), false, LOT_??? }, <--- UNIMPLEMENTED +// { "index", LVT_???, offsetof(struct Animation, index), false, LOT_??? }, <--- UNIMPLEMENTED + { "length", LVT_U32, offsetof(struct Animation, length), false, LOT_NONE }, +}; + +#define LUA_GRAPH_NODE_FIELD_COUNT 6 +static struct LuaObjectField sGraphNodeFields[LUA_GRAPH_NODE_FIELD_COUNT] = { + { "type", LVT_S16, offsetof(struct GraphNode, type), false, LOT_NONE }, + { "flags", LVT_S16, offsetof(struct GraphNode, flags), false, LOT_NONE }, + { "prev", LVT_COBJECT_P, offsetof(struct GraphNode, prev), false, LOT_GRAPHNODE }, + { "next", LVT_COBJECT_P, offsetof(struct GraphNode, next), false, LOT_GRAPHNODE }, + { "parent", LVT_COBJECT_P, offsetof(struct GraphNode, parent), false, LOT_GRAPHNODE }, + { "children", LVT_COBJECT_P, offsetof(struct GraphNode, children), false, LOT_GRAPHNODE }, +}; + +#define LUA_GRAPH_NODE_OBJECT_SUB_FIELD_COUNT 11 +static struct LuaObjectField sGraphNodeObject_subFields[LUA_GRAPH_NODE_OBJECT_SUB_FIELD_COUNT] = { + { "animID", LVT_S16, offsetof(struct GraphNodeObject_sub, animID), false, LOT_NONE }, + { "animYTrans", LVT_S16, offsetof(struct GraphNodeObject_sub, animYTrans), false, LOT_NONE }, + { "curAnim", LVT_COBJECT_P, offsetof(struct GraphNodeObject_sub, curAnim), false, LOT_ANIMATION }, + { "animFrame", LVT_S16, offsetof(struct GraphNodeObject_sub, animFrame), false, LOT_NONE }, + { "animTimer", LVT_U16, offsetof(struct GraphNodeObject_sub, animTimer), false, LOT_NONE }, + { "animFrameAccelAssist", LVT_S32, offsetof(struct GraphNodeObject_sub, animFrameAccelAssist), false, LOT_NONE }, + { "animAccel", LVT_S32, offsetof(struct GraphNodeObject_sub, animAccel), false, LOT_NONE }, + { "prevAnimFrame", LVT_S16, offsetof(struct GraphNodeObject_sub, prevAnimFrame), false, LOT_NONE }, + { "prevAnimID", LVT_S16, offsetof(struct GraphNodeObject_sub, prevAnimID), false, LOT_NONE }, + { "prevAnimFrameTimestamp", LVT_U32, offsetof(struct GraphNodeObject_sub, prevAnimFrameTimestamp), false, LOT_NONE }, + { "prevAnimPtr", LVT_COBJECT_P, offsetof(struct GraphNodeObject_sub, prevAnimPtr), false, LOT_ANIMATION }, +}; + +#define LUA_GRAPH_NODE_OBJECT_FIELD_COUNT 19 +static struct LuaObjectField sGraphNodeObjectFields[LUA_GRAPH_NODE_OBJECT_FIELD_COUNT] = { + { "node", LVT_COBJECT, offsetof(struct GraphNodeObject, node), true, LOT_GRAPHNODE }, + { "sharedChild", LVT_COBJECT_P, offsetof(struct GraphNodeObject, sharedChild), false, LOT_GRAPHNODE }, + { "unk18", LVT_S8, offsetof(struct GraphNodeObject, unk18), false, LOT_NONE }, + { "unk19", LVT_S8, offsetof(struct GraphNodeObject, unk19), false, LOT_NONE }, + { "angle", LVT_COBJECT, offsetof(struct GraphNodeObject, angle), true, LOT_VEC3S }, + { "pos", LVT_COBJECT, offsetof(struct GraphNodeObject, pos), true, LOT_VEC3F }, + { "prevAngle", LVT_COBJECT, offsetof(struct GraphNodeObject, prevAngle), true, LOT_VEC3S }, + { "prevPos", LVT_COBJECT, offsetof(struct GraphNodeObject, prevPos), true, LOT_VEC3F }, + { "prevTimestamp", LVT_U32, offsetof(struct GraphNodeObject, prevTimestamp), false, LOT_NONE }, + { "prevShadowPos", LVT_COBJECT, offsetof(struct GraphNodeObject, prevShadowPos), true, LOT_VEC3F }, + { "prevShadowPosTimestamp", LVT_U32, offsetof(struct GraphNodeObject, prevShadowPosTimestamp), false, LOT_NONE }, + { "scale", LVT_COBJECT, offsetof(struct GraphNodeObject, scale), true, LOT_VEC3F }, + { "prevScale", LVT_COBJECT, offsetof(struct GraphNodeObject, prevScale), true, LOT_VEC3F }, + { "prevScaleTimestamp", LVT_U32, offsetof(struct GraphNodeObject, prevScaleTimestamp), false, LOT_NONE }, + { "animInfo", LVT_COBJECT, offsetof(struct GraphNodeObject, unk38), true, LOT_GRAPHNODEOBJECT_SUB }, + { "unk4C", LVT_COBJECT_P, offsetof(struct GraphNodeObject, unk4C), false, LOT_SPAWNINFO }, +// { "throwMatrix", LVT_???, offsetof(struct GraphNodeObject, throwMatrix), false, LOT_??? }, <--- UNIMPLEMENTED +// { "prevThrowMatrix", LVT_???, offsetof(struct GraphNodeObject, prevThrowMatrix), false, LOT_??? }, <--- UNIMPLEMENTED + { "prevThrowMatrixTimestamp", LVT_U32, offsetof(struct GraphNodeObject, prevThrowMatrixTimestamp), false, LOT_NONE }, +// { "throwMatrixInterpolated", LVT_???, offsetof(struct GraphNodeObject, throwMatrixInterpolated), false, LOT_??? }, <--- UNIMPLEMENTED + { "cameraToObject", LVT_COBJECT, offsetof(struct GraphNodeObject, cameraToObject), true, LOT_VEC3F }, + { "skipInterpolationTimestamp", LVT_U32, offsetof(struct GraphNodeObject, skipInterpolationTimestamp), false, LOT_NONE }, +}; + +#define LUA_OBJECT_NODE_FIELD_COUNT 3 +static struct LuaObjectField sObjectNodeFields[LUA_OBJECT_NODE_FIELD_COUNT] = { + { "gfx", LVT_COBJECT, offsetof(struct ObjectNode, gfx), true, LOT_GRAPHNODEOBJECT }, + { "next", LVT_COBJECT_P, offsetof(struct ObjectNode, next), false, LOT_OBJECTNODE }, + { "prev", LVT_COBJECT_P, offsetof(struct ObjectNode, prev), false, LOT_OBJECTNODE }, +}; + +#define LUA_OBJECT_FIELD_COUNT 21 +static struct LuaObjectField sObjectFields[LUA_OBJECT_FIELD_COUNT] = { + { "header", LVT_COBJECT, offsetof(struct Object, header), true, LOT_OBJECTNODE }, + { "parentObj", LVT_COBJECT_P, offsetof(struct Object, parentObj), false, LOT_OBJECT }, + { "prevObj", LVT_COBJECT_P, offsetof(struct Object, prevObj), false, LOT_OBJECT }, + { "collidedObjInteractTypes", LVT_U32, offsetof(struct Object, collidedObjInteractTypes), false, LOT_NONE }, + { "activeFlags", LVT_S16, offsetof(struct Object, activeFlags), false, LOT_NONE }, + { "numCollidedObjs", LVT_S16, offsetof(struct Object, numCollidedObjs), false, LOT_NONE }, +// { "collidedObjs", LVT_COBJECT_P, offsetof(struct Object, collidedObjs), false, LOT_??? }, <--- UNIMPLEMENTED +// { "rawData", LVT_???, offsetof(struct Object, rawData), false, LOT_??? }, <--- UNIMPLEMENTED +// { "ptrData", LVT_???, offsetof(struct Object, ptrData), false, LOT_??? }, <--- UNIMPLEMENTED + { "unused1", LVT_U32, offsetof(struct Object, unused1), false, LOT_NONE }, +// { "curBhvCommand", LVT_???, offsetof(struct Object, curBhvCommand), false, LOT_??? }, <--- UNIMPLEMENTED + { "bhvStackIndex", LVT_U32, offsetof(struct Object, bhvStackIndex), false, LOT_NONE }, +// { "bhvStack", LVT_???, offsetof(struct Object, bhvStack), false, LOT_??? }, <--- UNIMPLEMENTED + { "bhvDelayTimer", LVT_S16, offsetof(struct Object, bhvDelayTimer), false, LOT_NONE }, + { "respawnInfoType", LVT_S16, offsetof(struct Object, respawnInfoType), false, LOT_NONE }, + { "hitboxRadius", LVT_F32, offsetof(struct Object, hitboxRadius), false, LOT_NONE }, + { "hitboxHeight", LVT_F32, offsetof(struct Object, hitboxHeight), false, LOT_NONE }, + { "hurtboxRadius", LVT_F32, offsetof(struct Object, hurtboxRadius), false, LOT_NONE }, + { "hurtboxHeight", LVT_F32, offsetof(struct Object, hurtboxHeight), false, LOT_NONE }, + { "hitboxDownOffset", LVT_F32, offsetof(struct Object, hitboxDownOffset), false, LOT_NONE }, +// { "behavior", LVT_???, offsetof(struct Object, behavior), false, LOT_??? }, <--- UNIMPLEMENTED + { "heldByPlayerIndex", LVT_U32, offsetof(struct Object, heldByPlayerIndex), false, LOT_NONE }, + { "platform", LVT_COBJECT_P, offsetof(struct Object, platform), false, LOT_OBJECT }, +// { "collisionData", LVT_???, offsetof(struct Object, collisionData), false, LOT_??? }, <--- UNIMPLEMENTED +// { "transform", LVT_???, offsetof(struct Object, transform), false, LOT_??? }, <--- UNIMPLEMENTED +// { "respawnInfo", LVT_???, offsetof(struct Object, respawnInfo), false, LOT_??? }, <--- UNIMPLEMENTED + { "createdThroughNetwork", LVT_U8, offsetof(struct Object, createdThroughNetwork), false, LOT_NONE }, +// { "areaTimerType", LVT_???, offsetof(struct Object, areaTimerType), false, LOT_??? }, <--- UNIMPLEMENTED + { "areaTimer", LVT_U32, offsetof(struct Object, areaTimer), false, LOT_NONE }, + { "areaTimerDuration", LVT_U32, offsetof(struct Object, areaTimerDuration), false, LOT_NONE }, +// { "areaTimerRunOnceCallback)(void)", LVT_???, offsetof(struct Object, areaTimerRunOnceCallback)(void)), false, LOT_??? }, <--- UNIMPLEMENTED + { "globalPlayerIndex", LVT_U8, offsetof(struct Object, globalPlayerIndex), false, LOT_NONE }, +}; + +#define LUA_OBJECT_HITBOX_FIELD_COUNT 9 +static struct LuaObjectField sObjectHitboxFields[LUA_OBJECT_HITBOX_FIELD_COUNT] = { + { "interactType", LVT_U32, offsetof(struct ObjectHitbox, interactType), false, LOT_NONE }, + { "downOffset", LVT_U8, offsetof(struct ObjectHitbox, downOffset), false, LOT_NONE }, + { "damageOrCoinValue", LVT_S8, offsetof(struct ObjectHitbox, damageOrCoinValue), false, LOT_NONE }, + { "health", LVT_S8, offsetof(struct ObjectHitbox, health), false, LOT_NONE }, + { "numLootCoins", LVT_S8, offsetof(struct ObjectHitbox, numLootCoins), false, LOT_NONE }, + { "radius", LVT_S16, offsetof(struct ObjectHitbox, radius), false, LOT_NONE }, + { "height", LVT_S16, offsetof(struct ObjectHitbox, height), false, LOT_NONE }, + { "hurtboxRadius", LVT_S16, offsetof(struct ObjectHitbox, hurtboxRadius), false, LOT_NONE }, + { "hurtboxHeight", LVT_S16, offsetof(struct ObjectHitbox, hurtboxHeight), false, LOT_NONE }, +}; + +#define LUA_WAYPOINT_FIELD_COUNT 2 +static struct LuaObjectField sWaypointFields[LUA_WAYPOINT_FIELD_COUNT] = { + { "flags", LVT_S16, offsetof(struct Waypoint, flags), false, LOT_NONE }, + { "pos", LVT_COBJECT, offsetof(struct Waypoint, pos), true, LOT_VEC3S }, +}; + +#define LUA_SURFACE_FIELD_COUNT 16 +static struct LuaObjectField sSurfaceFields[LUA_SURFACE_FIELD_COUNT] = { + { "type", LVT_S16, offsetof(struct Surface, type), false, LOT_NONE }, + { "force", LVT_S16, offsetof(struct Surface, force), false, LOT_NONE }, + { "flags", LVT_S8, offsetof(struct Surface, flags), false, LOT_NONE }, + { "room", LVT_S8, offsetof(struct Surface, room), false, LOT_NONE }, + { "lowerY", LVT_S16, offsetof(struct Surface, lowerY), false, LOT_NONE }, + { "upperY", LVT_S16, offsetof(struct Surface, upperY), false, LOT_NONE }, + { "vertex1", LVT_COBJECT, offsetof(struct Surface, vertex1), true, LOT_VEC3S }, + { "vertex2", LVT_COBJECT, offsetof(struct Surface, vertex2), true, LOT_VEC3S }, + { "vertex3", LVT_COBJECT, offsetof(struct Surface, vertex3), true, LOT_VEC3S }, + { "normal", LVT_COBJECT, offsetof(struct Surface, normal), true, LOT_VEC3F }, + { "originOffset", LVT_F32, offsetof(struct Surface, originOffset), false, LOT_NONE }, + { "object", LVT_COBJECT_P, offsetof(struct Surface, object), false, LOT_OBJECT }, + { "prevVertex1", LVT_COBJECT, offsetof(struct Surface, prevVertex1), true, LOT_VEC3S }, + { "prevVertex2", LVT_COBJECT, offsetof(struct Surface, prevVertex2), true, LOT_VEC3S }, + { "prevVertex3", LVT_COBJECT, offsetof(struct Surface, prevVertex3), true, LOT_VEC3S }, + { "modifiedTimestamp", LVT_U32, offsetof(struct Surface, modifiedTimestamp), false, LOT_NONE }, +}; + +#define LUA_MARIO_BODY_STATE_FIELD_COUNT 12 +static struct LuaObjectField sMarioBodyStateFields[LUA_MARIO_BODY_STATE_FIELD_COUNT] = { + { "action", LVT_U32, offsetof(struct MarioBodyState, action), false, LOT_NONE }, + { "capState", LVT_S8, offsetof(struct MarioBodyState, capState), false, LOT_NONE }, + { "eyeState", LVT_S8, offsetof(struct MarioBodyState, eyeState), false, LOT_NONE }, + { "handState", LVT_S8, offsetof(struct MarioBodyState, handState), false, LOT_NONE }, + { "wingFlutter", LVT_S8, offsetof(struct MarioBodyState, wingFlutter), false, LOT_NONE }, + { "modelState", LVT_S16, offsetof(struct MarioBodyState, modelState), false, LOT_NONE }, + { "grabPos", LVT_S8, offsetof(struct MarioBodyState, grabPos), false, LOT_NONE }, + { "punchState", LVT_U8, offsetof(struct MarioBodyState, punchState), false, LOT_NONE }, + { "torsoAngle", LVT_COBJECT, offsetof(struct MarioBodyState, torsoAngle), true, LOT_VEC3S }, + { "headAngle", LVT_COBJECT, offsetof(struct MarioBodyState, headAngle), true, LOT_VEC3S }, + { "heldObjLastPosition", LVT_COBJECT, offsetof(struct MarioBodyState, heldObjLastPosition), true, LOT_VEC3F }, + { "torsoPos", LVT_COBJECT, offsetof(struct MarioBodyState, torsoPos), true, LOT_VEC3F }, +// { "handFootPos", LVT_???, offsetof(struct MarioBodyState, handFootPos), false, LOT_??? }, <--- UNIMPLEMENTED +}; + +#define LUA_OFFSET_SIZE_PAIR_FIELD_COUNT 2 +static struct LuaObjectField sOffsetSizePairFields[LUA_OFFSET_SIZE_PAIR_FIELD_COUNT] = { + { "offset", LVT_U32, offsetof(struct OffsetSizePair, offset), false, LOT_NONE }, + { "size", LVT_U32, offsetof(struct OffsetSizePair, size), false, LOT_NONE }, +}; + +#define LUA_MARIO_ANIMATION_FIELD_COUNT 1 +static struct LuaObjectField sMarioAnimationFields[LUA_MARIO_ANIMATION_FIELD_COUNT] = { +// { "animDmaTable", LVT_COBJECT_P, offsetof(struct MarioAnimation, animDmaTable), false, LOT_??? }, <--- UNIMPLEMENTED +// { "currentAnimAddr", LVT_???, offsetof(struct MarioAnimation, currentAnimAddr), false, LOT_??? }, <--- UNIMPLEMENTED + { "targetAnim", LVT_COBJECT_P, offsetof(struct MarioAnimation, targetAnim), false, LOT_ANIMATION }, +// { "padding", LVT_???, offsetof(struct MarioAnimation, padding), false, LOT_??? }, <--- UNIMPLEMENTED +}; + +#define LUA_MARIO_STATE_FIELD_COUNT 72 +static struct LuaObjectField sMarioStateFields[LUA_MARIO_STATE_FIELD_COUNT] = { + { "playerIndex", LVT_U16, offsetof(struct MarioState, playerIndex), false, LOT_NONE }, + { "input", LVT_U16, offsetof(struct MarioState, input), false, LOT_NONE }, + { "flags", LVT_U32, offsetof(struct MarioState, flags), false, LOT_NONE }, + { "particleFlags", LVT_U32, offsetof(struct MarioState, particleFlags), false, LOT_NONE }, + { "action", LVT_U32, offsetof(struct MarioState, action), false, LOT_NONE }, + { "prevAction", LVT_U32, offsetof(struct MarioState, prevAction), false, LOT_NONE }, + { "terrainSoundAddend", LVT_U32, offsetof(struct MarioState, terrainSoundAddend), false, LOT_NONE }, + { "actionState", LVT_U16, offsetof(struct MarioState, actionState), false, LOT_NONE }, + { "actionTimer", LVT_U16, offsetof(struct MarioState, actionTimer), false, LOT_NONE }, + { "actionArg", LVT_U32, offsetof(struct MarioState, actionArg), false, LOT_NONE }, + { "intendedMag", LVT_F32, offsetof(struct MarioState, intendedMag), false, LOT_NONE }, + { "intendedYaw", LVT_S16, offsetof(struct MarioState, intendedYaw), false, LOT_NONE }, + { "invincTimer", LVT_S16, offsetof(struct MarioState, invincTimer), false, LOT_NONE }, + { "framesSinceA", LVT_U8, offsetof(struct MarioState, framesSinceA), false, LOT_NONE }, + { "framesSinceB", LVT_U8, offsetof(struct MarioState, framesSinceB), false, LOT_NONE }, + { "wallKickTimer", LVT_U8, offsetof(struct MarioState, wallKickTimer), false, LOT_NONE }, + { "doubleJumpTimer", LVT_U8, offsetof(struct MarioState, doubleJumpTimer), false, LOT_NONE }, + { "faceAngle", LVT_COBJECT, offsetof(struct MarioState, faceAngle), true, LOT_VEC3S }, + { "angleVel", LVT_COBJECT, offsetof(struct MarioState, angleVel), true, LOT_VEC3S }, + { "slideYaw", LVT_S16, offsetof(struct MarioState, slideYaw), false, LOT_NONE }, + { "twirlYaw", LVT_S16, offsetof(struct MarioState, twirlYaw), false, LOT_NONE }, + { "pos", LVT_COBJECT, offsetof(struct MarioState, pos), true, LOT_VEC3F }, + { "vel", LVT_COBJECT, offsetof(struct MarioState, vel), true, LOT_VEC3F }, + { "forwardVel", LVT_F32, offsetof(struct MarioState, forwardVel), false, LOT_NONE }, + { "slideVelX", LVT_F32, offsetof(struct MarioState, slideVelX), false, LOT_NONE }, + { "slideVelZ", LVT_F32, offsetof(struct MarioState, slideVelZ), false, LOT_NONE }, + { "wall", LVT_COBJECT_P, offsetof(struct MarioState, wall), false, LOT_SURFACE }, + { "ceil", LVT_COBJECT_P, offsetof(struct MarioState, ceil), false, LOT_SURFACE }, + { "floor", LVT_COBJECT_P, offsetof(struct MarioState, floor), false, LOT_SURFACE }, + { "ceilHeight", LVT_F32, offsetof(struct MarioState, ceilHeight), false, LOT_NONE }, + { "floorHeight", LVT_F32, offsetof(struct MarioState, floorHeight), false, LOT_NONE }, + { "floorAngle", LVT_S16, offsetof(struct MarioState, floorAngle), false, LOT_NONE }, + { "waterLevel", LVT_S16, offsetof(struct MarioState, waterLevel), false, LOT_NONE }, + { "interactObj", LVT_COBJECT_P, offsetof(struct MarioState, interactObj), false, LOT_OBJECT }, + { "heldObj", LVT_COBJECT_P, offsetof(struct MarioState, heldObj), false, LOT_OBJECT }, + { "usedObj", LVT_COBJECT_P, offsetof(struct MarioState, usedObj), false, LOT_OBJECT }, + { "riddenObj", LVT_COBJECT_P, offsetof(struct MarioState, riddenObj), false, LOT_OBJECT }, + { "marioObj", LVT_COBJECT_P, offsetof(struct MarioState, marioObj), false, LOT_OBJECT }, + { "spawnInfo", LVT_COBJECT_P, offsetof(struct MarioState, spawnInfo), false, LOT_SPAWNINFO }, + { "area", LVT_COBJECT_P, offsetof(struct MarioState, area), false, LOT_AREA }, + { "statusForCamera", LVT_COBJECT_P, offsetof(struct MarioState, statusForCamera), false, LOT_PLAYERCAMERASTATE }, + { "marioBodyState", LVT_COBJECT_P, offsetof(struct MarioState, marioBodyState), false, LOT_MARIOBODYSTATE }, + { "controller", LVT_COBJECT_P, offsetof(struct MarioState, controller), false, LOT_CONTROLLER }, + { "animation", LVT_COBJECT_P, offsetof(struct MarioState, animation), false, LOT_MARIOANIMATION }, + { "collidedObjInteractTypes", LVT_U32, offsetof(struct MarioState, collidedObjInteractTypes), false, LOT_NONE }, + { "numCoins", LVT_S16, offsetof(struct MarioState, numCoins), false, LOT_NONE }, + { "numStars", LVT_S16, offsetof(struct MarioState, numStars), false, LOT_NONE }, + { "numKeys", LVT_S8, offsetof(struct MarioState, numKeys), false, LOT_NONE }, + { "numLives", LVT_S8, offsetof(struct MarioState, numLives), false, LOT_NONE }, + { "health", LVT_S16, offsetof(struct MarioState, health), false, LOT_NONE }, + { "unkB0", LVT_S16, offsetof(struct MarioState, unkB0), false, LOT_NONE }, + { "hurtCounter", LVT_U8, offsetof(struct MarioState, hurtCounter), false, LOT_NONE }, + { "healCounter", LVT_U8, offsetof(struct MarioState, healCounter), false, LOT_NONE }, + { "squishTimer", LVT_U8, offsetof(struct MarioState, squishTimer), false, LOT_NONE }, + { "fadeWarpOpacity", LVT_U8, offsetof(struct MarioState, fadeWarpOpacity), false, LOT_NONE }, + { "capTimer", LVT_U16, offsetof(struct MarioState, capTimer), false, LOT_NONE }, + { "prevNumStarsForDialog", LVT_S16, offsetof(struct MarioState, prevNumStarsForDialog), false, LOT_NONE }, + { "peakHeight", LVT_F32, offsetof(struct MarioState, peakHeight), false, LOT_NONE }, + { "quicksandDepth", LVT_F32, offsetof(struct MarioState, quicksandDepth), false, LOT_NONE }, + { "unkC4", LVT_F32, offsetof(struct MarioState, unkC4), false, LOT_NONE }, + { "currentRoom", LVT_S16, offsetof(struct MarioState, currentRoom), false, LOT_NONE }, + { "heldByObj", LVT_COBJECT_P, offsetof(struct MarioState, heldByObj), false, LOT_OBJECT }, + { "isSnoring", LVT_U8, offsetof(struct MarioState, isSnoring), false, LOT_NONE }, + { "bubbleObj", LVT_COBJECT_P, offsetof(struct MarioState, bubbleObj), false, LOT_OBJECT }, + { "freeze", LVT_U8, offsetof(struct MarioState, freeze), false, LOT_NONE }, +// { "splineKeyframe", LVT_???, offsetof(struct MarioState, splineKeyframe), false, LOT_??? }, <--- UNIMPLEMENTED + { "splineKeyframeFraction", LVT_F32, offsetof(struct MarioState, splineKeyframeFraction), false, LOT_NONE }, + { "splineState", LVT_S32, offsetof(struct MarioState, splineState), false, LOT_NONE }, + { "nonInstantWarpPos", LVT_COBJECT, offsetof(struct MarioState, nonInstantWarpPos), true, LOT_VEC3F }, + { "character", LVT_COBJECT_P, offsetof(struct MarioState, character), false, LOT_CHARACTER }, + { "wasNetworkVisible", LVT_U8, offsetof(struct MarioState, wasNetworkVisible), false, LOT_NONE }, + { "minimumBoneY", LVT_F32, offsetof(struct MarioState, minimumBoneY), false, LOT_NONE }, + { "curAnimOffset", LVT_F32, offsetof(struct MarioState, curAnimOffset), false, LOT_NONE }, +}; + +#define LUA_WARP_NODE_FIELD_COUNT 4 +static struct LuaObjectField sWarpNodeFields[LUA_WARP_NODE_FIELD_COUNT] = { + { "id", LVT_U8, offsetof(struct WarpNode, id), false, LOT_NONE }, + { "destLevel", LVT_U8, offsetof(struct WarpNode, destLevel), false, LOT_NONE }, + { "destArea", LVT_U8, offsetof(struct WarpNode, destArea), false, LOT_NONE }, + { "destNode", LVT_U8, offsetof(struct WarpNode, destNode), false, LOT_NONE }, +}; + +#define LUA_OBJECT_WARP_NODE_FIELD_COUNT 3 +static struct LuaObjectField sObjectWarpNodeFields[LUA_OBJECT_WARP_NODE_FIELD_COUNT] = { + { "node", LVT_COBJECT, offsetof(struct ObjectWarpNode, node), true, LOT_WARPNODE }, + { "object", LVT_COBJECT_P, offsetof(struct ObjectWarpNode, object), false, LOT_OBJECT }, + { "next", LVT_COBJECT_P, offsetof(struct ObjectWarpNode, next), false, LOT_OBJECTWARPNODE }, +}; + +#define LUA_INSTANT_WARP_FIELD_COUNT 3 +static struct LuaObjectField sInstantWarpFields[LUA_INSTANT_WARP_FIELD_COUNT] = { + { "id", LVT_U8, offsetof(struct InstantWarp, id), false, LOT_NONE }, + { "area", LVT_U8, offsetof(struct InstantWarp, area), false, LOT_NONE }, + { "displacement", LVT_COBJECT, offsetof(struct InstantWarp, displacement), true, LOT_VEC3S }, +}; + +#define LUA_SPAWN_INFO_FIELD_COUNT 7 +static struct LuaObjectField sSpawnInfoFields[LUA_SPAWN_INFO_FIELD_COUNT] = { + { "startPos", LVT_COBJECT, offsetof(struct SpawnInfo, startPos), true, LOT_VEC3S }, + { "startAngle", LVT_COBJECT, offsetof(struct SpawnInfo, startAngle), true, LOT_VEC3S }, + { "areaIndex", LVT_S8, offsetof(struct SpawnInfo, areaIndex), false, LOT_NONE }, + { "activeAreaIndex", LVT_S8, offsetof(struct SpawnInfo, activeAreaIndex), false, LOT_NONE }, + { "behaviorArg", LVT_U32, offsetof(struct SpawnInfo, behaviorArg), false, LOT_NONE }, +// { "behaviorScript", LVT_???, offsetof(struct SpawnInfo, behaviorScript), false, LOT_??? }, <--- UNIMPLEMENTED + { "unk18", LVT_COBJECT_P, offsetof(struct SpawnInfo, unk18), false, LOT_GRAPHNODE }, + { "next", LVT_COBJECT_P, offsetof(struct SpawnInfo, next), false, LOT_SPAWNINFO }, +}; + +#define LUA_WHIRLPOOL_FIELD_COUNT 2 +static struct LuaObjectField sWhirlpoolFields[LUA_WHIRLPOOL_FIELD_COUNT] = { + { "pos", LVT_COBJECT, offsetof(struct Whirlpool, pos), true, LOT_VEC3S }, + { "strength", LVT_S16, offsetof(struct Whirlpool, strength), false, LOT_NONE }, +}; + +#define LUA_AREA_FIELD_COUNT 10 +static struct LuaObjectField sAreaFields[LUA_AREA_FIELD_COUNT] = { + { "index", LVT_S8, offsetof(struct Area, index), false, LOT_NONE }, + { "flags", LVT_S8, offsetof(struct Area, flags), false, LOT_NONE }, + { "terrainType", LVT_U16, offsetof(struct Area, terrainType), false, LOT_NONE }, +// { "unk04", LVT_COBJECT_P, offsetof(struct Area, unk04), false, LOT_??? }, <--- UNIMPLEMENTED +// { "terrainData", LVT_???, offsetof(struct Area, terrainData), false, LOT_??? }, <--- UNIMPLEMENTED +// { "surfaceRooms", LVT_???, offsetof(struct Area, surfaceRooms), false, LOT_??? }, <--- UNIMPLEMENTED +// { "macroObjects", LVT_???, offsetof(struct Area, macroObjects), false, LOT_??? }, <--- UNIMPLEMENTED + { "warpNodes", LVT_COBJECT_P, offsetof(struct Area, warpNodes), false, LOT_OBJECTWARPNODE }, + { "paintingWarpNodes", LVT_COBJECT_P, offsetof(struct Area, paintingWarpNodes), false, LOT_WARPNODE }, + { "instantWarps", LVT_COBJECT_P, offsetof(struct Area, instantWarps), false, LOT_INSTANTWARP }, + { "objectSpawnInfos", LVT_COBJECT_P, offsetof(struct Area, objectSpawnInfos), false, LOT_SPAWNINFO }, + { "camera", LVT_COBJECT_P, offsetof(struct Area, camera), false, LOT_CAMERA }, +// { "unused28", LVT_COBJECT_P, offsetof(struct Area, unused28), false, LOT_??? }, <--- UNIMPLEMENTED +// { "whirlpools", LVT_COBJECT_P, offsetof(struct Area, whirlpools), false, LOT_??? }, <--- UNIMPLEMENTED +// { "dialog", LVT_???, offsetof(struct Area, dialog), false, LOT_??? }, <--- UNIMPLEMENTED + { "musicParam", LVT_U16, offsetof(struct Area, musicParam), false, LOT_NONE }, + { "musicParam2", LVT_U16, offsetof(struct Area, musicParam2), false, LOT_NONE }, +// { "cachedBehaviors", LVT_???, offsetof(struct Area, cachedBehaviors), false, LOT_??? }, <--- UNIMPLEMENTED +// { "cachedPositions", LVT_???, offsetof(struct Area, cachedPositions), false, LOT_??? }, <--- UNIMPLEMENTED +}; + +#define LUA_WARP_TRANSITION_DATA_FIELD_COUNT 10 +static struct LuaObjectField sWarpTransitionDataFields[LUA_WARP_TRANSITION_DATA_FIELD_COUNT] = { + { "red", LVT_U8, offsetof(struct WarpTransitionData, red), false, LOT_NONE }, + { "green", LVT_U8, offsetof(struct WarpTransitionData, green), false, LOT_NONE }, + { "blue", LVT_U8, offsetof(struct WarpTransitionData, blue), false, LOT_NONE }, + { "startTexRadius", LVT_S16, offsetof(struct WarpTransitionData, startTexRadius), false, LOT_NONE }, + { "endTexRadius", LVT_S16, offsetof(struct WarpTransitionData, endTexRadius), false, LOT_NONE }, + { "startTexX", LVT_S16, offsetof(struct WarpTransitionData, startTexX), false, LOT_NONE }, + { "startTexY", LVT_S16, offsetof(struct WarpTransitionData, startTexY), false, LOT_NONE }, + { "endTexX", LVT_S16, offsetof(struct WarpTransitionData, endTexX), false, LOT_NONE }, + { "endTexY", LVT_S16, offsetof(struct WarpTransitionData, endTexY), false, LOT_NONE }, + { "texTimer", LVT_S16, offsetof(struct WarpTransitionData, texTimer), false, LOT_NONE }, +}; + +#define LUA_WARP_TRANSITION_FIELD_COUNT 5 +static struct LuaObjectField sWarpTransitionFields[LUA_WARP_TRANSITION_FIELD_COUNT] = { + { "isActive", LVT_U8, offsetof(struct WarpTransition, isActive), false, LOT_NONE }, + { "type", LVT_U8, offsetof(struct WarpTransition, type), false, LOT_NONE }, + { "time", LVT_U8, offsetof(struct WarpTransition, time), false, LOT_NONE }, + { "pauseRendering", LVT_U8, offsetof(struct WarpTransition, pauseRendering), false, LOT_NONE }, + { "data", LVT_COBJECT, offsetof(struct WarpTransition, data), true, LOT_WARPTRANSITIONDATA }, +}; + +#define LUA_PLAYER_CAMERA_STATE_FIELD_COUNT 7 +static struct LuaObjectField sPlayerCameraStateFields[LUA_PLAYER_CAMERA_STATE_FIELD_COUNT] = { + { "action", LVT_U32, offsetof(struct PlayerCameraState, action), false, LOT_NONE }, + { "pos", LVT_COBJECT, offsetof(struct PlayerCameraState, pos), true, LOT_VEC3F }, + { "faceAngle", LVT_COBJECT, offsetof(struct PlayerCameraState, faceAngle), true, LOT_VEC3S }, + { "headRotation", LVT_COBJECT, offsetof(struct PlayerCameraState, headRotation), true, LOT_VEC3S }, + { "unused", LVT_S16, offsetof(struct PlayerCameraState, unused), false, LOT_NONE }, + { "cameraEvent", LVT_S16, offsetof(struct PlayerCameraState, cameraEvent), false, LOT_NONE }, + { "usedObj", LVT_COBJECT_P, offsetof(struct PlayerCameraState, usedObj), false, LOT_OBJECT }, +}; + +#define LUA_TRANSITION_INFO_FIELD_COUNT 9 +static struct LuaObjectField sTransitionInfoFields[LUA_TRANSITION_INFO_FIELD_COUNT] = { + { "posPitch", LVT_S16, offsetof(struct TransitionInfo, posPitch), false, LOT_NONE }, + { "posYaw", LVT_S16, offsetof(struct TransitionInfo, posYaw), false, LOT_NONE }, + { "posDist", LVT_F32, offsetof(struct TransitionInfo, posDist), false, LOT_NONE }, + { "focPitch", LVT_S16, offsetof(struct TransitionInfo, focPitch), false, LOT_NONE }, + { "focYaw", LVT_S16, offsetof(struct TransitionInfo, focYaw), false, LOT_NONE }, + { "focDist", LVT_F32, offsetof(struct TransitionInfo, focDist), false, LOT_NONE }, + { "framesLeft", LVT_S32, offsetof(struct TransitionInfo, framesLeft), false, LOT_NONE }, + { "marioPos", LVT_COBJECT, offsetof(struct TransitionInfo, marioPos), true, LOT_VEC3F }, + { "pad", LVT_U8, offsetof(struct TransitionInfo, pad), false, LOT_NONE }, +}; + +#define LUA_HANDHELD_SHAKE_POINT_FIELD_COUNT 3 +static struct LuaObjectField sHandheldShakePointFields[LUA_HANDHELD_SHAKE_POINT_FIELD_COUNT] = { + { "index", LVT_S8, offsetof(struct HandheldShakePoint, index), false, LOT_NONE }, + { "pad", LVT_U32, offsetof(struct HandheldShakePoint, pad), false, LOT_NONE }, + { "point", LVT_COBJECT, offsetof(struct HandheldShakePoint, point), true, LOT_VEC3S }, +}; + +#define LUA_CAMERA_TRIGGER_FIELD_COUNT 8 +static struct LuaObjectField sCameraTriggerFields[LUA_CAMERA_TRIGGER_FIELD_COUNT] = { + { "area", LVT_S8, offsetof(struct CameraTrigger, area), false, LOT_NONE }, +// { "event", LVT_???, offsetof(struct CameraTrigger, event), false, LOT_??? }, <--- UNIMPLEMENTED + { "centerX", LVT_S16, offsetof(struct CameraTrigger, centerX), false, LOT_NONE }, + { "centerY", LVT_S16, offsetof(struct CameraTrigger, centerY), false, LOT_NONE }, + { "centerZ", LVT_S16, offsetof(struct CameraTrigger, centerZ), false, LOT_NONE }, + { "boundsX", LVT_S16, offsetof(struct CameraTrigger, boundsX), false, LOT_NONE }, + { "boundsY", LVT_S16, offsetof(struct CameraTrigger, boundsY), false, LOT_NONE }, + { "boundsZ", LVT_S16, offsetof(struct CameraTrigger, boundsZ), false, LOT_NONE }, + { "boundsYaw", LVT_S16, offsetof(struct CameraTrigger, boundsYaw), false, LOT_NONE }, +}; + +#define LUA_CUTSCENE_FIELD_COUNT 1 +static struct LuaObjectField sCutsceneFields[LUA_CUTSCENE_FIELD_COUNT] = { +// { "shot", LVT_???, offsetof(struct Cutscene, shot), false, LOT_??? }, <--- UNIMPLEMENTED + { "duration", LVT_S16, offsetof(struct Cutscene, duration), false, LOT_NONE }, +}; + +#define LUA_CAMERA_FOVSTATUS_FIELD_COUNT 8 +static struct LuaObjectField sCameraFOVStatusFields[LUA_CAMERA_FOVSTATUS_FIELD_COUNT] = { + { "fovFunc", LVT_U8, offsetof(struct CameraFOVStatus, fovFunc), false, LOT_NONE }, + { "fov", LVT_F32, offsetof(struct CameraFOVStatus, fov), false, LOT_NONE }, + { "fovOffset", LVT_F32, offsetof(struct CameraFOVStatus, fovOffset), false, LOT_NONE }, + { "unusedIsSleeping", LVT_U32, offsetof(struct CameraFOVStatus, unusedIsSleeping), false, LOT_NONE }, + { "shakeAmplitude", LVT_F32, offsetof(struct CameraFOVStatus, shakeAmplitude), false, LOT_NONE }, + { "shakePhase", LVT_S16, offsetof(struct CameraFOVStatus, shakePhase), false, LOT_NONE }, + { "shakeSpeed", LVT_S16, offsetof(struct CameraFOVStatus, shakeSpeed), false, LOT_NONE }, + { "decay", LVT_S16, offsetof(struct CameraFOVStatus, decay), false, LOT_NONE }, +}; + +#define LUA_CUTSCENE_SPLINE_POINT_FIELD_COUNT 3 +static struct LuaObjectField sCutsceneSplinePointFields[LUA_CUTSCENE_SPLINE_POINT_FIELD_COUNT] = { + { "index", LVT_S8, offsetof(struct CutsceneSplinePoint, index), false, LOT_NONE }, + { "speed", LVT_U8, offsetof(struct CutsceneSplinePoint, speed), false, LOT_NONE }, + { "point", LVT_COBJECT, offsetof(struct CutsceneSplinePoint, point), true, LOT_VEC3S }, +}; + +#define LUA_PLAYER_GEOMETRY_FIELD_COUNT 13 +static struct LuaObjectField sPlayerGeometryFields[LUA_PLAYER_GEOMETRY_FIELD_COUNT] = { + { "currFloor", LVT_COBJECT_P, offsetof(struct PlayerGeometry, currFloor), false, LOT_SURFACE }, + { "currFloorHeight", LVT_F32, offsetof(struct PlayerGeometry, currFloorHeight), false, LOT_NONE }, + { "currFloorType", LVT_S16, offsetof(struct PlayerGeometry, currFloorType), false, LOT_NONE }, + { "currCeil", LVT_COBJECT_P, offsetof(struct PlayerGeometry, currCeil), false, LOT_SURFACE }, + { "currCeilType", LVT_S16, offsetof(struct PlayerGeometry, currCeilType), false, LOT_NONE }, + { "currCeilHeight", LVT_F32, offsetof(struct PlayerGeometry, currCeilHeight), false, LOT_NONE }, + { "prevFloor", LVT_COBJECT_P, offsetof(struct PlayerGeometry, prevFloor), false, LOT_SURFACE }, + { "prevFloorHeight", LVT_F32, offsetof(struct PlayerGeometry, prevFloorHeight), false, LOT_NONE }, + { "prevFloorType", LVT_S16, offsetof(struct PlayerGeometry, prevFloorType), false, LOT_NONE }, + { "prevCeil", LVT_COBJECT_P, offsetof(struct PlayerGeometry, prevCeil), false, LOT_SURFACE }, + { "prevCeilHeight", LVT_F32, offsetof(struct PlayerGeometry, prevCeilHeight), false, LOT_NONE }, + { "prevCeilType", LVT_S16, offsetof(struct PlayerGeometry, prevCeilType), false, LOT_NONE }, + { "waterHeight", LVT_F32, offsetof(struct PlayerGeometry, waterHeight), false, LOT_NONE }, +}; + +#define LUA_LINEAR_TRANSITION_POINT_FIELD_COUNT 5 +static struct LuaObjectField sLinearTransitionPointFields[LUA_LINEAR_TRANSITION_POINT_FIELD_COUNT] = { + { "focus", LVT_COBJECT, offsetof(struct LinearTransitionPoint, focus), true, LOT_VEC3F }, + { "pos", LVT_COBJECT, offsetof(struct LinearTransitionPoint, pos), true, LOT_VEC3F }, + { "dist", LVT_F32, offsetof(struct LinearTransitionPoint, dist), false, LOT_NONE }, + { "pitch", LVT_S16, offsetof(struct LinearTransitionPoint, pitch), false, LOT_NONE }, + { "yaw", LVT_S16, offsetof(struct LinearTransitionPoint, yaw), false, LOT_NONE }, +}; + +#define LUA_MODE_TRANSITION_INFO_FIELD_COUNT 6 +static struct LuaObjectField sModeTransitionInfoFields[LUA_MODE_TRANSITION_INFO_FIELD_COUNT] = { + { "newMode", LVT_S16, offsetof(struct ModeTransitionInfo, newMode), false, LOT_NONE }, + { "lastMode", LVT_S16, offsetof(struct ModeTransitionInfo, lastMode), false, LOT_NONE }, + { "max", LVT_S16, offsetof(struct ModeTransitionInfo, max), false, LOT_NONE }, + { "frame", LVT_S16, offsetof(struct ModeTransitionInfo, frame), false, LOT_NONE }, + { "transitionStart", LVT_COBJECT, offsetof(struct ModeTransitionInfo, transitionStart), true, LOT_LINEARTRANSITIONPOINT }, + { "transitionEnd", LVT_COBJECT, offsetof(struct ModeTransitionInfo, transitionEnd), true, LOT_LINEARTRANSITIONPOINT }, +}; + +#define LUA_PARALLEL_TRACKING_POINT_FIELD_COUNT 4 +static struct LuaObjectField sParallelTrackingPointFields[LUA_PARALLEL_TRACKING_POINT_FIELD_COUNT] = { + { "startOfPath", LVT_S16, offsetof(struct ParallelTrackingPoint, startOfPath), false, LOT_NONE }, + { "pos", LVT_COBJECT, offsetof(struct ParallelTrackingPoint, pos), true, LOT_VEC3F }, + { "distThresh", LVT_F32, offsetof(struct ParallelTrackingPoint, distThresh), false, LOT_NONE }, + { "zoom", LVT_F32, offsetof(struct ParallelTrackingPoint, zoom), false, LOT_NONE }, +}; + +#define LUA_CAMERA_STORED_INFO_FIELD_COUNT 4 +static struct LuaObjectField sCameraStoredInfoFields[LUA_CAMERA_STORED_INFO_FIELD_COUNT] = { + { "pos", LVT_COBJECT, offsetof(struct CameraStoredInfo, pos), true, LOT_VEC3F }, + { "focus", LVT_COBJECT, offsetof(struct CameraStoredInfo, focus), true, LOT_VEC3F }, + { "panDist", LVT_F32, offsetof(struct CameraStoredInfo, panDist), false, LOT_NONE }, + { "cannonYOffset", LVT_F32, offsetof(struct CameraStoredInfo, cannonYOffset), false, LOT_NONE }, +}; + +#define LUA_CUTSCENE_VARIABLE_FIELD_COUNT 5 +static struct LuaObjectField sCutsceneVariableFields[LUA_CUTSCENE_VARIABLE_FIELD_COUNT] = { + { "unused1", LVT_S32, offsetof(struct CutsceneVariable, unused1), false, LOT_NONE }, + { "point", LVT_COBJECT, offsetof(struct CutsceneVariable, point), true, LOT_VEC3F }, + { "unusedPoint", LVT_COBJECT, offsetof(struct CutsceneVariable, unusedPoint), true, LOT_VEC3F }, + { "angle", LVT_COBJECT, offsetof(struct CutsceneVariable, angle), true, LOT_VEC3S }, + { "unused2", LVT_S16, offsetof(struct CutsceneVariable, unused2), false, LOT_NONE }, +}; + +#define LUA_CAMERA_FIELD_COUNT 12 +static struct LuaObjectField sCameraFields[LUA_CAMERA_FIELD_COUNT] = { + { "mode", LVT_U8, offsetof(struct Camera, mode), false, LOT_NONE }, + { "defMode", LVT_U8, offsetof(struct Camera, defMode), false, LOT_NONE }, + { "yaw", LVT_S16, offsetof(struct Camera, yaw), false, LOT_NONE }, + { "focus", LVT_COBJECT, offsetof(struct Camera, focus), true, LOT_VEC3F }, + { "pos", LVT_COBJECT, offsetof(struct Camera, pos), true, LOT_VEC3F }, + { "unusedVec1", LVT_COBJECT, offsetof(struct Camera, unusedVec1), true, LOT_VEC3F }, + { "areaCenX", LVT_F32, offsetof(struct Camera, areaCenX), false, LOT_NONE }, + { "areaCenZ", LVT_F32, offsetof(struct Camera, areaCenZ), false, LOT_NONE }, + { "cutscene", LVT_U8, offsetof(struct Camera, cutscene), false, LOT_NONE }, +// { "filler31", LVT_???, offsetof(struct Camera, filler31), false, LOT_??? }, <--- UNIMPLEMENTED + { "nextYaw", LVT_S16, offsetof(struct Camera, nextYaw), false, LOT_NONE }, +// { "filler3C", LVT_???, offsetof(struct Camera, filler3C), false, LOT_??? }, <--- UNIMPLEMENTED + { "doorStatus", LVT_U8, offsetof(struct Camera, doorStatus), false, LOT_NONE }, + { "areaCenY", LVT_F32, offsetof(struct Camera, areaCenY), false, LOT_NONE }, +}; + +#define LUA_LAKITU_STATE_FIELD_COUNT 35 +static struct LuaObjectField sLakituStateFields[LUA_LAKITU_STATE_FIELD_COUNT] = { + { "curFocus", LVT_COBJECT, offsetof(struct LakituState, curFocus), true, LOT_VEC3F }, + { "curPos", LVT_COBJECT, offsetof(struct LakituState, curPos), true, LOT_VEC3F }, + { "goalFocus", LVT_COBJECT, offsetof(struct LakituState, goalFocus), true, LOT_VEC3F }, + { "goalPos", LVT_COBJECT, offsetof(struct LakituState, goalPos), true, LOT_VEC3F }, +// { "filler30", LVT_???, offsetof(struct LakituState, filler30), false, LOT_??? }, <--- UNIMPLEMENTED + { "mode", LVT_U8, offsetof(struct LakituState, mode), false, LOT_NONE }, + { "defMode", LVT_U8, offsetof(struct LakituState, defMode), false, LOT_NONE }, +// { "filler3E", LVT_???, offsetof(struct LakituState, filler3E), false, LOT_??? }, <--- UNIMPLEMENTED + { "focusDistance", LVT_F32, offsetof(struct LakituState, focusDistance), false, LOT_NONE }, + { "oldPitch", LVT_S16, offsetof(struct LakituState, oldPitch), false, LOT_NONE }, + { "oldYaw", LVT_S16, offsetof(struct LakituState, oldYaw), false, LOT_NONE }, + { "oldRoll", LVT_S16, offsetof(struct LakituState, oldRoll), false, LOT_NONE }, + { "shakeMagnitude", LVT_COBJECT, offsetof(struct LakituState, shakeMagnitude), true, LOT_VEC3S }, + { "shakePitchPhase", LVT_S16, offsetof(struct LakituState, shakePitchPhase), false, LOT_NONE }, + { "shakePitchVel", LVT_S16, offsetof(struct LakituState, shakePitchVel), false, LOT_NONE }, + { "shakePitchDecay", LVT_S16, offsetof(struct LakituState, shakePitchDecay), false, LOT_NONE }, + { "unusedVec1", LVT_COBJECT, offsetof(struct LakituState, unusedVec1), true, LOT_VEC3F }, + { "unusedVec2", LVT_COBJECT, offsetof(struct LakituState, unusedVec2), true, LOT_VEC3S }, +// { "filler72", LVT_???, offsetof(struct LakituState, filler72), false, LOT_??? }, <--- UNIMPLEMENTED + { "roll", LVT_S16, offsetof(struct LakituState, roll), false, LOT_NONE }, + { "yaw", LVT_S16, offsetof(struct LakituState, yaw), false, LOT_NONE }, + { "nextYaw", LVT_S16, offsetof(struct LakituState, nextYaw), false, LOT_NONE }, + { "focus", LVT_COBJECT, offsetof(struct LakituState, focus), true, LOT_VEC3F }, + { "pos", LVT_COBJECT, offsetof(struct LakituState, pos), true, LOT_VEC3F }, + { "shakeRollPhase", LVT_S16, offsetof(struct LakituState, shakeRollPhase), false, LOT_NONE }, + { "shakeRollVel", LVT_S16, offsetof(struct LakituState, shakeRollVel), false, LOT_NONE }, + { "shakeRollDecay", LVT_S16, offsetof(struct LakituState, shakeRollDecay), false, LOT_NONE }, + { "shakeYawPhase", LVT_S16, offsetof(struct LakituState, shakeYawPhase), false, LOT_NONE }, + { "shakeYawVel", LVT_S16, offsetof(struct LakituState, shakeYawVel), false, LOT_NONE }, + { "shakeYawDecay", LVT_S16, offsetof(struct LakituState, shakeYawDecay), false, LOT_NONE }, + { "focHSpeed", LVT_F32, offsetof(struct LakituState, focHSpeed), false, LOT_NONE }, + { "focVSpeed", LVT_F32, offsetof(struct LakituState, focVSpeed), false, LOT_NONE }, + { "posHSpeed", LVT_F32, offsetof(struct LakituState, posHSpeed), false, LOT_NONE }, + { "posVSpeed", LVT_F32, offsetof(struct LakituState, posVSpeed), false, LOT_NONE }, + { "keyDanceRoll", LVT_S16, offsetof(struct LakituState, keyDanceRoll), false, LOT_NONE }, + { "lastFrameAction", LVT_U32, offsetof(struct LakituState, lastFrameAction), false, LOT_NONE }, + { "unused", LVT_S16, offsetof(struct LakituState, unused), false, LOT_NONE }, + { "skipCameraInterpolationTimestamp", LVT_U32, offsetof(struct LakituState, skipCameraInterpolationTimestamp), false, LOT_NONE }, +}; + +#define LUA_CHARACTER_FIELD_COUNT 54 +static struct LuaObjectField sCharacterFields[LUA_CHARACTER_FIELD_COUNT] = { +// { "name", LVT_???, offsetof(struct Character, name), false, LOT_??? }, <--- UNIMPLEMENTED +// { "hudHead", LVT_???, offsetof(struct Character, hudHead), false, LOT_??? }, <--- UNIMPLEMENTED +// { "hudHeadTexture", LVT_???, offsetof(struct Character, hudHeadTexture), false, LOT_??? }, <--- UNIMPLEMENTED + { "cameraHudHead", LVT_U32, offsetof(struct Character, cameraHudHead), false, LOT_NONE }, + { "modelId", LVT_U32, offsetof(struct Character, modelId), false, LOT_NONE }, + { "capModelId", LVT_U32, offsetof(struct Character, capModelId), false, LOT_NONE }, + { "capMetalModelId", LVT_U32, offsetof(struct Character, capMetalModelId), false, LOT_NONE }, + { "capWingModelId", LVT_U32, offsetof(struct Character, capWingModelId), false, LOT_NONE }, + { "capMetalWingModelId", LVT_U32, offsetof(struct Character, capMetalWingModelId), false, LOT_NONE }, + { "capEnemyLayer", LVT_U8, offsetof(struct Character, capEnemyLayer), false, LOT_NONE }, +// { "capEnemyGfx", LVT_???, offsetof(struct Character, capEnemyGfx), false, LOT_??? }, <--- UNIMPLEMENTED +// { "capEnemyDecalGfx", LVT_???, offsetof(struct Character, capEnemyDecalGfx), false, LOT_??? }, <--- UNIMPLEMENTED + { "animOffsetEnabled", LVT_U8, offsetof(struct Character, animOffsetEnabled), false, LOT_NONE }, + { "animOffsetLowYPoint", LVT_F32, offsetof(struct Character, animOffsetLowYPoint), false, LOT_NONE }, + { "animOffsetFeet", LVT_F32, offsetof(struct Character, animOffsetFeet), false, LOT_NONE }, + { "animOffsetHand", LVT_F32, offsetof(struct Character, animOffsetHand), false, LOT_NONE }, + { "soundFreqScale", LVT_F32, offsetof(struct Character, soundFreqScale), false, LOT_NONE }, + { "soundYahWahHoo", LVT_S32, offsetof(struct Character, soundYahWahHoo), false, LOT_NONE }, + { "soundHoohoo", LVT_S32, offsetof(struct Character, soundHoohoo), false, LOT_NONE }, + { "soundYahoo", LVT_S32, offsetof(struct Character, soundYahoo), false, LOT_NONE }, + { "soundUh", LVT_S32, offsetof(struct Character, soundUh), false, LOT_NONE }, + { "soundHrmm", LVT_S32, offsetof(struct Character, soundHrmm), false, LOT_NONE }, + { "soundWah2", LVT_S32, offsetof(struct Character, soundWah2), false, LOT_NONE }, + { "soundWhoa", LVT_S32, offsetof(struct Character, soundWhoa), false, LOT_NONE }, + { "soundEeuh", LVT_S32, offsetof(struct Character, soundEeuh), false, LOT_NONE }, + { "soundAttacked", LVT_S32, offsetof(struct Character, soundAttacked), false, LOT_NONE }, + { "soundOoof", LVT_S32, offsetof(struct Character, soundOoof), false, LOT_NONE }, + { "soundOoof2", LVT_S32, offsetof(struct Character, soundOoof2), false, LOT_NONE }, + { "soundHereWeGo", LVT_S32, offsetof(struct Character, soundHereWeGo), false, LOT_NONE }, + { "soundYawning", LVT_S32, offsetof(struct Character, soundYawning), false, LOT_NONE }, + { "soundSnoring1", LVT_S32, offsetof(struct Character, soundSnoring1), false, LOT_NONE }, + { "soundSnoring2", LVT_S32, offsetof(struct Character, soundSnoring2), false, LOT_NONE }, + { "soundWaaaooow", LVT_S32, offsetof(struct Character, soundWaaaooow), false, LOT_NONE }, + { "soundHaha", LVT_S32, offsetof(struct Character, soundHaha), false, LOT_NONE }, + { "soundHaha_2", LVT_S32, offsetof(struct Character, soundHaha_2), false, LOT_NONE }, + { "soundUh2", LVT_S32, offsetof(struct Character, soundUh2), false, LOT_NONE }, + { "soundUh2_2", LVT_S32, offsetof(struct Character, soundUh2_2), false, LOT_NONE }, + { "soundOnFire", LVT_S32, offsetof(struct Character, soundOnFire), false, LOT_NONE }, + { "soundDying", LVT_S32, offsetof(struct Character, soundDying), false, LOT_NONE }, + { "soundPantingCold", LVT_S32, offsetof(struct Character, soundPantingCold), false, LOT_NONE }, + { "soundPanting", LVT_S32, offsetof(struct Character, soundPanting), false, LOT_NONE }, + { "soundCoughing1", LVT_S32, offsetof(struct Character, soundCoughing1), false, LOT_NONE }, + { "soundCoughing2", LVT_S32, offsetof(struct Character, soundCoughing2), false, LOT_NONE }, + { "soundCoughing3", LVT_S32, offsetof(struct Character, soundCoughing3), false, LOT_NONE }, + { "soundPunchYah", LVT_S32, offsetof(struct Character, soundPunchYah), false, LOT_NONE }, + { "soundPunchHoo", LVT_S32, offsetof(struct Character, soundPunchHoo), false, LOT_NONE }, + { "soundMamaMia", LVT_S32, offsetof(struct Character, soundMamaMia), false, LOT_NONE }, + { "soundGroundPoundWah", LVT_S32, offsetof(struct Character, soundGroundPoundWah), false, LOT_NONE }, + { "soundDrowning", LVT_S32, offsetof(struct Character, soundDrowning), false, LOT_NONE }, + { "soundPunchWah", LVT_S32, offsetof(struct Character, soundPunchWah), false, LOT_NONE }, + { "soundYahooWahaYippee", LVT_S32, offsetof(struct Character, soundYahooWahaYippee), false, LOT_NONE }, + { "soundDoh", LVT_S32, offsetof(struct Character, soundDoh), false, LOT_NONE }, + { "soundGameOver", LVT_S32, offsetof(struct Character, soundGameOver), false, LOT_NONE }, + { "soundHello", LVT_S32, offsetof(struct Character, soundHello), false, LOT_NONE }, + { "soundPressStartToPlay", LVT_S32, offsetof(struct Character, soundPressStartToPlay), false, LOT_NONE }, + { "soundTwirlBounce", LVT_S32, offsetof(struct Character, soundTwirlBounce), false, LOT_NONE }, + { "soundSnoring3", LVT_S32, offsetof(struct Character, soundSnoring3), false, LOT_NONE }, + { "soundSoLongaBowser", LVT_S32, offsetof(struct Character, soundSoLongaBowser), false, LOT_NONE }, + { "soundImaTired", LVT_S32, offsetof(struct Character, soundImaTired), false, LOT_NONE }, +}; + +struct LuaObjectTable sLuaObjectAutogenTable[LOT_AUTOGEN_MAX - LOT_AUTOGEN_MIN] = { + { LOT_CONTROLLER, sControllerFields, LUA_CONTROLLER_FIELD_COUNT }, + { LOT_ANIMATION, sAnimationFields, LUA_ANIMATION_FIELD_COUNT }, + { LOT_GRAPHNODE, sGraphNodeFields, LUA_GRAPH_NODE_FIELD_COUNT }, + { LOT_GRAPHNODEOBJECT_SUB, sGraphNodeObject_subFields, LUA_GRAPH_NODE_OBJECT_SUB_FIELD_COUNT }, + { LOT_GRAPHNODEOBJECT, sGraphNodeObjectFields, LUA_GRAPH_NODE_OBJECT_FIELD_COUNT }, + { LOT_OBJECTNODE, sObjectNodeFields, LUA_OBJECT_NODE_FIELD_COUNT }, + { LOT_OBJECT, sObjectFields, LUA_OBJECT_FIELD_COUNT }, + { LOT_OBJECTHITBOX, sObjectHitboxFields, LUA_OBJECT_HITBOX_FIELD_COUNT }, + { LOT_WAYPOINT, sWaypointFields, LUA_WAYPOINT_FIELD_COUNT }, + { LOT_SURFACE, sSurfaceFields, LUA_SURFACE_FIELD_COUNT }, + { LOT_MARIOBODYSTATE, sMarioBodyStateFields, LUA_MARIO_BODY_STATE_FIELD_COUNT }, + { LOT_OFFSETSIZEPAIR, sOffsetSizePairFields, LUA_OFFSET_SIZE_PAIR_FIELD_COUNT }, + { LOT_MARIOANIMATION, sMarioAnimationFields, LUA_MARIO_ANIMATION_FIELD_COUNT }, + { LOT_MARIOSTATE, sMarioStateFields, LUA_MARIO_STATE_FIELD_COUNT }, + { LOT_WARPNODE, sWarpNodeFields, LUA_WARP_NODE_FIELD_COUNT }, + { LOT_OBJECTWARPNODE, sObjectWarpNodeFields, LUA_OBJECT_WARP_NODE_FIELD_COUNT }, + { LOT_INSTANTWARP, sInstantWarpFields, LUA_INSTANT_WARP_FIELD_COUNT }, + { LOT_SPAWNINFO, sSpawnInfoFields, LUA_SPAWN_INFO_FIELD_COUNT }, + { LOT_WHIRLPOOL, sWhirlpoolFields, LUA_WHIRLPOOL_FIELD_COUNT }, + { LOT_AREA, sAreaFields, LUA_AREA_FIELD_COUNT }, + { LOT_WARPTRANSITIONDATA, sWarpTransitionDataFields, LUA_WARP_TRANSITION_DATA_FIELD_COUNT }, + { LOT_WARPTRANSITION, sWarpTransitionFields, LUA_WARP_TRANSITION_FIELD_COUNT }, + { LOT_PLAYERCAMERASTATE, sPlayerCameraStateFields, LUA_PLAYER_CAMERA_STATE_FIELD_COUNT }, + { LOT_TRANSITIONINFO, sTransitionInfoFields, LUA_TRANSITION_INFO_FIELD_COUNT }, + { LOT_HANDHELDSHAKEPOINT, sHandheldShakePointFields, LUA_HANDHELD_SHAKE_POINT_FIELD_COUNT }, + { LOT_CAMERATRIGGER, sCameraTriggerFields, LUA_CAMERA_TRIGGER_FIELD_COUNT }, + { LOT_CUTSCENE, sCutsceneFields, LUA_CUTSCENE_FIELD_COUNT }, + { LOT_CAMERAFOVSTATUS, sCameraFOVStatusFields, LUA_CAMERA_FOVSTATUS_FIELD_COUNT }, + { LOT_CUTSCENESPLINEPOINT, sCutsceneSplinePointFields, LUA_CUTSCENE_SPLINE_POINT_FIELD_COUNT }, + { LOT_PLAYERGEOMETRY, sPlayerGeometryFields, LUA_PLAYER_GEOMETRY_FIELD_COUNT }, + { LOT_LINEARTRANSITIONPOINT, sLinearTransitionPointFields, LUA_LINEAR_TRANSITION_POINT_FIELD_COUNT }, + { LOT_MODETRANSITIONINFO, sModeTransitionInfoFields, LUA_MODE_TRANSITION_INFO_FIELD_COUNT }, + { LOT_PARALLELTRACKINGPOINT, sParallelTrackingPointFields, LUA_PARALLEL_TRACKING_POINT_FIELD_COUNT }, + { LOT_CAMERASTOREDINFO, sCameraStoredInfoFields, LUA_CAMERA_STORED_INFO_FIELD_COUNT }, + { LOT_CUTSCENEVARIABLE, sCutsceneVariableFields, LUA_CUTSCENE_VARIABLE_FIELD_COUNT }, + { LOT_CAMERA, sCameraFields, LUA_CAMERA_FIELD_COUNT }, + { LOT_LAKITUSTATE, sLakituStateFields, LUA_LAKITU_STATE_FIELD_COUNT }, + { LOT_CHARACTER, sCharacterFields, LUA_CHARACTER_FIELD_COUNT }, +}; + +struct LuaObjectField* smlua_get_object_field_autogen(u16 lot, const char* key) { + struct LuaObjectTable* ot = &sLuaObjectAutogenTable[lot - LOT_AUTOGEN_MIN - 1]; + // TODO: change this to binary search or hash table or something + for (int i = 0; i < ot->fieldCount; i++) { + if (!strcmp(ot->fields[i].key, key)) { + return &ot->fields[i]; + } + } + return NULL; +} + diff --git a/src/pc/lua/smlua_cobject_autogen.h b/src/pc/lua/smlua_cobject_autogen.h new file mode 100644 index 00000000..e1f3a967 --- /dev/null +++ b/src/pc/lua/smlua_cobject_autogen.h @@ -0,0 +1,49 @@ +#ifndef SMLUA_COBJECT_AUTOGEN_H +#define SMLUA_COBJECT_AUTOGEN_H + +enum LuaObjectAutogenType { + LOT_AUTOGEN_MIN = 1000, + LOT_CONTROLLER, + LOT_ANIMATION, + LOT_GRAPHNODE, + LOT_GRAPHNODEOBJECT_SUB, + LOT_GRAPHNODEOBJECT, + LOT_OBJECTNODE, + LOT_OBJECT, + LOT_OBJECTHITBOX, + LOT_WAYPOINT, + LOT_SURFACE, + LOT_MARIOBODYSTATE, + LOT_OFFSETSIZEPAIR, + LOT_MARIOANIMATION, + LOT_MARIOSTATE, + LOT_WARPNODE, + LOT_OBJECTWARPNODE, + LOT_INSTANTWARP, + LOT_SPAWNINFO, + LOT_WHIRLPOOL, + LOT_AREA, + LOT_WARPTRANSITIONDATA, + LOT_WARPTRANSITION, + LOT_PLAYERCAMERASTATE, + LOT_TRANSITIONINFO, + LOT_HANDHELDSHAKEPOINT, + LOT_CAMERATRIGGER, + LOT_CUTSCENE, + LOT_CAMERAFOVSTATUS, + LOT_CUTSCENESPLINEPOINT, + LOT_PLAYERGEOMETRY, + LOT_LINEARTRANSITIONPOINT, + LOT_MODETRANSITIONINFO, + LOT_PARALLELTRACKINGPOINT, + LOT_CAMERASTOREDINFO, + LOT_CUTSCENEVARIABLE, + LOT_CAMERA, + LOT_LAKITUSTATE, + LOT_CHARACTER, + LOT_AUTOGEN_MAX, +}; + +struct LuaObjectField* smlua_get_object_field_autogen(u16 lot, const char* key); + +#endif diff --git a/src/pc/lua/smlua_functions_autogen.c b/src/pc/lua/smlua_functions_autogen.c index 1a886e73..b6952dde 100644 --- a/src/pc/lua/smlua_functions_autogen.c +++ b/src/pc/lua/smlua_functions_autogen.c @@ -90,7 +90,7 @@ int smlua_func_play_sound(lua_State* L) { int smlua_func_is_anim_at_end(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } lua_pushinteger(L, is_anim_at_end(m)); @@ -101,7 +101,7 @@ int smlua_func_is_anim_at_end(lua_State* L) { int smlua_func_is_anim_past_end(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } lua_pushinteger(L, is_anim_past_end(m)); @@ -112,7 +112,7 @@ int smlua_func_is_anim_past_end(lua_State* L) { int smlua_func_set_mario_animation(lua_State* L) { if(!smlua_functions_valid_param_count(L, 2)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } s32 targetAnimID = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -125,7 +125,7 @@ int smlua_func_set_mario_animation(lua_State* L) { int smlua_func_set_mario_anim_with_accel(lua_State* L) { if(!smlua_functions_valid_param_count(L, 3)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } s32 targetAnimID = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -140,7 +140,7 @@ int smlua_func_set_mario_anim_with_accel(lua_State* L) { int smlua_func_set_anim_to_frame(lua_State* L) { if(!smlua_functions_valid_param_count(L, 2)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } s16 animFrame = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -153,7 +153,7 @@ int smlua_func_set_anim_to_frame(lua_State* L) { int smlua_func_is_anim_past_frame(lua_State* L) { if(!smlua_functions_valid_param_count(L, 2)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } s16 animFrame = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -191,7 +191,7 @@ int smlua_func_find_mario_anim_flags_and_translation(lua_State* L) { int smlua_func_update_mario_pos_for_anim(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } update_mario_pos_for_anim(m); @@ -202,7 +202,7 @@ int smlua_func_update_mario_pos_for_anim(lua_State* L) { int smlua_func_return_mario_anim_y_translation(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } lua_pushinteger(L, return_mario_anim_y_translation(m)); @@ -213,7 +213,7 @@ int smlua_func_return_mario_anim_y_translation(lua_State* L) { int smlua_func_play_sound_if_no_flag(lua_State* L) { if(!smlua_functions_valid_param_count(L, 3)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } u32 soundBits = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -228,7 +228,7 @@ int smlua_func_play_sound_if_no_flag(lua_State* L) { int smlua_func_play_mario_jump_sound(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } play_mario_jump_sound(m); @@ -239,7 +239,7 @@ int smlua_func_play_mario_jump_sound(lua_State* L) { int smlua_func_adjust_sound_for_speed(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } adjust_sound_for_speed(m); @@ -250,7 +250,7 @@ int smlua_func_adjust_sound_for_speed(lua_State* L) { int smlua_func_play_sound_and_spawn_particles(lua_State* L) { if(!smlua_functions_valid_param_count(L, 3)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } u32 soundBits = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -265,7 +265,7 @@ int smlua_func_play_sound_and_spawn_particles(lua_State* L) { int smlua_func_play_mario_action_sound(lua_State* L) { if(!smlua_functions_valid_param_count(L, 3)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } u32 soundBits = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -280,7 +280,7 @@ int smlua_func_play_mario_action_sound(lua_State* L) { int smlua_func_play_mario_landing_sound(lua_State* L) { if(!smlua_functions_valid_param_count(L, 2)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } u32 soundBits = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -293,7 +293,7 @@ int smlua_func_play_mario_landing_sound(lua_State* L) { int smlua_func_play_mario_landing_sound_once(lua_State* L) { if(!smlua_functions_valid_param_count(L, 2)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } u32 soundBits = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -306,7 +306,7 @@ int smlua_func_play_mario_landing_sound_once(lua_State* L) { int smlua_func_play_mario_heavy_landing_sound(lua_State* L) { if(!smlua_functions_valid_param_count(L, 2)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } u32 soundBits = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -319,7 +319,7 @@ int smlua_func_play_mario_heavy_landing_sound(lua_State* L) { int smlua_func_play_mario_heavy_landing_sound_once(lua_State* L) { if(!smlua_functions_valid_param_count(L, 2)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } u32 soundBits = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -332,7 +332,7 @@ int smlua_func_play_mario_heavy_landing_sound_once(lua_State* L) { int smlua_func_play_mario_sound(lua_State* L) { if(!smlua_functions_valid_param_count(L, 3)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } s32 primarySoundBits = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -347,7 +347,7 @@ int smlua_func_play_mario_sound(lua_State* L) { int smlua_func_mario_set_bubbled(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } mario_set_bubbled(m); @@ -358,7 +358,7 @@ int smlua_func_mario_set_bubbled(lua_State* L) { int smlua_func_mario_set_forward_vel(lua_State* L) { if(!smlua_functions_valid_param_count(L, 2)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } f32 speed = smlua_to_number(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -371,7 +371,7 @@ int smlua_func_mario_set_forward_vel(lua_State* L) { int smlua_func_mario_get_floor_class(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } lua_pushinteger(L, mario_get_floor_class(m)); @@ -382,7 +382,7 @@ int smlua_func_mario_get_floor_class(lua_State* L) { int smlua_func_mario_get_terrain_sound_addend(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } lua_pushinteger(L, mario_get_terrain_sound_addend(m)); @@ -447,7 +447,7 @@ int smlua_func_vec3f_find_ceil(lua_State* L) { int smlua_func_mario_facing_downhill(lua_State* L) { if(!smlua_functions_valid_param_count(L, 2)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } s32 turnYaw = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -460,7 +460,7 @@ int smlua_func_mario_facing_downhill(lua_State* L) { int smlua_func_mario_floor_is_slippery(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } lua_pushinteger(L, mario_floor_is_slippery(m)); @@ -471,7 +471,7 @@ int smlua_func_mario_floor_is_slippery(lua_State* L) { int smlua_func_mario_floor_is_slope(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } lua_pushinteger(L, mario_floor_is_slope(m)); @@ -482,7 +482,7 @@ int smlua_func_mario_floor_is_slope(lua_State* L) { int smlua_func_mario_floor_is_steep(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } lua_pushinteger(L, mario_floor_is_steep(m)); @@ -493,7 +493,7 @@ int smlua_func_mario_floor_is_steep(lua_State* L) { int smlua_func_find_floor_height_relative_polar(lua_State* L) { if(!smlua_functions_valid_param_count(L, 3)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } s16 angleFromMario = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -508,7 +508,7 @@ int smlua_func_find_floor_height_relative_polar(lua_State* L) { int smlua_func_find_floor_slope(lua_State* L) { if(!smlua_functions_valid_param_count(L, 2)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } s16 yawOffset = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -521,7 +521,7 @@ int smlua_func_find_floor_slope(lua_State* L) { int smlua_func_update_mario_sound_and_camera(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } update_mario_sound_and_camera(m); @@ -532,7 +532,7 @@ int smlua_func_update_mario_sound_and_camera(lua_State* L) { int smlua_func_set_steep_jump_action(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } set_steep_jump_action(m); @@ -543,7 +543,7 @@ int smlua_func_set_steep_jump_action(lua_State* L) { int smlua_func_set_mario_action(lua_State* L) { if(!smlua_functions_valid_param_count(L, 3)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } u32 action = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -558,7 +558,7 @@ int smlua_func_set_mario_action(lua_State* L) { int smlua_func_set_jump_from_landing(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } lua_pushinteger(L, set_jump_from_landing(m)); @@ -569,7 +569,7 @@ int smlua_func_set_jump_from_landing(lua_State* L) { int smlua_func_set_jumping_action(lua_State* L) { if(!smlua_functions_valid_param_count(L, 3)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } u32 action = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -584,7 +584,7 @@ int smlua_func_set_jumping_action(lua_State* L) { int smlua_func_drop_and_set_mario_action(lua_State* L) { if(!smlua_functions_valid_param_count(L, 3)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } u32 action = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -599,7 +599,7 @@ int smlua_func_drop_and_set_mario_action(lua_State* L) { int smlua_func_hurt_and_set_mario_action(lua_State* L) { if(!smlua_functions_valid_param_count(L, 4)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } u32 action = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -616,7 +616,7 @@ int smlua_func_hurt_and_set_mario_action(lua_State* L) { int smlua_func_check_common_action_exits(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } lua_pushinteger(L, check_common_action_exits(m)); @@ -627,7 +627,7 @@ int smlua_func_check_common_action_exits(lua_State* L) { int smlua_func_check_common_hold_action_exits(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } lua_pushinteger(L, check_common_hold_action_exits(m)); @@ -638,7 +638,7 @@ int smlua_func_check_common_hold_action_exits(lua_State* L) { int smlua_func_transition_submerged_to_walking(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } lua_pushinteger(L, transition_submerged_to_walking(m)); @@ -649,7 +649,7 @@ int smlua_func_transition_submerged_to_walking(lua_State* L) { int smlua_func_set_water_plunge_action(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } lua_pushinteger(L, set_water_plunge_action(m)); @@ -671,7 +671,7 @@ int smlua_func_execute_mario_action(lua_State* L) { int smlua_func_force_idle_state(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } lua_pushinteger(L, force_idle_state(m)); @@ -686,7 +686,7 @@ int smlua_func_force_idle_state(lua_State* L) { int smlua_func_play_flip_sounds(lua_State* L) { if(!smlua_functions_valid_param_count(L, 4)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } s16 frame1 = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -704,7 +704,7 @@ int smlua_func_play_flip_sounds(lua_State* L) { int smlua_func_play_far_fall_sound(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern void play_far_fall_sound(struct MarioState *m); @@ -716,7 +716,7 @@ int smlua_func_play_far_fall_sound(lua_State* L) { int smlua_func_play_knockback_sound(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern void play_knockback_sound(struct MarioState *m); @@ -728,7 +728,7 @@ int smlua_func_play_knockback_sound(lua_State* L) { int smlua_func_lava_boost_on_wall(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 lava_boost_on_wall(struct MarioState *m); @@ -740,7 +740,7 @@ int smlua_func_lava_boost_on_wall(lua_State* L) { int smlua_func_check_fall_damage(lua_State* L) { if(!smlua_functions_valid_param_count(L, 2)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } u32 hardFallAction = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -754,7 +754,7 @@ int smlua_func_check_fall_damage(lua_State* L) { int smlua_func_check_kick_or_dive_in_air(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 check_kick_or_dive_in_air(struct MarioState *m); @@ -766,7 +766,7 @@ int smlua_func_check_kick_or_dive_in_air(lua_State* L) { int smlua_func_should_get_stuck_in_ground(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 should_get_stuck_in_ground(struct MarioState *m); @@ -778,7 +778,7 @@ int smlua_func_should_get_stuck_in_ground(lua_State* L) { int smlua_func_check_fall_damage_or_get_stuck(lua_State* L) { if(!smlua_functions_valid_param_count(L, 2)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } u32 hardFallAction = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -792,7 +792,7 @@ int smlua_func_check_fall_damage_or_get_stuck(lua_State* L) { int smlua_func_check_horizontal_wind(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 check_horizontal_wind(struct MarioState *m); @@ -804,7 +804,7 @@ int smlua_func_check_horizontal_wind(lua_State* L) { int smlua_func_update_air_with_turn(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern void update_air_with_turn(struct MarioState *m); @@ -816,7 +816,7 @@ int smlua_func_update_air_with_turn(lua_State* L) { int smlua_func_update_air_without_turn(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern void update_air_without_turn(struct MarioState *m); @@ -828,7 +828,7 @@ int smlua_func_update_air_without_turn(lua_State* L) { int smlua_func_update_lava_boost_or_twirling(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern void update_lava_boost_or_twirling(struct MarioState *m); @@ -840,7 +840,7 @@ int smlua_func_update_lava_boost_or_twirling(lua_State* L) { int smlua_func_update_flying_yaw(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern void update_flying_yaw(struct MarioState *m); @@ -852,7 +852,7 @@ int smlua_func_update_flying_yaw(lua_State* L) { int smlua_func_update_flying_pitch(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern void update_flying_pitch(struct MarioState *m); @@ -864,7 +864,7 @@ int smlua_func_update_flying_pitch(lua_State* L) { int smlua_func_update_flying(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern void update_flying(struct MarioState *m); @@ -876,7 +876,7 @@ int smlua_func_update_flying(lua_State* L) { int smlua_func_common_air_action_step(lua_State* L) { if(!smlua_functions_valid_param_count(L, 4)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } u32 landAction = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -894,7 +894,7 @@ int smlua_func_common_air_action_step(lua_State* L) { int smlua_func_act_jump(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_jump(struct MarioState *m); @@ -906,7 +906,7 @@ int smlua_func_act_jump(lua_State* L) { int smlua_func_act_double_jump(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_double_jump(struct MarioState *m); @@ -918,7 +918,7 @@ int smlua_func_act_double_jump(lua_State* L) { int smlua_func_act_triple_jump(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_triple_jump(struct MarioState *m); @@ -930,7 +930,7 @@ int smlua_func_act_triple_jump(lua_State* L) { int smlua_func_act_backflip(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_backflip(struct MarioState *m); @@ -942,7 +942,7 @@ int smlua_func_act_backflip(lua_State* L) { int smlua_func_act_freefall(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_freefall(struct MarioState *m); @@ -954,7 +954,7 @@ int smlua_func_act_freefall(lua_State* L) { int smlua_func_act_hold_jump(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_hold_jump(struct MarioState *m); @@ -966,7 +966,7 @@ int smlua_func_act_hold_jump(lua_State* L) { int smlua_func_act_hold_freefall(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_hold_freefall(struct MarioState *m); @@ -978,7 +978,7 @@ int smlua_func_act_hold_freefall(lua_State* L) { int smlua_func_act_side_flip(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_side_flip(struct MarioState *m); @@ -990,7 +990,7 @@ int smlua_func_act_side_flip(lua_State* L) { int smlua_func_act_wall_kick_air(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_wall_kick_air(struct MarioState *m); @@ -1002,7 +1002,7 @@ int smlua_func_act_wall_kick_air(lua_State* L) { int smlua_func_act_long_jump(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_long_jump(struct MarioState *m); @@ -1014,7 +1014,7 @@ int smlua_func_act_long_jump(lua_State* L) { int smlua_func_act_riding_shell_air(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_riding_shell_air(struct MarioState *m); @@ -1026,7 +1026,7 @@ int smlua_func_act_riding_shell_air(lua_State* L) { int smlua_func_act_twirling(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_twirling(struct MarioState *m); @@ -1038,7 +1038,7 @@ int smlua_func_act_twirling(lua_State* L) { int smlua_func_act_dive(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_dive(struct MarioState *m); @@ -1050,7 +1050,7 @@ int smlua_func_act_dive(lua_State* L) { int smlua_func_act_air_throw(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_air_throw(struct MarioState *m); @@ -1062,7 +1062,7 @@ int smlua_func_act_air_throw(lua_State* L) { int smlua_func_act_water_jump(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_water_jump(struct MarioState *m); @@ -1074,7 +1074,7 @@ int smlua_func_act_water_jump(lua_State* L) { int smlua_func_act_hold_water_jump(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_hold_water_jump(struct MarioState *m); @@ -1086,7 +1086,7 @@ int smlua_func_act_hold_water_jump(lua_State* L) { int smlua_func_act_steep_jump(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_steep_jump(struct MarioState *m); @@ -1098,7 +1098,7 @@ int smlua_func_act_steep_jump(lua_State* L) { int smlua_func_act_ground_pound(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_ground_pound(struct MarioState *m); @@ -1110,7 +1110,7 @@ int smlua_func_act_ground_pound(lua_State* L) { int smlua_func_act_burning_jump(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_burning_jump(struct MarioState *m); @@ -1122,7 +1122,7 @@ int smlua_func_act_burning_jump(lua_State* L) { int smlua_func_act_burning_fall(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_burning_fall(struct MarioState *m); @@ -1134,7 +1134,7 @@ int smlua_func_act_burning_fall(lua_State* L) { int smlua_func_act_crazy_box_bounce(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_crazy_box_bounce(struct MarioState *m); @@ -1146,7 +1146,7 @@ int smlua_func_act_crazy_box_bounce(lua_State* L) { int smlua_func_common_air_knockback_step(lua_State* L) { if(!smlua_functions_valid_param_count(L, 5)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } u32 landAction = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -1166,7 +1166,7 @@ int smlua_func_common_air_knockback_step(lua_State* L) { int smlua_func_check_wall_kick(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 check_wall_kick(struct MarioState *m); @@ -1178,7 +1178,7 @@ int smlua_func_check_wall_kick(lua_State* L) { int smlua_func_act_backward_air_kb(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_backward_air_kb(struct MarioState *m); @@ -1190,7 +1190,7 @@ int smlua_func_act_backward_air_kb(lua_State* L) { int smlua_func_act_forward_air_kb(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_forward_air_kb(struct MarioState *m); @@ -1202,7 +1202,7 @@ int smlua_func_act_forward_air_kb(lua_State* L) { int smlua_func_act_hard_backward_air_kb(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_hard_backward_air_kb(struct MarioState *m); @@ -1214,7 +1214,7 @@ int smlua_func_act_hard_backward_air_kb(lua_State* L) { int smlua_func_act_hard_forward_air_kb(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_hard_forward_air_kb(struct MarioState *m); @@ -1226,7 +1226,7 @@ int smlua_func_act_hard_forward_air_kb(lua_State* L) { int smlua_func_act_thrown_backward(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_thrown_backward(struct MarioState *m); @@ -1238,7 +1238,7 @@ int smlua_func_act_thrown_backward(lua_State* L) { int smlua_func_act_thrown_forward(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_thrown_forward(struct MarioState *m); @@ -1250,7 +1250,7 @@ int smlua_func_act_thrown_forward(lua_State* L) { int smlua_func_act_soft_bonk(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_soft_bonk(struct MarioState *m); @@ -1262,7 +1262,7 @@ int smlua_func_act_soft_bonk(lua_State* L) { int smlua_func_act_getting_blown(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_getting_blown(struct MarioState *m); @@ -1274,7 +1274,7 @@ int smlua_func_act_getting_blown(lua_State* L) { int smlua_func_act_air_hit_wall(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_air_hit_wall(struct MarioState *m); @@ -1286,7 +1286,7 @@ int smlua_func_act_air_hit_wall(lua_State* L) { int smlua_func_act_forward_rollout(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_forward_rollout(struct MarioState *m); @@ -1298,7 +1298,7 @@ int smlua_func_act_forward_rollout(lua_State* L) { int smlua_func_act_backward_rollout(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_backward_rollout(struct MarioState *m); @@ -1310,7 +1310,7 @@ int smlua_func_act_backward_rollout(lua_State* L) { int smlua_func_act_butt_slide_air(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_butt_slide_air(struct MarioState *m); @@ -1322,7 +1322,7 @@ int smlua_func_act_butt_slide_air(lua_State* L) { int smlua_func_act_hold_butt_slide_air(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_hold_butt_slide_air(struct MarioState *m); @@ -1334,7 +1334,7 @@ int smlua_func_act_hold_butt_slide_air(lua_State* L) { int smlua_func_act_lava_boost(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_lava_boost(struct MarioState *m); @@ -1346,7 +1346,7 @@ int smlua_func_act_lava_boost(lua_State* L) { int smlua_func_act_slide_kick(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_slide_kick(struct MarioState *m); @@ -1358,7 +1358,7 @@ int smlua_func_act_slide_kick(lua_State* L) { int smlua_func_act_jump_kick(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_jump_kick(struct MarioState *m); @@ -1370,7 +1370,7 @@ int smlua_func_act_jump_kick(lua_State* L) { int smlua_func_act_shot_from_cannon(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_shot_from_cannon(struct MarioState *m); @@ -1382,7 +1382,7 @@ int smlua_func_act_shot_from_cannon(lua_State* L) { int smlua_func_act_flying(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_flying(struct MarioState *m); @@ -1394,7 +1394,7 @@ int smlua_func_act_flying(lua_State* L) { int smlua_func_act_riding_hoot(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_riding_hoot(struct MarioState *m); @@ -1406,7 +1406,7 @@ int smlua_func_act_riding_hoot(lua_State* L) { int smlua_func_act_flying_triple_jump(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_flying_triple_jump(struct MarioState *m); @@ -1418,7 +1418,7 @@ int smlua_func_act_flying_triple_jump(lua_State* L) { int smlua_func_act_top_of_pole_jump(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_top_of_pole_jump(struct MarioState *m); @@ -1430,7 +1430,7 @@ int smlua_func_act_top_of_pole_jump(lua_State* L) { int smlua_func_act_vertical_wind(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_vertical_wind(struct MarioState *m); @@ -1442,7 +1442,7 @@ int smlua_func_act_vertical_wind(lua_State* L) { int smlua_func_act_special_triple_jump(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_special_triple_jump(struct MarioState *m); @@ -1454,7 +1454,7 @@ int smlua_func_act_special_triple_jump(lua_State* L) { int smlua_func_check_common_airborne_cancels(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 check_common_airborne_cancels(struct MarioState *m); @@ -1466,7 +1466,7 @@ int smlua_func_check_common_airborne_cancels(lua_State* L) { int smlua_func_mario_execute_airborne_action(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 mario_execute_airborne_action(struct MarioState *m); @@ -1482,7 +1482,7 @@ int smlua_func_mario_execute_airborne_action(lua_State* L) { int smlua_func_add_tree_leaf_particles(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern void add_tree_leaf_particles(struct MarioState *m); @@ -1494,7 +1494,7 @@ int smlua_func_add_tree_leaf_particles(lua_State* L) { int smlua_func_play_climbing_sounds(lua_State* L) { if(!smlua_functions_valid_param_count(L, 2)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } s32 b = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -1508,7 +1508,7 @@ int smlua_func_play_climbing_sounds(lua_State* L) { int smlua_func_set_pole_position(lua_State* L) { if(!smlua_functions_valid_param_count(L, 2)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } f32 offsetY = smlua_to_number(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -1522,7 +1522,7 @@ int smlua_func_set_pole_position(lua_State* L) { int smlua_func_act_holding_pole(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_holding_pole(struct MarioState *m); @@ -1534,7 +1534,7 @@ int smlua_func_act_holding_pole(lua_State* L) { int smlua_func_act_climbing_pole(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_climbing_pole(struct MarioState *m); @@ -1546,7 +1546,7 @@ int smlua_func_act_climbing_pole(lua_State* L) { int smlua_func_act_grab_pole_slow(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_grab_pole_slow(struct MarioState *m); @@ -1558,7 +1558,7 @@ int smlua_func_act_grab_pole_slow(lua_State* L) { int smlua_func_act_grab_pole_fast(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_grab_pole_fast(struct MarioState *m); @@ -1570,7 +1570,7 @@ int smlua_func_act_grab_pole_fast(lua_State* L) { int smlua_func_act_top_of_pole_transition(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_top_of_pole_transition(struct MarioState *m); @@ -1582,7 +1582,7 @@ int smlua_func_act_top_of_pole_transition(lua_State* L) { int smlua_func_act_top_of_pole(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_top_of_pole(struct MarioState *m); @@ -1594,7 +1594,7 @@ int smlua_func_act_top_of_pole(lua_State* L) { int smlua_func_perform_hanging_step(lua_State* L) { if(!smlua_functions_valid_param_count(L, 2)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } f32* nextPos = smlua_get_vec3f_from_buffer(); @@ -1618,7 +1618,7 @@ int smlua_func_perform_hanging_step(lua_State* L) { int smlua_func_update_hang_moving(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 update_hang_moving(struct MarioState *m); @@ -1630,7 +1630,7 @@ int smlua_func_update_hang_moving(lua_State* L) { int smlua_func_update_hang_stationary(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern void update_hang_stationary(struct MarioState *m); @@ -1642,7 +1642,7 @@ int smlua_func_update_hang_stationary(lua_State* L) { int smlua_func_act_start_hanging(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_start_hanging(struct MarioState *m); @@ -1654,7 +1654,7 @@ int smlua_func_act_start_hanging(lua_State* L) { int smlua_func_act_hanging(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_hanging(struct MarioState *m); @@ -1666,7 +1666,7 @@ int smlua_func_act_hanging(lua_State* L) { int smlua_func_act_hang_moving(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_hang_moving(struct MarioState *m); @@ -1678,7 +1678,7 @@ int smlua_func_act_hang_moving(lua_State* L) { int smlua_func_let_go_of_ledge(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 let_go_of_ledge(struct MarioState *m); @@ -1690,7 +1690,7 @@ int smlua_func_let_go_of_ledge(lua_State* L) { int smlua_func_climb_up_ledge(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern void climb_up_ledge(struct MarioState *m); @@ -1702,7 +1702,7 @@ int smlua_func_climb_up_ledge(lua_State* L) { int smlua_func_update_ledge_climb_camera(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern void update_ledge_climb_camera(struct MarioState *m); @@ -1714,7 +1714,7 @@ int smlua_func_update_ledge_climb_camera(lua_State* L) { int smlua_func_update_ledge_climb(lua_State* L) { if(!smlua_functions_valid_param_count(L, 3)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } s32 animation = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -1730,7 +1730,7 @@ int smlua_func_update_ledge_climb(lua_State* L) { int smlua_func_act_ledge_grab(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_ledge_grab(struct MarioState *m); @@ -1742,7 +1742,7 @@ int smlua_func_act_ledge_grab(lua_State* L) { int smlua_func_act_ledge_climb_slow(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_ledge_climb_slow(struct MarioState *m); @@ -1754,7 +1754,7 @@ int smlua_func_act_ledge_climb_slow(lua_State* L) { int smlua_func_act_ledge_climb_down(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_ledge_climb_down(struct MarioState *m); @@ -1766,7 +1766,7 @@ int smlua_func_act_ledge_climb_down(lua_State* L) { int smlua_func_act_ledge_climb_fast(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_ledge_climb_fast(struct MarioState *m); @@ -1778,7 +1778,7 @@ int smlua_func_act_ledge_climb_fast(lua_State* L) { int smlua_func_act_grabbed(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_grabbed(struct MarioState *m); @@ -1790,7 +1790,7 @@ int smlua_func_act_grabbed(lua_State* L) { int smlua_func_act_in_cannon(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_in_cannon(struct MarioState *m); @@ -1802,7 +1802,7 @@ int smlua_func_act_in_cannon(lua_State* L) { int smlua_func_act_tornado_twirling(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_tornado_twirling(struct MarioState *m); @@ -1814,7 +1814,7 @@ int smlua_func_act_tornado_twirling(lua_State* L) { int smlua_func_act_bubbled(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 act_bubbled(struct MarioState* m); @@ -1826,7 +1826,7 @@ int smlua_func_act_bubbled(lua_State* L) { int smlua_func_check_common_automatic_cancels(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 check_common_automatic_cancels(struct MarioState *m); @@ -1838,7 +1838,7 @@ int smlua_func_check_common_automatic_cancels(lua_State* L) { int smlua_func_mario_execute_automatic_action(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 mario_execute_automatic_action(struct MarioState *m); @@ -1884,7 +1884,7 @@ int smlua_func_bhv_end_toad_loop(UNUSED lua_State* L) { int smlua_func_handle_save_menu(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern void handle_save_menu(struct MarioState *m); @@ -1897,7 +1897,7 @@ int smlua_func_handle_save_menu(lua_State* L) { int smlua_func_spawn_obj_at_mario_rel_yaw(lua_State* L) { if(!smlua_functions_valid_param_count(L, 4)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } s32 model = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -1916,7 +1916,7 @@ int smlua_func_spawn_obj_at_mario_rel_yaw(lua_State* L) { int smlua_func_cutscene_take_cap_off(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern void cutscene_take_cap_off(struct MarioState *m); @@ -1928,7 +1928,7 @@ int smlua_func_cutscene_take_cap_off(lua_State* L) { int smlua_func_cutscene_put_cap_on(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern void cutscene_put_cap_on(struct MarioState *m); @@ -1940,7 +1940,7 @@ int smlua_func_cutscene_put_cap_on(lua_State* L) { int smlua_func_should_start_or_continue_dialog(lua_State* L) { if(!smlua_functions_valid_param_count(L, 2)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } struct Object* object = (struct Object*)smlua_to_cobject(L, 2, LOT_OBJECT); if (!gSmLuaConvertSuccess) { return 0; } @@ -1954,7 +1954,7 @@ int smlua_func_should_start_or_continue_dialog(lua_State* L) { int smlua_func_general_star_dance_handler(lua_State* L) { if(!smlua_functions_valid_param_count(L, 2)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } s32 isInWater = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -1968,7 +1968,7 @@ int smlua_func_general_star_dance_handler(lua_State* L) { int smlua_func_stuck_in_ground_handler(lua_State* L) { if(!smlua_functions_valid_param_count(L, 6)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } s32 animation = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -2012,7 +2012,7 @@ int smlua_func_generate_yellow_sparkles(lua_State* L) { int smlua_func_tilt_body_running(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s16 tilt_body_running(struct MarioState *m); @@ -2024,7 +2024,7 @@ int smlua_func_tilt_body_running(lua_State* L) { int smlua_func_play_step_sound(lua_State* L) { if(!smlua_functions_valid_param_count(L, 3)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } s16 frame1 = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -2040,7 +2040,7 @@ int smlua_func_play_step_sound(lua_State* L) { int smlua_func_align_with_floor(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern void align_with_floor(struct MarioState *m); @@ -2052,7 +2052,7 @@ int smlua_func_align_with_floor(lua_State* L) { int smlua_func_begin_walking_action(lua_State* L) { if(!smlua_functions_valid_param_count(L, 4)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } f32 forwardVel = smlua_to_number(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -2070,7 +2070,7 @@ int smlua_func_begin_walking_action(lua_State* L) { int smlua_func_check_ledge_climb_down(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern void check_ledge_climb_down(struct MarioState *m); @@ -2082,7 +2082,7 @@ int smlua_func_check_ledge_climb_down(lua_State* L) { int smlua_func_slide_bonk(lua_State* L) { if(!smlua_functions_valid_param_count(L, 3)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } u32 fastAction = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -2098,7 +2098,7 @@ int smlua_func_slide_bonk(lua_State* L) { int smlua_func_set_triple_jump_action(lua_State* L) { if(!smlua_functions_valid_param_count(L, 3)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } u32 action = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -2114,7 +2114,7 @@ int smlua_func_set_triple_jump_action(lua_State* L) { int smlua_func_update_sliding_angle(lua_State* L) { if(!smlua_functions_valid_param_count(L, 3)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } f32 accel = smlua_to_number(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -2130,7 +2130,7 @@ int smlua_func_update_sliding_angle(lua_State* L) { int smlua_func_update_sliding(lua_State* L) { if(!smlua_functions_valid_param_count(L, 2)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } f32 stopSpeed = smlua_to_number(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -2144,7 +2144,7 @@ int smlua_func_update_sliding(lua_State* L) { int smlua_func_apply_slope_accel(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern void apply_slope_accel(struct MarioState *m); @@ -2156,7 +2156,7 @@ int smlua_func_apply_slope_accel(lua_State* L) { int smlua_func_apply_landing_accel(lua_State* L) { if(!smlua_functions_valid_param_count(L, 2)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } f32 frictionFactor = smlua_to_number(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -2170,7 +2170,7 @@ int smlua_func_apply_landing_accel(lua_State* L) { int smlua_func_update_shell_speed(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern void update_shell_speed(struct MarioState *m); @@ -2182,7 +2182,7 @@ int smlua_func_update_shell_speed(lua_State* L) { int smlua_func_apply_slope_decel(lua_State* L) { if(!smlua_functions_valid_param_count(L, 2)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } f32 decelCoef = smlua_to_number(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -2196,7 +2196,7 @@ int smlua_func_apply_slope_decel(lua_State* L) { int smlua_func_update_decelerating_speed(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 update_decelerating_speed(struct MarioState *m); @@ -2208,7 +2208,7 @@ int smlua_func_update_decelerating_speed(lua_State* L) { int smlua_func_update_walking_speed(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern void update_walking_speed(struct MarioState *m); @@ -2220,7 +2220,7 @@ int smlua_func_update_walking_speed(lua_State* L) { int smlua_func_should_begin_sliding(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 should_begin_sliding(struct MarioState *m); @@ -2232,7 +2232,7 @@ int smlua_func_should_begin_sliding(lua_State* L) { int smlua_func_analog_stick_held_back(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 analog_stick_held_back(struct MarioState *m); @@ -2244,7 +2244,7 @@ int smlua_func_analog_stick_held_back(lua_State* L) { int smlua_func_check_ground_dive_or_punch(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 check_ground_dive_or_punch(struct MarioState *m); @@ -2256,7 +2256,7 @@ int smlua_func_check_ground_dive_or_punch(lua_State* L) { int smlua_func_begin_braking_action(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 begin_braking_action(struct MarioState *m); @@ -2268,7 +2268,7 @@ int smlua_func_begin_braking_action(lua_State* L) { int smlua_func_anim_and_audio_for_walk(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern void anim_and_audio_for_walk(struct MarioState *m); @@ -2280,7 +2280,7 @@ int smlua_func_anim_and_audio_for_walk(lua_State* L) { int smlua_func_anim_and_audio_for_hold_walk(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern void anim_and_audio_for_hold_walk(struct MarioState *m); @@ -2292,7 +2292,7 @@ int smlua_func_anim_and_audio_for_hold_walk(lua_State* L) { int smlua_func_anim_and_audio_for_heavy_walk(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern void anim_and_audio_for_heavy_walk(struct MarioState *m); @@ -2304,7 +2304,7 @@ int smlua_func_anim_and_audio_for_heavy_walk(lua_State* L) { int smlua_func_push_or_sidle_wall(lua_State* L) { if(!smlua_functions_valid_param_count(L, 2)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } f32* startPos = smlua_get_vec3f_from_buffer(); @@ -2328,7 +2328,7 @@ int smlua_func_push_or_sidle_wall(lua_State* L) { int smlua_func_tilt_body_walking(lua_State* L) { if(!smlua_functions_valid_param_count(L, 2)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } s16 startYaw = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -2342,7 +2342,7 @@ int smlua_func_tilt_body_walking(lua_State* L) { int smlua_func_tilt_body_ground_shell(lua_State* L) { if(!smlua_functions_valid_param_count(L, 2)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } s16 startYaw = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -2356,7 +2356,7 @@ int smlua_func_tilt_body_ground_shell(lua_State* L) { int smlua_func_tilt_body_butt_slide(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern void tilt_body_butt_slide(struct MarioState *m); @@ -2368,7 +2368,7 @@ int smlua_func_tilt_body_butt_slide(lua_State* L) { int smlua_func_common_slide_action(lua_State* L) { if(!smlua_functions_valid_param_count(L, 4)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } u32 endAction = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -2386,7 +2386,7 @@ int smlua_func_common_slide_action(lua_State* L) { int smlua_func_common_slide_action_with_jump(lua_State* L) { if(!smlua_functions_valid_param_count(L, 5)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } u32 stopAction = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -2406,7 +2406,7 @@ int smlua_func_common_slide_action_with_jump(lua_State* L) { int smlua_func_stomach_slide_action(lua_State* L) { if(!smlua_functions_valid_param_count(L, 4)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } u32 stopAction = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -2424,7 +2424,7 @@ int smlua_func_stomach_slide_action(lua_State* L) { int smlua_func_common_ground_knockback_action(lua_State* L) { if(!smlua_functions_valid_param_count(L, 5)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } s32 animation = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -2444,7 +2444,7 @@ int smlua_func_common_ground_knockback_action(lua_State* L) { int smlua_func_common_landing_action(lua_State* L) { if(!smlua_functions_valid_param_count(L, 3)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } s16 animation = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -2460,7 +2460,7 @@ int smlua_func_common_landing_action(lua_State* L) { int smlua_func_quicksand_jump_land_action(lua_State* L) { if(!smlua_functions_valid_param_count(L, 5)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } s32 animation1 = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -2480,7 +2480,7 @@ int smlua_func_quicksand_jump_land_action(lua_State* L) { int smlua_func_check_common_moving_cancels(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 check_common_moving_cancels(struct MarioState *m); @@ -2492,7 +2492,7 @@ int smlua_func_check_common_moving_cancels(lua_State* L) { int smlua_func_mario_execute_moving_action(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 mario_execute_moving_action(struct MarioState *m); @@ -2508,7 +2508,7 @@ int smlua_func_mario_execute_moving_action(lua_State* L) { int smlua_func_animated_stationary_ground_step(lua_State* L) { if(!smlua_functions_valid_param_count(L, 3)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } s32 animation = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -2524,7 +2524,7 @@ int smlua_func_animated_stationary_ground_step(lua_State* L) { int smlua_func_mario_update_punch_sequence(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 mario_update_punch_sequence(struct MarioState *m); @@ -2536,7 +2536,7 @@ int smlua_func_mario_update_punch_sequence(lua_State* L) { int smlua_func_check_common_object_cancels(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 check_common_object_cancels(struct MarioState *m); @@ -2548,7 +2548,7 @@ int smlua_func_check_common_object_cancels(lua_State* L) { int smlua_func_mario_execute_object_action(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 mario_execute_object_action(struct MarioState *m); @@ -2564,7 +2564,7 @@ int smlua_func_mario_execute_object_action(lua_State* L) { int smlua_func_check_common_idle_cancels(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 check_common_idle_cancels(struct MarioState *m); @@ -2576,7 +2576,7 @@ int smlua_func_check_common_idle_cancels(lua_State* L) { int smlua_func_check_common_hold_idle_cancels(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 check_common_hold_idle_cancels(struct MarioState *m); @@ -2588,7 +2588,7 @@ int smlua_func_check_common_hold_idle_cancels(lua_State* L) { int smlua_func_play_anim_sound(lua_State* L) { if(!smlua_functions_valid_param_count(L, 4)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } u32 actionState = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -2606,7 +2606,7 @@ int smlua_func_play_anim_sound(lua_State* L) { int smlua_func_stopping_step(lua_State* L) { if(!smlua_functions_valid_param_count(L, 3)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } s32 animID = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -2622,7 +2622,7 @@ int smlua_func_stopping_step(lua_State* L) { int smlua_func_landing_step(lua_State* L) { if(!smlua_functions_valid_param_count(L, 3)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } s32 arg1 = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -2638,7 +2638,7 @@ int smlua_func_landing_step(lua_State* L) { int smlua_func_check_common_landing_cancels(lua_State* L) { if(!smlua_functions_valid_param_count(L, 2)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } u32 action = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -2652,7 +2652,7 @@ int smlua_func_check_common_landing_cancels(lua_State* L) { int smlua_func_check_common_stationary_cancels(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 check_common_stationary_cancels(struct MarioState *m); @@ -2664,7 +2664,7 @@ int smlua_func_check_common_stationary_cancels(lua_State* L) { int smlua_func_mario_execute_stationary_action(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 mario_execute_stationary_action(struct MarioState *m); @@ -2680,7 +2680,7 @@ int smlua_func_mario_execute_stationary_action(lua_State* L) { int smlua_func_set_swimming_at_surface_particles(lua_State* L) { if(!smlua_functions_valid_param_count(L, 2)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } u32 particleFlag = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -2694,7 +2694,7 @@ int smlua_func_set_swimming_at_surface_particles(lua_State* L) { int smlua_func_perform_water_step(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern u32 perform_water_step(struct MarioState *m); @@ -2706,7 +2706,7 @@ int smlua_func_perform_water_step(lua_State* L) { int smlua_func_perform_water_full_step(lua_State* L) { if(!smlua_functions_valid_param_count(L, 2)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } f32* nextPos = smlua_get_vec3f_from_buffer(); @@ -2730,7 +2730,7 @@ int smlua_func_perform_water_full_step(lua_State* L) { int smlua_func_mario_execute_submerged_action(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern s32 mario_execute_submerged_action(struct MarioState *m); @@ -2742,7 +2742,7 @@ int smlua_func_mario_execute_submerged_action(lua_State* L) { int smlua_func_float_surface_gfx(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } extern void float_surface_gfx(struct MarioState *m); @@ -2754,7 +2754,7 @@ int smlua_func_float_surface_gfx(lua_State* L) { int smlua_func_apply_water_current(lua_State* L) { if(!smlua_functions_valid_param_count(L, 2)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } f32* step = smlua_get_vec3f_from_buffer(); @@ -2791,7 +2791,7 @@ int smlua_func_get_additive_y_vel_for_jumps(UNUSED lua_State* L) { int smlua_func_mario_bonk_reflection(lua_State* L) { if(!smlua_functions_valid_param_count(L, 2)) { return 0; } - struct MarioState* arg0 = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* arg0 = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } u32 arg1 = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -2804,7 +2804,7 @@ int smlua_func_mario_bonk_reflection(lua_State* L) { int smlua_func_mario_update_quicksand(lua_State* L) { if(!smlua_functions_valid_param_count(L, 2)) { return 0; } - struct MarioState* arg0 = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* arg0 = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } f32 arg1 = smlua_to_number(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -2817,7 +2817,7 @@ int smlua_func_mario_update_quicksand(lua_State* L) { int smlua_func_mario_push_off_steep_floor(lua_State* L) { if(!smlua_functions_valid_param_count(L, 3)) { return 0; } - struct MarioState* arg0 = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* arg0 = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } u32 arg1 = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -2832,7 +2832,7 @@ int smlua_func_mario_push_off_steep_floor(lua_State* L) { int smlua_func_mario_update_moving_sand(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* arg0 = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* arg0 = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } lua_pushinteger(L, mario_update_moving_sand(arg0)); @@ -2843,7 +2843,7 @@ int smlua_func_mario_update_moving_sand(lua_State* L) { int smlua_func_mario_update_windy_ground(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* arg0 = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* arg0 = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } lua_pushinteger(L, mario_update_windy_ground(arg0)); @@ -2854,7 +2854,7 @@ int smlua_func_mario_update_windy_ground(lua_State* L) { int smlua_func_stop_and_set_height_to_floor(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* arg0 = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* arg0 = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } stop_and_set_height_to_floor(arg0); @@ -2865,7 +2865,7 @@ int smlua_func_stop_and_set_height_to_floor(lua_State* L) { int smlua_func_stationary_ground_step(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* arg0 = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* arg0 = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } lua_pushinteger(L, stationary_ground_step(arg0)); @@ -2876,7 +2876,7 @@ int smlua_func_stationary_ground_step(lua_State* L) { int smlua_func_perform_ground_step(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* arg0 = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* arg0 = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } lua_pushinteger(L, perform_ground_step(arg0)); @@ -2887,7 +2887,7 @@ int smlua_func_perform_ground_step(lua_State* L) { int smlua_func_perform_air_step(lua_State* L) { if(!smlua_functions_valid_param_count(L, 2)) { return 0; } - struct MarioState* arg0 = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* arg0 = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } u32 arg1 = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } @@ -2900,7 +2900,7 @@ int smlua_func_perform_air_step(lua_State* L) { int smlua_func_set_vel_from_pitch_and_yaw(lua_State* L) { if(!smlua_functions_valid_param_count(L, 1)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } set_vel_from_pitch_and_yaw(m); @@ -3130,7 +3130,7 @@ int smlua_func_queue_rumble_data_object(lua_State* L) { int smlua_func_queue_rumble_data_mario(lua_State* L) { if(!smlua_functions_valid_param_count(L, 3)) { return 0; } - struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIO_STATE); + struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE); if (!gSmLuaConvertSuccess) { return 0; } s16 a0 = smlua_to_integer(L, 2); if (!gSmLuaConvertSuccess) { return 0; } diff --git a/src/pc/lua/smlua_utils.c b/src/pc/lua/smlua_utils.c index d54a08e4..572b93c4 100644 --- a/src/pc/lua/smlua_utils.c +++ b/src/pc/lua/smlua_utils.c @@ -76,7 +76,7 @@ const char* smlua_to_string(lua_State* L, int index) { return lua_tostring(L, index); } -void* smlua_to_cobject(lua_State* L, int index, enum LuaObjectType lot) { +void* smlua_to_cobject(lua_State* L, int index, u16 lot) { if (lua_type(L, index) != LUA_TTABLE) { LOG_LUA("LUA: smlua_to_cobject received improper type '%d'", lua_type(L, index)); smlua_logline(); @@ -123,7 +123,7 @@ void* smlua_to_cobject(lua_State* L, int index, enum LuaObjectType lot) { ////////////////////////////////////////////// -void smlua_push_object(lua_State* L, enum LuaObjectType lot, void* p) { +void smlua_push_object(lua_State* L, u16 lot, void* p) { if (p == NULL) { lua_pushnil(L); return; diff --git a/src/pc/lua/smlua_utils.h b/src/pc/lua/smlua_utils.h index 404c7f3f..b7162c68 100644 --- a/src/pc/lua/smlua_utils.h +++ b/src/pc/lua/smlua_utils.h @@ -12,9 +12,9 @@ void smlua_logline(void); lua_Integer smlua_to_integer(lua_State* L, int index); lua_Number smlua_to_number(lua_State* L, int index); const char* smlua_to_string(lua_State* L, int index); -void* smlua_to_cobject(lua_State* L, int index, enum LuaObjectType lot); +void* smlua_to_cobject(lua_State* L, int index, u16 lot); -void smlua_push_object(lua_State* L, enum LuaObjectType lot, void* p); +void smlua_push_object(lua_State* L, u16 lot, void* p); void smlua_push_integer_field(int index, char* name, lua_Integer val); void smlua_push_number_field(int index, char* name, lua_Number val);