mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-10-30 08:01:01 +00:00
38399 lines
1.3 MiB
38399 lines
1.3 MiB
/* THIS FILE IS AUTOGENERATED */
|
|
/* SHOULD NOT BE MANUALLY CHANGED */
|
|
|
|
#include "smlua.h"
|
|
|
|
#include "src/audio/external.h"
|
|
#include "src/engine/math_util.h"
|
|
#include "src/engine/surface_collision.h"
|
|
#include "src/engine/surface_load.h"
|
|
#include "src/game/camera.h"
|
|
#include "src/game/characters.h"
|
|
#include "src/game/mario_step.h"
|
|
#include "src/game/mario.h"
|
|
#include "src/game/rumble_init.h"
|
|
#include "src/pc/djui/djui_popup.h"
|
|
#include "src/pc/network/network_utils.h"
|
|
#include "src/pc/djui/djui_console.h"
|
|
#include "src/pc/djui/djui_chat_message.h"
|
|
#include "src/pc/djui/djui_language.h"
|
|
#include "src/game/interaction.h"
|
|
#include "src/game/level_info.h"
|
|
#include "src/game/save_file.h"
|
|
#include "src/game/sound_init.h"
|
|
#include "src/pc/djui/djui_hud_utils.h"
|
|
#include "src/pc/djui/djui_panel_menu.h"
|
|
#include "src/pc/network/network_player.h"
|
|
#include "src/pc/network/lag_compensation.h"
|
|
#include "include/behavior_table.h"
|
|
#include "src/pc/lua/utils/smlua_obj_utils.h"
|
|
#include "src/pc/lua/utils/smlua_misc_utils.h"
|
|
#include "src/pc/lua/utils/smlua_camera_utils.h"
|
|
#include "src/pc/lua/utils/smlua_gfx_utils.h"
|
|
#include "src/pc/lua/utils/smlua_collision_utils.h"
|
|
#include "src/pc/lua/utils/smlua_model_utils.h"
|
|
#include "src/pc/lua/utils/smlua_text_utils.h"
|
|
#include "src/pc/lua/utils/smlua_audio_utils.h"
|
|
#include "src/pc/lua/utils/smlua_level_utils.h"
|
|
#include "src/pc/lua/utils/smlua_anim_utils.h"
|
|
#include "src/pc/lua/utils/smlua_deprecated.h"
|
|
#include "src/game/platform_displacement.h"
|
|
#include "src/game/spawn_sound.h"
|
|
#include "src/game/object_list_processor.h"
|
|
#include "src/game/behavior_actions.h"
|
|
#include "src/game/mario_misc.h"
|
|
#include "src/pc/mods/mod_storage.h"
|
|
#include "src/pc/mods/mod_fs.h"
|
|
#include "src/pc/utils/misc.h"
|
|
#include "src/game/level_update.h"
|
|
#include "src/game/area.h"
|
|
#include "src/engine/level_script.h"
|
|
#include "src/game/ingame_menu.h"
|
|
#include "src/game/first_person_cam.h"
|
|
#include "src/engine/behavior_script.h"
|
|
#include "src/audio/seqplayer.h"
|
|
#include "src/engine/lighting_engine.h"
|
|
#include "src/pc/network/sync_object.h"
|
|
|
|
|
|
///////////////
|
|
// vec types //
|
|
///////////////
|
|
|
|
void smlua_new_vec2f(Vec2f src) {
|
|
struct lua_State *L = gLuaState;
|
|
lua_newtable(L);
|
|
int tableIndex = lua_gettop(L);
|
|
lua_pushstring(L, "x");
|
|
lua_pushnumber(L, src[0]);
|
|
lua_settable(L, tableIndex);
|
|
lua_pushstring(L, "y");
|
|
lua_pushnumber(L, src[1]);
|
|
lua_settable(L, tableIndex);
|
|
}
|
|
|
|
void smlua_get_vec2f(Vec2f dest, int index) {
|
|
dest[0] = smlua_get_number_field(index, "x");
|
|
dest[1] = smlua_get_number_field(index, "y");
|
|
}
|
|
|
|
void smlua_push_vec2f(Vec2f src, int index) {
|
|
smlua_push_number_field(index, "x", src[0]);
|
|
smlua_push_number_field(index, "y", src[1]);
|
|
}
|
|
|
|
void smlua_new_vec3f(Vec3f src) {
|
|
struct lua_State *L = gLuaState;
|
|
lua_newtable(L);
|
|
int tableIndex = lua_gettop(L);
|
|
lua_pushstring(L, "x");
|
|
lua_pushnumber(L, src[0]);
|
|
lua_settable(L, tableIndex);
|
|
lua_pushstring(L, "y");
|
|
lua_pushnumber(L, src[1]);
|
|
lua_settable(L, tableIndex);
|
|
lua_pushstring(L, "z");
|
|
lua_pushnumber(L, src[2]);
|
|
lua_settable(L, tableIndex);
|
|
}
|
|
|
|
void smlua_get_vec3f(Vec3f dest, int index) {
|
|
dest[0] = smlua_get_number_field(index, "x");
|
|
dest[1] = smlua_get_number_field(index, "y");
|
|
dest[2] = smlua_get_number_field(index, "z");
|
|
}
|
|
|
|
void smlua_push_vec3f(Vec3f src, int index) {
|
|
smlua_push_number_field(index, "x", src[0]);
|
|
smlua_push_number_field(index, "y", src[1]);
|
|
smlua_push_number_field(index, "z", src[2]);
|
|
}
|
|
|
|
void smlua_new_vec4f(Vec4f src) {
|
|
struct lua_State *L = gLuaState;
|
|
lua_newtable(L);
|
|
int tableIndex = lua_gettop(L);
|
|
lua_pushstring(L, "x");
|
|
lua_pushnumber(L, src[0]);
|
|
lua_settable(L, tableIndex);
|
|
lua_pushstring(L, "y");
|
|
lua_pushnumber(L, src[1]);
|
|
lua_settable(L, tableIndex);
|
|
lua_pushstring(L, "z");
|
|
lua_pushnumber(L, src[2]);
|
|
lua_settable(L, tableIndex);
|
|
lua_pushstring(L, "w");
|
|
lua_pushnumber(L, src[3]);
|
|
lua_settable(L, tableIndex);
|
|
}
|
|
|
|
void smlua_get_vec4f(Vec4f dest, int index) {
|
|
dest[0] = smlua_get_number_field(index, "x");
|
|
dest[1] = smlua_get_number_field(index, "y");
|
|
dest[2] = smlua_get_number_field(index, "z");
|
|
dest[3] = smlua_get_number_field(index, "w");
|
|
}
|
|
|
|
void smlua_push_vec4f(Vec4f src, int index) {
|
|
smlua_push_number_field(index, "x", src[0]);
|
|
smlua_push_number_field(index, "y", src[1]);
|
|
smlua_push_number_field(index, "z", src[2]);
|
|
smlua_push_number_field(index, "w", src[3]);
|
|
}
|
|
|
|
void smlua_new_vec2i(Vec2i src) {
|
|
struct lua_State *L = gLuaState;
|
|
lua_newtable(L);
|
|
int tableIndex = lua_gettop(L);
|
|
lua_pushstring(L, "x");
|
|
lua_pushinteger(L, src[0]);
|
|
lua_settable(L, tableIndex);
|
|
lua_pushstring(L, "y");
|
|
lua_pushinteger(L, src[1]);
|
|
lua_settable(L, tableIndex);
|
|
}
|
|
|
|
void smlua_get_vec2i(Vec2i dest, int index) {
|
|
dest[0] = smlua_get_integer_field(index, "x");
|
|
dest[1] = smlua_get_integer_field(index, "y");
|
|
}
|
|
|
|
void smlua_push_vec2i(Vec2i src, int index) {
|
|
smlua_push_integer_field(index, "x", src[0]);
|
|
smlua_push_integer_field(index, "y", src[1]);
|
|
}
|
|
|
|
void smlua_new_vec3i(Vec3i src) {
|
|
struct lua_State *L = gLuaState;
|
|
lua_newtable(L);
|
|
int tableIndex = lua_gettop(L);
|
|
lua_pushstring(L, "x");
|
|
lua_pushinteger(L, src[0]);
|
|
lua_settable(L, tableIndex);
|
|
lua_pushstring(L, "y");
|
|
lua_pushinteger(L, src[1]);
|
|
lua_settable(L, tableIndex);
|
|
lua_pushstring(L, "z");
|
|
lua_pushinteger(L, src[2]);
|
|
lua_settable(L, tableIndex);
|
|
}
|
|
|
|
void smlua_get_vec3i(Vec3i dest, int index) {
|
|
dest[0] = smlua_get_integer_field(index, "x");
|
|
dest[1] = smlua_get_integer_field(index, "y");
|
|
dest[2] = smlua_get_integer_field(index, "z");
|
|
}
|
|
|
|
void smlua_push_vec3i(Vec3i src, int index) {
|
|
smlua_push_integer_field(index, "x", src[0]);
|
|
smlua_push_integer_field(index, "y", src[1]);
|
|
smlua_push_integer_field(index, "z", src[2]);
|
|
}
|
|
|
|
void smlua_new_vec4i(Vec4i src) {
|
|
struct lua_State *L = gLuaState;
|
|
lua_newtable(L);
|
|
int tableIndex = lua_gettop(L);
|
|
lua_pushstring(L, "x");
|
|
lua_pushinteger(L, src[0]);
|
|
lua_settable(L, tableIndex);
|
|
lua_pushstring(L, "y");
|
|
lua_pushinteger(L, src[1]);
|
|
lua_settable(L, tableIndex);
|
|
lua_pushstring(L, "z");
|
|
lua_pushinteger(L, src[2]);
|
|
lua_settable(L, tableIndex);
|
|
lua_pushstring(L, "w");
|
|
lua_pushinteger(L, src[3]);
|
|
lua_settable(L, tableIndex);
|
|
}
|
|
|
|
void smlua_get_vec4i(Vec4i dest, int index) {
|
|
dest[0] = smlua_get_integer_field(index, "x");
|
|
dest[1] = smlua_get_integer_field(index, "y");
|
|
dest[2] = smlua_get_integer_field(index, "z");
|
|
dest[3] = smlua_get_integer_field(index, "w");
|
|
}
|
|
|
|
void smlua_push_vec4i(Vec4i src, int index) {
|
|
smlua_push_integer_field(index, "x", src[0]);
|
|
smlua_push_integer_field(index, "y", src[1]);
|
|
smlua_push_integer_field(index, "z", src[2]);
|
|
smlua_push_integer_field(index, "w", src[3]);
|
|
}
|
|
|
|
void smlua_new_vec2s(Vec2s src) {
|
|
struct lua_State *L = gLuaState;
|
|
lua_newtable(L);
|
|
int tableIndex = lua_gettop(L);
|
|
lua_pushstring(L, "x");
|
|
lua_pushinteger(L, src[0]);
|
|
lua_settable(L, tableIndex);
|
|
lua_pushstring(L, "y");
|
|
lua_pushinteger(L, src[1]);
|
|
lua_settable(L, tableIndex);
|
|
}
|
|
|
|
void smlua_get_vec2s(Vec2s dest, int index) {
|
|
dest[0] = smlua_get_integer_field(index, "x");
|
|
dest[1] = smlua_get_integer_field(index, "y");
|
|
}
|
|
|
|
void smlua_push_vec2s(Vec2s src, int index) {
|
|
smlua_push_integer_field(index, "x", src[0]);
|
|
smlua_push_integer_field(index, "y", src[1]);
|
|
}
|
|
|
|
void smlua_new_vec3s(Vec3s src) {
|
|
struct lua_State *L = gLuaState;
|
|
lua_newtable(L);
|
|
int tableIndex = lua_gettop(L);
|
|
lua_pushstring(L, "x");
|
|
lua_pushinteger(L, src[0]);
|
|
lua_settable(L, tableIndex);
|
|
lua_pushstring(L, "y");
|
|
lua_pushinteger(L, src[1]);
|
|
lua_settable(L, tableIndex);
|
|
lua_pushstring(L, "z");
|
|
lua_pushinteger(L, src[2]);
|
|
lua_settable(L, tableIndex);
|
|
}
|
|
|
|
void smlua_get_vec3s(Vec3s dest, int index) {
|
|
dest[0] = smlua_get_integer_field(index, "x");
|
|
dest[1] = smlua_get_integer_field(index, "y");
|
|
dest[2] = smlua_get_integer_field(index, "z");
|
|
}
|
|
|
|
void smlua_push_vec3s(Vec3s src, int index) {
|
|
smlua_push_integer_field(index, "x", src[0]);
|
|
smlua_push_integer_field(index, "y", src[1]);
|
|
smlua_push_integer_field(index, "z", src[2]);
|
|
}
|
|
|
|
void smlua_new_vec4s(Vec4s src) {
|
|
struct lua_State *L = gLuaState;
|
|
lua_newtable(L);
|
|
int tableIndex = lua_gettop(L);
|
|
lua_pushstring(L, "x");
|
|
lua_pushinteger(L, src[0]);
|
|
lua_settable(L, tableIndex);
|
|
lua_pushstring(L, "y");
|
|
lua_pushinteger(L, src[1]);
|
|
lua_settable(L, tableIndex);
|
|
lua_pushstring(L, "z");
|
|
lua_pushinteger(L, src[2]);
|
|
lua_settable(L, tableIndex);
|
|
lua_pushstring(L, "w");
|
|
lua_pushinteger(L, src[3]);
|
|
lua_settable(L, tableIndex);
|
|
}
|
|
|
|
void smlua_get_vec4s(Vec4s dest, int index) {
|
|
dest[0] = smlua_get_integer_field(index, "x");
|
|
dest[1] = smlua_get_integer_field(index, "y");
|
|
dest[2] = smlua_get_integer_field(index, "z");
|
|
dest[3] = smlua_get_integer_field(index, "w");
|
|
}
|
|
|
|
void smlua_push_vec4s(Vec4s src, int index) {
|
|
smlua_push_integer_field(index, "x", src[0]);
|
|
smlua_push_integer_field(index, "y", src[1]);
|
|
smlua_push_integer_field(index, "z", src[2]);
|
|
smlua_push_integer_field(index, "w", src[3]);
|
|
}
|
|
|
|
void smlua_new_mat4(Mat4 src) {
|
|
struct lua_State *L = gLuaState;
|
|
lua_newtable(L);
|
|
int tableIndex = lua_gettop(L);
|
|
lua_pushstring(L, "m00");
|
|
lua_pushnumber(L, src[0][0]);
|
|
lua_settable(L, tableIndex);
|
|
lua_pushstring(L, "m01");
|
|
lua_pushnumber(L, src[0][1]);
|
|
lua_settable(L, tableIndex);
|
|
lua_pushstring(L, "m02");
|
|
lua_pushnumber(L, src[0][2]);
|
|
lua_settable(L, tableIndex);
|
|
lua_pushstring(L, "m03");
|
|
lua_pushnumber(L, src[0][3]);
|
|
lua_settable(L, tableIndex);
|
|
lua_pushstring(L, "m10");
|
|
lua_pushnumber(L, src[1][0]);
|
|
lua_settable(L, tableIndex);
|
|
lua_pushstring(L, "m11");
|
|
lua_pushnumber(L, src[1][1]);
|
|
lua_settable(L, tableIndex);
|
|
lua_pushstring(L, "m12");
|
|
lua_pushnumber(L, src[1][2]);
|
|
lua_settable(L, tableIndex);
|
|
lua_pushstring(L, "m13");
|
|
lua_pushnumber(L, src[1][3]);
|
|
lua_settable(L, tableIndex);
|
|
lua_pushstring(L, "m20");
|
|
lua_pushnumber(L, src[2][0]);
|
|
lua_settable(L, tableIndex);
|
|
lua_pushstring(L, "m21");
|
|
lua_pushnumber(L, src[2][1]);
|
|
lua_settable(L, tableIndex);
|
|
lua_pushstring(L, "m22");
|
|
lua_pushnumber(L, src[2][2]);
|
|
lua_settable(L, tableIndex);
|
|
lua_pushstring(L, "m23");
|
|
lua_pushnumber(L, src[2][3]);
|
|
lua_settable(L, tableIndex);
|
|
lua_pushstring(L, "m30");
|
|
lua_pushnumber(L, src[3][0]);
|
|
lua_settable(L, tableIndex);
|
|
lua_pushstring(L, "m31");
|
|
lua_pushnumber(L, src[3][1]);
|
|
lua_settable(L, tableIndex);
|
|
lua_pushstring(L, "m32");
|
|
lua_pushnumber(L, src[3][2]);
|
|
lua_settable(L, tableIndex);
|
|
lua_pushstring(L, "m33");
|
|
lua_pushnumber(L, src[3][3]);
|
|
lua_settable(L, tableIndex);
|
|
}
|
|
|
|
void smlua_get_mat4(Mat4 dest, int index) {
|
|
dest[0][0] = smlua_get_number_field(index, "m00");
|
|
dest[0][1] = smlua_get_number_field(index, "m01");
|
|
dest[0][2] = smlua_get_number_field(index, "m02");
|
|
dest[0][3] = smlua_get_number_field(index, "m03");
|
|
dest[1][0] = smlua_get_number_field(index, "m10");
|
|
dest[1][1] = smlua_get_number_field(index, "m11");
|
|
dest[1][2] = smlua_get_number_field(index, "m12");
|
|
dest[1][3] = smlua_get_number_field(index, "m13");
|
|
dest[2][0] = smlua_get_number_field(index, "m20");
|
|
dest[2][1] = smlua_get_number_field(index, "m21");
|
|
dest[2][2] = smlua_get_number_field(index, "m22");
|
|
dest[2][3] = smlua_get_number_field(index, "m23");
|
|
dest[3][0] = smlua_get_number_field(index, "m30");
|
|
dest[3][1] = smlua_get_number_field(index, "m31");
|
|
dest[3][2] = smlua_get_number_field(index, "m32");
|
|
dest[3][3] = smlua_get_number_field(index, "m33");
|
|
}
|
|
|
|
void smlua_push_mat4(Mat4 src, int index) {
|
|
smlua_push_number_field(index, "m00", src[0][0]);
|
|
smlua_push_number_field(index, "m01", src[0][1]);
|
|
smlua_push_number_field(index, "m02", src[0][2]);
|
|
smlua_push_number_field(index, "m03", src[0][3]);
|
|
smlua_push_number_field(index, "m10", src[1][0]);
|
|
smlua_push_number_field(index, "m11", src[1][1]);
|
|
smlua_push_number_field(index, "m12", src[1][2]);
|
|
smlua_push_number_field(index, "m13", src[1][3]);
|
|
smlua_push_number_field(index, "m20", src[2][0]);
|
|
smlua_push_number_field(index, "m21", src[2][1]);
|
|
smlua_push_number_field(index, "m22", src[2][2]);
|
|
smlua_push_number_field(index, "m23", src[2][3]);
|
|
smlua_push_number_field(index, "m30", src[3][0]);
|
|
smlua_push_number_field(index, "m31", src[3][1]);
|
|
smlua_push_number_field(index, "m32", src[3][2]);
|
|
smlua_push_number_field(index, "m33", src[3][3]);
|
|
smlua_push_number_field(index, "a", src[0][0]);
|
|
smlua_push_number_field(index, "b", src[0][1]);
|
|
smlua_push_number_field(index, "c", src[0][2]);
|
|
smlua_push_number_field(index, "d", src[0][3]);
|
|
smlua_push_number_field(index, "e", src[1][0]);
|
|
smlua_push_number_field(index, "f", src[1][1]);
|
|
smlua_push_number_field(index, "g", src[1][2]);
|
|
smlua_push_number_field(index, "h", src[1][3]);
|
|
smlua_push_number_field(index, "i", src[2][0]);
|
|
smlua_push_number_field(index, "j", src[2][1]);
|
|
smlua_push_number_field(index, "k", src[2][2]);
|
|
smlua_push_number_field(index, "l", src[2][3]);
|
|
smlua_push_number_field(index, "m", src[3][0]);
|
|
smlua_push_number_field(index, "n", src[3][1]);
|
|
smlua_push_number_field(index, "o", src[3][2]);
|
|
smlua_push_number_field(index, "p", src[3][3]);
|
|
}
|
|
|
|
void smlua_new_color(Color src) {
|
|
struct lua_State *L = gLuaState;
|
|
lua_newtable(L);
|
|
int tableIndex = lua_gettop(L);
|
|
lua_pushstring(L, "r");
|
|
lua_pushinteger(L, src[0]);
|
|
lua_settable(L, tableIndex);
|
|
lua_pushstring(L, "g");
|
|
lua_pushinteger(L, src[1]);
|
|
lua_settable(L, tableIndex);
|
|
lua_pushstring(L, "b");
|
|
lua_pushinteger(L, src[2]);
|
|
lua_settable(L, tableIndex);
|
|
}
|
|
|
|
void smlua_get_color(Color dest, int index) {
|
|
dest[0] = smlua_get_integer_field(index, "r");
|
|
dest[1] = smlua_get_integer_field(index, "g");
|
|
dest[2] = smlua_get_integer_field(index, "b");
|
|
}
|
|
|
|
void smlua_push_color(Color src, int index) {
|
|
smlua_push_integer_field(index, "r", src[0]);
|
|
smlua_push_integer_field(index, "g", src[1]);
|
|
smlua_push_integer_field(index, "b", src[2]);
|
|
}
|
|
|
|
|
|
|
|
////////////
|
|
// area.h //
|
|
////////////
|
|
|
|
int smlua_func_get_mario_spawn_type(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_mario_spawn_type", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_mario_spawn_type"); return 0; }
|
|
|
|
lua_pushinteger(L, get_mario_spawn_type(o));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_area_get_warp_node(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "area_get_warp_node", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 id = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "area_get_warp_node"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_OBJECTWARPNODE, area_get_warp_node(id), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_area_get_any_warp_node(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "area_get_any_warp_node", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
smlua_push_object(L, LOT_OBJECTWARPNODE, area_get_any_warp_node(), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_area_get_warp_node_from_params(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "area_get_warp_node_from_params", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "area_get_warp_node_from_params"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_OBJECTWARPNODE, area_get_warp_node_from_params(o), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_transition(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 5) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_transition", 5, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 transType = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "play_transition"); return 0; }
|
|
s16 time = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "play_transition"); return 0; }
|
|
u8 red = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "play_transition"); return 0; }
|
|
u8 green = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "play_transition"); return 0; }
|
|
u8 blue = smlua_to_integer(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "play_transition"); return 0; }
|
|
|
|
play_transition(transType, time, red, green, blue);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_transition_after_delay(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 6) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_transition_after_delay", 6, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 transType = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "play_transition_after_delay"); return 0; }
|
|
s16 time = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "play_transition_after_delay"); return 0; }
|
|
u8 red = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "play_transition_after_delay"); return 0; }
|
|
u8 green = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "play_transition_after_delay"); return 0; }
|
|
u8 blue = smlua_to_integer(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "play_transition_after_delay"); return 0; }
|
|
s16 delay = smlua_to_integer(L, 6);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 6, "play_transition_after_delay"); return 0; }
|
|
|
|
play_transition_after_delay(transType, time, red, green, blue, delay);
|
|
|
|
return 1;
|
|
}
|
|
|
|
////////////////////////
|
|
// behavior_actions.h //
|
|
////////////////////////
|
|
|
|
int smlua_func_spawn_mist_particles_variable(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "spawn_mist_particles_variable", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 count = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "spawn_mist_particles_variable"); return 0; }
|
|
s32 offsetY = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "spawn_mist_particles_variable"); return 0; }
|
|
f32 size = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "spawn_mist_particles_variable"); return 0; }
|
|
|
|
spawn_mist_particles_variable(count, offsetY, size);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_spawn_star_no_level_exit(lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_spawn_star_no_level_exit", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* object = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "bhv_spawn_star_no_level_exit"); return 0; }
|
|
u32 params = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "bhv_spawn_star_no_level_exit"); return 0; }
|
|
u8 networkSendEvent = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "bhv_spawn_star_no_level_exit"); return 0; }
|
|
|
|
bhv_spawn_star_no_level_exit(object, params, networkSendEvent);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_spawn_triangle_break_particles(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "spawn_triangle_break_particles", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 numTris = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "spawn_triangle_break_particles"); return 0; }
|
|
s16 triModel = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "spawn_triangle_break_particles"); return 0; }
|
|
f32 triSize = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "spawn_triangle_break_particles"); return 0; }
|
|
s16 triAnimState = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "spawn_triangle_break_particles"); return 0; }
|
|
|
|
spawn_triangle_break_particles(numTris, triModel, triSize, triAnimState);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_spawn_mist_from_global(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "spawn_mist_from_global", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
spawn_mist_from_global();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_clear_particle_flags(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "clear_particle_flags", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u32 flags = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "clear_particle_flags"); return 0; }
|
|
|
|
clear_particle_flags(flags);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_spawn_wind_particles(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "spawn_wind_particles", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 pitch = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "spawn_wind_particles"); return 0; }
|
|
s16 yaw = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "spawn_wind_particles"); return 0; }
|
|
|
|
spawn_wind_particles(pitch, yaw);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_check_if_moving_over_floor(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "check_if_moving_over_floor", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 a0 = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "check_if_moving_over_floor"); return 0; }
|
|
f32 a1 = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "check_if_moving_over_floor"); return 0; }
|
|
|
|
lua_pushinteger(L, check_if_moving_over_floor(a0, a1));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_arc_to_goal_pos(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "arc_to_goal_pos", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f goal;
|
|
smlua_get_vec3f(goal, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "arc_to_goal_pos"); return 0; }
|
|
|
|
Vec3f pos;
|
|
smlua_get_vec3f(pos, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "arc_to_goal_pos"); return 0; }
|
|
f32 yVel = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "arc_to_goal_pos"); return 0; }
|
|
f32 gravity = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "arc_to_goal_pos"); return 0; }
|
|
|
|
lua_pushinteger(L, arc_to_goal_pos(goal, pos, yVel, gravity));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_tox_box_move(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "tox_box_move", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 forwardVel = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "tox_box_move"); return 0; }
|
|
f32 a1 = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "tox_box_move"); return 0; }
|
|
s16 deltaPitch = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "tox_box_move"); return 0; }
|
|
s16 deltaRoll = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "tox_box_move"); return 0; }
|
|
|
|
tox_box_move(forwardVel, a1, deltaPitch, deltaRoll);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_penguin_walking_sound(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_penguin_walking_sound", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 walk = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "play_penguin_walking_sound"); return 0; }
|
|
|
|
play_penguin_walking_sound(walk);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_update_angle_from_move_flags(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "update_angle_from_move_flags", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 * angle = (s32 *)smlua_to_cpointer(L, 1, LVT_S32_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "update_angle_from_move_flags"); return 0; }
|
|
|
|
lua_pushinteger(L, update_angle_from_move_flags(angle));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_spawn_strong_wind_particles(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 5) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_spawn_strong_wind_particles", 5, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 windSpread = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_spawn_strong_wind_particles"); return 0; }
|
|
f32 scale = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "cur_obj_spawn_strong_wind_particles"); return 0; }
|
|
f32 relPosX = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "cur_obj_spawn_strong_wind_particles"); return 0; }
|
|
f32 relPosY = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "cur_obj_spawn_strong_wind_particles"); return 0; }
|
|
f32 relPosZ = smlua_to_number(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "cur_obj_spawn_strong_wind_particles"); return 0; }
|
|
|
|
cur_obj_spawn_strong_wind_particles(windSpread, scale, relPosX, relPosY, relPosZ);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_star_door_loop_2(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_star_door_loop_2", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_star_door_loop_2();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_cap_switch_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_cap_switch_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_cap_switch_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_tiny_star_particles_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_tiny_star_particles_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_tiny_star_particles_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_grindel_thwomp_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_grindel_thwomp_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_grindel_thwomp_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_koopa_shell_underwater_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_koopa_shell_underwater_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_koopa_shell_underwater_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_door_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_door_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_door_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_door_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_door_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_door_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_star_door_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_star_door_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_star_door_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_mr_i_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_mr_i_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_mr_i_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_mr_i_body_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_mr_i_body_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_mr_i_body_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_mr_i_particle_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_mr_i_particle_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_mr_i_particle_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_piranha_particle_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_piranha_particle_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_piranha_particle_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_giant_pole_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_giant_pole_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_giant_pole_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_pole_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_pole_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_pole_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_pole_base_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_pole_base_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_pole_base_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_thi_huge_island_top_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_thi_huge_island_top_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_thi_huge_island_top_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_thi_tiny_island_top_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_thi_tiny_island_top_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_thi_tiny_island_top_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_king_bobomb_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_king_bobomb_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_king_bobomb_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bobomb_anchor_mario_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bobomb_anchor_mario_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bobomb_anchor_mario_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_beta_chest_bottom_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_beta_chest_bottom_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_beta_chest_bottom_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_beta_chest_bottom_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_beta_chest_bottom_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_beta_chest_bottom_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_beta_chest_lid_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_beta_chest_lid_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_beta_chest_lid_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bubble_wave_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bubble_wave_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bubble_wave_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bubble_maybe_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bubble_maybe_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bubble_maybe_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bubble_player_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bubble_player_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bubble_player_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_water_air_bubble_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_water_air_bubble_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_water_air_bubble_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_water_air_bubble_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_water_air_bubble_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_water_air_bubble_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_particle_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_particle_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_particle_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_particle_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_particle_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_particle_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_water_waves_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_water_waves_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_water_waves_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_small_bubbles_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_small_bubbles_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_small_bubbles_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_fish_group_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_fish_group_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_fish_group_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_cannon_base_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_cannon_base_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_cannon_base_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_cannon_barrel_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_cannon_barrel_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_cannon_barrel_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_cannon_base_unused_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_cannon_base_unused_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_cannon_base_unused_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_common_anchor_mario_behavior(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "common_anchor_mario_behavior", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 sp28 = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "common_anchor_mario_behavior"); return 0; }
|
|
f32 sp2C = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "common_anchor_mario_behavior"); return 0; }
|
|
s32 sp30 = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "common_anchor_mario_behavior"); return 0; }
|
|
|
|
common_anchor_mario_behavior(sp28, sp2C, sp30);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_chuckya_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_chuckya_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_chuckya_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_chuckya_anchor_mario_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_chuckya_anchor_mario_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_chuckya_anchor_mario_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_rotating_platform_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_rotating_platform_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_rotating_platform_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_wf_breakable_wall_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_wf_breakable_wall_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_wf_breakable_wall_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_kickable_board_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_kickable_board_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_kickable_board_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_tower_door_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_tower_door_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_tower_door_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_wf_rotating_wooden_platform_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_wf_rotating_wooden_platform_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_wf_rotating_wooden_platform_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_wf_rotating_wooden_platform_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_wf_rotating_wooden_platform_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_wf_rotating_wooden_platform_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_fading_warp_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_fading_warp_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_fading_warp_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_warp_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_warp_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_warp_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_white_puff_exploding_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_white_puff_exploding_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_white_puff_exploding_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_spawned_star_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_spawned_star_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_spawned_star_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_spawned_star_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_spawned_star_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_spawned_star_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_coin_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_coin_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_coin_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_coin_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_coin_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_coin_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_coin_inside_boo_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_coin_inside_boo_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_coin_inside_boo_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_coin_formation_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_coin_formation_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_coin_formation_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_coin_formation_spawn_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_coin_formation_spawn_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_coin_formation_spawn_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_coin_formation_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_coin_formation_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_coin_formation_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_temp_coin_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_temp_coin_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_temp_coin_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_coin_sparkles_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_coin_sparkles_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_coin_sparkles_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_golden_coin_sparkles_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_golden_coin_sparkles_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_golden_coin_sparkles_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_wall_tiny_star_particle_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_wall_tiny_star_particle_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_wall_tiny_star_particle_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_pound_tiny_star_particle_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_pound_tiny_star_particle_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_pound_tiny_star_particle_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_pound_tiny_star_particle_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_pound_tiny_star_particle_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_pound_tiny_star_particle_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_punch_tiny_triangle_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_punch_tiny_triangle_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_punch_tiny_triangle_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_punch_tiny_triangle_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_punch_tiny_triangle_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_punch_tiny_triangle_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_tumbling_bridge_platform_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_tumbling_bridge_platform_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_tumbling_bridge_platform_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_tumbling_bridge_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_tumbling_bridge_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_tumbling_bridge_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_elevator_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_elevator_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_elevator_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_elevator_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_elevator_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_elevator_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_water_mist_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_water_mist_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_water_mist_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_water_mist_spawn_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_water_mist_spawn_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_water_mist_spawn_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_water_mist_2_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_water_mist_2_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_water_mist_2_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_pound_white_puffs_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_pound_white_puffs_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_pound_white_puffs_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_ground_sand_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_ground_sand_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_ground_sand_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_ground_snow_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_ground_snow_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_ground_snow_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_wind_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_wind_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_wind_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_unused_particle_spawn_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_unused_particle_spawn_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_unused_particle_spawn_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_ukiki_cage_star_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_ukiki_cage_star_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_ukiki_cage_star_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_ukiki_cage_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_ukiki_cage_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_ukiki_cage_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bitfs_sinking_platform_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bitfs_sinking_platform_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bitfs_sinking_platform_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bitfs_sinking_cage_platform_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bitfs_sinking_cage_platform_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bitfs_sinking_cage_platform_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_ddd_moving_pole_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_ddd_moving_pole_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_ddd_moving_pole_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_platform_normals_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_platform_normals_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_platform_normals_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_tilting_inverted_pyramid_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_tilting_inverted_pyramid_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_tilting_inverted_pyramid_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_squishable_platform_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_squishable_platform_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_squishable_platform_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_beta_moving_flames_spawn_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_beta_moving_flames_spawn_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_beta_moving_flames_spawn_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_beta_moving_flames_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_beta_moving_flames_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_beta_moving_flames_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_rr_rotating_bridge_platform_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_rr_rotating_bridge_platform_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_rr_rotating_bridge_platform_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_flamethrower_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_flamethrower_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_flamethrower_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_flamethrower_flame_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_flamethrower_flame_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_flamethrower_flame_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bouncing_fireball_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bouncing_fireball_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bouncing_fireball_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bouncing_fireball_flame_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bouncing_fireball_flame_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bouncing_fireball_flame_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bowser_shock_wave_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bowser_shock_wave_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bowser_shock_wave_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_flame_mario_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_flame_mario_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_flame_mario_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_black_smoke_mario_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_black_smoke_mario_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_black_smoke_mario_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_black_smoke_bowser_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_black_smoke_bowser_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_black_smoke_bowser_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_black_smoke_upward_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_black_smoke_upward_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_black_smoke_upward_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_beta_fish_splash_spawner_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_beta_fish_splash_spawner_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_beta_fish_splash_spawner_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_spindrift_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_spindrift_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_spindrift_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_tower_platform_group_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_tower_platform_group_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_tower_platform_group_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_tower_platform_group_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_tower_platform_group_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_tower_platform_group_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_wf_sliding_tower_platform_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_wf_sliding_tower_platform_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_wf_sliding_tower_platform_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_wf_elevator_tower_platform_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_wf_elevator_tower_platform_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_wf_elevator_tower_platform_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_wf_solid_tower_platform_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_wf_solid_tower_platform_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_wf_solid_tower_platform_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_snow_leaf_particle_spawn_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_snow_leaf_particle_spawn_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_snow_leaf_particle_spawn_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_tree_snow_or_leaf_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_tree_snow_or_leaf_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_tree_snow_or_leaf_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_piranha_plant_bubble_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_piranha_plant_bubble_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_piranha_plant_bubble_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_piranha_plant_waking_bubbles_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_piranha_plant_waking_bubbles_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_piranha_plant_waking_bubbles_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_purple_switch_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_purple_switch_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_purple_switch_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_hidden_object_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_hidden_object_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_hidden_object_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_breakable_box_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_breakable_box_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_breakable_box_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_pushable_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_pushable_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_pushable_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_small_water_wave_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_small_water_wave_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_small_water_wave_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_yellow_coin_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_yellow_coin_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_yellow_coin_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_yellow_coin_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_yellow_coin_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_yellow_coin_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_squarish_path_moving_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_squarish_path_moving_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_squarish_path_moving_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_squarish_path_parent_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_squarish_path_parent_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_squarish_path_parent_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_squarish_path_parent_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_squarish_path_parent_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_squarish_path_parent_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_heave_ho_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_heave_ho_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_heave_ho_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_heave_ho_throw_mario_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_heave_ho_throw_mario_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_heave_ho_throw_mario_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_ccm_touched_star_spawn_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_ccm_touched_star_spawn_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_ccm_touched_star_spawn_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_unused_poundable_platform(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_unused_poundable_platform", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_unused_poundable_platform();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_beta_trampoline_top_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_beta_trampoline_top_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_beta_trampoline_top_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_beta_trampoline_spring_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_beta_trampoline_spring_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_beta_trampoline_spring_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_jumping_box_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_jumping_box_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_jumping_box_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_boo_cage_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_boo_cage_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_boo_cage_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_boo_cage_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_boo_cage_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_boo_cage_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bowser_key_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bowser_key_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bowser_key_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bowser_key_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bowser_key_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bowser_key_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_grand_star_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_grand_star_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_grand_star_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_grand_star_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_grand_star_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_grand_star_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_beta_boo_key_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_beta_boo_key_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_beta_boo_key_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_alpha_boo_key_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_alpha_boo_key_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_alpha_boo_key_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bullet_bill_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bullet_bill_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bullet_bill_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bullet_bill_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bullet_bill_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bullet_bill_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_white_puff_smoke_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_white_puff_smoke_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_white_puff_smoke_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bowser_tail_anchor_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bowser_tail_anchor_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bowser_tail_anchor_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bowser_tail_anchor_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bowser_tail_anchor_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bowser_tail_anchor_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bowser_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bowser_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bowser_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bowser_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bowser_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bowser_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bowser_body_anchor_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bowser_body_anchor_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bowser_body_anchor_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bowser_body_anchor_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bowser_body_anchor_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bowser_body_anchor_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bowser_flame_spawn_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bowser_flame_spawn_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bowser_flame_spawn_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_tilting_bowser_lava_platform_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_tilting_bowser_lava_platform_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_tilting_bowser_lava_platform_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_falling_bowser_platform_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_falling_bowser_platform_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_falling_bowser_platform_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_blue_bowser_flame_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_blue_bowser_flame_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_blue_bowser_flame_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_blue_bowser_flame_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_blue_bowser_flame_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_blue_bowser_flame_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_flame_floating_landing_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_flame_floating_landing_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_flame_floating_landing_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_flame_floating_landing_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_flame_floating_landing_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_flame_floating_landing_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_blue_flames_group_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_blue_flames_group_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_blue_flames_group_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_flame_bouncing_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_flame_bouncing_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_flame_bouncing_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_flame_bouncing_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_flame_bouncing_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_flame_bouncing_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_flame_moving_forward_growing_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_flame_moving_forward_growing_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_flame_moving_forward_growing_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_flame_moving_forward_growing_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_flame_moving_forward_growing_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_flame_moving_forward_growing_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_flame_bowser_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_flame_bowser_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_flame_bowser_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_flame_bowser_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_flame_bowser_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_flame_bowser_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_flame_large_burning_out_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_flame_large_burning_out_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_flame_large_burning_out_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_blue_fish_movement_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_blue_fish_movement_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_blue_fish_movement_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_tank_fish_group_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_tank_fish_group_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_tank_fish_group_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_checkerboard_elevator_group_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_checkerboard_elevator_group_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_checkerboard_elevator_group_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_checkerboard_elevator_group_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_checkerboard_elevator_group_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_checkerboard_elevator_group_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_checkerboard_platform_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_checkerboard_platform_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_checkerboard_platform_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_checkerboard_platform_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_checkerboard_platform_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_checkerboard_platform_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bowser_key_unlock_door_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bowser_key_unlock_door_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bowser_key_unlock_door_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bowser_key_course_exit_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bowser_key_course_exit_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bowser_key_course_exit_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_invisible_objects_under_bridge_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_invisible_objects_under_bridge_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_invisible_objects_under_bridge_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_invisible_objects_under_bridge_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_invisible_objects_under_bridge_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_invisible_objects_under_bridge_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_water_level_pillar_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_water_level_pillar_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_water_level_pillar_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_water_level_pillar_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_water_level_pillar_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_water_level_pillar_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_ddd_warp_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_ddd_warp_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_ddd_warp_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_moat_grills_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_moat_grills_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_moat_grills_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_rotating_clock_arm_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_rotating_clock_arm_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_rotating_clock_arm_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_ukiki_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_ukiki_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_ukiki_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_ukiki_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_ukiki_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_ukiki_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_lll_sinking_rock_block_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_lll_sinking_rock_block_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_lll_sinking_rock_block_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_lll_moving_octagonal_mesh_platform_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_lll_moving_octagonal_mesh_platform_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_lll_moving_octagonal_mesh_platform_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_lll_rotating_block_fire_bars_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_lll_rotating_block_fire_bars_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_lll_rotating_block_fire_bars_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_lll_rotating_hex_flame_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_lll_rotating_hex_flame_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_lll_rotating_hex_flame_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_lll_wood_piece_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_lll_wood_piece_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_lll_wood_piece_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_lll_floating_wood_bridge_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_lll_floating_wood_bridge_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_lll_floating_wood_bridge_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_volcano_flames_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_volcano_flames_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_volcano_flames_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_lll_rotating_hexagonal_ring_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_lll_rotating_hexagonal_ring_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_lll_rotating_hexagonal_ring_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_lll_sinking_rectangular_platform_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_lll_sinking_rectangular_platform_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_lll_sinking_rectangular_platform_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_lll_sinking_square_platforms_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_lll_sinking_square_platforms_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_lll_sinking_square_platforms_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_koopa_shell_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_koopa_shell_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_koopa_shell_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_koopa_shell_flame_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_koopa_shell_flame_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_koopa_shell_flame_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_tox_box_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_tox_box_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_tox_box_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_moving_fast_enough_to_make_piranha_plant_bite(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mario_moving_fast_enough_to_make_piranha_plant_bite", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, mario_moving_fast_enough_to_make_piranha_plant_bite());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_piranha_plant_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_piranha_plant_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_piranha_plant_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_lll_bowser_puzzle_piece_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_lll_bowser_puzzle_piece_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_lll_bowser_puzzle_piece_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_lll_bowser_puzzle_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_lll_bowser_puzzle_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_lll_bowser_puzzle_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_tuxies_mother_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_tuxies_mother_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_tuxies_mother_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_small_penguin_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_small_penguin_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_small_penguin_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_fish_spawner_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_fish_spawner_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_fish_spawner_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_fish_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_fish_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_fish_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_wdw_express_elevator_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_wdw_express_elevator_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_wdw_express_elevator_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bub_spawner_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bub_spawner_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bub_spawner_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bub_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bub_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bub_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_exclamation_box_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_exclamation_box_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_exclamation_box_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_exclamation_box_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_exclamation_box_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_exclamation_box_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_rotating_exclamation_box_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_rotating_exclamation_box_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_rotating_exclamation_box_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_sound_spawner_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_sound_spawner_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_sound_spawner_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bowsers_sub_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bowsers_sub_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bowsers_sub_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_sushi_shark_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_sushi_shark_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_sushi_shark_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_sushi_shark_collision_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_sushi_shark_collision_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_sushi_shark_collision_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_jrb_sliding_box_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_jrb_sliding_box_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_jrb_sliding_box_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_ship_part_3_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_ship_part_3_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_ship_part_3_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_sunken_ship_part_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_sunken_ship_part_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_sunken_ship_part_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_white_puff_1_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_white_puff_1_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_white_puff_1_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_white_puff_2_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_white_puff_2_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_white_puff_2_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_blue_coin_number_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_blue_coin_number_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_blue_coin_number_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_blue_coin_switch_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_blue_coin_switch_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_blue_coin_switch_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_blue_coin_switch_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_blue_coin_switch_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_blue_coin_switch_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_hidden_blue_coin_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_hidden_blue_coin_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_hidden_blue_coin_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_openable_cage_door_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_openable_cage_door_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_openable_cage_door_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_openable_grill_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_openable_grill_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_openable_grill_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_water_level_diamond_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_water_level_diamond_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_water_level_diamond_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_init_changing_water_level_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_init_changing_water_level_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_init_changing_water_level_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_tweester_sand_particle_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_tweester_sand_particle_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_tweester_sand_particle_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_tweester_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_tweester_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_tweester_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_merry_go_round_boo_manager_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_merry_go_round_boo_manager_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_merry_go_round_boo_manager_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_animated_texture_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_animated_texture_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_animated_texture_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_boo_in_castle_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_boo_in_castle_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_boo_in_castle_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_boo_with_cage_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_boo_with_cage_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_boo_with_cage_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_boo_with_cage_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_boo_with_cage_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_boo_with_cage_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_boo_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_boo_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_boo_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_big_boo_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_big_boo_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_big_boo_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_courtyard_boo_triplet_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_courtyard_boo_triplet_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_courtyard_boo_triplet_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_set_secondary_camera_focus(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_set_secondary_camera_focus", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
obj_set_secondary_camera_focus();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_boo_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_boo_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_boo_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_boo_boss_spawned_bridge_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_boo_boss_spawned_bridge_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_boo_boss_spawned_bridge_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bbh_tilting_trap_platform_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bbh_tilting_trap_platform_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bbh_tilting_trap_platform_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_haunted_bookshelf_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_haunted_bookshelf_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_haunted_bookshelf_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_merry_go_round_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_merry_go_round_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_merry_go_round_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
#ifndef VERSION_JP
|
|
int smlua_func_bhv_play_music_track_when_touched_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_play_music_track_when_touched_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_play_music_track_when_touched_loop();
|
|
|
|
return 1;
|
|
}
|
|
#endif
|
|
|
|
int smlua_func_bhv_beta_bowser_anchor_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_beta_bowser_anchor_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_beta_bowser_anchor_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_static_checkered_platform_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_static_checkered_platform_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_static_checkered_platform_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_castle_floor_trap_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_castle_floor_trap_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_castle_floor_trap_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_castle_floor_trap_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_castle_floor_trap_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_castle_floor_trap_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_floor_trap_in_castle_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_floor_trap_in_castle_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_floor_trap_in_castle_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_sparkle_spawn_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_sparkle_spawn_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_sparkle_spawn_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_scuttlebug_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_scuttlebug_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_scuttlebug_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_scuttlebug_spawn_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_scuttlebug_spawn_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_scuttlebug_spawn_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_whomp_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_whomp_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_whomp_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_water_splash_spawn_droplets(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_water_splash_spawn_droplets", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_water_splash_spawn_droplets();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_water_droplet_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_water_droplet_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_water_droplet_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_water_droplet_splash_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_water_droplet_splash_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_water_droplet_splash_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bubble_splash_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bubble_splash_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bubble_splash_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_idle_water_wave_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_idle_water_wave_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_idle_water_wave_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_shallow_water_splash_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_shallow_water_splash_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_shallow_water_splash_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_wave_trail_shrink(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_wave_trail_shrink", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_wave_trail_shrink();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_strong_wind_particle_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_strong_wind_particle_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_strong_wind_particle_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_sl_snowman_wind_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_sl_snowman_wind_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_sl_snowman_wind_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_sl_walking_penguin_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_sl_walking_penguin_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_sl_walking_penguin_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_menu_button_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_menu_button_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_menu_button_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_menu_button_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_menu_button_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_menu_button_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_menu_button_manager_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_menu_button_manager_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_menu_button_manager_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_menu_button_manager_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_menu_button_manager_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_menu_button_manager_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_act_selector_star_type_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_act_selector_star_type_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_act_selector_star_type_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_act_selector_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_act_selector_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_act_selector_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_act_selector_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_act_selector_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_act_selector_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_moving_yellow_coin_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_moving_yellow_coin_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_moving_yellow_coin_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_moving_yellow_coin_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_moving_yellow_coin_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_moving_yellow_coin_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_moving_blue_coin_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_moving_blue_coin_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_moving_blue_coin_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_moving_blue_coin_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_moving_blue_coin_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_moving_blue_coin_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_blue_coin_sliding_jumping_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_blue_coin_sliding_jumping_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_blue_coin_sliding_jumping_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_blue_coin_sliding_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_blue_coin_sliding_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_blue_coin_sliding_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_blue_coin_jumping_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_blue_coin_jumping_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_blue_coin_jumping_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_seaweed_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_seaweed_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_seaweed_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_seaweed_bundle_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_seaweed_bundle_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_seaweed_bundle_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bobomb_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bobomb_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bobomb_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bobomb_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bobomb_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bobomb_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bobomb_fuse_smoke_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bobomb_fuse_smoke_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bobomb_fuse_smoke_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bobomb_buddy_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bobomb_buddy_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bobomb_buddy_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bobomb_buddy_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bobomb_buddy_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bobomb_buddy_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_cannon_closed_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_cannon_closed_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_cannon_closed_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_cannon_closed_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_cannon_closed_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_cannon_closed_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_whirlpool_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_whirlpool_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_whirlpool_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_whirlpool_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_whirlpool_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_whirlpool_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_jet_stream_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_jet_stream_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_jet_stream_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_homing_amp_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_homing_amp_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_homing_amp_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_homing_amp_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_homing_amp_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_homing_amp_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_circling_amp_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_circling_amp_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_circling_amp_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_circling_amp_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_circling_amp_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_circling_amp_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_butterfly_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_butterfly_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_butterfly_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_butterfly_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_butterfly_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_butterfly_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_hoot_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_hoot_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_hoot_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_hoot_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_hoot_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_hoot_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_beta_holdable_object_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_beta_holdable_object_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_beta_holdable_object_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_beta_holdable_object_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_beta_holdable_object_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_beta_holdable_object_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_object_bubble_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_object_bubble_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_object_bubble_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_object_bubble_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_object_bubble_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_object_bubble_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_object_water_wave_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_object_water_wave_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_object_water_wave_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_object_water_wave_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_object_water_wave_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_object_water_wave_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_explosion_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_explosion_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_explosion_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_explosion_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_explosion_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_explosion_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bobomb_bully_death_smoke_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bobomb_bully_death_smoke_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bobomb_bully_death_smoke_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bobomb_explosion_bubble_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bobomb_explosion_bubble_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bobomb_explosion_bubble_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bobomb_explosion_bubble_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bobomb_explosion_bubble_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bobomb_explosion_bubble_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_respawner_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_respawner_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_respawner_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_small_bully_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_small_bully_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_small_bully_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bully_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bully_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bully_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_big_bully_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_big_bully_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_big_bully_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_big_bully_with_minions_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_big_bully_with_minions_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_big_bully_with_minions_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_big_bully_with_minions_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_big_bully_with_minions_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_big_bully_with_minions_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_jet_stream_ring_spawner_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_jet_stream_ring_spawner_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_jet_stream_ring_spawner_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_jet_stream_water_ring_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_jet_stream_water_ring_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_jet_stream_water_ring_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_jet_stream_water_ring_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_jet_stream_water_ring_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_jet_stream_water_ring_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_manta_ray_water_ring_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_manta_ray_water_ring_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_manta_ray_water_ring_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_manta_ray_water_ring_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_manta_ray_water_ring_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_manta_ray_water_ring_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bowser_bomb_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bowser_bomb_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bowser_bomb_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bowser_bomb_explosion_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bowser_bomb_explosion_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bowser_bomb_explosion_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bowser_bomb_smoke_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bowser_bomb_smoke_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bowser_bomb_smoke_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_celebration_star_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_celebration_star_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_celebration_star_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_celebration_star_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_celebration_star_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_celebration_star_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_celebration_star_sparkle_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_celebration_star_sparkle_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_celebration_star_sparkle_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_star_key_collection_puff_spawner_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_star_key_collection_puff_spawner_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_star_key_collection_puff_spawner_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_lll_drawbridge_spawner_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_lll_drawbridge_spawner_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_lll_drawbridge_spawner_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_lll_drawbridge_spawner_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_lll_drawbridge_spawner_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_lll_drawbridge_spawner_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_lll_drawbridge_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_lll_drawbridge_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_lll_drawbridge_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_small_bomp_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_small_bomp_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_small_bomp_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_small_bomp_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_small_bomp_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_small_bomp_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_large_bomp_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_large_bomp_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_large_bomp_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_large_bomp_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_large_bomp_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_large_bomp_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_wf_sliding_platform_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_wf_sliding_platform_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_wf_sliding_platform_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_wf_sliding_platform_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_wf_sliding_platform_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_wf_sliding_platform_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_moneybag_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_moneybag_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_moneybag_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_moneybag_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_moneybag_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_moneybag_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_moneybag_hidden_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_moneybag_hidden_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_moneybag_hidden_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bob_pit_bowling_ball_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bob_pit_bowling_ball_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bob_pit_bowling_ball_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bob_pit_bowling_ball_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bob_pit_bowling_ball_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bob_pit_bowling_ball_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_free_bowling_ball_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_free_bowling_ball_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_free_bowling_ball_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_free_bowling_ball_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_free_bowling_ball_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_free_bowling_ball_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bowling_ball_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bowling_ball_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bowling_ball_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bowling_ball_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bowling_ball_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bowling_ball_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_generic_bowling_ball_spawner_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_generic_bowling_ball_spawner_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_generic_bowling_ball_spawner_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_generic_bowling_ball_spawner_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_generic_bowling_ball_spawner_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_generic_bowling_ball_spawner_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_thi_bowling_ball_spawner_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_thi_bowling_ball_spawner_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_thi_bowling_ball_spawner_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_rr_cruiser_wing_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_rr_cruiser_wing_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_rr_cruiser_wing_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_rr_cruiser_wing_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_rr_cruiser_wing_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_rr_cruiser_wing_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_spindel_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_spindel_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_spindel_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_spindel_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_spindel_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_spindel_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_ssl_moving_pyramid_wall_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_ssl_moving_pyramid_wall_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_ssl_moving_pyramid_wall_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_ssl_moving_pyramid_wall_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_ssl_moving_pyramid_wall_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_ssl_moving_pyramid_wall_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_pyramid_elevator_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_pyramid_elevator_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_pyramid_elevator_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_pyramid_elevator_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_pyramid_elevator_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_pyramid_elevator_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_pyramid_elevator_trajectory_marker_ball_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_pyramid_elevator_trajectory_marker_ball_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_pyramid_elevator_trajectory_marker_ball_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_pyramid_top_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_pyramid_top_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_pyramid_top_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_pyramid_top_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_pyramid_top_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_pyramid_top_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_pyramid_top_fragment_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_pyramid_top_fragment_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_pyramid_top_fragment_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_pyramid_top_fragment_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_pyramid_top_fragment_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_pyramid_top_fragment_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_pyramid_pillar_touch_detector_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_pyramid_pillar_touch_detector_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_pyramid_pillar_touch_detector_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_waterfall_sound_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_waterfall_sound_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_waterfall_sound_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_volcano_sound_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_volcano_sound_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_volcano_sound_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_castle_flag_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_castle_flag_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_castle_flag_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_birds_sound_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_birds_sound_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_birds_sound_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_ambient_sounds_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_ambient_sounds_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_ambient_sounds_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_sand_sound_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_sand_sound_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_sand_sound_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_castle_cannon_grate_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_castle_cannon_grate_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_castle_cannon_grate_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_snowmans_bottom_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_snowmans_bottom_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_snowmans_bottom_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_snowmans_bottom_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_snowmans_bottom_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_snowmans_bottom_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_snowmans_head_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_snowmans_head_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_snowmans_head_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_snowmans_head_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_snowmans_head_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_snowmans_head_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_snowmans_body_checkpoint_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_snowmans_body_checkpoint_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_snowmans_body_checkpoint_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_big_boulder_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_big_boulder_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_big_boulder_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_big_boulder_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_big_boulder_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_big_boulder_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_big_boulder_generator_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_big_boulder_generator_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_big_boulder_generator_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_wing_cap_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_wing_cap_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_wing_cap_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_wing_vanish_cap_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_wing_vanish_cap_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_wing_vanish_cap_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_metal_cap_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_metal_cap_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_metal_cap_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_metal_cap_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_metal_cap_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_metal_cap_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_normal_cap_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_normal_cap_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_normal_cap_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_normal_cap_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_normal_cap_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_normal_cap_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_vanish_cap_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_vanish_cap_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_vanish_cap_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_star_number_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_star_number_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_star_number_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_spawn_star_number(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "spawn_star_number", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
spawn_star_number();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_collect_star_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_collect_star_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_collect_star_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_collect_star_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_collect_star_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_collect_star_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_star_spawn_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_star_spawn_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_star_spawn_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_star_spawn_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_star_spawn_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_star_spawn_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_hidden_red_coin_star_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_hidden_red_coin_star_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_hidden_red_coin_star_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_hidden_red_coin_star_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_hidden_red_coin_star_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_hidden_red_coin_star_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_red_coin_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_red_coin_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_red_coin_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_red_coin_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_red_coin_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_red_coin_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bowser_course_red_coin_star_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bowser_course_red_coin_star_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bowser_course_red_coin_star_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_hidden_star_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_hidden_star_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_hidden_star_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_hidden_star_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_hidden_star_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_hidden_star_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_hidden_star_trigger_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_hidden_star_trigger_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_hidden_star_trigger_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_ttm_rolling_log_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_ttm_rolling_log_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_ttm_rolling_log_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_rolling_log_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_rolling_log_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_rolling_log_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_lll_rolling_log_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_lll_rolling_log_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_lll_rolling_log_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_1up_trigger_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_1up_trigger_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_1up_trigger_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_1up_common_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_1up_common_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_1up_common_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_1up_walking_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_1up_walking_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_1up_walking_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_1up_running_away_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_1up_running_away_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_1up_running_away_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_1up_sliding_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_1up_sliding_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_1up_sliding_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_1up_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_1up_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_1up_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_1up_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_1up_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_1up_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_1up_jump_on_approach_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_1up_jump_on_approach_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_1up_jump_on_approach_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_1up_hidden_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_1up_hidden_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_1up_hidden_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_1up_hidden_trigger_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_1up_hidden_trigger_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_1up_hidden_trigger_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_1up_hidden_in_pole_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_1up_hidden_in_pole_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_1up_hidden_in_pole_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_1up_hidden_in_pole_trigger_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_1up_hidden_in_pole_trigger_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_1up_hidden_in_pole_trigger_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_1up_hidden_in_pole_spawner_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_1up_hidden_in_pole_spawner_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_1up_hidden_in_pole_spawner_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_controllable_platform_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_controllable_platform_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_controllable_platform_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_controllable_platform_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_controllable_platform_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_controllable_platform_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_controllable_platform_sub_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_controllable_platform_sub_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_controllable_platform_sub_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_breakable_box_small_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_breakable_box_small_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_breakable_box_small_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_breakable_box_small_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_breakable_box_small_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_breakable_box_small_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_sliding_snow_mound_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_sliding_snow_mound_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_sliding_snow_mound_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_snow_mound_spawn_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_snow_mound_spawn_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_snow_mound_spawn_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_floating_platform_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_floating_platform_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_floating_platform_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_arrow_lift_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_arrow_lift_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_arrow_lift_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_orange_number_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_orange_number_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_orange_number_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_orange_number_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_orange_number_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_orange_number_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_manta_ray_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_manta_ray_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_manta_ray_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_manta_ray_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_manta_ray_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_manta_ray_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_falling_pillar_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_falling_pillar_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_falling_pillar_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_falling_pillar_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_falling_pillar_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_falling_pillar_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_falling_pillar_hitbox_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_falling_pillar_hitbox_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_falling_pillar_hitbox_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_jrb_floating_box_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_jrb_floating_box_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_jrb_floating_box_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_decorative_pendulum_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_decorative_pendulum_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_decorative_pendulum_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_decorative_pendulum_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_decorative_pendulum_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_decorative_pendulum_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_treasure_chest_ship_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_treasure_chest_ship_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_treasure_chest_ship_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_treasure_chest_ship_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_treasure_chest_ship_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_treasure_chest_ship_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_treasure_chest_jrb_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_treasure_chest_jrb_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_treasure_chest_jrb_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_treasure_chest_jrb_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_treasure_chest_jrb_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_treasure_chest_jrb_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_treasure_chest_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_treasure_chest_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_treasure_chest_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_treasure_chest_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_treasure_chest_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_treasure_chest_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_treasure_chest_bottom_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_treasure_chest_bottom_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_treasure_chest_bottom_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_treasure_chest_bottom_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_treasure_chest_bottom_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_treasure_chest_bottom_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_treasure_chest_top_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_treasure_chest_top_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_treasure_chest_top_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_mips_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_mips_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_mips_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_mips_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_mips_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_mips_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_yoshi_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_yoshi_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_yoshi_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_koopa_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_koopa_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_koopa_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_koopa_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_koopa_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_koopa_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_koopa_race_endpoint_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_koopa_race_endpoint_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_koopa_race_endpoint_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_pokey_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_pokey_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_pokey_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_pokey_body_part_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_pokey_body_part_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_pokey_body_part_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_swoop_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_swoop_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_swoop_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_fly_guy_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_fly_guy_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_fly_guy_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_goomba_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_goomba_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_goomba_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_goomba_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_goomba_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_goomba_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_goomba_triplet_spawner_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_goomba_triplet_spawner_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_goomba_triplet_spawner_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_chain_chomp_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_chain_chomp_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_chain_chomp_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_chain_chomp_chain_part_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_chain_chomp_chain_part_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_chain_chomp_chain_part_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_wooden_post_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_wooden_post_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_wooden_post_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_chain_chomp_gate_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_chain_chomp_gate_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_chain_chomp_gate_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_chain_chomp_gate_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_chain_chomp_gate_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_chain_chomp_gate_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_wiggler_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_wiggler_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_wiggler_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_wiggler_body_part_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_wiggler_body_part_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_wiggler_body_part_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_enemy_lakitu_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_enemy_lakitu_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_enemy_lakitu_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_camera_lakitu_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_camera_lakitu_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_camera_lakitu_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_camera_lakitu_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_camera_lakitu_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_camera_lakitu_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_cloud_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_cloud_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_cloud_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_cloud_part_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_cloud_part_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_cloud_part_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_spiny_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_spiny_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_spiny_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_monty_mole_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_monty_mole_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_monty_mole_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_monty_mole_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_monty_mole_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_monty_mole_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_monty_mole_hole_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_monty_mole_hole_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_monty_mole_hole_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_monty_mole_rock_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_monty_mole_rock_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_monty_mole_rock_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_platform_on_track_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_platform_on_track_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_platform_on_track_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_platform_on_track_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_platform_on_track_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_platform_on_track_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_track_ball_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_track_ball_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_track_ball_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_seesaw_platform_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_seesaw_platform_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_seesaw_platform_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_seesaw_platform_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_seesaw_platform_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_seesaw_platform_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_ferris_wheel_axle_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_ferris_wheel_axle_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_ferris_wheel_axle_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_ferris_wheel_platform_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_ferris_wheel_platform_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_ferris_wheel_platform_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_ferris_wheel_platform_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_ferris_wheel_platform_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_ferris_wheel_platform_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_water_bomb_spawner_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_water_bomb_spawner_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_water_bomb_spawner_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_water_bomb_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_water_bomb_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_water_bomb_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_water_bomb_shadow_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_water_bomb_shadow_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_water_bomb_shadow_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_ttc_rotating_solid_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_ttc_rotating_solid_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_ttc_rotating_solid_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_ttc_rotating_solid_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_ttc_rotating_solid_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_ttc_rotating_solid_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_ttc_pendulum_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_ttc_pendulum_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_ttc_pendulum_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_ttc_pendulum_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_ttc_pendulum_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_ttc_pendulum_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_ttc_treadmill_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_ttc_treadmill_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_ttc_treadmill_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_ttc_treadmill_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_ttc_treadmill_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_ttc_treadmill_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_ttc_moving_bar_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_ttc_moving_bar_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_ttc_moving_bar_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_ttc_moving_bar_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_ttc_moving_bar_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_ttc_moving_bar_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_ttc_cog_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_ttc_cog_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_ttc_cog_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_ttc_cog_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_ttc_cog_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_ttc_cog_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_ttc_pit_block_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_ttc_pit_block_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_ttc_pit_block_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_ttc_pit_block_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_ttc_pit_block_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_ttc_pit_block_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_ttc_elevator_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_ttc_elevator_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_ttc_elevator_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_ttc_elevator_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_ttc_elevator_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_ttc_elevator_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_ttc_2d_rotator_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_ttc_2d_rotator_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_ttc_2d_rotator_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_ttc_2d_rotator_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_ttc_2d_rotator_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_ttc_2d_rotator_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_ttc_spinner_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_ttc_spinner_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_ttc_spinner_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_mr_blizzard_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_mr_blizzard_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_mr_blizzard_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_mr_blizzard_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_mr_blizzard_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_mr_blizzard_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_mr_blizzard_snowball(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_mr_blizzard_snowball", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_mr_blizzard_snowball();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_sliding_plat_2_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_sliding_plat_2_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_sliding_plat_2_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_sliding_plat_2_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_sliding_plat_2_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_sliding_plat_2_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_rotating_octagonal_plat_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_rotating_octagonal_plat_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_rotating_octagonal_plat_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_rotating_octagonal_plat_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_rotating_octagonal_plat_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_rotating_octagonal_plat_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_animates_on_floor_switch_press_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_animates_on_floor_switch_press_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_animates_on_floor_switch_press_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_animates_on_floor_switch_press_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_animates_on_floor_switch_press_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_animates_on_floor_switch_press_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_activated_back_and_forth_platform_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_activated_back_and_forth_platform_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_activated_back_and_forth_platform_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_activated_back_and_forth_platform_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_activated_back_and_forth_platform_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_activated_back_and_forth_platform_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_recovery_heart_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_recovery_heart_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_recovery_heart_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_water_bomb_cannon_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_water_bomb_cannon_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_water_bomb_cannon_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bubble_cannon_barrel_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bubble_cannon_barrel_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bubble_cannon_barrel_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_unagi_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_unagi_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_unagi_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_unagi_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_unagi_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_unagi_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_unagi_subobject_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_unagi_subobject_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_unagi_subobject_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_dorrie_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_dorrie_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_dorrie_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_haunted_chair_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_haunted_chair_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_haunted_chair_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_haunted_chair_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_haunted_chair_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_haunted_chair_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_mad_piano_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_mad_piano_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_mad_piano_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_flying_bookend_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_flying_bookend_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_flying_bookend_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bookend_spawn_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bookend_spawn_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bookend_spawn_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_haunted_bookshelf_manager_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_haunted_bookshelf_manager_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_haunted_bookshelf_manager_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_book_switch_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_book_switch_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_book_switch_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_fire_piranha_plant_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_fire_piranha_plant_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_fire_piranha_plant_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_fire_piranha_plant_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_fire_piranha_plant_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_fire_piranha_plant_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_small_piranha_flame_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_small_piranha_flame_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_small_piranha_flame_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_fire_spitter_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_fire_spitter_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_fire_spitter_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_fly_guy_flame_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_fly_guy_flame_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_fly_guy_flame_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_snufit_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_snufit_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_snufit_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_snufit_balls_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_snufit_balls_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_snufit_balls_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_horizontal_grindel_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_horizontal_grindel_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_horizontal_grindel_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_horizontal_grindel_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_horizontal_grindel_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_horizontal_grindel_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_eyerok_boss_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_eyerok_boss_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_eyerok_boss_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_eyerok_boss_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_eyerok_boss_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_eyerok_boss_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_eyerok_hand_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_eyerok_hand_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_eyerok_hand_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_klepto_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_klepto_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_klepto_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_klepto_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_klepto_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_klepto_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bird_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bird_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bird_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_racing_penguin_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_racing_penguin_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_racing_penguin_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_racing_penguin_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_racing_penguin_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_racing_penguin_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_penguin_race_finish_line_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_penguin_race_finish_line_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_penguin_race_finish_line_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_penguin_race_shortcut_check_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_penguin_race_shortcut_check_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_penguin_race_shortcut_check_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_coffin_spawner_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_coffin_spawner_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_coffin_spawner_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_coffin_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_coffin_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_coffin_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_clam_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_clam_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_clam_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_skeeter_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_skeeter_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_skeeter_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_skeeter_wave_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_skeeter_wave_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_skeeter_wave_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_swing_platform_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_swing_platform_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_swing_platform_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_swing_platform_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_swing_platform_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_swing_platform_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_donut_platform_spawner_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_donut_platform_spawner_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_donut_platform_spawner_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_donut_platform_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_donut_platform_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_donut_platform_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_ddd_pole_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_ddd_pole_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_ddd_pole_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_ddd_pole_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_ddd_pole_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_ddd_pole_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_red_coin_star_marker_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_red_coin_star_marker_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_red_coin_star_marker_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_triplet_butterfly_update(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_triplet_butterfly_update", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_triplet_butterfly_update();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_bubba_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_bubba_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_bubba_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_intro_lakitu_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_intro_lakitu_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_intro_lakitu_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_intro_peach_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_intro_peach_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_intro_peach_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_end_birds_1_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_end_birds_1_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_end_birds_1_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_end_birds_2_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_end_birds_2_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_end_birds_2_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_intro_scene_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_intro_scene_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_intro_scene_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_yoshi_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_yoshi_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_yoshi_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_volcano_trap_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_volcano_trap_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_volcano_trap_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_uv_update_scroll(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "uv_update_scroll", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
uv_update_scroll();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_ambient_light_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_ambient_light_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_ambient_light_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_point_light_init(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_point_light_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_point_light_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_point_light_loop(UNUSED lua_State* L) {
|
|
if (!gCurrentObject) { return 0; }
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_point_light_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_point_light_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
/*
|
|
int smlua_func_geo_move_mario_part_from_parent(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "geo_move_mario_part_from_parent", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 run = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "geo_move_mario_part_from_parent"); return 0; }
|
|
// struct GraphNode* node = (struct GraphNode*)smlua_to_cobject(L, 2, LOT_GRAPHNODE); <--- UNIMPLEMENTED
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "geo_move_mario_part_from_parent"); return 0; }
|
|
|
|
Mat4 mtx;
|
|
smlua_get_mat4(mtx, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "geo_move_mario_part_from_parent"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_GFX, geo_move_mario_part_from_parent(run, node, mtx), NULL);
|
|
|
|
return 1;
|
|
}
|
|
*/
|
|
|
|
/*
|
|
int smlua_func_geo_bits_bowser_coloring(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "geo_bits_bowser_coloring", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 run = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "geo_bits_bowser_coloring"); return 0; }
|
|
// struct GraphNode* node = (struct GraphNode*)smlua_to_cobject(L, 2, LOT_GRAPHNODE); <--- UNIMPLEMENTED
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "geo_bits_bowser_coloring"); return 0; }
|
|
s32 a2 = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "geo_bits_bowser_coloring"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_GFX, geo_bits_bowser_coloring(run, node, a2), NULL);
|
|
|
|
return 1;
|
|
}
|
|
*/
|
|
|
|
/*
|
|
int smlua_func_geo_update_body_rot_from_parent(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "geo_update_body_rot_from_parent", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 run = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "geo_update_body_rot_from_parent"); return 0; }
|
|
// struct GraphNode* node = (struct GraphNode*)smlua_to_cobject(L, 2, LOT_GRAPHNODE); <--- UNIMPLEMENTED
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "geo_update_body_rot_from_parent"); return 0; }
|
|
|
|
Mat4 mtx;
|
|
smlua_get_mat4(mtx, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "geo_update_body_rot_from_parent"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_GFX, geo_update_body_rot_from_parent(run, node, mtx), NULL);
|
|
|
|
return 1;
|
|
}
|
|
*/
|
|
|
|
/*
|
|
int smlua_func_geo_switch_bowser_eyes(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "geo_switch_bowser_eyes", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 run = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "geo_switch_bowser_eyes"); return 0; }
|
|
// struct GraphNode* node = (struct GraphNode*)smlua_to_cobject(L, 2, LOT_GRAPHNODE); <--- UNIMPLEMENTED
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "geo_switch_bowser_eyes"); return 0; }
|
|
Mat4 * mtx = (Mat4 *)smlua_to_cobject(L, 3, LOT_MAT4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "geo_switch_bowser_eyes"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_GFX, geo_switch_bowser_eyes(run, node, mtx), NULL);
|
|
|
|
return 1;
|
|
}
|
|
*/
|
|
|
|
/*
|
|
int smlua_func_geo_switch_tuxie_mother_eyes(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "geo_switch_tuxie_mother_eyes", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 run = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "geo_switch_tuxie_mother_eyes"); return 0; }
|
|
// struct GraphNode* node = (struct GraphNode*)smlua_to_cobject(L, 2, LOT_GRAPHNODE); <--- UNIMPLEMENTED
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "geo_switch_tuxie_mother_eyes"); return 0; }
|
|
Mat4 * mtx = (Mat4 *)smlua_to_cobject(L, 3, LOT_MAT4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "geo_switch_tuxie_mother_eyes"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_GFX, geo_switch_tuxie_mother_eyes(run, node, mtx), NULL);
|
|
|
|
return 1;
|
|
}
|
|
*/
|
|
|
|
/*
|
|
int smlua_func_geo_update_held_mario_pos(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "geo_update_held_mario_pos", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 run = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "geo_update_held_mario_pos"); return 0; }
|
|
// struct GraphNode* node = (struct GraphNode*)smlua_to_cobject(L, 2, LOT_GRAPHNODE); <--- UNIMPLEMENTED
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "geo_update_held_mario_pos"); return 0; }
|
|
|
|
Mat4 mtx;
|
|
smlua_get_mat4(mtx, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "geo_update_held_mario_pos"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_GFX, geo_update_held_mario_pos(run, node, mtx), NULL);
|
|
|
|
return 1;
|
|
}
|
|
*/
|
|
|
|
/*
|
|
int smlua_func_geo_snufit_move_mask(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "geo_snufit_move_mask", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 callContext = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "geo_snufit_move_mask"); return 0; }
|
|
// struct GraphNode* node = (struct GraphNode*)smlua_to_cobject(L, 2, LOT_GRAPHNODE); <--- UNIMPLEMENTED
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "geo_snufit_move_mask"); return 0; }
|
|
Mat4 * c = (Mat4 *)smlua_to_cobject(L, 3, LOT_MAT4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "geo_snufit_move_mask"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_GFX, geo_snufit_move_mask(callContext, node, c), NULL);
|
|
|
|
return 1;
|
|
}
|
|
*/
|
|
|
|
/*
|
|
int smlua_func_geo_snufit_scale_body(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "geo_snufit_scale_body", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 callContext = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "geo_snufit_scale_body"); return 0; }
|
|
// struct GraphNode* node = (struct GraphNode*)smlua_to_cobject(L, 2, LOT_GRAPHNODE); <--- UNIMPLEMENTED
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "geo_snufit_scale_body"); return 0; }
|
|
Mat4 * c = (Mat4 *)smlua_to_cobject(L, 3, LOT_MAT4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "geo_snufit_scale_body"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_GFX, geo_snufit_scale_body(callContext, node, c), NULL);
|
|
|
|
return 1;
|
|
}
|
|
*/
|
|
|
|
/*
|
|
int smlua_func_geo_scale_bowser_key(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "geo_scale_bowser_key", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 run = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "geo_scale_bowser_key"); return 0; }
|
|
// struct GraphNode* node = (struct GraphNode*)smlua_to_cobject(L, 2, LOT_GRAPHNODE); <--- UNIMPLEMENTED
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "geo_scale_bowser_key"); return 0; }
|
|
f32 mtx[4][4] = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "geo_scale_bowser_key"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_GFX, geo_scale_bowser_key(run, node, mtx[4][4]), NULL);
|
|
|
|
return 1;
|
|
}
|
|
*/
|
|
|
|
int smlua_func_spawn_default_star(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "spawn_default_star", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 x = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "spawn_default_star"); return 0; }
|
|
f32 y = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "spawn_default_star"); return 0; }
|
|
f32 z = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "spawn_default_star"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_OBJECT, spawn_default_star(x, y, z), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_spawn_red_coin_cutscene_star(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "spawn_red_coin_cutscene_star", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 x = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "spawn_red_coin_cutscene_star"); return 0; }
|
|
f32 y = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "spawn_red_coin_cutscene_star"); return 0; }
|
|
f32 z = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "spawn_red_coin_cutscene_star"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_OBJECT, spawn_red_coin_cutscene_star(x, y, z), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_spawn_no_exit_star(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "spawn_no_exit_star", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 x = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "spawn_no_exit_star"); return 0; }
|
|
f32 y = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "spawn_no_exit_star"); return 0; }
|
|
f32 z = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "spawn_no_exit_star"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_OBJECT, spawn_no_exit_star(x, y, z), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
///////////////////////
|
|
// behavior_script.h //
|
|
///////////////////////
|
|
|
|
int smlua_func_random_u16(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "random_u16", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, random_u16());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_random_float(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "random_float", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushnumber(L, random_float());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_random_sign(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "random_sign", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, random_sign());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_update_gfx_pos_and_angle(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_update_gfx_pos_and_angle", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_update_gfx_pos_and_angle"); return 0; }
|
|
|
|
obj_update_gfx_pos_and_angle(obj);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_position_based_random_u16(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "position_based_random_u16", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, position_based_random_u16());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_position_based_random_float_position(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "position_based_random_float_position", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushnumber(L, position_based_random_float_position());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_draw_distance_scalar(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "draw_distance_scalar", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushnumber(L, draw_distance_scalar());
|
|
|
|
return 1;
|
|
}
|
|
|
|
//////////////////////
|
|
// behavior_table.h //
|
|
//////////////////////
|
|
|
|
int smlua_func_get_id_from_behavior(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_id_from_behavior", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
BehaviorScript* behavior = (BehaviorScript*)smlua_to_cpointer(L, 1, LVT_BEHAVIORSCRIPT_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_id_from_behavior"); return 0; }
|
|
|
|
lua_pushinteger(L, get_id_from_behavior(behavior));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_id_from_vanilla_behavior(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_id_from_vanilla_behavior", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
BehaviorScript* behavior = (BehaviorScript*)smlua_to_cpointer(L, 1, LVT_BEHAVIORSCRIPT_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_id_from_vanilla_behavior"); return 0; }
|
|
|
|
lua_pushinteger(L, get_id_from_vanilla_behavior(behavior));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_behavior_from_id(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_behavior_from_id", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
int id = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_behavior_from_id"); return 0; }
|
|
|
|
smlua_push_pointer(L, LVT_BEHAVIORSCRIPT_P, (void*)get_behavior_from_id(id), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_behavior_name_from_id(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_behavior_name_from_id", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
int id = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_behavior_name_from_id"); return 0; }
|
|
|
|
lua_pushstring(L, get_behavior_name_from_id(id));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_id_from_behavior_name(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_id_from_behavior_name", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
const char* name = smlua_to_string(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_id_from_behavior_name"); return 0; }
|
|
|
|
lua_pushinteger(L, get_id_from_behavior_name(name));
|
|
|
|
return 1;
|
|
}
|
|
|
|
//////////////
|
|
// camera.h //
|
|
//////////////
|
|
|
|
int smlua_func_skip_camera_interpolation(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "skip_camera_interpolation", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
skip_camera_interpolation();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_camera_shake_from_hit(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_camera_shake_from_hit", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 shake = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_camera_shake_from_hit"); return 0; }
|
|
|
|
set_camera_shake_from_hit(shake);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_environmental_camera_shake(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_environmental_camera_shake", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 shake = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_environmental_camera_shake"); return 0; }
|
|
|
|
set_environmental_camera_shake(shake);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_camera_shake_from_point(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_camera_shake_from_point", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 shake = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_camera_shake_from_point"); return 0; }
|
|
f32 posX = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "set_camera_shake_from_point"); return 0; }
|
|
f32 posY = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "set_camera_shake_from_point"); return 0; }
|
|
f32 posZ = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "set_camera_shake_from_point"); return 0; }
|
|
|
|
set_camera_shake_from_point(shake, posX, posY, posZ);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_move_mario_head_c_up(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "move_mario_head_c_up", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Camera* c = (struct Camera*)smlua_to_cobject(L, 1, LOT_CAMERA);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "move_mario_head_c_up"); return 0; }
|
|
|
|
move_mario_head_c_up(c);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_transition_next_state(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "transition_next_state", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Camera* c = (struct Camera*)smlua_to_cobject(L, 1, LOT_CAMERA);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "transition_next_state"); return 0; }
|
|
s16 frames = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "transition_next_state"); return 0; }
|
|
|
|
transition_next_state(c, frames);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_camera_mode(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_camera_mode", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Camera* c = (struct Camera*)smlua_to_cobject(L, 1, LOT_CAMERA);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_camera_mode"); return 0; }
|
|
s16 mode = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "set_camera_mode"); return 0; }
|
|
s16 frames = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "set_camera_mode"); return 0; }
|
|
|
|
set_camera_mode(c, mode, frames);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_soft_reset_camera(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "soft_reset_camera", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Camera* c = (struct Camera*)smlua_to_cobject(L, 1, LOT_CAMERA);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "soft_reset_camera"); return 0; }
|
|
|
|
soft_reset_camera(c);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_reset_camera(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "reset_camera", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Camera* c = (struct Camera*)smlua_to_cobject(L, 1, LOT_CAMERA);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "reset_camera"); return 0; }
|
|
|
|
reset_camera(c);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_select_mario_cam_mode(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "select_mario_cam_mode", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
select_mario_cam_mode();
|
|
|
|
return 1;
|
|
}
|
|
|
|
/*
|
|
int smlua_func_geo_camera_main(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "geo_camera_main", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 callContext = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "geo_camera_main"); return 0; }
|
|
// struct GraphNode* g = (struct GraphNode*)smlua_to_cobject(L, 2, LOT_GRAPHNODE); <--- UNIMPLEMENTED
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "geo_camera_main"); return 0; }
|
|
// void * context = (void *)smlua_to_cobject(L, 3, LOT_???); <--- UNIMPLEMENTED
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "geo_camera_main"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_GFX, geo_camera_main(callContext, g, context), NULL);
|
|
|
|
return 1;
|
|
}
|
|
*/
|
|
|
|
int smlua_func_object_pos_to_vec3f(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "object_pos_to_vec3f", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f dst;
|
|
smlua_get_vec3f(dst, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "object_pos_to_vec3f"); return 0; }
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 2, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "object_pos_to_vec3f"); return 0; }
|
|
|
|
object_pos_to_vec3f(dst, o);
|
|
|
|
smlua_push_vec3f(dst, 1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3f_to_object_pos(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3f_to_object_pos", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3f_to_object_pos"); return 0; }
|
|
|
|
Vec3f src;
|
|
smlua_get_vec3f(src, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3f_to_object_pos"); return 0; }
|
|
|
|
vec3f_to_object_pos(o, src);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_object_face_angle_to_vec3s(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "object_face_angle_to_vec3s", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3s dst;
|
|
smlua_get_vec3s(dst, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "object_face_angle_to_vec3s"); return 0; }
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 2, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "object_face_angle_to_vec3s"); return 0; }
|
|
|
|
object_face_angle_to_vec3s(dst, o);
|
|
|
|
smlua_push_vec3s(dst, 1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3s_to_object_face_angle(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3s_to_object_face_angle", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3s_to_object_face_angle"); return 0; }
|
|
|
|
Vec3s src;
|
|
smlua_get_vec3s(src, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3s_to_object_face_angle"); return 0; }
|
|
|
|
vec3s_to_object_face_angle(o, src);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_object_move_angle_to_vec3s(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "object_move_angle_to_vec3s", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3s dst;
|
|
smlua_get_vec3s(dst, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "object_move_angle_to_vec3s"); return 0; }
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 2, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "object_move_angle_to_vec3s"); return 0; }
|
|
|
|
object_move_angle_to_vec3s(dst, o);
|
|
|
|
smlua_push_vec3s(dst, 1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3s_to_object_move_angle(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3s_to_object_move_angle", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3s_to_object_move_angle"); return 0; }
|
|
|
|
Vec3s src;
|
|
smlua_get_vec3s(src, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3s_to_object_move_angle"); return 0; }
|
|
|
|
vec3s_to_object_move_angle(o, src);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cam_select_alt_mode(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cam_select_alt_mode", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 angle = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cam_select_alt_mode"); return 0; }
|
|
|
|
lua_pushinteger(L, cam_select_alt_mode(angle));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_cam_angle(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_cam_angle", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 mode = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_cam_angle"); return 0; }
|
|
|
|
lua_pushinteger(L, set_cam_angle(mode));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_handheld_shake(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_handheld_shake", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 mode = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_handheld_shake"); return 0; }
|
|
|
|
set_handheld_shake(mode);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_shake_camera_handheld(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "shake_camera_handheld", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f pos;
|
|
smlua_get_vec3f(pos, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "shake_camera_handheld"); return 0; }
|
|
|
|
Vec3f focus;
|
|
smlua_get_vec3f(focus, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "shake_camera_handheld"); return 0; }
|
|
|
|
shake_camera_handheld(pos, focus);
|
|
|
|
smlua_push_vec3f(focus, 2);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_find_c_buttons_pressed(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "find_c_buttons_pressed", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
u16 currentState = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "find_c_buttons_pressed"); return 0; }
|
|
u16 buttonsPressed = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "find_c_buttons_pressed"); return 0; }
|
|
u16 buttonsDown = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "find_c_buttons_pressed"); return 0; }
|
|
|
|
lua_pushinteger(L, find_c_buttons_pressed(currentState, buttonsPressed, buttonsDown));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_collide_with_walls(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "collide_with_walls", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f pos;
|
|
smlua_get_vec3f(pos, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "collide_with_walls"); return 0; }
|
|
f32 offsetY = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "collide_with_walls"); return 0; }
|
|
f32 radius = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "collide_with_walls"); return 0; }
|
|
|
|
lua_pushinteger(L, collide_with_walls(pos, offsetY, radius));
|
|
|
|
smlua_push_vec3f(pos, 1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_clamp_pitch(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "clamp_pitch", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f from;
|
|
smlua_get_vec3f(from, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "clamp_pitch"); return 0; }
|
|
|
|
Vec3f to;
|
|
smlua_get_vec3f(to, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "clamp_pitch"); return 0; }
|
|
s16 maxPitch = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "clamp_pitch"); return 0; }
|
|
s16 minPitch = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "clamp_pitch"); return 0; }
|
|
|
|
lua_pushinteger(L, clamp_pitch(from, to, maxPitch, minPitch));
|
|
|
|
smlua_push_vec3f(to, 2);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_is_within_100_units_of_mario(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "is_within_100_units_of_mario", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 posX = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "is_within_100_units_of_mario"); return 0; }
|
|
f32 posY = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "is_within_100_units_of_mario"); return 0; }
|
|
f32 posZ = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "is_within_100_units_of_mario"); return 0; }
|
|
|
|
lua_pushinteger(L, is_within_100_units_of_mario(posX, posY, posZ));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_or_approach_f32_asymptotic(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_or_approach_f32_asymptotic", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 * dst = (f32 *)smlua_to_cpointer(L, 1, LVT_F32_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_or_approach_f32_asymptotic"); return 0; }
|
|
f32 goal = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "set_or_approach_f32_asymptotic"); return 0; }
|
|
f32 scale = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "set_or_approach_f32_asymptotic"); return 0; }
|
|
|
|
lua_pushinteger(L, set_or_approach_f32_asymptotic(dst, goal, scale));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_approach_f32_asymptotic_bool(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "approach_f32_asymptotic_bool", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 * current = (f32 *)smlua_to_cpointer(L, 1, LVT_F32_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "approach_f32_asymptotic_bool"); return 0; }
|
|
f32 target = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "approach_f32_asymptotic_bool"); return 0; }
|
|
f32 multiplier = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "approach_f32_asymptotic_bool"); return 0; }
|
|
|
|
lua_pushinteger(L, approach_f32_asymptotic_bool(current, target, multiplier));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_approach_f32_asymptotic(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "approach_f32_asymptotic", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 current = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "approach_f32_asymptotic"); return 0; }
|
|
f32 target = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "approach_f32_asymptotic"); return 0; }
|
|
f32 multiplier = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "approach_f32_asymptotic"); return 0; }
|
|
|
|
lua_pushnumber(L, approach_f32_asymptotic(current, target, multiplier));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_approach_s16_asymptotic_bool(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "approach_s16_asymptotic_bool", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 * current = (s16 *)smlua_to_cpointer(L, 1, LVT_S16_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "approach_s16_asymptotic_bool"); return 0; }
|
|
s16 target = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "approach_s16_asymptotic_bool"); return 0; }
|
|
s16 divisor = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "approach_s16_asymptotic_bool"); return 0; }
|
|
|
|
lua_pushinteger(L, approach_s16_asymptotic_bool(current, target, divisor));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_approach_s16_asymptotic(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "approach_s16_asymptotic", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 current = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "approach_s16_asymptotic"); return 0; }
|
|
s16 target = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "approach_s16_asymptotic"); return 0; }
|
|
s16 divisor = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "approach_s16_asymptotic"); return 0; }
|
|
|
|
lua_pushinteger(L, approach_s16_asymptotic(current, target, divisor));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_approach_vec3f_asymptotic(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 5) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "approach_vec3f_asymptotic", 5, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f current;
|
|
smlua_get_vec3f(current, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "approach_vec3f_asymptotic"); return 0; }
|
|
|
|
Vec3f target;
|
|
smlua_get_vec3f(target, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "approach_vec3f_asymptotic"); return 0; }
|
|
f32 xMul = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "approach_vec3f_asymptotic"); return 0; }
|
|
f32 yMul = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "approach_vec3f_asymptotic"); return 0; }
|
|
f32 zMul = smlua_to_number(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "approach_vec3f_asymptotic"); return 0; }
|
|
|
|
approach_vec3f_asymptotic(current, target, xMul, yMul, zMul);
|
|
|
|
smlua_push_vec3f(current, 1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_or_approach_vec3f_asymptotic(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 5) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_or_approach_vec3f_asymptotic", 5, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f dst;
|
|
smlua_get_vec3f(dst, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_or_approach_vec3f_asymptotic"); return 0; }
|
|
|
|
Vec3f goal;
|
|
smlua_get_vec3f(goal, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "set_or_approach_vec3f_asymptotic"); return 0; }
|
|
f32 xMul = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "set_or_approach_vec3f_asymptotic"); return 0; }
|
|
f32 yMul = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "set_or_approach_vec3f_asymptotic"); return 0; }
|
|
f32 zMul = smlua_to_number(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "set_or_approach_vec3f_asymptotic"); return 0; }
|
|
|
|
set_or_approach_vec3f_asymptotic(dst, goal, xMul, yMul, zMul);
|
|
|
|
smlua_push_vec3f(dst, 1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_approach_s16_symmetric_bool(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_approach_s16_symmetric_bool", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 * current = (s16 *)smlua_to_cpointer(L, 1, LVT_S16_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "camera_approach_s16_symmetric_bool"); return 0; }
|
|
s16 target = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "camera_approach_s16_symmetric_bool"); return 0; }
|
|
s16 increment = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "camera_approach_s16_symmetric_bool"); return 0; }
|
|
|
|
lua_pushinteger(L, camera_approach_s16_symmetric_bool(current, target, increment));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_or_approach_s16_symmetric(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_or_approach_s16_symmetric", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 * current = (s16 *)smlua_to_cpointer(L, 1, LVT_S16_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_or_approach_s16_symmetric"); return 0; }
|
|
s16 target = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "set_or_approach_s16_symmetric"); return 0; }
|
|
s16 increment = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "set_or_approach_s16_symmetric"); return 0; }
|
|
|
|
lua_pushinteger(L, set_or_approach_s16_symmetric(current, target, increment));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_approach_f32_symmetric_bool(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_approach_f32_symmetric_bool", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 * current = (f32 *)smlua_to_cpointer(L, 1, LVT_F32_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "camera_approach_f32_symmetric_bool"); return 0; }
|
|
f32 target = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "camera_approach_f32_symmetric_bool"); return 0; }
|
|
f32 increment = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "camera_approach_f32_symmetric_bool"); return 0; }
|
|
|
|
lua_pushinteger(L, camera_approach_f32_symmetric_bool(current, target, increment));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_approach_f32_symmetric(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_approach_f32_symmetric", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 value = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "camera_approach_f32_symmetric"); return 0; }
|
|
f32 target = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "camera_approach_f32_symmetric"); return 0; }
|
|
f32 increment = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "camera_approach_f32_symmetric"); return 0; }
|
|
|
|
lua_pushnumber(L, camera_approach_f32_symmetric(value, target, increment));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_random_vec3s(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "random_vec3s", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3s dst;
|
|
smlua_get_vec3s(dst, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "random_vec3s"); return 0; }
|
|
s16 xRange = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "random_vec3s"); return 0; }
|
|
s16 yRange = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "random_vec3s"); return 0; }
|
|
s16 zRange = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "random_vec3s"); return 0; }
|
|
|
|
random_vec3s(dst, xRange, yRange, zRange);
|
|
|
|
smlua_push_vec3s(dst, 1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_clamp_positions_and_find_yaw(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 6) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "clamp_positions_and_find_yaw", 6, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f pos;
|
|
smlua_get_vec3f(pos, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "clamp_positions_and_find_yaw"); return 0; }
|
|
|
|
Vec3f origin;
|
|
smlua_get_vec3f(origin, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "clamp_positions_and_find_yaw"); return 0; }
|
|
f32 xMax = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "clamp_positions_and_find_yaw"); return 0; }
|
|
f32 xMin = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "clamp_positions_and_find_yaw"); return 0; }
|
|
f32 zMax = smlua_to_number(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "clamp_positions_and_find_yaw"); return 0; }
|
|
f32 zMin = smlua_to_number(L, 6);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 6, "clamp_positions_and_find_yaw"); return 0; }
|
|
|
|
lua_pushinteger(L, clamp_positions_and_find_yaw(pos, origin, xMax, xMin, zMax, zMin));
|
|
|
|
smlua_push_vec3f(pos, 1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_is_range_behind_surface(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 5) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "is_range_behind_surface", 5, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f from;
|
|
smlua_get_vec3f(from, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "is_range_behind_surface"); return 0; }
|
|
|
|
Vec3f to;
|
|
smlua_get_vec3f(to, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "is_range_behind_surface"); return 0; }
|
|
struct Surface* surf = (struct Surface*)smlua_to_cobject(L, 3, LOT_SURFACE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "is_range_behind_surface"); return 0; }
|
|
s16 range = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "is_range_behind_surface"); return 0; }
|
|
s16 surfType = smlua_to_integer(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "is_range_behind_surface"); return 0; }
|
|
|
|
lua_pushinteger(L, is_range_behind_surface(from, to, surf, range, surfType));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_scale_along_line(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "scale_along_line", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f dest;
|
|
smlua_get_vec3f(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "scale_along_line"); return 0; }
|
|
|
|
Vec3f from;
|
|
smlua_get_vec3f(from, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "scale_along_line"); return 0; }
|
|
|
|
Vec3f to;
|
|
smlua_get_vec3f(to, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "scale_along_line"); return 0; }
|
|
f32 scale = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "scale_along_line"); return 0; }
|
|
|
|
scale_along_line(dest, from, to, scale);
|
|
|
|
smlua_push_vec3f(dest, 1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_calculate_pitch(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "calculate_pitch", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f from;
|
|
smlua_get_vec3f(from, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "calculate_pitch"); return 0; }
|
|
|
|
Vec3f to;
|
|
smlua_get_vec3f(to, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "calculate_pitch"); return 0; }
|
|
|
|
lua_pushinteger(L, calculate_pitch(from, to));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_calculate_yaw(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "calculate_yaw", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f from;
|
|
smlua_get_vec3f(from, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "calculate_yaw"); return 0; }
|
|
|
|
Vec3f to;
|
|
smlua_get_vec3f(to, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "calculate_yaw"); return 0; }
|
|
|
|
lua_pushinteger(L, calculate_yaw(from, to));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_calculate_angles(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "calculate_angles", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f from;
|
|
smlua_get_vec3f(from, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "calculate_angles"); return 0; }
|
|
|
|
Vec3f to;
|
|
smlua_get_vec3f(to, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "calculate_angles"); return 0; }
|
|
s16 * pitch = (s16 *)smlua_to_cpointer(L, 3, LVT_S16_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "calculate_angles"); return 0; }
|
|
s16 * yaw = (s16 *)smlua_to_cpointer(L, 4, LVT_S16_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "calculate_angles"); return 0; }
|
|
|
|
calculate_angles(from, to, pitch, yaw);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_calc_abs_dist(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "calc_abs_dist", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f a;
|
|
smlua_get_vec3f(a, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "calc_abs_dist"); return 0; }
|
|
|
|
Vec3f b;
|
|
smlua_get_vec3f(b, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "calc_abs_dist"); return 0; }
|
|
|
|
lua_pushnumber(L, calc_abs_dist(a, b));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_calc_hor_dist(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "calc_hor_dist", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f a;
|
|
smlua_get_vec3f(a, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "calc_hor_dist"); return 0; }
|
|
|
|
Vec3f b;
|
|
smlua_get_vec3f(b, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "calc_hor_dist"); return 0; }
|
|
|
|
lua_pushnumber(L, calc_hor_dist(a, b));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_rotate_in_xz(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "rotate_in_xz", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f dst;
|
|
smlua_get_vec3f(dst, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "rotate_in_xz"); return 0; }
|
|
|
|
Vec3f src;
|
|
smlua_get_vec3f(src, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "rotate_in_xz"); return 0; }
|
|
s16 yaw = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "rotate_in_xz"); return 0; }
|
|
|
|
rotate_in_xz(dst, src, yaw);
|
|
|
|
smlua_push_vec3f(dst, 1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_rotate_in_yz(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "rotate_in_yz", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f dst;
|
|
smlua_get_vec3f(dst, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "rotate_in_yz"); return 0; }
|
|
|
|
Vec3f src;
|
|
smlua_get_vec3f(src, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "rotate_in_yz"); return 0; }
|
|
s16 pitch = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "rotate_in_yz"); return 0; }
|
|
|
|
rotate_in_yz(dst, src, pitch);
|
|
|
|
smlua_push_vec3f(dst, 1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_camera_pitch_shake(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_camera_pitch_shake", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 mag = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_camera_pitch_shake"); return 0; }
|
|
s16 decay = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "set_camera_pitch_shake"); return 0; }
|
|
s16 inc = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "set_camera_pitch_shake"); return 0; }
|
|
|
|
set_camera_pitch_shake(mag, decay, inc);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_camera_yaw_shake(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_camera_yaw_shake", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 mag = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_camera_yaw_shake"); return 0; }
|
|
s16 decay = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "set_camera_yaw_shake"); return 0; }
|
|
s16 inc = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "set_camera_yaw_shake"); return 0; }
|
|
|
|
set_camera_yaw_shake(mag, decay, inc);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_camera_roll_shake(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_camera_roll_shake", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 mag = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_camera_roll_shake"); return 0; }
|
|
s16 decay = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "set_camera_roll_shake"); return 0; }
|
|
s16 inc = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "set_camera_roll_shake"); return 0; }
|
|
|
|
set_camera_roll_shake(mag, decay, inc);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_pitch_shake_from_point(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 7) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_pitch_shake_from_point", 7, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 mag = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_pitch_shake_from_point"); return 0; }
|
|
s16 decay = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "set_pitch_shake_from_point"); return 0; }
|
|
s16 inc = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "set_pitch_shake_from_point"); return 0; }
|
|
f32 maxDist = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "set_pitch_shake_from_point"); return 0; }
|
|
f32 posX = smlua_to_number(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "set_pitch_shake_from_point"); return 0; }
|
|
f32 posY = smlua_to_number(L, 6);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 6, "set_pitch_shake_from_point"); return 0; }
|
|
f32 posZ = smlua_to_number(L, 7);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 7, "set_pitch_shake_from_point"); return 0; }
|
|
|
|
set_pitch_shake_from_point(mag, decay, inc, maxDist, posX, posY, posZ);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_shake_camera_pitch(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "shake_camera_pitch", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f pos;
|
|
smlua_get_vec3f(pos, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "shake_camera_pitch"); return 0; }
|
|
|
|
Vec3f focus;
|
|
smlua_get_vec3f(focus, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "shake_camera_pitch"); return 0; }
|
|
|
|
shake_camera_pitch(pos, focus);
|
|
|
|
smlua_push_vec3f(focus, 2);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_shake_camera_yaw(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "shake_camera_yaw", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f pos;
|
|
smlua_get_vec3f(pos, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "shake_camera_yaw"); return 0; }
|
|
|
|
Vec3f focus;
|
|
smlua_get_vec3f(focus, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "shake_camera_yaw"); return 0; }
|
|
|
|
shake_camera_yaw(pos, focus);
|
|
|
|
smlua_push_vec3f(focus, 2);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_shake_camera_roll(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "shake_camera_roll", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 * roll = (s16 *)smlua_to_cpointer(L, 1, LVT_S16_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "shake_camera_roll"); return 0; }
|
|
|
|
shake_camera_roll(roll);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_offset_yaw_outward_radial(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "offset_yaw_outward_radial", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Camera* c = (struct Camera*)smlua_to_cobject(L, 1, LOT_CAMERA);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "offset_yaw_outward_radial"); return 0; }
|
|
s16 areaYaw = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "offset_yaw_outward_radial"); return 0; }
|
|
|
|
lua_pushinteger(L, offset_yaw_outward_radial(c, areaYaw));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_camera_buzz_if_cdown(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_camera_buzz_if_cdown", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
play_camera_buzz_if_cdown();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_camera_buzz_if_cbutton(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_camera_buzz_if_cbutton", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
play_camera_buzz_if_cbutton();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_camera_buzz_if_c_sideways(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_camera_buzz_if_c_sideways", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
play_camera_buzz_if_c_sideways();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_sound_cbutton_up(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_sound_cbutton_up", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
play_sound_cbutton_up();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_sound_cbutton_down(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_sound_cbutton_down", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
play_sound_cbutton_down();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_sound_cbutton_side(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_sound_cbutton_side", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
play_sound_cbutton_side();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_sound_button_change_blocked(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_sound_button_change_blocked", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
play_sound_button_change_blocked();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_sound_rbutton_changed(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_sound_rbutton_changed", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
play_sound_rbutton_changed();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_sound_if_cam_switched_to_lakitu_or_mario(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_sound_if_cam_switched_to_lakitu_or_mario", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
play_sound_if_cam_switched_to_lakitu_or_mario();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_radial_camera_input(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "radial_camera_input", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Camera* c = (struct Camera*)smlua_to_cobject(L, 1, LOT_CAMERA);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "radial_camera_input"); return 0; }
|
|
f32 unused = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "radial_camera_input"); return 0; }
|
|
|
|
lua_pushinteger(L, radial_camera_input(c, unused));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_trigger_cutscene_dialog(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "trigger_cutscene_dialog", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 trigger = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "trigger_cutscene_dialog"); return 0; }
|
|
|
|
lua_pushinteger(L, trigger_cutscene_dialog(trigger));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_handle_c_button_movement(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "handle_c_button_movement", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Camera* c = (struct Camera*)smlua_to_cobject(L, 1, LOT_CAMERA);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "handle_c_button_movement"); return 0; }
|
|
|
|
handle_c_button_movement(c);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_start_cutscene(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "start_cutscene", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Camera* c = (struct Camera*)smlua_to_cobject(L, 1, LOT_CAMERA);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "start_cutscene"); return 0; }
|
|
u8 cutscene = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "start_cutscene"); return 0; }
|
|
|
|
start_cutscene(c, cutscene);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_cutscene_from_mario_status(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_cutscene_from_mario_status", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Camera* c = (struct Camera*)smlua_to_cobject(L, 1, LOT_CAMERA);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_cutscene_from_mario_status"); return 0; }
|
|
|
|
lua_pushinteger(L, get_cutscene_from_mario_status(c));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_warp_camera(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "warp_camera", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 displacementX = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "warp_camera"); return 0; }
|
|
f32 displacementY = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "warp_camera"); return 0; }
|
|
f32 displacementZ = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "warp_camera"); return 0; }
|
|
|
|
warp_camera(displacementX, displacementY, displacementZ);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_approach_camera_height(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "approach_camera_height", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Camera* c = (struct Camera*)smlua_to_cobject(L, 1, LOT_CAMERA);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "approach_camera_height"); return 0; }
|
|
f32 goal = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "approach_camera_height"); return 0; }
|
|
f32 inc = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "approach_camera_height"); return 0; }
|
|
|
|
approach_camera_height(c, goal, inc);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_offset_rotated(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "offset_rotated", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f dst;
|
|
smlua_get_vec3f(dst, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "offset_rotated"); return 0; }
|
|
|
|
Vec3f from;
|
|
smlua_get_vec3f(from, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "offset_rotated"); return 0; }
|
|
|
|
Vec3f to;
|
|
smlua_get_vec3f(to, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "offset_rotated"); return 0; }
|
|
|
|
Vec3s rotation;
|
|
smlua_get_vec3s(rotation, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "offset_rotated"); return 0; }
|
|
|
|
offset_rotated(dst, from, to, rotation);
|
|
|
|
smlua_push_vec3f(dst, 1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_next_lakitu_state(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 7) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "next_lakitu_state", 7, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f newPos;
|
|
smlua_get_vec3f(newPos, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "next_lakitu_state"); return 0; }
|
|
|
|
Vec3f newFoc;
|
|
smlua_get_vec3f(newFoc, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "next_lakitu_state"); return 0; }
|
|
|
|
Vec3f curPos;
|
|
smlua_get_vec3f(curPos, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "next_lakitu_state"); return 0; }
|
|
|
|
Vec3f curFoc;
|
|
smlua_get_vec3f(curFoc, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "next_lakitu_state"); return 0; }
|
|
|
|
Vec3f oldPos;
|
|
smlua_get_vec3f(oldPos, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "next_lakitu_state"); return 0; }
|
|
|
|
Vec3f oldFoc;
|
|
smlua_get_vec3f(oldFoc, 6);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 6, "next_lakitu_state"); return 0; }
|
|
s16 yaw = smlua_to_integer(L, 7);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 7, "next_lakitu_state"); return 0; }
|
|
|
|
lua_pushinteger(L, next_lakitu_state(newPos, newFoc, curPos, curFoc, oldPos, oldFoc, yaw));
|
|
|
|
smlua_push_vec3f(newPos, 1);
|
|
|
|
smlua_push_vec3f(newFoc, 2);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_fixed_cam_axis_sa_lobby(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_fixed_cam_axis_sa_lobby", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 preset = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_fixed_cam_axis_sa_lobby"); return 0; }
|
|
|
|
set_fixed_cam_axis_sa_lobby(preset);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_course_processing(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_course_processing", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Camera* c = (struct Camera*)smlua_to_cobject(L, 1, LOT_CAMERA);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "camera_course_processing"); return 0; }
|
|
|
|
lua_pushinteger(L, camera_course_processing(c));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_resolve_geometry_collisions(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "resolve_geometry_collisions", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f pos;
|
|
smlua_get_vec3f(pos, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "resolve_geometry_collisions"); return 0; }
|
|
|
|
Vec3f lastGood;
|
|
smlua_get_vec3f(lastGood, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "resolve_geometry_collisions"); return 0; }
|
|
|
|
resolve_geometry_collisions(pos, lastGood);
|
|
|
|
smlua_push_vec3f(pos, 1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_rotate_camera_around_walls(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "rotate_camera_around_walls", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Camera* c = (struct Camera*)smlua_to_cobject(L, 1, LOT_CAMERA);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "rotate_camera_around_walls"); return 0; }
|
|
|
|
Vec3f cPos;
|
|
smlua_get_vec3f(cPos, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "rotate_camera_around_walls"); return 0; }
|
|
s16 * avoidYaw = (s16 *)smlua_to_cpointer(L, 3, LVT_S16_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "rotate_camera_around_walls"); return 0; }
|
|
s16 yawRange = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "rotate_camera_around_walls"); return 0; }
|
|
|
|
lua_pushinteger(L, rotate_camera_around_walls(c, cPos, avoidYaw, yawRange));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_find_mario_floor_and_ceil(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "find_mario_floor_and_ceil", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct PlayerGeometry* pg = (struct PlayerGeometry*)smlua_to_cobject(L, 1, LOT_PLAYERGEOMETRY);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "find_mario_floor_and_ceil"); return 0; }
|
|
|
|
find_mario_floor_and_ceil(pg);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_start_object_cutscene_without_focus(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "start_object_cutscene_without_focus", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 cutscene = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "start_object_cutscene_without_focus"); return 0; }
|
|
|
|
lua_pushinteger(L, start_object_cutscene_without_focus(cutscene));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cutscene_object_with_dialog(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cutscene_object_with_dialog", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 cutscene = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cutscene_object_with_dialog"); return 0; }
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 2, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "cutscene_object_with_dialog"); return 0; }
|
|
s16 dialogID = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "cutscene_object_with_dialog"); return 0; }
|
|
|
|
lua_pushinteger(L, cutscene_object_with_dialog(cutscene, o, dialogID));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cutscene_object_without_dialog(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cutscene_object_without_dialog", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 cutscene = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cutscene_object_without_dialog"); return 0; }
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 2, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "cutscene_object_without_dialog"); return 0; }
|
|
|
|
lua_pushinteger(L, cutscene_object_without_dialog(cutscene, o));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cutscene_object(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cutscene_object", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 cutscene = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cutscene_object"); return 0; }
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 2, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "cutscene_object"); return 0; }
|
|
|
|
lua_pushinteger(L, cutscene_object(cutscene, o));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_cutscene(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_cutscene", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Camera* c = (struct Camera*)smlua_to_cobject(L, 1, LOT_CAMERA);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "play_cutscene"); return 0; }
|
|
|
|
play_cutscene(c);
|
|
|
|
return 1;
|
|
}
|
|
|
|
/*
|
|
int smlua_func_cutscene_event(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cutscene_event", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
// CameraEvent event = (CameraEvent)smlua_to_cobject(L, 1, LOT_???); <--- UNIMPLEMENTED
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cutscene_event"); return 0; }
|
|
struct Camera* c = (struct Camera*)smlua_to_cobject(L, 2, LOT_CAMERA);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "cutscene_event"); return 0; }
|
|
s16 start = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "cutscene_event"); return 0; }
|
|
s16 end = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "cutscene_event"); return 0; }
|
|
|
|
lua_pushinteger(L, cutscene_event(event, c, start, end));
|
|
|
|
return 1;
|
|
}
|
|
*/
|
|
|
|
int smlua_func_cutscene_spawn_obj(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cutscene_spawn_obj", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
u32 obj = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cutscene_spawn_obj"); return 0; }
|
|
s16 frame = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "cutscene_spawn_obj"); return 0; }
|
|
|
|
lua_pushinteger(L, cutscene_spawn_obj(obj, frame));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_fov_shake(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_fov_shake", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 amplitude = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_fov_shake"); return 0; }
|
|
s16 decay = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "set_fov_shake"); return 0; }
|
|
s16 shakeSpeed = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "set_fov_shake"); return 0; }
|
|
|
|
set_fov_shake(amplitude, decay, shakeSpeed);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_fov_function(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_fov_function", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 func = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_fov_function"); return 0; }
|
|
|
|
set_fov_function(func);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cutscene_set_fov_shake_preset(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cutscene_set_fov_shake_preset", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 preset = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cutscene_set_fov_shake_preset"); return 0; }
|
|
|
|
cutscene_set_fov_shake_preset(preset);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_fov_shake_from_point_preset(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_fov_shake_from_point_preset", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 preset = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_fov_shake_from_point_preset"); return 0; }
|
|
f32 posX = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "set_fov_shake_from_point_preset"); return 0; }
|
|
f32 posY = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "set_fov_shake_from_point_preset"); return 0; }
|
|
f32 posZ = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "set_fov_shake_from_point_preset"); return 0; }
|
|
|
|
set_fov_shake_from_point_preset(preset, posX, posY, posZ);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_rotate_towards_point(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 6) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_rotate_towards_point", 6, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_rotate_towards_point"); return 0; }
|
|
|
|
Vec3f point;
|
|
smlua_get_vec3f(point, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_rotate_towards_point"); return 0; }
|
|
s16 pitchOff = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_rotate_towards_point"); return 0; }
|
|
s16 yawOff = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "obj_rotate_towards_point"); return 0; }
|
|
s16 pitchDiv = smlua_to_integer(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "obj_rotate_towards_point"); return 0; }
|
|
s16 yawDiv = smlua_to_integer(L, 6);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 6, "obj_rotate_towards_point"); return 0; }
|
|
|
|
obj_rotate_towards_point(o, point, pitchOff, yawOff, pitchDiv, yawDiv);
|
|
|
|
return 1;
|
|
}
|
|
|
|
/*
|
|
int smlua_func_geo_camera_fov(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "geo_camera_fov", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 callContext = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "geo_camera_fov"); return 0; }
|
|
// struct GraphNode* g = (struct GraphNode*)smlua_to_cobject(L, 2, LOT_GRAPHNODE); <--- UNIMPLEMENTED
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "geo_camera_fov"); return 0; }
|
|
// void * context = (void *)smlua_to_cobject(L, 3, LOT_???); <--- UNIMPLEMENTED
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "geo_camera_fov"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_GFX, geo_camera_fov(callContext, g, context), NULL);
|
|
|
|
return 1;
|
|
}
|
|
*/
|
|
|
|
int smlua_func_set_camera_mode_fixed(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_camera_mode_fixed", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Camera* c = (struct Camera*)smlua_to_cobject(L, 1, LOT_CAMERA);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_camera_mode_fixed"); return 0; }
|
|
s16 x = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "set_camera_mode_fixed"); return 0; }
|
|
s16 y = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "set_camera_mode_fixed"); return 0; }
|
|
s16 z = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "set_camera_mode_fixed"); return 0; }
|
|
|
|
lua_pushinteger(L, set_camera_mode_fixed(c, x, y, z));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_snap_to_45_degrees(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "snap_to_45_degrees", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 angle = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "snap_to_45_degrees"); return 0; }
|
|
|
|
lua_pushinteger(L, snap_to_45_degrees(angle));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_set_use_course_specific_settings(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_set_use_course_specific_settings", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 enable = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "camera_set_use_course_specific_settings"); return 0; }
|
|
|
|
camera_set_use_course_specific_settings(enable);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_center_rom_hack_camera(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "center_rom_hack_camera", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
center_rom_hack_camera();
|
|
|
|
return 1;
|
|
}
|
|
|
|
//////////////////
|
|
// characters.h //
|
|
//////////////////
|
|
|
|
int smlua_func_get_character(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_character", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_character"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_CHARACTER, get_character(m), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_character_sound(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_character_sound", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "play_character_sound"); return 0; }
|
|
int characterSound = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "play_character_sound"); return 0; }
|
|
|
|
play_character_sound(m, characterSound);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_character_sound_offset(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_character_sound_offset", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "play_character_sound_offset"); return 0; }
|
|
int characterSound = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "play_character_sound_offset"); return 0; }
|
|
u32 offset = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "play_character_sound_offset"); return 0; }
|
|
|
|
play_character_sound_offset(m, characterSound, offset);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_character_sound_if_no_flag(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_character_sound_if_no_flag", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "play_character_sound_if_no_flag"); return 0; }
|
|
int characterSound = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "play_character_sound_if_no_flag"); return 0; }
|
|
u32 flags = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "play_character_sound_if_no_flag"); return 0; }
|
|
|
|
play_character_sound_if_no_flag(m, characterSound, flags);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_character_anim_offset(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_character_anim_offset", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_character_anim_offset"); return 0; }
|
|
|
|
lua_pushnumber(L, get_character_anim_offset(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_character_anim(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_character_anim", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_character_anim"); return 0; }
|
|
int characterAnim = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "get_character_anim"); return 0; }
|
|
|
|
lua_pushinteger(L, get_character_anim(m, characterAnim));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_update_character_anim_offset(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "update_character_anim_offset", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "update_character_anim_offset"); return 0; }
|
|
|
|
update_character_anim_offset(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
/////////////////////////
|
|
// djui_chat_message.h //
|
|
/////////////////////////
|
|
|
|
int smlua_func_djui_chat_message_create(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_chat_message_create", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
const char* message = smlua_to_string(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "djui_chat_message_create"); return 0; }
|
|
|
|
djui_chat_message_create(message);
|
|
|
|
return 1;
|
|
}
|
|
|
|
////////////////////
|
|
// djui_console.h //
|
|
////////////////////
|
|
|
|
int smlua_func_djui_console_toggle(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_console_toggle", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
djui_console_toggle();
|
|
|
|
return 1;
|
|
}
|
|
|
|
//////////////////////
|
|
// djui_hud_utils.h //
|
|
//////////////////////
|
|
|
|
int smlua_func_djui_hud_get_resolution(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_hud_get_resolution", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, djui_hud_get_resolution());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_hud_set_resolution(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_hud_set_resolution", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
int resolutionType = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "djui_hud_set_resolution"); return 0; }
|
|
|
|
djui_hud_set_resolution(resolutionType);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_hud_get_filter(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_hud_get_filter", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, djui_hud_get_filter());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_hud_set_filter(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_hud_set_filter", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
int filterType = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "djui_hud_set_filter"); return 0; }
|
|
|
|
djui_hud_set_filter(filterType);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_hud_get_font(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_hud_get_font", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, djui_hud_get_font());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_hud_set_font(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_hud_set_font", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s8 fontType = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "djui_hud_set_font"); return 0; }
|
|
|
|
djui_hud_set_font(fontType);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_hud_get_color(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_hud_get_color", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
smlua_push_object(L, LOT_DJUICOLOR, djui_hud_get_color(), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_hud_set_color(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_hud_set_color", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 r = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "djui_hud_set_color"); return 0; }
|
|
u8 g = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "djui_hud_set_color"); return 0; }
|
|
u8 b = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "djui_hud_set_color"); return 0; }
|
|
u8 a = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "djui_hud_set_color"); return 0; }
|
|
|
|
djui_hud_set_color(r, g, b, a);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_hud_reset_color(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_hud_reset_color", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
djui_hud_reset_color();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_hud_get_rotation(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_hud_get_rotation", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
smlua_push_object(L, LOT_HUDUTILSROTATION, djui_hud_get_rotation(), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_hud_set_rotation(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_hud_set_rotation", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 rotation = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "djui_hud_set_rotation"); return 0; }
|
|
f32 pivotX = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "djui_hud_set_rotation"); return 0; }
|
|
f32 pivotY = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "djui_hud_set_rotation"); return 0; }
|
|
|
|
djui_hud_set_rotation(rotation, pivotX, pivotY);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_hud_set_rotation_interpolated(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 6) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_hud_set_rotation_interpolated", 6, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 prevRotation = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "djui_hud_set_rotation_interpolated"); return 0; }
|
|
f32 prevPivotX = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "djui_hud_set_rotation_interpolated"); return 0; }
|
|
f32 prevPivotY = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "djui_hud_set_rotation_interpolated"); return 0; }
|
|
s32 rotation = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "djui_hud_set_rotation_interpolated"); return 0; }
|
|
f32 pivotX = smlua_to_number(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "djui_hud_set_rotation_interpolated"); return 0; }
|
|
f32 pivotY = smlua_to_number(L, 6);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 6, "djui_hud_set_rotation_interpolated"); return 0; }
|
|
|
|
djui_hud_set_rotation_interpolated(prevRotation, prevPivotX, prevPivotY, rotation, pivotX, pivotY);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_hud_get_screen_width(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_hud_get_screen_width", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, djui_hud_get_screen_width());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_hud_get_screen_height(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_hud_get_screen_height", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, djui_hud_get_screen_height());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_hud_get_mouse_x(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_hud_get_mouse_x", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushnumber(L, djui_hud_get_mouse_x());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_hud_get_mouse_y(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_hud_get_mouse_y", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushnumber(L, djui_hud_get_mouse_y());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_hud_get_raw_mouse_x(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_hud_get_raw_mouse_x", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushnumber(L, djui_hud_get_raw_mouse_x());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_hud_get_raw_mouse_y(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_hud_get_raw_mouse_y", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushnumber(L, djui_hud_get_raw_mouse_y());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_hud_set_mouse_locked(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_hud_set_mouse_locked", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
bool locked = smlua_to_boolean(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "djui_hud_set_mouse_locked"); return 0; }
|
|
|
|
djui_hud_set_mouse_locked(locked);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_hud_get_mouse_buttons_down(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_hud_get_mouse_buttons_down", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, djui_hud_get_mouse_buttons_down());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_hud_get_mouse_buttons_pressed(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_hud_get_mouse_buttons_pressed", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, djui_hud_get_mouse_buttons_pressed());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_hud_get_mouse_buttons_released(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_hud_get_mouse_buttons_released", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, djui_hud_get_mouse_buttons_released());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_hud_get_mouse_scroll_x(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_hud_get_mouse_scroll_x", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushnumber(L, djui_hud_get_mouse_scroll_x());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_hud_get_mouse_scroll_y(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_hud_get_mouse_scroll_y", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushnumber(L, djui_hud_get_mouse_scroll_y());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_hud_measure_text(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_hud_measure_text", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
const char* message = smlua_to_string(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "djui_hud_measure_text"); return 0; }
|
|
|
|
lua_pushnumber(L, djui_hud_measure_text(message));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_hud_print_text(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_hud_print_text", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
const char* message = smlua_to_string(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "djui_hud_print_text"); return 0; }
|
|
f32 x = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "djui_hud_print_text"); return 0; }
|
|
f32 y = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "djui_hud_print_text"); return 0; }
|
|
f32 scale = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "djui_hud_print_text"); return 0; }
|
|
|
|
djui_hud_print_text(message, x, y, scale);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_hud_print_text_interpolated(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 7) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_hud_print_text_interpolated", 7, top);
|
|
return 0;
|
|
}
|
|
|
|
const char* message = smlua_to_string(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "djui_hud_print_text_interpolated"); return 0; }
|
|
f32 prevX = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "djui_hud_print_text_interpolated"); return 0; }
|
|
f32 prevY = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "djui_hud_print_text_interpolated"); return 0; }
|
|
f32 prevScale = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "djui_hud_print_text_interpolated"); return 0; }
|
|
f32 x = smlua_to_number(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "djui_hud_print_text_interpolated"); return 0; }
|
|
f32 y = smlua_to_number(L, 6);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 6, "djui_hud_print_text_interpolated"); return 0; }
|
|
f32 scale = smlua_to_number(L, 7);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 7, "djui_hud_print_text_interpolated"); return 0; }
|
|
|
|
djui_hud_print_text_interpolated(message, prevX, prevY, prevScale, x, y, scale);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_hud_render_texture(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 5) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_hud_render_texture", 5, top);
|
|
return 0;
|
|
}
|
|
|
|
struct TextureInfo *texInfo = smlua_to_texture_info(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "djui_hud_render_texture"); return 0; }
|
|
f32 x = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "djui_hud_render_texture"); return 0; }
|
|
f32 y = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "djui_hud_render_texture"); return 0; }
|
|
f32 scaleW = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "djui_hud_render_texture"); return 0; }
|
|
f32 scaleH = smlua_to_number(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "djui_hud_render_texture"); return 0; }
|
|
|
|
djui_hud_render_texture(texInfo, x, y, scaleW, scaleH);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_hud_render_texture_tile(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 9) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_hud_render_texture_tile", 9, top);
|
|
return 0;
|
|
}
|
|
|
|
struct TextureInfo *texInfo = smlua_to_texture_info(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "djui_hud_render_texture_tile"); return 0; }
|
|
f32 x = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "djui_hud_render_texture_tile"); return 0; }
|
|
f32 y = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "djui_hud_render_texture_tile"); return 0; }
|
|
f32 scaleW = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "djui_hud_render_texture_tile"); return 0; }
|
|
f32 scaleH = smlua_to_number(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "djui_hud_render_texture_tile"); return 0; }
|
|
u32 tileX = smlua_to_integer(L, 6);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 6, "djui_hud_render_texture_tile"); return 0; }
|
|
u32 tileY = smlua_to_integer(L, 7);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 7, "djui_hud_render_texture_tile"); return 0; }
|
|
u32 tileW = smlua_to_integer(L, 8);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 8, "djui_hud_render_texture_tile"); return 0; }
|
|
u32 tileH = smlua_to_integer(L, 9);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 9, "djui_hud_render_texture_tile"); return 0; }
|
|
|
|
djui_hud_render_texture_tile(texInfo, x, y, scaleW, scaleH, tileX, tileY, tileW, tileH);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_hud_render_texture_interpolated(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 9) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_hud_render_texture_interpolated", 9, top);
|
|
return 0;
|
|
}
|
|
|
|
struct TextureInfo *texInfo = smlua_to_texture_info(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "djui_hud_render_texture_interpolated"); return 0; }
|
|
f32 prevX = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "djui_hud_render_texture_interpolated"); return 0; }
|
|
f32 prevY = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "djui_hud_render_texture_interpolated"); return 0; }
|
|
f32 prevScaleW = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "djui_hud_render_texture_interpolated"); return 0; }
|
|
f32 prevScaleH = smlua_to_number(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "djui_hud_render_texture_interpolated"); return 0; }
|
|
f32 x = smlua_to_number(L, 6);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 6, "djui_hud_render_texture_interpolated"); return 0; }
|
|
f32 y = smlua_to_number(L, 7);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 7, "djui_hud_render_texture_interpolated"); return 0; }
|
|
f32 scaleW = smlua_to_number(L, 8);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 8, "djui_hud_render_texture_interpolated"); return 0; }
|
|
f32 scaleH = smlua_to_number(L, 9);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 9, "djui_hud_render_texture_interpolated"); return 0; }
|
|
|
|
djui_hud_render_texture_interpolated(texInfo, prevX, prevY, prevScaleW, prevScaleH, x, y, scaleW, scaleH);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_hud_render_texture_tile_interpolated(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 13) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_hud_render_texture_tile_interpolated", 13, top);
|
|
return 0;
|
|
}
|
|
|
|
struct TextureInfo *texInfo = smlua_to_texture_info(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "djui_hud_render_texture_tile_interpolated"); return 0; }
|
|
f32 prevX = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "djui_hud_render_texture_tile_interpolated"); return 0; }
|
|
f32 prevY = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "djui_hud_render_texture_tile_interpolated"); return 0; }
|
|
f32 prevScaleW = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "djui_hud_render_texture_tile_interpolated"); return 0; }
|
|
f32 prevScaleH = smlua_to_number(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "djui_hud_render_texture_tile_interpolated"); return 0; }
|
|
f32 x = smlua_to_number(L, 6);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 6, "djui_hud_render_texture_tile_interpolated"); return 0; }
|
|
f32 y = smlua_to_number(L, 7);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 7, "djui_hud_render_texture_tile_interpolated"); return 0; }
|
|
f32 scaleW = smlua_to_number(L, 8);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 8, "djui_hud_render_texture_tile_interpolated"); return 0; }
|
|
f32 scaleH = smlua_to_number(L, 9);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 9, "djui_hud_render_texture_tile_interpolated"); return 0; }
|
|
u32 tileX = smlua_to_integer(L, 10);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 10, "djui_hud_render_texture_tile_interpolated"); return 0; }
|
|
u32 tileY = smlua_to_integer(L, 11);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 11, "djui_hud_render_texture_tile_interpolated"); return 0; }
|
|
u32 tileW = smlua_to_integer(L, 12);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 12, "djui_hud_render_texture_tile_interpolated"); return 0; }
|
|
u32 tileH = smlua_to_integer(L, 13);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 13, "djui_hud_render_texture_tile_interpolated"); return 0; }
|
|
|
|
djui_hud_render_texture_tile_interpolated(texInfo, prevX, prevY, prevScaleW, prevScaleH, x, y, scaleW, scaleH, tileX, tileY, tileW, tileH);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_hud_render_rect(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_hud_render_rect", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 x = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "djui_hud_render_rect"); return 0; }
|
|
f32 y = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "djui_hud_render_rect"); return 0; }
|
|
f32 width = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "djui_hud_render_rect"); return 0; }
|
|
f32 height = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "djui_hud_render_rect"); return 0; }
|
|
|
|
djui_hud_render_rect(x, y, width, height);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_hud_render_rect_interpolated(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 8) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_hud_render_rect_interpolated", 8, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 prevX = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "djui_hud_render_rect_interpolated"); return 0; }
|
|
f32 prevY = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "djui_hud_render_rect_interpolated"); return 0; }
|
|
f32 prevWidth = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "djui_hud_render_rect_interpolated"); return 0; }
|
|
f32 prevHeight = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "djui_hud_render_rect_interpolated"); return 0; }
|
|
f32 x = smlua_to_number(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "djui_hud_render_rect_interpolated"); return 0; }
|
|
f32 y = smlua_to_number(L, 6);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 6, "djui_hud_render_rect_interpolated"); return 0; }
|
|
f32 width = smlua_to_number(L, 7);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 7, "djui_hud_render_rect_interpolated"); return 0; }
|
|
f32 height = smlua_to_number(L, 8);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 8, "djui_hud_render_rect_interpolated"); return 0; }
|
|
|
|
djui_hud_render_rect_interpolated(prevX, prevY, prevWidth, prevHeight, x, y, width, height);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_current_fov(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_current_fov", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushnumber(L, get_current_fov());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_hud_get_fov_coeff(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_hud_get_fov_coeff", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushnumber(L, djui_hud_get_fov_coeff());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_hud_world_pos_to_screen_pos(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_hud_world_pos_to_screen_pos", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f pos;
|
|
smlua_get_vec3f(pos, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "djui_hud_world_pos_to_screen_pos"); return 0; }
|
|
|
|
Vec3f out;
|
|
smlua_get_vec3f(out, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "djui_hud_world_pos_to_screen_pos"); return 0; }
|
|
|
|
lua_pushboolean(L, djui_hud_world_pos_to_screen_pos(pos, out));
|
|
|
|
smlua_push_vec3f(out, 2);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_hud_is_pause_menu_created(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_hud_is_pause_menu_created", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushboolean(L, djui_hud_is_pause_menu_created());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_open_pause_menu(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_open_pause_menu", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
djui_open_pause_menu();
|
|
|
|
return 1;
|
|
}
|
|
|
|
/////////////////////
|
|
// djui_language.h //
|
|
/////////////////////
|
|
|
|
int smlua_func_djui_language_get(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_language_get", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
const char* section = smlua_to_string(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "djui_language_get"); return 0; }
|
|
const char* key = smlua_to_string(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "djui_language_get"); return 0; }
|
|
|
|
lua_pushstring(L, djui_language_get(section, key));
|
|
|
|
return 1;
|
|
}
|
|
|
|
///////////////////////
|
|
// djui_panel_menu.h //
|
|
///////////////////////
|
|
|
|
int smlua_func_djui_menu_get_rainbow_string_color(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_menu_get_rainbow_string_color", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
int color = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "djui_menu_get_rainbow_string_color"); return 0; }
|
|
|
|
lua_pushstring(L, djui_menu_get_rainbow_string_color(color));
|
|
|
|
return 1;
|
|
}
|
|
|
|
//////////////////
|
|
// djui_popup.h //
|
|
//////////////////
|
|
|
|
int smlua_func_djui_popup_create(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_popup_create", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
const char* message = smlua_to_string(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "djui_popup_create"); return 0; }
|
|
int lines = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "djui_popup_create"); return 0; }
|
|
|
|
djui_popup_create(message, lines);
|
|
|
|
return 1;
|
|
}
|
|
|
|
////////////////
|
|
// external.h //
|
|
////////////////
|
|
|
|
int smlua_func_play_sound(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_sound", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 soundBits = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "play_sound"); return 0; }
|
|
|
|
f32 *pos = smlua_get_vec3f_from_buffer();
|
|
smlua_get_vec3f(pos, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "play_sound"); return 0; }
|
|
|
|
play_sound(soundBits, pos);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_sound_with_freq_scale(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_sound_with_freq_scale", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 soundBits = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "play_sound_with_freq_scale"); return 0; }
|
|
|
|
f32 *pos = smlua_get_vec3f_from_buffer();
|
|
smlua_get_vec3f(pos, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "play_sound_with_freq_scale"); return 0; }
|
|
f32 freqScale = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "play_sound_with_freq_scale"); return 0; }
|
|
|
|
play_sound_with_freq_scale(soundBits, pos, freqScale);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_seq_player_fade_out(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "seq_player_fade_out", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 player = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "seq_player_fade_out"); return 0; }
|
|
u16 fadeDuration = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "seq_player_fade_out"); return 0; }
|
|
|
|
seq_player_fade_out(player, fadeDuration);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_fade_volume_scale(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "fade_volume_scale", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 player = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "fade_volume_scale"); return 0; }
|
|
u8 targetScale = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "fade_volume_scale"); return 0; }
|
|
u16 fadeDuration = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "fade_volume_scale"); return 0; }
|
|
|
|
fade_volume_scale(player, targetScale, fadeDuration);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_seq_player_lower_volume(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "seq_player_lower_volume", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 player = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "seq_player_lower_volume"); return 0; }
|
|
u16 fadeDuration = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "seq_player_lower_volume"); return 0; }
|
|
u8 percentage = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "seq_player_lower_volume"); return 0; }
|
|
|
|
seq_player_lower_volume(player, fadeDuration, percentage);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_seq_player_unlower_volume(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "seq_player_unlower_volume", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 player = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "seq_player_unlower_volume"); return 0; }
|
|
u16 fadeDuration = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "seq_player_unlower_volume"); return 0; }
|
|
|
|
seq_player_unlower_volume(player, fadeDuration);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_audio_muted(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_audio_muted", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 muted = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_audio_muted"); return 0; }
|
|
|
|
set_audio_muted(muted);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_stop_sound(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "stop_sound", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
u32 soundBits = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "stop_sound"); return 0; }
|
|
|
|
f32 *pos = smlua_get_vec3f_from_buffer();
|
|
smlua_get_vec3f(pos, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "stop_sound"); return 0; }
|
|
|
|
stop_sound(soundBits, pos);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_stop_sounds_from_source(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "stop_sounds_from_source", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
f32 *pos = smlua_get_vec3f_from_buffer();
|
|
smlua_get_vec3f(pos, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "stop_sounds_from_source"); return 0; }
|
|
|
|
stop_sounds_from_source(pos);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_stop_sounds_in_continuous_banks(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "stop_sounds_in_continuous_banks", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
stop_sounds_in_continuous_banks();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_sound_banks_disable(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "sound_banks_disable", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 player = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "sound_banks_disable"); return 0; }
|
|
u16 bankMask = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "sound_banks_disable"); return 0; }
|
|
|
|
sound_banks_disable(player, bankMask);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_sound_banks_enable(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "sound_banks_enable", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 player = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "sound_banks_enable"); return 0; }
|
|
u16 bankMask = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "sound_banks_enable"); return 0; }
|
|
|
|
sound_banks_enable(player, bankMask);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_sound_moving_speed(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_sound_moving_speed", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 bank = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_sound_moving_speed"); return 0; }
|
|
u8 speed = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "set_sound_moving_speed"); return 0; }
|
|
|
|
set_sound_moving_speed(bank, speed);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_dialog_sound(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_dialog_sound", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 dialogID = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "play_dialog_sound"); return 0; }
|
|
|
|
play_dialog_sound(dialogID);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_music(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_music", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 player = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "play_music"); return 0; }
|
|
u16 seqArgs = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "play_music"); return 0; }
|
|
u16 fadeTimer = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "play_music"); return 0; }
|
|
|
|
play_music(player, seqArgs, fadeTimer);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_stop_background_music(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "stop_background_music", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u16 seqId = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "stop_background_music"); return 0; }
|
|
|
|
stop_background_music(seqId);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_fadeout_background_music(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "fadeout_background_music", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
u16 seqId = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "fadeout_background_music"); return 0; }
|
|
u16 fadeOut = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "fadeout_background_music"); return 0; }
|
|
|
|
fadeout_background_music(seqId, fadeOut);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_drop_queued_background_music(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "drop_queued_background_music", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
drop_queued_background_music();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_current_background_music(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_current_background_music", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, get_current_background_music());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_current_background_music_default_volume(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_current_background_music_default_volume", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, get_current_background_music_default_volume());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_current_background_music_target_volume(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_current_background_music_target_volume", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, get_current_background_music_target_volume());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_current_background_music_max_target_volume(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_current_background_music_max_target_volume", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, get_current_background_music_max_target_volume());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_is_current_background_music_volume_lowered(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "is_current_background_music_volume_lowered", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, is_current_background_music_volume_lowered());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_secondary_music(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_secondary_music", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 seqId = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "play_secondary_music"); return 0; }
|
|
u8 bgMusicVolume = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "play_secondary_music"); return 0; }
|
|
u8 volume = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "play_secondary_music"); return 0; }
|
|
u16 fadeTimer = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "play_secondary_music"); return 0; }
|
|
|
|
play_secondary_music(seqId, bgMusicVolume, volume, fadeTimer);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_stop_secondary_music(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "stop_secondary_music", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u16 fadeTimer = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "stop_secondary_music"); return 0; }
|
|
|
|
stop_secondary_music(fadeTimer);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_audio_fadeout(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_audio_fadeout", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u16 fadeOutTime = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_audio_fadeout"); return 0; }
|
|
|
|
set_audio_fadeout(fadeOutTime);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_course_clear(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_course_clear", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
play_course_clear();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_peachs_jingle(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_peachs_jingle", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
play_peachs_jingle();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_puzzle_jingle(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_puzzle_jingle", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
play_puzzle_jingle();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_star_fanfare(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_star_fanfare", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
play_star_fanfare();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_power_star_jingle(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_power_star_jingle", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 keepBackgroundMusic = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "play_power_star_jingle"); return 0; }
|
|
|
|
play_power_star_jingle(keepBackgroundMusic);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_race_fanfare(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_race_fanfare", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
play_race_fanfare();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_toads_jingle(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_toads_jingle", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
play_toads_jingle();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_sound_reset_background_music_default_volume(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "sound_reset_background_music_default_volume", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 seqId = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "sound_reset_background_music_default_volume"); return 0; }
|
|
|
|
sound_reset_background_music_default_volume(seqId);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_sound_set_background_music_default_volume(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "sound_set_background_music_default_volume", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 seqId = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "sound_set_background_music_default_volume"); return 0; }
|
|
u8 volume = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "sound_set_background_music_default_volume"); return 0; }
|
|
|
|
sound_set_background_music_default_volume(seqId, volume);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_sound_pan(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_sound_pan", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 x = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_sound_pan"); return 0; }
|
|
f32 z = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "get_sound_pan"); return 0; }
|
|
|
|
lua_pushnumber(L, get_sound_pan(x, z));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_sound_get_level_intensity(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "sound_get_level_intensity", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 distance = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "sound_get_level_intensity"); return 0; }
|
|
|
|
lua_pushnumber(L, sound_get_level_intensity(distance));
|
|
|
|
return 1;
|
|
}
|
|
|
|
////////////////////////
|
|
// first_person_cam.h //
|
|
////////////////////////
|
|
|
|
int smlua_func_first_person_check_cancels(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "first_person_check_cancels", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "first_person_check_cancels"); return 0; }
|
|
|
|
lua_pushboolean(L, first_person_check_cancels(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_first_person_enabled(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_first_person_enabled", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushboolean(L, get_first_person_enabled());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_first_person_enabled(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_first_person_enabled", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
bool enable = smlua_to_boolean(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_first_person_enabled"); return 0; }
|
|
|
|
set_first_person_enabled(enable);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_first_person_reset(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "first_person_reset", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
first_person_reset();
|
|
|
|
return 1;
|
|
}
|
|
|
|
///////////////////
|
|
// ingame_menu.h //
|
|
///////////////////
|
|
|
|
int smlua_func_create_dialog_box(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "create_dialog_box", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 dialog = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "create_dialog_box"); return 0; }
|
|
|
|
create_dialog_box(dialog);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_create_dialog_box_with_var(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "create_dialog_box_with_var", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 dialog = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "create_dialog_box_with_var"); return 0; }
|
|
s32 dialogVar = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "create_dialog_box_with_var"); return 0; }
|
|
|
|
create_dialog_box_with_var(dialog, dialogVar);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_create_dialog_inverted_box(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "create_dialog_inverted_box", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 dialog = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "create_dialog_inverted_box"); return 0; }
|
|
|
|
create_dialog_inverted_box(dialog);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_create_dialog_box_with_response(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "create_dialog_box_with_response", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 dialog = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "create_dialog_box_with_response"); return 0; }
|
|
|
|
create_dialog_box_with_response(dialog);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_reset_dialog_render_state(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "reset_dialog_render_state", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
reset_dialog_render_state();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_menu_mode(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_menu_mode", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 mode = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_menu_mode"); return 0; }
|
|
|
|
set_menu_mode(mode);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_min_dialog_width(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_min_dialog_width", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 width = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_min_dialog_width"); return 0; }
|
|
|
|
set_min_dialog_width(width);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_dialog_override_pos(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_dialog_override_pos", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 x = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_dialog_override_pos"); return 0; }
|
|
s16 y = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "set_dialog_override_pos"); return 0; }
|
|
|
|
set_dialog_override_pos(x, y);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_reset_dialog_override_pos(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "reset_dialog_override_pos", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
reset_dialog_override_pos();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_dialog_override_color(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 8) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_dialog_override_color", 8, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 bgR = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_dialog_override_color"); return 0; }
|
|
u8 bgG = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "set_dialog_override_color"); return 0; }
|
|
u8 bgB = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "set_dialog_override_color"); return 0; }
|
|
u8 bgA = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "set_dialog_override_color"); return 0; }
|
|
u8 textR = smlua_to_integer(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "set_dialog_override_color"); return 0; }
|
|
u8 textG = smlua_to_integer(L, 6);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 6, "set_dialog_override_color"); return 0; }
|
|
u8 textB = smlua_to_integer(L, 7);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 7, "set_dialog_override_color"); return 0; }
|
|
u8 textA = smlua_to_integer(L, 8);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 8, "set_dialog_override_color"); return 0; }
|
|
|
|
set_dialog_override_color(bgR, bgG, bgB, bgA, textR, textG, textB, textA);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_reset_dialog_override_color(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "reset_dialog_override_color", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
reset_dialog_override_color();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_dialog_box_state(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_dialog_box_state", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 state = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_dialog_box_state"); return 0; }
|
|
|
|
set_dialog_box_state(state);
|
|
|
|
return 1;
|
|
}
|
|
|
|
///////////////////
|
|
// interaction.h //
|
|
///////////////////
|
|
|
|
int smlua_func_interact_coin(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "interact_coin", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "interact_coin"); return 0; }
|
|
// interactType skipped so mods can't lie about what interaction it is
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 3, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "interact_coin"); return 0; }
|
|
|
|
lua_pushinteger(L, process_interaction(m, INTERACT_COIN, o, interact_coin));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_interact_water_ring(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "interact_water_ring", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "interact_water_ring"); return 0; }
|
|
// interactType skipped so mods can't lie about what interaction it is
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 3, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "interact_water_ring"); return 0; }
|
|
|
|
lua_pushinteger(L, process_interaction(m, INTERACT_WATER_RING, o, interact_water_ring));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_interact_star_or_key(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "interact_star_or_key", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "interact_star_or_key"); return 0; }
|
|
// interactType skipped so mods can't lie about what interaction it is
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 3, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "interact_star_or_key"); return 0; }
|
|
|
|
lua_pushinteger(L, process_interaction(m, INTERACT_STAR_OR_KEY, o, interact_star_or_key));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_interact_bbh_entrance(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "interact_bbh_entrance", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "interact_bbh_entrance"); return 0; }
|
|
// interactType skipped so mods can't lie about what interaction it is
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 3, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "interact_bbh_entrance"); return 0; }
|
|
|
|
lua_pushinteger(L, process_interaction(m, INTERACT_BBH_ENTRANCE, o, interact_bbh_entrance));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_interact_warp(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "interact_warp", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "interact_warp"); return 0; }
|
|
// interactType skipped so mods can't lie about what interaction it is
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 3, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "interact_warp"); return 0; }
|
|
|
|
lua_pushinteger(L, process_interaction(m, INTERACT_WARP, o, interact_warp));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_interact_warp_door(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "interact_warp_door", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "interact_warp_door"); return 0; }
|
|
// interactType skipped so mods can't lie about what interaction it is
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 3, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "interact_warp_door"); return 0; }
|
|
|
|
lua_pushinteger(L, process_interaction(m, INTERACT_WARP_DOOR, o, interact_warp_door));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_interact_door(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "interact_door", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "interact_door"); return 0; }
|
|
// interactType skipped so mods can't lie about what interaction it is
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 3, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "interact_door"); return 0; }
|
|
|
|
lua_pushinteger(L, process_interaction(m, INTERACT_DOOR, o, interact_door));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_interact_cannon_base(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "interact_cannon_base", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "interact_cannon_base"); return 0; }
|
|
// interactType skipped so mods can't lie about what interaction it is
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 3, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "interact_cannon_base"); return 0; }
|
|
|
|
lua_pushinteger(L, process_interaction(m, INTERACT_CANNON_BASE, o, interact_cannon_base));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_interact_player(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "interact_player", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "interact_player"); return 0; }
|
|
// interactType skipped so mods can't lie about what interaction it is
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 3, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "interact_player"); return 0; }
|
|
|
|
lua_pushinteger(L, process_interaction(m, INTERACT_PLAYER, o, interact_player));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_interact_igloo_barrier(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "interact_igloo_barrier", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "interact_igloo_barrier"); return 0; }
|
|
// interactType skipped so mods can't lie about what interaction it is
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 3, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "interact_igloo_barrier"); return 0; }
|
|
|
|
lua_pushinteger(L, process_interaction(m, INTERACT_IGLOO_BARRIER, o, interact_igloo_barrier));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_interact_tornado(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "interact_tornado", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "interact_tornado"); return 0; }
|
|
// interactType skipped so mods can't lie about what interaction it is
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 3, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "interact_tornado"); return 0; }
|
|
|
|
lua_pushinteger(L, process_interaction(m, INTERACT_TORNADO, o, interact_tornado));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_interact_whirlpool(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "interact_whirlpool", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "interact_whirlpool"); return 0; }
|
|
// interactType skipped so mods can't lie about what interaction it is
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 3, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "interact_whirlpool"); return 0; }
|
|
|
|
lua_pushinteger(L, process_interaction(m, INTERACT_WHIRLPOOL, o, interact_whirlpool));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_interact_strong_wind(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "interact_strong_wind", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "interact_strong_wind"); return 0; }
|
|
// interactType skipped so mods can't lie about what interaction it is
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 3, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "interact_strong_wind"); return 0; }
|
|
|
|
lua_pushinteger(L, process_interaction(m, INTERACT_STRONG_WIND, o, interact_strong_wind));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_interact_flame(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "interact_flame", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "interact_flame"); return 0; }
|
|
// interactType skipped so mods can't lie about what interaction it is
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 3, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "interact_flame"); return 0; }
|
|
|
|
lua_pushinteger(L, process_interaction(m, INTERACT_FLAME, o, interact_flame));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_interact_snufit_bullet(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "interact_snufit_bullet", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "interact_snufit_bullet"); return 0; }
|
|
// interactType skipped so mods can't lie about what interaction it is
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 3, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "interact_snufit_bullet"); return 0; }
|
|
|
|
lua_pushinteger(L, process_interaction(m, INTERACT_SNUFIT_BULLET, o, interact_snufit_bullet));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_interact_clam_or_bubba(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "interact_clam_or_bubba", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "interact_clam_or_bubba"); return 0; }
|
|
// interactType skipped so mods can't lie about what interaction it is
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 3, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "interact_clam_or_bubba"); return 0; }
|
|
|
|
lua_pushinteger(L, process_interaction(m, INTERACT_CLAM_OR_BUBBA, o, interact_clam_or_bubba));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_interact_bully(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "interact_bully", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "interact_bully"); return 0; }
|
|
// interactType skipped so mods can't lie about what interaction it is
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 3, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "interact_bully"); return 0; }
|
|
|
|
lua_pushinteger(L, process_interaction(m, INTERACT_BULLY, o, interact_bully));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_interact_shock(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "interact_shock", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "interact_shock"); return 0; }
|
|
// interactType skipped so mods can't lie about what interaction it is
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 3, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "interact_shock"); return 0; }
|
|
|
|
lua_pushinteger(L, process_interaction(m, INTERACT_SHOCK, o, interact_shock));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_interact_mr_blizzard(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "interact_mr_blizzard", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "interact_mr_blizzard"); return 0; }
|
|
// interactType skipped so mods can't lie about what interaction it is
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 3, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "interact_mr_blizzard"); return 0; }
|
|
|
|
lua_pushinteger(L, process_interaction(m, INTERACT_MR_BLIZZARD, o, interact_mr_blizzard));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_interact_hit_from_below(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "interact_hit_from_below", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "interact_hit_from_below"); return 0; }
|
|
// interactType skipped so mods can't lie about what interaction it is
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 3, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "interact_hit_from_below"); return 0; }
|
|
|
|
lua_pushinteger(L, process_interaction(m, INTERACT_HIT_FROM_BELOW, o, interact_hit_from_below));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_interact_bounce_top(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "interact_bounce_top", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "interact_bounce_top"); return 0; }
|
|
// interactType skipped so mods can't lie about what interaction it is
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 3, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "interact_bounce_top"); return 0; }
|
|
|
|
lua_pushinteger(L, process_interaction(m, INTERACT_BOUNCE_TOP, o, interact_bounce_top));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_interact_spiny_walking(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "interact_spiny_walking", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "interact_spiny_walking"); return 0; }
|
|
// interactType skipped so mods can't lie about what interaction it is
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 3, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "interact_spiny_walking"); return 0; }
|
|
|
|
lua_pushinteger(L, process_interaction(m, INTERACT_SPINY_WALKING, o, interact_spiny_walking));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_interact_damage(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "interact_damage", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "interact_damage"); return 0; }
|
|
// interactType skipped so mods can't lie about what interaction it is
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 3, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "interact_damage"); return 0; }
|
|
|
|
lua_pushinteger(L, process_interaction(m, INTERACT_DAMAGE, o, interact_damage));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_interact_breakable(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "interact_breakable", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "interact_breakable"); return 0; }
|
|
// interactType skipped so mods can't lie about what interaction it is
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 3, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "interact_breakable"); return 0; }
|
|
|
|
lua_pushinteger(L, process_interaction(m, INTERACT_BREAKABLE, o, interact_breakable));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_interact_koopa_shell(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "interact_koopa_shell", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "interact_koopa_shell"); return 0; }
|
|
// interactType skipped so mods can't lie about what interaction it is
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 3, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "interact_koopa_shell"); return 0; }
|
|
|
|
lua_pushinteger(L, process_interaction(m, INTERACT_KOOPA_SHELL, o, interact_koopa_shell));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_interact_pole(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "interact_pole", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "interact_pole"); return 0; }
|
|
// interactType skipped so mods can't lie about what interaction it is
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 3, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "interact_pole"); return 0; }
|
|
|
|
lua_pushinteger(L, process_interaction(m, INTERACT_POLE, o, interact_pole));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_interact_hoot(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "interact_hoot", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "interact_hoot"); return 0; }
|
|
// interactType skipped so mods can't lie about what interaction it is
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 3, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "interact_hoot"); return 0; }
|
|
|
|
lua_pushinteger(L, process_interaction(m, INTERACT_HOOT, o, interact_hoot));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_interact_cap(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "interact_cap", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "interact_cap"); return 0; }
|
|
// interactType skipped so mods can't lie about what interaction it is
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 3, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "interact_cap"); return 0; }
|
|
|
|
lua_pushinteger(L, process_interaction(m, INTERACT_CAP, o, interact_cap));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_interact_grabbable(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "interact_grabbable", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "interact_grabbable"); return 0; }
|
|
// interactType skipped so mods can't lie about what interaction it is
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 3, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "interact_grabbable"); return 0; }
|
|
|
|
lua_pushinteger(L, process_interaction(m, INTERACT_GRABBABLE, o, interact_grabbable));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_interact_text(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "interact_text", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "interact_text"); return 0; }
|
|
// interactType skipped so mods can't lie about what interaction it is
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 3, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "interact_text"); return 0; }
|
|
|
|
lua_pushinteger(L, process_interaction(m, INTERACT_TEXT, o, interact_text));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_obj_angle_to_object(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mario_obj_angle_to_object", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mario_obj_angle_to_object"); return 0; }
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 2, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mario_obj_angle_to_object"); return 0; }
|
|
|
|
lua_pushinteger(L, mario_obj_angle_to_object(m, o));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_stop_riding_object(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mario_stop_riding_object", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mario_stop_riding_object"); return 0; }
|
|
|
|
mario_stop_riding_object(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_grab_used_object(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mario_grab_used_object", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mario_grab_used_object"); return 0; }
|
|
|
|
mario_grab_used_object(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_drop_held_object(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mario_drop_held_object", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mario_drop_held_object"); return 0; }
|
|
|
|
mario_drop_held_object(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_throw_held_object(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mario_throw_held_object", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mario_throw_held_object"); return 0; }
|
|
|
|
mario_throw_held_object(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_stop_riding_and_holding(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mario_stop_riding_and_holding", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mario_stop_riding_and_holding"); return 0; }
|
|
|
|
mario_stop_riding_and_holding(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_does_mario_have_normal_cap_on_head(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "does_mario_have_normal_cap_on_head", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "does_mario_have_normal_cap_on_head"); return 0; }
|
|
|
|
lua_pushinteger(L, does_mario_have_normal_cap_on_head(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_does_mario_have_blown_cap(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "does_mario_have_blown_cap", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "does_mario_have_blown_cap"); return 0; }
|
|
|
|
lua_pushboolean(L, does_mario_have_blown_cap(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_blow_off_cap(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mario_blow_off_cap", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mario_blow_off_cap"); return 0; }
|
|
f32 capSpeed = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mario_blow_off_cap"); return 0; }
|
|
|
|
mario_blow_off_cap(m, capSpeed);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_lose_cap_to_enemy(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mario_lose_cap_to_enemy", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mario_lose_cap_to_enemy"); return 0; }
|
|
u32 arg = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mario_lose_cap_to_enemy"); return 0; }
|
|
|
|
lua_pushinteger(L, mario_lose_cap_to_enemy(m, arg));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_retrieve_cap(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mario_retrieve_cap", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mario_retrieve_cap"); return 0; }
|
|
|
|
mario_retrieve_cap(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_get_collided_object(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mario_get_collided_object", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mario_get_collided_object"); return 0; }
|
|
u32 interactType = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mario_get_collided_object"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_OBJECT, mario_get_collided_object(m, interactType), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_check_object_grab(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mario_check_object_grab", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mario_check_object_grab"); return 0; }
|
|
|
|
lua_pushinteger(L, mario_check_object_grab(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_door_save_file_flag(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_door_save_file_flag", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* door = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_door_save_file_flag"); return 0; }
|
|
|
|
lua_pushinteger(L, get_door_save_file_flag(door));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_passes_pvp_interaction_checks(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "passes_pvp_interaction_checks", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* attacker = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "passes_pvp_interaction_checks"); return 0; }
|
|
struct MarioState* victim = (struct MarioState*)smlua_to_cobject(L, 2, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "passes_pvp_interaction_checks"); return 0; }
|
|
|
|
lua_pushinteger(L, passes_pvp_interaction_checks(attacker, victim));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_should_push_or_pull_door(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "should_push_or_pull_door", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "should_push_or_pull_door"); return 0; }
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 2, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "should_push_or_pull_door"); return 0; }
|
|
|
|
lua_pushinteger(L, should_push_or_pull_door(m, o));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_take_damage_and_knock_back(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "take_damage_and_knock_back", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "take_damage_and_knock_back"); return 0; }
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 2, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "take_damage_and_knock_back"); return 0; }
|
|
|
|
lua_pushinteger(L, take_damage_and_knock_back(m, o));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_mario_cap_flag(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_mario_cap_flag", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* capObject = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_mario_cap_flag"); return 0; }
|
|
|
|
lua_pushinteger(L, get_mario_cap_flag(capObject));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_determine_interaction(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "determine_interaction", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "determine_interaction"); return 0; }
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 2, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "determine_interaction"); return 0; }
|
|
|
|
lua_pushinteger(L, determine_interaction(m, o));
|
|
|
|
return 1;
|
|
}
|
|
|
|
////////////////////////
|
|
// lag_compensation.h //
|
|
////////////////////////
|
|
|
|
int smlua_func_lag_compensation_store(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "lag_compensation_store", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lag_compensation_store();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_lag_compensation_get_local_state(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "lag_compensation_get_local_state", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct NetworkPlayer* otherNp = (struct NetworkPlayer*)smlua_to_cobject(L, 1, LOT_NETWORKPLAYER);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "lag_compensation_get_local_state"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_MARIOSTATE, lag_compensation_get_local_state(otherNp), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_lag_compensation_get_local_state_ready(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "lag_compensation_get_local_state_ready", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushboolean(L, lag_compensation_get_local_state_ready());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_lag_compensation_get_local_state_index(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "lag_compensation_get_local_state_index", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, lag_compensation_get_local_state_index());
|
|
|
|
return 1;
|
|
}
|
|
|
|
//////////////////
|
|
// level_info.h //
|
|
//////////////////
|
|
|
|
int smlua_func_get_level_name_ascii(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_level_name_ascii", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 courseNum = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_level_name_ascii"); return 0; }
|
|
s16 levelNum = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "get_level_name_ascii"); return 0; }
|
|
s16 areaIndex = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "get_level_name_ascii"); return 0; }
|
|
s16 charCase = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "get_level_name_ascii"); return 0; }
|
|
|
|
lua_pushstring(L, get_level_name_ascii(courseNum, levelNum, areaIndex, charCase));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_level_name_sm64(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_level_name_sm64", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 courseNum = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_level_name_sm64"); return 0; }
|
|
s16 levelNum = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "get_level_name_sm64"); return 0; }
|
|
s16 areaIndex = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "get_level_name_sm64"); return 0; }
|
|
s16 charCase = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "get_level_name_sm64"); return 0; }
|
|
|
|
smlua_push_pointer(L, LVT_U8_P, (void*)get_level_name_sm64(courseNum, levelNum, areaIndex, charCase), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_level_name(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_level_name", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 courseNum = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_level_name"); return 0; }
|
|
s16 levelNum = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "get_level_name"); return 0; }
|
|
s16 areaIndex = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "get_level_name"); return 0; }
|
|
|
|
lua_pushstring(L, get_level_name(courseNum, levelNum, areaIndex));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_star_name_ascii(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_star_name_ascii", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 courseNum = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_star_name_ascii"); return 0; }
|
|
s16 starNum = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "get_star_name_ascii"); return 0; }
|
|
s16 charCase = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "get_star_name_ascii"); return 0; }
|
|
|
|
lua_pushstring(L, get_star_name_ascii(courseNum, starNum, charCase));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_star_name_sm64(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_star_name_sm64", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 courseNum = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_star_name_sm64"); return 0; }
|
|
s16 starNum = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "get_star_name_sm64"); return 0; }
|
|
s16 charCase = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "get_star_name_sm64"); return 0; }
|
|
|
|
smlua_push_pointer(L, LVT_U8_P, (void*)get_star_name_sm64(courseNum, starNum, charCase), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_star_name(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_star_name", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 courseNum = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_star_name"); return 0; }
|
|
s16 starNum = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "get_star_name"); return 0; }
|
|
|
|
lua_pushstring(L, get_star_name(courseNum, starNum));
|
|
|
|
return 1;
|
|
}
|
|
|
|
////////////////////
|
|
// level_script.h //
|
|
////////////////////
|
|
|
|
int smlua_func_area_create_warp_node(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 6) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "area_create_warp_node", 6, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 id = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "area_create_warp_node"); return 0; }
|
|
u8 destLevel = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "area_create_warp_node"); return 0; }
|
|
u8 destArea = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "area_create_warp_node"); return 0; }
|
|
u8 destNode = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "area_create_warp_node"); return 0; }
|
|
u8 checkpoint = smlua_to_integer(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "area_create_warp_node"); return 0; }
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 6, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 6, "area_create_warp_node"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_OBJECTWARPNODE, area_create_warp_node(id, destLevel, destArea, destNode, checkpoint, o), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
////////////////////
|
|
// level_update.h //
|
|
////////////////////
|
|
|
|
int smlua_func_level_control_timer_running(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "level_control_timer_running", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, level_control_timer_running());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_fade_into_special_warp(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "fade_into_special_warp", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
u32 arg = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "fade_into_special_warp"); return 0; }
|
|
u32 color = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "fade_into_special_warp"); return 0; }
|
|
|
|
fade_into_special_warp(arg, color);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_instant_warp(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_instant_warp", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 index = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_instant_warp"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_INSTANTWARP, get_instant_warp(index), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_painting_warp_node(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_painting_warp_node", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
smlua_push_object(L, LOT_WARPNODE, get_painting_warp_node(), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_initiate_painting_warp(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "initiate_painting_warp", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 paintingIndex = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "initiate_painting_warp"); return 0; }
|
|
|
|
initiate_painting_warp(paintingIndex);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_level_trigger_warp(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "level_trigger_warp", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "level_trigger_warp"); return 0; }
|
|
s32 warpOp = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "level_trigger_warp"); return 0; }
|
|
|
|
lua_pushinteger(L, level_trigger_warp(m, warpOp));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_warp_special(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "warp_special", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 arg = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "warp_special"); return 0; }
|
|
|
|
warp_special(arg);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_lvl_set_current_level(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "lvl_set_current_level", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 param = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "lvl_set_current_level"); return 0; }
|
|
s16 levelNum = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "lvl_set_current_level"); return 0; }
|
|
|
|
lua_pushinteger(L, lvl_set_current_level(param, levelNum));
|
|
|
|
return 1;
|
|
}
|
|
|
|
///////////////////////
|
|
// lighting_engine.h //
|
|
///////////////////////
|
|
|
|
int smlua_func_le_set_mode(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "le_set_mode", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
int mode = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "le_set_mode"); return 0; }
|
|
|
|
le_set_mode(mode);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_le_get_mode(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "le_get_mode", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, le_get_mode());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_le_set_tone_mapping(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "le_set_tone_mapping", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
int toneMapping = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "le_set_tone_mapping"); return 0; }
|
|
|
|
le_set_tone_mapping(toneMapping);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_le_is_enabled(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "le_is_enabled", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushboolean(L, le_is_enabled());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_le_calculate_lighting_color(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "le_calculate_lighting_color", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f pos;
|
|
smlua_get_vec3f(pos, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "le_calculate_lighting_color"); return 0; }
|
|
|
|
Color out;
|
|
smlua_get_color(out, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "le_calculate_lighting_color"); return 0; }
|
|
f32 lightIntensityScalar = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "le_calculate_lighting_color"); return 0; }
|
|
|
|
le_calculate_lighting_color(pos, out, lightIntensityScalar);
|
|
|
|
smlua_push_color(out, 2);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_le_calculate_lighting_color_with_normal(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "le_calculate_lighting_color_with_normal", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f pos;
|
|
smlua_get_vec3f(pos, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "le_calculate_lighting_color_with_normal"); return 0; }
|
|
|
|
Vec3f normal;
|
|
smlua_get_vec3f(normal, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "le_calculate_lighting_color_with_normal"); return 0; }
|
|
|
|
Color out;
|
|
smlua_get_color(out, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "le_calculate_lighting_color_with_normal"); return 0; }
|
|
f32 lightIntensityScalar = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "le_calculate_lighting_color_with_normal"); return 0; }
|
|
|
|
le_calculate_lighting_color_with_normal(pos, normal, out, lightIntensityScalar);
|
|
|
|
smlua_push_color(out, 3);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_le_calculate_lighting_dir(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "le_calculate_lighting_dir", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f pos;
|
|
smlua_get_vec3f(pos, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "le_calculate_lighting_dir"); return 0; }
|
|
|
|
Vec3f out;
|
|
smlua_get_vec3f(out, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "le_calculate_lighting_dir"); return 0; }
|
|
|
|
le_calculate_lighting_dir(pos, out);
|
|
|
|
smlua_push_vec3f(out, 2);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_le_add_light(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 8) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "le_add_light", 8, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 x = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "le_add_light"); return 0; }
|
|
f32 y = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "le_add_light"); return 0; }
|
|
f32 z = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "le_add_light"); return 0; }
|
|
u8 r = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "le_add_light"); return 0; }
|
|
u8 g = smlua_to_integer(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "le_add_light"); return 0; }
|
|
u8 b = smlua_to_integer(L, 6);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 6, "le_add_light"); return 0; }
|
|
f32 radius = smlua_to_number(L, 7);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 7, "le_add_light"); return 0; }
|
|
f32 intensity = smlua_to_number(L, 8);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 8, "le_add_light"); return 0; }
|
|
|
|
lua_pushinteger(L, le_add_light(x, y, z, r, g, b, radius, intensity));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_le_remove_light(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "le_remove_light", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 id = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "le_remove_light"); return 0; }
|
|
|
|
le_remove_light(id);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_le_get_light_count(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "le_get_light_count", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, le_get_light_count());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_le_light_exists(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "le_light_exists", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 id = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "le_light_exists"); return 0; }
|
|
|
|
lua_pushboolean(L, le_light_exists(id));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_le_get_ambient_color(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "le_get_ambient_color", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Color out;
|
|
smlua_get_color(out, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "le_get_ambient_color"); return 0; }
|
|
|
|
le_get_ambient_color(out);
|
|
|
|
smlua_push_color(out, 1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_le_set_ambient_color(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "le_set_ambient_color", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 r = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "le_set_ambient_color"); return 0; }
|
|
u8 g = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "le_set_ambient_color"); return 0; }
|
|
u8 b = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "le_set_ambient_color"); return 0; }
|
|
|
|
le_set_ambient_color(r, g, b);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_le_get_light_pos(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "le_get_light_pos", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 id = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "le_get_light_pos"); return 0; }
|
|
|
|
Vec3f out;
|
|
smlua_get_vec3f(out, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "le_get_light_pos"); return 0; }
|
|
|
|
le_get_light_pos(id, out);
|
|
|
|
smlua_push_vec3f(out, 2);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_le_set_light_pos(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "le_set_light_pos", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 id = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "le_set_light_pos"); return 0; }
|
|
f32 x = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "le_set_light_pos"); return 0; }
|
|
f32 y = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "le_set_light_pos"); return 0; }
|
|
f32 z = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "le_set_light_pos"); return 0; }
|
|
|
|
le_set_light_pos(id, x, y, z);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_le_get_light_color(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "le_get_light_color", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 id = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "le_get_light_color"); return 0; }
|
|
|
|
Color out;
|
|
smlua_get_color(out, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "le_get_light_color"); return 0; }
|
|
|
|
le_get_light_color(id, out);
|
|
|
|
smlua_push_color(out, 2);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_le_set_light_color(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "le_set_light_color", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 id = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "le_set_light_color"); return 0; }
|
|
u8 r = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "le_set_light_color"); return 0; }
|
|
u8 g = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "le_set_light_color"); return 0; }
|
|
u8 b = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "le_set_light_color"); return 0; }
|
|
|
|
le_set_light_color(id, r, g, b);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_le_get_light_radius(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "le_get_light_radius", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 id = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "le_get_light_radius"); return 0; }
|
|
|
|
lua_pushnumber(L, le_get_light_radius(id));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_le_set_light_radius(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "le_set_light_radius", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 id = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "le_set_light_radius"); return 0; }
|
|
f32 radius = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "le_set_light_radius"); return 0; }
|
|
|
|
le_set_light_radius(id, radius);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_le_get_light_intensity(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "le_get_light_intensity", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 id = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "le_get_light_intensity"); return 0; }
|
|
|
|
lua_pushnumber(L, le_get_light_intensity(id));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_le_set_light_intensity(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "le_set_light_intensity", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 id = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "le_set_light_intensity"); return 0; }
|
|
f32 intensity = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "le_set_light_intensity"); return 0; }
|
|
|
|
le_set_light_intensity(id, intensity);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_le_get_light_use_surface_normals(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "le_get_light_use_surface_normals", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 id = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "le_get_light_use_surface_normals"); return 0; }
|
|
|
|
lua_pushboolean(L, le_get_light_use_surface_normals(id));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_le_set_light_use_surface_normals(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "le_set_light_use_surface_normals", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 id = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "le_set_light_use_surface_normals"); return 0; }
|
|
bool useSurfaceNormals = smlua_to_boolean(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "le_set_light_use_surface_normals"); return 0; }
|
|
|
|
le_set_light_use_surface_normals(id, useSurfaceNormals);
|
|
|
|
return 1;
|
|
}
|
|
|
|
/////////////
|
|
// mario.h //
|
|
/////////////
|
|
|
|
int smlua_func_is_anim_at_end(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "is_anim_at_end", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "is_anim_at_end"); return 0; }
|
|
|
|
lua_pushinteger(L, is_anim_at_end(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_is_anim_past_end(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "is_anim_past_end", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "is_anim_past_end"); return 0; }
|
|
|
|
lua_pushinteger(L, is_anim_past_end(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_mario_animation(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_mario_animation", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_mario_animation"); return 0; }
|
|
s32 targetAnimID = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "set_mario_animation"); return 0; }
|
|
|
|
lua_pushinteger(L, set_mario_animation(m, targetAnimID));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_mario_anim_with_accel(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_mario_anim_with_accel", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_mario_anim_with_accel"); return 0; }
|
|
s32 targetAnimID = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "set_mario_anim_with_accel"); return 0; }
|
|
s32 accel = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "set_mario_anim_with_accel"); return 0; }
|
|
|
|
lua_pushinteger(L, set_mario_anim_with_accel(m, targetAnimID, accel));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_character_animation(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_character_animation", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_character_animation"); return 0; }
|
|
int targetAnimID = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "set_character_animation"); return 0; }
|
|
|
|
lua_pushinteger(L, set_character_animation(m, targetAnimID));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_character_anim_with_accel(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_character_anim_with_accel", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_character_anim_with_accel"); return 0; }
|
|
int targetAnimID = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "set_character_anim_with_accel"); return 0; }
|
|
s32 accel = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "set_character_anim_with_accel"); return 0; }
|
|
|
|
lua_pushinteger(L, set_character_anim_with_accel(m, targetAnimID, accel));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_anim_to_frame(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_anim_to_frame", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_anim_to_frame"); return 0; }
|
|
s16 animFrame = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "set_anim_to_frame"); return 0; }
|
|
|
|
set_anim_to_frame(m, animFrame);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_is_anim_past_frame(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "is_anim_past_frame", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "is_anim_past_frame"); return 0; }
|
|
s16 animFrame = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "is_anim_past_frame"); return 0; }
|
|
|
|
lua_pushinteger(L, is_anim_past_frame(m, animFrame));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_find_mario_anim_flags_and_translation(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "find_mario_anim_flags_and_translation", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "find_mario_anim_flags_and_translation"); return 0; }
|
|
s32 yaw = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "find_mario_anim_flags_and_translation"); return 0; }
|
|
|
|
Vec3s translation;
|
|
smlua_get_vec3s(translation, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "find_mario_anim_flags_and_translation"); return 0; }
|
|
|
|
lua_pushinteger(L, find_mario_anim_flags_and_translation(o, yaw, translation));
|
|
|
|
smlua_push_vec3s(translation, 3);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_update_mario_pos_for_anim(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "update_mario_pos_for_anim", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "update_mario_pos_for_anim"); return 0; }
|
|
|
|
update_mario_pos_for_anim(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_return_mario_anim_y_translation(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "return_mario_anim_y_translation", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "return_mario_anim_y_translation"); return 0; }
|
|
|
|
lua_pushinteger(L, return_mario_anim_y_translation(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_sound_if_no_flag(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_sound_if_no_flag", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "play_sound_if_no_flag"); return 0; }
|
|
u32 soundBits = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "play_sound_if_no_flag"); return 0; }
|
|
u32 flags = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "play_sound_if_no_flag"); return 0; }
|
|
|
|
play_sound_if_no_flag(m, soundBits, flags);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_mario_jump_sound(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_mario_jump_sound", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "play_mario_jump_sound"); return 0; }
|
|
|
|
play_mario_jump_sound(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_adjust_sound_for_speed(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "adjust_sound_for_speed", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "adjust_sound_for_speed"); return 0; }
|
|
|
|
adjust_sound_for_speed(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_sound_and_spawn_particles(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_sound_and_spawn_particles", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "play_sound_and_spawn_particles"); return 0; }
|
|
u32 soundBits = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "play_sound_and_spawn_particles"); return 0; }
|
|
u32 waveParticleType = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "play_sound_and_spawn_particles"); return 0; }
|
|
|
|
play_sound_and_spawn_particles(m, soundBits, waveParticleType);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_mario_action_sound(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_mario_action_sound", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "play_mario_action_sound"); return 0; }
|
|
u32 soundBits = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "play_mario_action_sound"); return 0; }
|
|
u32 waveParticleType = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "play_mario_action_sound"); return 0; }
|
|
|
|
play_mario_action_sound(m, soundBits, waveParticleType);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_mario_landing_sound(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_mario_landing_sound", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "play_mario_landing_sound"); return 0; }
|
|
u32 soundBits = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "play_mario_landing_sound"); return 0; }
|
|
|
|
play_mario_landing_sound(m, soundBits);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_mario_landing_sound_once(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_mario_landing_sound_once", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "play_mario_landing_sound_once"); return 0; }
|
|
u32 soundBits = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "play_mario_landing_sound_once"); return 0; }
|
|
|
|
play_mario_landing_sound_once(m, soundBits);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_mario_heavy_landing_sound(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_mario_heavy_landing_sound", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "play_mario_heavy_landing_sound"); return 0; }
|
|
u32 soundBits = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "play_mario_heavy_landing_sound"); return 0; }
|
|
|
|
play_mario_heavy_landing_sound(m, soundBits);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_mario_heavy_landing_sound_once(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_mario_heavy_landing_sound_once", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "play_mario_heavy_landing_sound_once"); return 0; }
|
|
u32 soundBits = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "play_mario_heavy_landing_sound_once"); return 0; }
|
|
|
|
play_mario_heavy_landing_sound_once(m, soundBits);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_mario_sound(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_mario_sound", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "play_mario_sound"); return 0; }
|
|
s32 primarySoundBits = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "play_mario_sound"); return 0; }
|
|
s32 scondarySoundBits = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "play_mario_sound"); return 0; }
|
|
|
|
play_mario_sound(m, primarySoundBits, scondarySoundBits);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_is_crouching(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mario_is_crouching", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mario_is_crouching"); return 0; }
|
|
|
|
lua_pushboolean(L, mario_is_crouching(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_is_ground_pound_landing(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mario_is_ground_pound_landing", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mario_is_ground_pound_landing"); return 0; }
|
|
|
|
lua_pushboolean(L, mario_is_ground_pound_landing(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_can_bubble(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mario_can_bubble", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mario_can_bubble"); return 0; }
|
|
|
|
lua_pushboolean(L, mario_can_bubble(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_set_bubbled(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mario_set_bubbled", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mario_set_bubbled"); return 0; }
|
|
|
|
mario_set_bubbled(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_set_forward_vel(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mario_set_forward_vel", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mario_set_forward_vel"); return 0; }
|
|
f32 speed = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mario_set_forward_vel"); return 0; }
|
|
|
|
mario_set_forward_vel(m, speed);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_get_floor_class(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mario_get_floor_class", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mario_get_floor_class"); return 0; }
|
|
|
|
lua_pushinteger(L, mario_get_floor_class(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_get_terrain_sound_addend(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mario_get_terrain_sound_addend", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mario_get_terrain_sound_addend"); return 0; }
|
|
|
|
lua_pushinteger(L, mario_get_terrain_sound_addend(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_resolve_and_return_wall_collisions(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "resolve_and_return_wall_collisions", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f pos;
|
|
smlua_get_vec3f(pos, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "resolve_and_return_wall_collisions"); return 0; }
|
|
f32 offset = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "resolve_and_return_wall_collisions"); return 0; }
|
|
f32 radius = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "resolve_and_return_wall_collisions"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_SURFACE, resolve_and_return_wall_collisions(pos, offset, radius), NULL);
|
|
|
|
smlua_push_vec3f(pos, 1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_resolve_and_return_wall_collisions_data(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "resolve_and_return_wall_collisions_data", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f pos;
|
|
smlua_get_vec3f(pos, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "resolve_and_return_wall_collisions_data"); return 0; }
|
|
f32 offset = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "resolve_and_return_wall_collisions_data"); return 0; }
|
|
f32 radius = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "resolve_and_return_wall_collisions_data"); return 0; }
|
|
struct WallCollisionData* collisionData = (struct WallCollisionData*)smlua_to_cobject(L, 4, LOT_WALLCOLLISIONDATA);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "resolve_and_return_wall_collisions_data"); return 0; }
|
|
|
|
resolve_and_return_wall_collisions_data(pos, offset, radius, collisionData);
|
|
|
|
smlua_push_vec3f(pos, 1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
/*
|
|
int smlua_func_vec3f_find_ceil(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3f_find_ceil", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f pos;
|
|
smlua_get_vec3f(pos, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3f_find_ceil"); return 0; }
|
|
f32 height = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3f_find_ceil"); return 0; }
|
|
// struct Surface** ceil = (struct Surface**)smlua_to_cobject(L, 3, LOT_???); <--- UNIMPLEMENTED
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "vec3f_find_ceil"); return 0; }
|
|
|
|
lua_pushnumber(L, vec3f_find_ceil(pos, height, ceil));
|
|
|
|
return 1;
|
|
}
|
|
*/
|
|
|
|
/*
|
|
int smlua_func_vec3f_mario_ceil(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3f_mario_ceil", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f pos;
|
|
smlua_get_vec3f(pos, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3f_mario_ceil"); return 0; }
|
|
f32 height = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3f_mario_ceil"); return 0; }
|
|
// struct Surface** ceil = (struct Surface**)smlua_to_cobject(L, 3, LOT_???); <--- UNIMPLEMENTED
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "vec3f_mario_ceil"); return 0; }
|
|
|
|
lua_pushnumber(L, vec3f_mario_ceil(pos, height, ceil));
|
|
|
|
return 1;
|
|
}
|
|
*/
|
|
|
|
int smlua_func_mario_facing_downhill(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mario_facing_downhill", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mario_facing_downhill"); return 0; }
|
|
s32 turnYaw = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mario_facing_downhill"); return 0; }
|
|
|
|
lua_pushinteger(L, mario_facing_downhill(m, turnYaw));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_floor_is_slippery(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mario_floor_is_slippery", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mario_floor_is_slippery"); return 0; }
|
|
|
|
lua_pushinteger(L, mario_floor_is_slippery(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_floor_is_slope(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mario_floor_is_slope", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mario_floor_is_slope"); return 0; }
|
|
|
|
lua_pushinteger(L, mario_floor_is_slope(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_floor_is_steep(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mario_floor_is_steep", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mario_floor_is_steep"); return 0; }
|
|
|
|
lua_pushinteger(L, mario_floor_is_steep(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_find_floor_height_relative_polar(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "find_floor_height_relative_polar", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "find_floor_height_relative_polar"); return 0; }
|
|
s16 angleFromMario = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "find_floor_height_relative_polar"); return 0; }
|
|
f32 distFromMario = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "find_floor_height_relative_polar"); return 0; }
|
|
|
|
lua_pushnumber(L, find_floor_height_relative_polar(m, angleFromMario, distFromMario));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_find_floor_slope(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "find_floor_slope", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "find_floor_slope"); return 0; }
|
|
s16 yawOffset = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "find_floor_slope"); return 0; }
|
|
|
|
lua_pushinteger(L, find_floor_slope(m, yawOffset));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_update_mario_sound_and_camera(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "update_mario_sound_and_camera", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "update_mario_sound_and_camera"); return 0; }
|
|
|
|
update_mario_sound_and_camera(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_steep_jump_action(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_steep_jump_action", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_steep_jump_action"); return 0; }
|
|
|
|
set_steep_jump_action(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_mario_y_vel_based_on_fspeed(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_mario_y_vel_based_on_fspeed", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_mario_y_vel_based_on_fspeed"); return 0; }
|
|
f32 initialVelY = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "set_mario_y_vel_based_on_fspeed"); return 0; }
|
|
f32 multiplier = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "set_mario_y_vel_based_on_fspeed"); return 0; }
|
|
|
|
set_mario_y_vel_based_on_fspeed(m, initialVelY, multiplier);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_mario_action(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_mario_action", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_mario_action"); return 0; }
|
|
u32 action = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "set_mario_action"); return 0; }
|
|
u32 actionArg = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "set_mario_action"); return 0; }
|
|
|
|
lua_pushinteger(L, set_mario_action(m, action, actionArg));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_jump_from_landing(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_jump_from_landing", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_jump_from_landing"); return 0; }
|
|
|
|
lua_pushinteger(L, set_jump_from_landing(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_jumping_action(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_jumping_action", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_jumping_action"); return 0; }
|
|
u32 action = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "set_jumping_action"); return 0; }
|
|
u32 actionArg = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "set_jumping_action"); return 0; }
|
|
|
|
lua_pushinteger(L, set_jumping_action(m, action, actionArg));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_drop_and_set_mario_action(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "drop_and_set_mario_action", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "drop_and_set_mario_action"); return 0; }
|
|
u32 action = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "drop_and_set_mario_action"); return 0; }
|
|
u32 actionArg = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "drop_and_set_mario_action"); return 0; }
|
|
|
|
lua_pushinteger(L, drop_and_set_mario_action(m, action, actionArg));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_hurt_and_set_mario_action(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "hurt_and_set_mario_action", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "hurt_and_set_mario_action"); return 0; }
|
|
u32 action = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "hurt_and_set_mario_action"); return 0; }
|
|
u32 actionArg = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "hurt_and_set_mario_action"); return 0; }
|
|
s16 hurtCounter = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "hurt_and_set_mario_action"); return 0; }
|
|
|
|
lua_pushinteger(L, hurt_and_set_mario_action(m, action, actionArg, hurtCounter));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_check_common_action_exits(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "check_common_action_exits", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "check_common_action_exits"); return 0; }
|
|
|
|
lua_pushinteger(L, check_common_action_exits(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_check_common_hold_action_exits(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "check_common_hold_action_exits", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "check_common_hold_action_exits"); return 0; }
|
|
|
|
lua_pushinteger(L, check_common_hold_action_exits(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_transition_submerged_to_walking(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "transition_submerged_to_walking", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "transition_submerged_to_walking"); return 0; }
|
|
|
|
lua_pushinteger(L, transition_submerged_to_walking(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_water_plunge_action(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_water_plunge_action", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_water_plunge_action"); return 0; }
|
|
|
|
lua_pushinteger(L, set_water_plunge_action(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_execute_mario_action(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "execute_mario_action", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "execute_mario_action"); return 0; }
|
|
|
|
lua_pushinteger(L, execute_mario_action(o));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_force_idle_state(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "force_idle_state", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "force_idle_state"); return 0; }
|
|
|
|
lua_pushinteger(L, force_idle_state(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_init_single_mario(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "init_single_mario", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "init_single_mario"); return 0; }
|
|
|
|
init_single_mario(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_mario_particle_flags(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_mario_particle_flags", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_mario_particle_flags"); return 0; }
|
|
u32 flags = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "set_mario_particle_flags"); return 0; }
|
|
u8 clear = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "set_mario_particle_flags"); return 0; }
|
|
|
|
set_mario_particle_flags(m, flags, clear);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_update_wall(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mario_update_wall", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mario_update_wall"); return 0; }
|
|
struct WallCollisionData* wcd = (struct WallCollisionData*)smlua_to_cobject(L, 2, LOT_WALLCOLLISIONDATA);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mario_update_wall"); return 0; }
|
|
|
|
mario_update_wall(m, wcd);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_mario_state_from_object(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_mario_state_from_object", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_mario_state_from_object"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_MARIOSTATE, get_mario_state_from_object(o), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
//////////////////////////////
|
|
// mario_actions_airborne.c //
|
|
//////////////////////////////
|
|
|
|
int smlua_func_play_flip_sounds(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_flip_sounds", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "play_flip_sounds"); return 0; }
|
|
s16 frame1 = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "play_flip_sounds"); return 0; }
|
|
s16 frame2 = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "play_flip_sounds"); return 0; }
|
|
s16 frame3 = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "play_flip_sounds"); return 0; }
|
|
|
|
extern void play_flip_sounds(struct MarioState *m, s16 frame1, s16 frame2, s16 frame3);
|
|
play_flip_sounds(m, frame1, frame2, frame3);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_far_fall_sound(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_far_fall_sound", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "play_far_fall_sound"); return 0; }
|
|
|
|
extern void play_far_fall_sound(struct MarioState *m);
|
|
play_far_fall_sound(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
#ifndef VERSION_JP
|
|
int smlua_func_play_knockback_sound(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_knockback_sound", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "play_knockback_sound"); return 0; }
|
|
|
|
extern void play_knockback_sound(struct MarioState *m);
|
|
play_knockback_sound(m);
|
|
|
|
return 1;
|
|
}
|
|
#endif
|
|
|
|
int smlua_func_lava_boost_on_wall(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "lava_boost_on_wall", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "lava_boost_on_wall"); return 0; }
|
|
|
|
extern s32 lava_boost_on_wall(struct MarioState *m);
|
|
lua_pushinteger(L, lava_boost_on_wall(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_check_fall_damage(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "check_fall_damage", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "check_fall_damage"); return 0; }
|
|
u32 hardFallAction = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "check_fall_damage"); return 0; }
|
|
|
|
extern s32 check_fall_damage(struct MarioState *m, u32 hardFallAction);
|
|
lua_pushinteger(L, check_fall_damage(m, hardFallAction));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_check_kick_or_dive_in_air(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "check_kick_or_dive_in_air", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "check_kick_or_dive_in_air"); return 0; }
|
|
|
|
extern s32 check_kick_or_dive_in_air(struct MarioState *m);
|
|
lua_pushinteger(L, check_kick_or_dive_in_air(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_should_get_stuck_in_ground(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "should_get_stuck_in_ground", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "should_get_stuck_in_ground"); return 0; }
|
|
|
|
extern s32 should_get_stuck_in_ground(struct MarioState *m);
|
|
lua_pushinteger(L, should_get_stuck_in_ground(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_check_fall_damage_or_get_stuck(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "check_fall_damage_or_get_stuck", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "check_fall_damage_or_get_stuck"); return 0; }
|
|
u32 hardFallAction = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "check_fall_damage_or_get_stuck"); return 0; }
|
|
|
|
extern s32 check_fall_damage_or_get_stuck(struct MarioState *m, u32 hardFallAction);
|
|
lua_pushinteger(L, check_fall_damage_or_get_stuck(m, hardFallAction));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_check_horizontal_wind(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "check_horizontal_wind", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "check_horizontal_wind"); return 0; }
|
|
|
|
extern s32 check_horizontal_wind(struct MarioState *m);
|
|
lua_pushinteger(L, check_horizontal_wind(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_update_air_with_turn(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "update_air_with_turn", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "update_air_with_turn"); return 0; }
|
|
|
|
extern void update_air_with_turn(struct MarioState *m);
|
|
update_air_with_turn(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_update_air_without_turn(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "update_air_without_turn", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "update_air_without_turn"); return 0; }
|
|
|
|
extern void update_air_without_turn(struct MarioState *m);
|
|
update_air_without_turn(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_update_lava_boost_or_twirling(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "update_lava_boost_or_twirling", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "update_lava_boost_or_twirling"); return 0; }
|
|
|
|
extern void update_lava_boost_or_twirling(struct MarioState *m);
|
|
update_lava_boost_or_twirling(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_update_flying_yaw(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "update_flying_yaw", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "update_flying_yaw"); return 0; }
|
|
|
|
extern void update_flying_yaw(struct MarioState *m);
|
|
update_flying_yaw(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_update_flying_pitch(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "update_flying_pitch", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "update_flying_pitch"); return 0; }
|
|
|
|
extern void update_flying_pitch(struct MarioState *m);
|
|
update_flying_pitch(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_update_flying(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "update_flying", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "update_flying"); return 0; }
|
|
|
|
extern void update_flying(struct MarioState *m);
|
|
update_flying(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_common_air_action_step(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "common_air_action_step", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "common_air_action_step"); return 0; }
|
|
u32 landAction = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "common_air_action_step"); return 0; }
|
|
s32 animation = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "common_air_action_step"); return 0; }
|
|
u32 stepArg = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "common_air_action_step"); return 0; }
|
|
|
|
extern u32 common_air_action_step(struct MarioState *m, u32 landAction, s32 animation, u32 stepArg);
|
|
lua_pushinteger(L, common_air_action_step(m, landAction, animation, stepArg));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_common_air_knockback_step(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 5) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "common_air_knockback_step", 5, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "common_air_knockback_step"); return 0; }
|
|
u32 landAction = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "common_air_knockback_step"); return 0; }
|
|
u32 hardFallAction = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "common_air_knockback_step"); return 0; }
|
|
s32 animation = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "common_air_knockback_step"); return 0; }
|
|
f32 speed = smlua_to_number(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "common_air_knockback_step"); return 0; }
|
|
|
|
extern u32 common_air_knockback_step(struct MarioState *m, u32 landAction, u32 hardFallAction, s32 animation, f32 speed);
|
|
lua_pushinteger(L, common_air_knockback_step(m, landAction, hardFallAction, animation, speed));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_check_wall_kick(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "check_wall_kick", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "check_wall_kick"); return 0; }
|
|
|
|
extern s32 check_wall_kick(struct MarioState *m);
|
|
lua_pushinteger(L, check_wall_kick(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_check_common_airborne_cancels(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "check_common_airborne_cancels", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "check_common_airborne_cancels"); return 0; }
|
|
|
|
extern s32 check_common_airborne_cancels(struct MarioState *m);
|
|
lua_pushinteger(L, check_common_airborne_cancels(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_execute_airborne_action(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mario_execute_airborne_action", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mario_execute_airborne_action"); return 0; }
|
|
|
|
extern s32 mario_execute_airborne_action(struct MarioState *m);
|
|
lua_pushinteger(L, mario_execute_airborne_action(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
///////////////////////////////
|
|
// mario_actions_automatic.c //
|
|
///////////////////////////////
|
|
|
|
int smlua_func_add_tree_leaf_particles(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "add_tree_leaf_particles", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "add_tree_leaf_particles"); return 0; }
|
|
|
|
extern void add_tree_leaf_particles(struct MarioState *m);
|
|
add_tree_leaf_particles(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_climbing_sounds(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_climbing_sounds", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "play_climbing_sounds"); return 0; }
|
|
s32 b = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "play_climbing_sounds"); return 0; }
|
|
|
|
extern void play_climbing_sounds(struct MarioState *m, s32 b);
|
|
play_climbing_sounds(m, b);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_pole_position(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_pole_position", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_pole_position"); return 0; }
|
|
f32 offsetY = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "set_pole_position"); return 0; }
|
|
|
|
extern s32 set_pole_position(struct MarioState *m, f32 offsetY);
|
|
lua_pushinteger(L, set_pole_position(m, offsetY));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_perform_hanging_step(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "perform_hanging_step", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "perform_hanging_step"); return 0; }
|
|
|
|
Vec3f nextPos;
|
|
smlua_get_vec3f(nextPos, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "perform_hanging_step"); return 0; }
|
|
|
|
extern s32 perform_hanging_step(struct MarioState *m, OUT Vec3f nextPos);
|
|
lua_pushinteger(L, perform_hanging_step(m, nextPos));
|
|
|
|
smlua_push_vec3f(nextPos, 2);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_update_hang_moving(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "update_hang_moving", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "update_hang_moving"); return 0; }
|
|
|
|
extern s32 update_hang_moving(struct MarioState *m);
|
|
lua_pushinteger(L, update_hang_moving(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_update_hang_stationary(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "update_hang_stationary", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "update_hang_stationary"); return 0; }
|
|
|
|
extern void update_hang_stationary(struct MarioState *m);
|
|
update_hang_stationary(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_let_go_of_ledge(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "let_go_of_ledge", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "let_go_of_ledge"); return 0; }
|
|
|
|
extern s32 let_go_of_ledge(struct MarioState *m);
|
|
lua_pushinteger(L, let_go_of_ledge(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_climb_up_ledge(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "climb_up_ledge", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "climb_up_ledge"); return 0; }
|
|
|
|
extern void climb_up_ledge(struct MarioState *m);
|
|
climb_up_ledge(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_update_ledge_climb_camera(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "update_ledge_climb_camera", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "update_ledge_climb_camera"); return 0; }
|
|
|
|
extern void update_ledge_climb_camera(struct MarioState *m);
|
|
update_ledge_climb_camera(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_update_ledge_climb(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "update_ledge_climb", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "update_ledge_climb"); return 0; }
|
|
s32 animation = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "update_ledge_climb"); return 0; }
|
|
u32 endAction = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "update_ledge_climb"); return 0; }
|
|
|
|
extern void update_ledge_climb(struct MarioState *m, s32 animation, u32 endAction);
|
|
update_ledge_climb(m, animation, endAction);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_pop_bubble(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mario_pop_bubble", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mario_pop_bubble"); return 0; }
|
|
|
|
extern void mario_pop_bubble(struct MarioState* m);
|
|
mario_pop_bubble(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_check_common_automatic_cancels(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "check_common_automatic_cancels", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "check_common_automatic_cancels"); return 0; }
|
|
|
|
extern s32 check_common_automatic_cancels(struct MarioState *m);
|
|
lua_pushinteger(L, check_common_automatic_cancels(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_execute_automatic_action(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mario_execute_automatic_action", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mario_execute_automatic_action"); return 0; }
|
|
|
|
extern s32 mario_execute_automatic_action(struct MarioState *m);
|
|
lua_pushinteger(L, mario_execute_automatic_action(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
//////////////////////////////
|
|
// mario_actions_cutscene.c //
|
|
//////////////////////////////
|
|
|
|
int smlua_func_get_credits_str_width(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_credits_str_width", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
char * str = (char *)smlua_to_cpointer(L, 1, LVT_STRING_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_credits_str_width"); return 0; }
|
|
|
|
extern s32 get_credits_str_width(char *str);
|
|
lua_pushinteger(L, get_credits_str_width(str));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_end_peach_loop(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_end_peach_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void bhv_end_peach_loop(void);
|
|
bhv_end_peach_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_end_toad_loop(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_end_toad_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void bhv_end_toad_loop(void);
|
|
bhv_end_toad_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_star_collection_dialog(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_star_collection_dialog", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_star_collection_dialog"); return 0; }
|
|
|
|
extern s32 get_star_collection_dialog(struct MarioState *m);
|
|
lua_pushinteger(L, get_star_collection_dialog(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_handle_save_menu(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "handle_save_menu", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "handle_save_menu"); return 0; }
|
|
|
|
extern void handle_save_menu(struct MarioState *m);
|
|
handle_save_menu(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cutscene_take_cap_off(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cutscene_take_cap_off", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cutscene_take_cap_off"); return 0; }
|
|
|
|
extern void cutscene_take_cap_off(struct MarioState *m);
|
|
cutscene_take_cap_off(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cutscene_put_cap_on(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cutscene_put_cap_on", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cutscene_put_cap_on"); return 0; }
|
|
|
|
extern void cutscene_put_cap_on(struct MarioState *m);
|
|
cutscene_put_cap_on(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_ready_to_speak(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mario_ready_to_speak", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mario_ready_to_speak"); return 0; }
|
|
|
|
extern s32 mario_ready_to_speak(struct MarioState* m);
|
|
lua_pushinteger(L, mario_ready_to_speak(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_should_start_or_continue_dialog(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "should_start_or_continue_dialog", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "should_start_or_continue_dialog"); return 0; }
|
|
struct Object* object = (struct Object*)smlua_to_cobject(L, 2, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "should_start_or_continue_dialog"); return 0; }
|
|
|
|
extern u8 should_start_or_continue_dialog(struct MarioState* m, struct Object* object);
|
|
lua_pushinteger(L, should_start_or_continue_dialog(m, object));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_general_star_dance_handler(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "general_star_dance_handler", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "general_star_dance_handler"); return 0; }
|
|
s32 isInWater = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "general_star_dance_handler"); return 0; }
|
|
|
|
extern void general_star_dance_handler(struct MarioState *m, s32 isInWater);
|
|
general_star_dance_handler(m, isInWater);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_common_death_handler(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "common_death_handler", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "common_death_handler"); return 0; }
|
|
s32 animation = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "common_death_handler"); return 0; }
|
|
s32 frameToDeathWarp = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "common_death_handler"); return 0; }
|
|
|
|
extern s32 common_death_handler(struct MarioState *m, s32 animation, s32 frameToDeathWarp);
|
|
lua_pushinteger(L, common_death_handler(m, animation, frameToDeathWarp));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_launch_mario_until_land(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "launch_mario_until_land", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "launch_mario_until_land"); return 0; }
|
|
s32 endAction = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "launch_mario_until_land"); return 0; }
|
|
s32 animation = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "launch_mario_until_land"); return 0; }
|
|
f32 forwardVel = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "launch_mario_until_land"); return 0; }
|
|
|
|
extern s32 launch_mario_until_land(struct MarioState *m, s32 endAction, s32 animation, f32 forwardVel);
|
|
lua_pushinteger(L, launch_mario_until_land(m, endAction, animation, forwardVel));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_stuck_in_ground_handler(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 6) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "stuck_in_ground_handler", 6, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "stuck_in_ground_handler"); return 0; }
|
|
s32 animation = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "stuck_in_ground_handler"); return 0; }
|
|
s32 unstuckFrame = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "stuck_in_ground_handler"); return 0; }
|
|
s32 target2 = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "stuck_in_ground_handler"); return 0; }
|
|
s32 target3 = smlua_to_integer(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "stuck_in_ground_handler"); return 0; }
|
|
s32 endAction = smlua_to_integer(L, 6);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 6, "stuck_in_ground_handler"); return 0; }
|
|
|
|
extern void stuck_in_ground_handler(struct MarioState *m, s32 animation, s32 unstuckFrame, s32 target2, s32 target3, s32 endAction);
|
|
stuck_in_ground_handler(m, animation, unstuckFrame, target2, target3, endAction);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_generate_yellow_sparkles(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "generate_yellow_sparkles", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 x = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "generate_yellow_sparkles"); return 0; }
|
|
s16 y = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "generate_yellow_sparkles"); return 0; }
|
|
s16 z = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "generate_yellow_sparkles"); return 0; }
|
|
f32 radius = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "generate_yellow_sparkles"); return 0; }
|
|
|
|
extern void generate_yellow_sparkles(s16 x, s16 y, s16 z, f32 radius);
|
|
generate_yellow_sparkles(x, y, z, radius);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_execute_cutscene_action(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mario_execute_cutscene_action", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mario_execute_cutscene_action"); return 0; }
|
|
|
|
extern s32 mario_execute_cutscene_action(struct MarioState *m);
|
|
lua_pushinteger(L, mario_execute_cutscene_action(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
////////////////////////////
|
|
// mario_actions_moving.c //
|
|
////////////////////////////
|
|
|
|
int smlua_func_tilt_body_running(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "tilt_body_running", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "tilt_body_running"); return 0; }
|
|
|
|
extern s16 tilt_body_running(struct MarioState *m);
|
|
lua_pushinteger(L, tilt_body_running(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_step_sound(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_step_sound", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "play_step_sound"); return 0; }
|
|
s16 frame1 = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "play_step_sound"); return 0; }
|
|
s16 frame2 = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "play_step_sound"); return 0; }
|
|
|
|
extern void play_step_sound(struct MarioState *m, s16 frame1, s16 frame2);
|
|
play_step_sound(m, frame1, frame2);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_align_with_floor(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "align_with_floor", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "align_with_floor"); return 0; }
|
|
|
|
extern void align_with_floor(struct MarioState *m);
|
|
align_with_floor(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_begin_walking_action(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "begin_walking_action", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "begin_walking_action"); return 0; }
|
|
f32 forwardVel = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "begin_walking_action"); return 0; }
|
|
u32 action = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "begin_walking_action"); return 0; }
|
|
u32 actionArg = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "begin_walking_action"); return 0; }
|
|
|
|
extern s32 begin_walking_action(struct MarioState *m, f32 forwardVel, u32 action, u32 actionArg);
|
|
lua_pushinteger(L, begin_walking_action(m, forwardVel, action, actionArg));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_check_ledge_climb_down(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "check_ledge_climb_down", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "check_ledge_climb_down"); return 0; }
|
|
|
|
extern void check_ledge_climb_down(struct MarioState *m);
|
|
check_ledge_climb_down(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_slide_bonk(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "slide_bonk", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "slide_bonk"); return 0; }
|
|
u32 fastAction = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "slide_bonk"); return 0; }
|
|
u32 slowAction = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "slide_bonk"); return 0; }
|
|
|
|
extern void slide_bonk(struct MarioState *m, u32 fastAction, u32 slowAction);
|
|
slide_bonk(m, fastAction, slowAction);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_triple_jump_action(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_triple_jump_action", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_triple_jump_action"); return 0; }
|
|
u32 action = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "set_triple_jump_action"); return 0; }
|
|
u32 actionArg = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "set_triple_jump_action"); return 0; }
|
|
|
|
extern s32 set_triple_jump_action(struct MarioState *m, UNUSED u32 action, UNUSED u32 actionArg);
|
|
lua_pushinteger(L, set_triple_jump_action(m, action, actionArg));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_update_sliding_angle(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "update_sliding_angle", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "update_sliding_angle"); return 0; }
|
|
f32 accel = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "update_sliding_angle"); return 0; }
|
|
f32 lossFactor = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "update_sliding_angle"); return 0; }
|
|
|
|
extern void update_sliding_angle(struct MarioState *m, f32 accel, f32 lossFactor);
|
|
update_sliding_angle(m, accel, lossFactor);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_update_sliding(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "update_sliding", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "update_sliding"); return 0; }
|
|
f32 stopSpeed = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "update_sliding"); return 0; }
|
|
|
|
extern s32 update_sliding(struct MarioState *m, f32 stopSpeed);
|
|
lua_pushinteger(L, update_sliding(m, stopSpeed));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_apply_slope_accel(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "apply_slope_accel", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "apply_slope_accel"); return 0; }
|
|
|
|
extern void apply_slope_accel(struct MarioState *m);
|
|
apply_slope_accel(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_apply_landing_accel(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "apply_landing_accel", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "apply_landing_accel"); return 0; }
|
|
f32 frictionFactor = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "apply_landing_accel"); return 0; }
|
|
|
|
extern s32 apply_landing_accel(struct MarioState *m, f32 frictionFactor);
|
|
lua_pushinteger(L, apply_landing_accel(m, frictionFactor));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_update_shell_speed(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "update_shell_speed", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "update_shell_speed"); return 0; }
|
|
|
|
extern void update_shell_speed(struct MarioState *m);
|
|
update_shell_speed(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_apply_slope_decel(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "apply_slope_decel", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "apply_slope_decel"); return 0; }
|
|
f32 decelCoef = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "apply_slope_decel"); return 0; }
|
|
|
|
extern s32 apply_slope_decel(struct MarioState *m, f32 decelCoef);
|
|
lua_pushinteger(L, apply_slope_decel(m, decelCoef));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_update_decelerating_speed(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "update_decelerating_speed", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "update_decelerating_speed"); return 0; }
|
|
|
|
extern s32 update_decelerating_speed(struct MarioState *m);
|
|
lua_pushinteger(L, update_decelerating_speed(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_update_walking_speed(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "update_walking_speed", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "update_walking_speed"); return 0; }
|
|
|
|
extern void update_walking_speed(struct MarioState *m);
|
|
update_walking_speed(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_should_begin_sliding(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "should_begin_sliding", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "should_begin_sliding"); return 0; }
|
|
|
|
extern s32 should_begin_sliding(struct MarioState *m);
|
|
lua_pushinteger(L, should_begin_sliding(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_analog_stick_held_back(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "analog_stick_held_back", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "analog_stick_held_back"); return 0; }
|
|
|
|
extern s32 analog_stick_held_back(struct MarioState *m);
|
|
lua_pushinteger(L, analog_stick_held_back(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_check_ground_dive_or_punch(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "check_ground_dive_or_punch", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "check_ground_dive_or_punch"); return 0; }
|
|
|
|
extern s32 check_ground_dive_or_punch(struct MarioState *m);
|
|
lua_pushinteger(L, check_ground_dive_or_punch(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_begin_braking_action(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "begin_braking_action", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "begin_braking_action"); return 0; }
|
|
|
|
extern s32 begin_braking_action(struct MarioState *m);
|
|
lua_pushinteger(L, begin_braking_action(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_anim_and_audio_for_walk(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "anim_and_audio_for_walk", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "anim_and_audio_for_walk"); return 0; }
|
|
|
|
extern void anim_and_audio_for_walk(struct MarioState *m);
|
|
anim_and_audio_for_walk(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_anim_and_audio_for_hold_walk(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "anim_and_audio_for_hold_walk", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "anim_and_audio_for_hold_walk"); return 0; }
|
|
|
|
extern void anim_and_audio_for_hold_walk(struct MarioState *m);
|
|
anim_and_audio_for_hold_walk(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_anim_and_audio_for_heavy_walk(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "anim_and_audio_for_heavy_walk", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "anim_and_audio_for_heavy_walk"); return 0; }
|
|
|
|
extern void anim_and_audio_for_heavy_walk(struct MarioState *m);
|
|
anim_and_audio_for_heavy_walk(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_push_or_sidle_wall(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "push_or_sidle_wall", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "push_or_sidle_wall"); return 0; }
|
|
|
|
Vec3f startPos;
|
|
smlua_get_vec3f(startPos, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "push_or_sidle_wall"); return 0; }
|
|
|
|
extern void push_or_sidle_wall(struct MarioState *m, Vec3f startPos);
|
|
push_or_sidle_wall(m, startPos);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_tilt_body_walking(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "tilt_body_walking", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "tilt_body_walking"); return 0; }
|
|
s16 startYaw = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "tilt_body_walking"); return 0; }
|
|
|
|
extern void tilt_body_walking(struct MarioState *m, s16 startYaw);
|
|
tilt_body_walking(m, startYaw);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_tilt_body_ground_shell(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "tilt_body_ground_shell", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "tilt_body_ground_shell"); return 0; }
|
|
s16 startYaw = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "tilt_body_ground_shell"); return 0; }
|
|
|
|
extern void tilt_body_ground_shell(struct MarioState *m, s16 startYaw);
|
|
tilt_body_ground_shell(m, startYaw);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_tilt_body_butt_slide(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "tilt_body_butt_slide", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "tilt_body_butt_slide"); return 0; }
|
|
|
|
extern void tilt_body_butt_slide(struct MarioState *m);
|
|
tilt_body_butt_slide(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_common_slide_action(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "common_slide_action", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "common_slide_action"); return 0; }
|
|
u32 endAction = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "common_slide_action"); return 0; }
|
|
u32 airAction = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "common_slide_action"); return 0; }
|
|
s32 animation = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "common_slide_action"); return 0; }
|
|
|
|
extern void common_slide_action(struct MarioState *m, u32 endAction, u32 airAction, s32 animation);
|
|
common_slide_action(m, endAction, airAction, animation);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_common_slide_action_with_jump(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 5) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "common_slide_action_with_jump", 5, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "common_slide_action_with_jump"); return 0; }
|
|
u32 stopAction = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "common_slide_action_with_jump"); return 0; }
|
|
u32 jumpAction = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "common_slide_action_with_jump"); return 0; }
|
|
u32 airAction = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "common_slide_action_with_jump"); return 0; }
|
|
s32 animation = smlua_to_integer(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "common_slide_action_with_jump"); return 0; }
|
|
|
|
extern s32 common_slide_action_with_jump(struct MarioState *m, u32 stopAction, u32 jumpAction, u32 airAction, s32 animation);
|
|
lua_pushinteger(L, common_slide_action_with_jump(m, stopAction, jumpAction, airAction, animation));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_stomach_slide_action(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "stomach_slide_action", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "stomach_slide_action"); return 0; }
|
|
u32 stopAction = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "stomach_slide_action"); return 0; }
|
|
u32 airAction = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "stomach_slide_action"); return 0; }
|
|
s32 animation = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "stomach_slide_action"); return 0; }
|
|
|
|
extern s32 stomach_slide_action(struct MarioState *m, u32 stopAction, u32 airAction, s32 animation);
|
|
lua_pushinteger(L, stomach_slide_action(m, stopAction, airAction, animation));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_common_ground_knockback_action(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 5) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "common_ground_knockback_action", 5, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "common_ground_knockback_action"); return 0; }
|
|
s32 animation = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "common_ground_knockback_action"); return 0; }
|
|
s32 arg2 = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "common_ground_knockback_action"); return 0; }
|
|
s32 arg3 = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "common_ground_knockback_action"); return 0; }
|
|
s32 arg4 = smlua_to_integer(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "common_ground_knockback_action"); return 0; }
|
|
|
|
extern s32 common_ground_knockback_action(struct MarioState *m, s32 animation, s32 arg2, s32 arg3, s32 arg4);
|
|
lua_pushinteger(L, common_ground_knockback_action(m, animation, arg2, arg3, arg4));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_common_landing_action(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "common_landing_action", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "common_landing_action"); return 0; }
|
|
s16 animation = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "common_landing_action"); return 0; }
|
|
u32 airAction = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "common_landing_action"); return 0; }
|
|
|
|
extern u32 common_landing_action(struct MarioState *m, s16 animation, u32 airAction);
|
|
lua_pushinteger(L, common_landing_action(m, animation, airAction));
|
|
|
|
return 1;
|
|
}
|
|
|
|
/*
|
|
int smlua_func_common_landing_cancels(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 5) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "common_landing_cancels", 5, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "common_landing_cancels"); return 0; }
|
|
struct LandingAction* landingAction = (struct LandingAction*)smlua_to_cobject(L, 2, LOT_LANDINGACTION);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "common_landing_cancels"); return 0; }
|
|
// s32 (*setAPressAction)(structMarioState* arg2 = (s32 (*setAPressAction)(structMarioState*)smlua_to_cobject(L, 3, LOT_???); <--- UNIMPLEMENTED
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "common_landing_cancels"); return 0; }
|
|
u32 arg3 = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "common_landing_cancels"); return 0; }
|
|
// u32) arg4 = (u32))smlua_to_cobject(L, 5, LOT_???); <--- UNIMPLEMENTED
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "common_landing_cancels"); return 0; }
|
|
|
|
extern s32 common_landing_cancels(struct MarioState *m, struct LandingAction *landingAction, s32 (*setAPressAction)(struct MarioState *, u32, u32));
|
|
lua_pushinteger(L, common_landing_cancels(m, landingAction, arg2, arg3, arg4));
|
|
|
|
return 1;
|
|
}
|
|
*/
|
|
|
|
int smlua_func_quicksand_jump_land_action(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 5) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "quicksand_jump_land_action", 5, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "quicksand_jump_land_action"); return 0; }
|
|
s32 animation1 = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "quicksand_jump_land_action"); return 0; }
|
|
s32 animation2 = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "quicksand_jump_land_action"); return 0; }
|
|
u32 endAction = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "quicksand_jump_land_action"); return 0; }
|
|
u32 airAction = smlua_to_integer(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "quicksand_jump_land_action"); return 0; }
|
|
|
|
extern s32 quicksand_jump_land_action(struct MarioState *m, s32 animation1, s32 animation2, u32 endAction, u32 airAction);
|
|
lua_pushinteger(L, quicksand_jump_land_action(m, animation1, animation2, endAction, airAction));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_check_common_moving_cancels(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "check_common_moving_cancels", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "check_common_moving_cancels"); return 0; }
|
|
|
|
extern s32 check_common_moving_cancels(struct MarioState *m);
|
|
lua_pushinteger(L, check_common_moving_cancels(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_execute_moving_action(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mario_execute_moving_action", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mario_execute_moving_action"); return 0; }
|
|
|
|
extern s32 mario_execute_moving_action(struct MarioState *m);
|
|
lua_pushinteger(L, mario_execute_moving_action(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
////////////////////////////
|
|
// mario_actions_object.c //
|
|
////////////////////////////
|
|
|
|
int smlua_func_animated_stationary_ground_step(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "animated_stationary_ground_step", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "animated_stationary_ground_step"); return 0; }
|
|
s32 animation = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "animated_stationary_ground_step"); return 0; }
|
|
u32 endAction = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "animated_stationary_ground_step"); return 0; }
|
|
|
|
extern void animated_stationary_ground_step(struct MarioState *m, s32 animation, u32 endAction);
|
|
animated_stationary_ground_step(m, animation, endAction);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_update_punch_sequence(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mario_update_punch_sequence", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mario_update_punch_sequence"); return 0; }
|
|
|
|
extern s32 mario_update_punch_sequence(struct MarioState *m);
|
|
lua_pushinteger(L, mario_update_punch_sequence(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_check_common_object_cancels(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "check_common_object_cancels", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "check_common_object_cancels"); return 0; }
|
|
|
|
extern s32 check_common_object_cancels(struct MarioState *m);
|
|
lua_pushinteger(L, check_common_object_cancels(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_execute_object_action(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mario_execute_object_action", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mario_execute_object_action"); return 0; }
|
|
|
|
extern s32 mario_execute_object_action(struct MarioState *m);
|
|
lua_pushinteger(L, mario_execute_object_action(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
////////////////////////////////
|
|
// mario_actions_stationary.c //
|
|
////////////////////////////////
|
|
|
|
int smlua_func_check_common_idle_cancels(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "check_common_idle_cancels", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "check_common_idle_cancels"); return 0; }
|
|
|
|
extern s32 check_common_idle_cancels(struct MarioState *m);
|
|
lua_pushinteger(L, check_common_idle_cancels(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_check_common_hold_idle_cancels(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "check_common_hold_idle_cancels", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "check_common_hold_idle_cancels"); return 0; }
|
|
|
|
extern s32 check_common_hold_idle_cancels(struct MarioState *m);
|
|
lua_pushinteger(L, check_common_hold_idle_cancels(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_anim_sound(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_anim_sound", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "play_anim_sound"); return 0; }
|
|
u32 actionState = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "play_anim_sound"); return 0; }
|
|
s32 animFrame = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "play_anim_sound"); return 0; }
|
|
u32 sound = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "play_anim_sound"); return 0; }
|
|
|
|
extern void play_anim_sound(struct MarioState *m, u32 actionState, s32 animFrame, u32 sound);
|
|
play_anim_sound(m, actionState, animFrame, sound);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_stopping_step(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "stopping_step", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "stopping_step"); return 0; }
|
|
s32 animID = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "stopping_step"); return 0; }
|
|
u32 action = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "stopping_step"); return 0; }
|
|
|
|
extern void stopping_step(struct MarioState *m, s32 animID, u32 action);
|
|
stopping_step(m, animID, action);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_landing_step(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "landing_step", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "landing_step"); return 0; }
|
|
s32 animID = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "landing_step"); return 0; }
|
|
u32 action = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "landing_step"); return 0; }
|
|
|
|
extern s32 landing_step(struct MarioState *m, s32 animID, u32 action);
|
|
lua_pushinteger(L, landing_step(m, animID, action));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_check_common_landing_cancels(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "check_common_landing_cancels", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "check_common_landing_cancels"); return 0; }
|
|
u32 action = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "check_common_landing_cancels"); return 0; }
|
|
|
|
extern s32 check_common_landing_cancels(struct MarioState *m, u32 action);
|
|
lua_pushinteger(L, check_common_landing_cancels(m, action));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_check_common_stationary_cancels(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "check_common_stationary_cancels", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "check_common_stationary_cancels"); return 0; }
|
|
|
|
extern s32 check_common_stationary_cancels(struct MarioState *m);
|
|
lua_pushinteger(L, check_common_stationary_cancels(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_execute_stationary_action(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mario_execute_stationary_action", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mario_execute_stationary_action"); return 0; }
|
|
|
|
extern s32 mario_execute_stationary_action(struct MarioState *m);
|
|
lua_pushinteger(L, mario_execute_stationary_action(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
///////////////////////////////
|
|
// mario_actions_submerged.c //
|
|
///////////////////////////////
|
|
|
|
int smlua_func_set_swimming_at_surface_particles(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_swimming_at_surface_particles", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_swimming_at_surface_particles"); return 0; }
|
|
u32 particleFlag = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "set_swimming_at_surface_particles"); return 0; }
|
|
|
|
extern void set_swimming_at_surface_particles(struct MarioState *m, u32 particleFlag);
|
|
set_swimming_at_surface_particles(m, particleFlag);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_perform_water_full_step(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "perform_water_full_step", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "perform_water_full_step"); return 0; }
|
|
|
|
Vec3f nextPos;
|
|
smlua_get_vec3f(nextPos, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "perform_water_full_step"); return 0; }
|
|
|
|
extern u32 perform_water_full_step(struct MarioState *m, OUT Vec3f nextPos);
|
|
lua_pushinteger(L, perform_water_full_step(m, nextPos));
|
|
|
|
smlua_push_vec3f(nextPos, 2);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_apply_water_current(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "apply_water_current", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "apply_water_current"); return 0; }
|
|
|
|
Vec3f step;
|
|
smlua_get_vec3f(step, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "apply_water_current"); return 0; }
|
|
|
|
extern void apply_water_current(struct MarioState *m, OUT Vec3f step);
|
|
apply_water_current(m, step);
|
|
|
|
smlua_push_vec3f(step, 2);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_perform_water_step(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "perform_water_step", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "perform_water_step"); return 0; }
|
|
|
|
extern u32 perform_water_step(struct MarioState *m);
|
|
lua_pushinteger(L, perform_water_step(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_float_surface_gfx(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "float_surface_gfx", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "float_surface_gfx"); return 0; }
|
|
|
|
extern void float_surface_gfx(struct MarioState *m);
|
|
float_surface_gfx(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_execute_submerged_action(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mario_execute_submerged_action", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mario_execute_submerged_action"); return 0; }
|
|
|
|
extern s32 mario_execute_submerged_action(struct MarioState *m);
|
|
lua_pushinteger(L, mario_execute_submerged_action(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
//////////////////
|
|
// mario_misc.h //
|
|
//////////////////
|
|
|
|
int smlua_func_bhv_toad_message_init(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_toad_message_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_toad_message_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_toad_message_loop(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_toad_message_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_toad_message_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_unlock_door_star_init(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_unlock_door_star_init", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_unlock_door_star_init();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_unlock_door_star_loop(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_unlock_door_star_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
bhv_unlock_door_star_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_geo_get_mario_state(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "geo_get_mario_state", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
smlua_push_object(L, LOT_MARIOSTATE, geo_get_mario_state(), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_geo_get_body_state(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "geo_get_body_state", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
smlua_push_object(L, LOT_MARIOBODYSTATE, geo_get_body_state(), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
//////////////////
|
|
// mario_step.h //
|
|
//////////////////
|
|
|
|
int smlua_func_get_additive_y_vel_for_jumps(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_additive_y_vel_for_jumps", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushnumber(L, get_additive_y_vel_for_jumps());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_bonk_reflection(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mario_bonk_reflection", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mario_bonk_reflection"); return 0; }
|
|
u8 negateSpeed = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mario_bonk_reflection"); return 0; }
|
|
|
|
mario_bonk_reflection(m, negateSpeed);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_init_bully_collision_data(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 7) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "init_bully_collision_data", 7, top);
|
|
return 0;
|
|
}
|
|
|
|
struct BullyCollisionData* data = (struct BullyCollisionData*)smlua_to_cobject(L, 1, LOT_BULLYCOLLISIONDATA);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "init_bully_collision_data"); return 0; }
|
|
f32 posX = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "init_bully_collision_data"); return 0; }
|
|
f32 posZ = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "init_bully_collision_data"); return 0; }
|
|
f32 forwardVel = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "init_bully_collision_data"); return 0; }
|
|
s16 yaw = smlua_to_integer(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "init_bully_collision_data"); return 0; }
|
|
f32 conversionRatio = smlua_to_number(L, 6);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 6, "init_bully_collision_data"); return 0; }
|
|
f32 radius = smlua_to_number(L, 7);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 7, "init_bully_collision_data"); return 0; }
|
|
|
|
init_bully_collision_data(data, posX, posZ, forwardVel, yaw, conversionRatio, radius);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_update_quicksand(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mario_update_quicksand", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mario_update_quicksand"); return 0; }
|
|
f32 sinkingSpeed = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mario_update_quicksand"); return 0; }
|
|
|
|
lua_pushinteger(L, mario_update_quicksand(m, sinkingSpeed));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_push_off_steep_floor(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mario_push_off_steep_floor", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mario_push_off_steep_floor"); return 0; }
|
|
u32 action = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mario_push_off_steep_floor"); return 0; }
|
|
u32 actionArg = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "mario_push_off_steep_floor"); return 0; }
|
|
|
|
lua_pushinteger(L, mario_push_off_steep_floor(m, action, actionArg));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_update_moving_sand(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mario_update_moving_sand", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mario_update_moving_sand"); return 0; }
|
|
|
|
lua_pushinteger(L, mario_update_moving_sand(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_update_windy_ground(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mario_update_windy_ground", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mario_update_windy_ground"); return 0; }
|
|
|
|
lua_pushinteger(L, mario_update_windy_ground(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_stop_and_set_height_to_floor(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "stop_and_set_height_to_floor", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "stop_and_set_height_to_floor"); return 0; }
|
|
|
|
stop_and_set_height_to_floor(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_stationary_ground_step(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "stationary_ground_step", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "stationary_ground_step"); return 0; }
|
|
|
|
lua_pushinteger(L, stationary_ground_step(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_perform_ground_step(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "perform_ground_step", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "perform_ground_step"); return 0; }
|
|
|
|
lua_pushinteger(L, perform_ground_step(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_perform_air_step(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "perform_air_step", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "perform_air_step"); return 0; }
|
|
u32 stepArg = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "perform_air_step"); return 0; }
|
|
|
|
lua_pushinteger(L, perform_air_step(m, stepArg));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_vel_from_pitch_and_yaw(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_vel_from_pitch_and_yaw", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_vel_from_pitch_and_yaw"); return 0; }
|
|
|
|
set_vel_from_pitch_and_yaw(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
/////////////////
|
|
// math_util.h //
|
|
/////////////////
|
|
|
|
int smlua_func_sins(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "sins", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 sm64Angle = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "sins"); return 0; }
|
|
|
|
lua_pushnumber(L, sins(sm64Angle));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_coss(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "coss", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 sm64Angle = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "coss"); return 0; }
|
|
|
|
lua_pushnumber(L, coss(sm64Angle));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_atan2s(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "atan2s", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 y = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "atan2s"); return 0; }
|
|
f32 x = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "atan2s"); return 0; }
|
|
|
|
lua_pushinteger(L, atan2s(y, x));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_atan2f(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "atan2f", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 a = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "atan2f"); return 0; }
|
|
f32 b = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "atan2f"); return 0; }
|
|
|
|
lua_pushnumber(L, atan2f(a, b));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_approach_s32(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "approach_s32", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 current = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "approach_s32"); return 0; }
|
|
s32 target = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "approach_s32"); return 0; }
|
|
s32 inc = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "approach_s32"); return 0; }
|
|
s32 dec = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "approach_s32"); return 0; }
|
|
|
|
lua_pushinteger(L, approach_s32(current, target, inc, dec));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_approach_f32(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "approach_f32", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 current = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "approach_f32"); return 0; }
|
|
f32 target = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "approach_f32"); return 0; }
|
|
f32 inc = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "approach_f32"); return 0; }
|
|
f32 dec = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "approach_f32"); return 0; }
|
|
|
|
lua_pushnumber(L, approach_f32(current, target, inc, dec));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_spline_get_weights(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "spline_get_weights", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "spline_get_weights"); return 0; }
|
|
|
|
Vec4f result;
|
|
smlua_get_vec4f(result, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "spline_get_weights"); return 0; }
|
|
f32 t = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "spline_get_weights"); return 0; }
|
|
s32 c = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "spline_get_weights"); return 0; }
|
|
|
|
spline_get_weights(m, result, t, c);
|
|
|
|
smlua_push_vec4f(result, 2);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_anim_spline_init(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "anim_spline_init", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "anim_spline_init"); return 0; }
|
|
Vec4s * keyFrames = (Vec4s *)smlua_to_cobject(L, 2, LOT_VEC4S);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "anim_spline_init"); return 0; }
|
|
|
|
anim_spline_init(m, keyFrames);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_anim_spline_poll(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "anim_spline_poll", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "anim_spline_poll"); return 0; }
|
|
|
|
Vec3f result;
|
|
smlua_get_vec3f(result, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "anim_spline_poll"); return 0; }
|
|
|
|
lua_pushinteger(L, anim_spline_poll(m, result));
|
|
|
|
smlua_push_vec3f(result, 2);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3f_rotate_zxy(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3f_rotate_zxy", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f v;
|
|
smlua_get_vec3f(v, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3f_rotate_zxy"); return 0; }
|
|
|
|
Vec3s rotate;
|
|
smlua_get_vec3s(rotate, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3f_rotate_zxy"); return 0; }
|
|
|
|
vec3f_rotate_zxy(v, rotate);
|
|
|
|
smlua_push_vec3f(v, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3f_rotate_around_n(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3f_rotate_around_n", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f dest;
|
|
smlua_get_vec3f(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3f_rotate_around_n"); return 0; }
|
|
|
|
Vec3f v;
|
|
smlua_get_vec3f(v, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3f_rotate_around_n"); return 0; }
|
|
|
|
Vec3f n;
|
|
smlua_get_vec3f(n, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "vec3f_rotate_around_n"); return 0; }
|
|
s16 r = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "vec3f_rotate_around_n"); return 0; }
|
|
|
|
vec3f_rotate_around_n(dest, v, n, r);
|
|
|
|
smlua_push_vec3f(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3f_project(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3f_project", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f dest;
|
|
smlua_get_vec3f(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3f_project"); return 0; }
|
|
|
|
Vec3f v;
|
|
smlua_get_vec3f(v, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3f_project"); return 0; }
|
|
|
|
Vec3f onto;
|
|
smlua_get_vec3f(onto, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "vec3f_project"); return 0; }
|
|
|
|
vec3f_project(dest, v, onto);
|
|
|
|
smlua_push_vec3f(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3f_transform(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 5) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3f_transform", 5, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f dest;
|
|
smlua_get_vec3f(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3f_transform"); return 0; }
|
|
|
|
Vec3f v;
|
|
smlua_get_vec3f(v, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3f_transform"); return 0; }
|
|
|
|
Vec3f translation;
|
|
smlua_get_vec3f(translation, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "vec3f_transform"); return 0; }
|
|
|
|
Vec3s rotation;
|
|
smlua_get_vec3s(rotation, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "vec3f_transform"); return 0; }
|
|
|
|
Vec3f scale;
|
|
smlua_get_vec3f(scale, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "vec3f_transform"); return 0; }
|
|
|
|
vec3f_transform(dest, v, translation, rotation, scale);
|
|
|
|
smlua_push_vec3f(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3f_get_dist_and_angle(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 5) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3f_get_dist_and_angle", 5, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f from;
|
|
smlua_get_vec3f(from, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3f_get_dist_and_angle"); return 0; }
|
|
|
|
Vec3f to;
|
|
smlua_get_vec3f(to, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3f_get_dist_and_angle"); return 0; }
|
|
f32 * dist = (f32 *)smlua_to_cpointer(L, 3, LVT_F32_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "vec3f_get_dist_and_angle"); return 0; }
|
|
s16 * pitch = (s16 *)smlua_to_cpointer(L, 4, LVT_S16_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "vec3f_get_dist_and_angle"); return 0; }
|
|
s16 * yaw = (s16 *)smlua_to_cpointer(L, 5, LVT_S16_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "vec3f_get_dist_and_angle"); return 0; }
|
|
|
|
vec3f_get_dist_and_angle(from, to, dist, pitch, yaw);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3f_set_dist_and_angle(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 5) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3f_set_dist_and_angle", 5, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f from;
|
|
smlua_get_vec3f(from, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3f_set_dist_and_angle"); return 0; }
|
|
|
|
Vec3f to;
|
|
smlua_get_vec3f(to, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3f_set_dist_and_angle"); return 0; }
|
|
f32 dist = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "vec3f_set_dist_and_angle"); return 0; }
|
|
s16 pitch = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "vec3f_set_dist_and_angle"); return 0; }
|
|
s16 yaw = smlua_to_integer(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "vec3f_set_dist_and_angle"); return 0; }
|
|
|
|
vec3f_set_dist_and_angle(from, to, dist, pitch, yaw);
|
|
|
|
smlua_push_vec3f(to, 2);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_find_vector_perpendicular_to_plane(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "find_vector_perpendicular_to_plane", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f dest;
|
|
smlua_get_vec3f(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "find_vector_perpendicular_to_plane"); return 0; }
|
|
|
|
Vec3f a;
|
|
smlua_get_vec3f(a, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "find_vector_perpendicular_to_plane"); return 0; }
|
|
|
|
Vec3f b;
|
|
smlua_get_vec3f(b, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "find_vector_perpendicular_to_plane"); return 0; }
|
|
|
|
Vec3f c;
|
|
smlua_get_vec3f(c, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "find_vector_perpendicular_to_plane"); return 0; }
|
|
|
|
find_vector_perpendicular_to_plane(dest, a, b, c);
|
|
|
|
smlua_push_vec3f(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mtxf_lookat(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mtxf_lookat", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Mat4 mtx;
|
|
smlua_get_mat4(mtx, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mtxf_lookat"); return 0; }
|
|
|
|
Vec3f from;
|
|
smlua_get_vec3f(from, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mtxf_lookat"); return 0; }
|
|
|
|
Vec3f to;
|
|
smlua_get_vec3f(to, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "mtxf_lookat"); return 0; }
|
|
s16 roll = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "mtxf_lookat"); return 0; }
|
|
|
|
mtxf_lookat(mtx, from, to, roll);
|
|
|
|
smlua_push_mat4(mtx, 1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mtxf_rotate_zxy_and_translate(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mtxf_rotate_zxy_and_translate", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Mat4 dest;
|
|
smlua_get_mat4(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mtxf_rotate_zxy_and_translate"); return 0; }
|
|
|
|
Vec3f translate;
|
|
smlua_get_vec3f(translate, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mtxf_rotate_zxy_and_translate"); return 0; }
|
|
|
|
Vec3s rotate;
|
|
smlua_get_vec3s(rotate, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "mtxf_rotate_zxy_and_translate"); return 0; }
|
|
|
|
mtxf_rotate_zxy_and_translate(dest, translate, rotate);
|
|
|
|
smlua_push_mat4(dest, 1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mtxf_rotate_xyz_and_translate(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mtxf_rotate_xyz_and_translate", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Mat4 dest;
|
|
smlua_get_mat4(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mtxf_rotate_xyz_and_translate"); return 0; }
|
|
|
|
Vec3f b;
|
|
smlua_get_vec3f(b, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mtxf_rotate_xyz_and_translate"); return 0; }
|
|
|
|
Vec3s c;
|
|
smlua_get_vec3s(c, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "mtxf_rotate_xyz_and_translate"); return 0; }
|
|
|
|
mtxf_rotate_xyz_and_translate(dest, b, c);
|
|
|
|
smlua_push_mat4(dest, 1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mtxf_billboard(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mtxf_billboard", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Mat4 dest;
|
|
smlua_get_mat4(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mtxf_billboard"); return 0; }
|
|
|
|
Mat4 mtx;
|
|
smlua_get_mat4(mtx, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mtxf_billboard"); return 0; }
|
|
|
|
Vec3f position;
|
|
smlua_get_vec3f(position, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "mtxf_billboard"); return 0; }
|
|
s16 angle = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "mtxf_billboard"); return 0; }
|
|
|
|
mtxf_billboard(dest, mtx, position, angle);
|
|
|
|
smlua_push_mat4(dest, 1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mtxf_cylboard(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mtxf_cylboard", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Mat4 dest;
|
|
smlua_get_mat4(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mtxf_cylboard"); return 0; }
|
|
|
|
Mat4 mtx;
|
|
smlua_get_mat4(mtx, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mtxf_cylboard"); return 0; }
|
|
|
|
Vec3f position;
|
|
smlua_get_vec3f(position, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "mtxf_cylboard"); return 0; }
|
|
s16 angle = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "mtxf_cylboard"); return 0; }
|
|
|
|
mtxf_cylboard(dest, mtx, position, angle);
|
|
|
|
smlua_push_mat4(dest, 1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mtxf_align_terrain_normal(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mtxf_align_terrain_normal", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Mat4 dest;
|
|
smlua_get_mat4(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mtxf_align_terrain_normal"); return 0; }
|
|
|
|
Vec3f upDir;
|
|
smlua_get_vec3f(upDir, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mtxf_align_terrain_normal"); return 0; }
|
|
|
|
Vec3f pos;
|
|
smlua_get_vec3f(pos, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "mtxf_align_terrain_normal"); return 0; }
|
|
s16 yaw = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "mtxf_align_terrain_normal"); return 0; }
|
|
|
|
mtxf_align_terrain_normal(dest, upDir, pos, yaw);
|
|
|
|
smlua_push_mat4(dest, 1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mtxf_align_terrain_triangle(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mtxf_align_terrain_triangle", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Mat4 mtx;
|
|
smlua_get_mat4(mtx, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mtxf_align_terrain_triangle"); return 0; }
|
|
|
|
Vec3f pos;
|
|
smlua_get_vec3f(pos, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mtxf_align_terrain_triangle"); return 0; }
|
|
s16 yaw = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "mtxf_align_terrain_triangle"); return 0; }
|
|
f32 radius = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "mtxf_align_terrain_triangle"); return 0; }
|
|
|
|
mtxf_align_terrain_triangle(mtx, pos, yaw, radius);
|
|
|
|
smlua_push_mat4(mtx, 1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mtxf_mul(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mtxf_mul", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Mat4 dest;
|
|
smlua_get_mat4(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mtxf_mul"); return 0; }
|
|
|
|
Mat4 a;
|
|
smlua_get_mat4(a, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mtxf_mul"); return 0; }
|
|
|
|
Mat4 b;
|
|
smlua_get_mat4(b, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "mtxf_mul"); return 0; }
|
|
|
|
mtxf_mul(dest, a, b);
|
|
|
|
smlua_push_mat4(dest, 1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mtxf_mul_vec3s(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mtxf_mul_vec3s", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Mat4 mtx;
|
|
smlua_get_mat4(mtx, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mtxf_mul_vec3s"); return 0; }
|
|
|
|
Vec3s b;
|
|
smlua_get_vec3s(b, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mtxf_mul_vec3s"); return 0; }
|
|
|
|
mtxf_mul_vec3s(mtx, b);
|
|
|
|
smlua_push_vec3s(b, 2);
|
|
|
|
lua_settop(L, 2);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mtxf_rotate_xy(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mtxf_rotate_xy", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Mat4 mtx;
|
|
smlua_get_mat4(mtx, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mtxf_rotate_xy"); return 0; }
|
|
s16 angle = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mtxf_rotate_xy"); return 0; }
|
|
|
|
mtxf_rotate_xy(mtx, angle);
|
|
|
|
smlua_push_mat4(mtx, 1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mtxf_inverse(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mtxf_inverse", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Mat4 dest;
|
|
smlua_get_mat4(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mtxf_inverse"); return 0; }
|
|
|
|
Mat4 src;
|
|
smlua_get_mat4(src, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mtxf_inverse"); return 0; }
|
|
|
|
mtxf_inverse(dest, src);
|
|
|
|
smlua_push_mat4(dest, 1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mtxf_inverse_non_affine(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mtxf_inverse_non_affine", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Mat4 dest;
|
|
smlua_get_mat4(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mtxf_inverse_non_affine"); return 0; }
|
|
|
|
Mat4 src;
|
|
smlua_get_mat4(src, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mtxf_inverse_non_affine"); return 0; }
|
|
|
|
lua_pushboolean(L, mtxf_inverse_non_affine(dest, src));
|
|
|
|
smlua_push_mat4(dest, 1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_pos_from_transform_mtx(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_pos_from_transform_mtx", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f dest;
|
|
smlua_get_vec3f(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_pos_from_transform_mtx"); return 0; }
|
|
|
|
Mat4 objMtx;
|
|
smlua_get_mat4(objMtx, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "get_pos_from_transform_mtx"); return 0; }
|
|
|
|
Mat4 camMtx;
|
|
smlua_get_mat4(camMtx, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "get_pos_from_transform_mtx"); return 0; }
|
|
|
|
get_pos_from_transform_mtx(dest, objMtx, camMtx);
|
|
|
|
smlua_push_vec3f(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
///////////////////
|
|
// math_util.inl //
|
|
///////////////////
|
|
|
|
int smlua_func_replace_value_if_not_zero(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "replace_value_if_not_zero", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 value = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "replace_value_if_not_zero"); return 0; }
|
|
f32 replacement = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "replace_value_if_not_zero"); return 0; }
|
|
|
|
lua_pushnumber(L, replace_value_if_not_zero(value, replacement));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_sm64_to_radians(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "sm64_to_radians", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 sm64Angle = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "sm64_to_radians"); return 0; }
|
|
|
|
lua_pushnumber(L, sm64_to_radians(sm64Angle));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_radians_to_sm64(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "radians_to_sm64", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 radiansAngle = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "radians_to_sm64"); return 0; }
|
|
|
|
lua_pushinteger(L, radians_to_sm64(radiansAngle));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_sm64_to_degrees(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "sm64_to_degrees", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 sm64Angle = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "sm64_to_degrees"); return 0; }
|
|
|
|
lua_pushnumber(L, sm64_to_degrees(sm64Angle));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_degrees_to_sm64(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "degrees_to_sm64", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 degreesAngle = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "degrees_to_sm64"); return 0; }
|
|
|
|
lua_pushinteger(L, degrees_to_sm64(degreesAngle));
|
|
|
|
return 1;
|
|
}
|
|
|
|
////////////////////////
|
|
// math_util_mat4.inl //
|
|
////////////////////////
|
|
|
|
int smlua_func_mtxf_zero(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mtxf_zero", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Mat4 mtx;
|
|
smlua_get_mat4(mtx, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mtxf_zero"); return 0; }
|
|
|
|
mtxf_zero(mtx);
|
|
|
|
smlua_push_mat4(mtx, 1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mtxf_copy(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mtxf_copy", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Mat4 dest;
|
|
smlua_get_mat4(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mtxf_copy"); return 0; }
|
|
|
|
Mat4 src;
|
|
smlua_get_mat4(src, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mtxf_copy"); return 0; }
|
|
|
|
mtxf_copy(dest, src);
|
|
|
|
smlua_push_mat4(dest, 1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mtxf_identity(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mtxf_identity", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Mat4 mtx;
|
|
smlua_get_mat4(mtx, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mtxf_identity"); return 0; }
|
|
|
|
mtxf_identity(mtx);
|
|
|
|
smlua_push_mat4(mtx, 1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mtxf_translate(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mtxf_translate", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Mat4 dest;
|
|
smlua_get_mat4(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mtxf_translate"); return 0; }
|
|
|
|
Vec3f b;
|
|
smlua_get_vec3f(b, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mtxf_translate"); return 0; }
|
|
|
|
mtxf_translate(dest, b);
|
|
|
|
smlua_push_mat4(dest, 1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mtxf_scale_vec3f(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mtxf_scale_vec3f", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Mat4 dest;
|
|
smlua_get_mat4(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mtxf_scale_vec3f"); return 0; }
|
|
|
|
Mat4 mtx;
|
|
smlua_get_mat4(mtx, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mtxf_scale_vec3f"); return 0; }
|
|
|
|
Vec3f s;
|
|
smlua_get_vec3f(s, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "mtxf_scale_vec3f"); return 0; }
|
|
|
|
mtxf_scale_vec3f(dest, mtx, s);
|
|
|
|
smlua_push_mat4(dest, 1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
/*
|
|
int smlua_func_mtxf_to_mtx(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mtxf_to_mtx", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
// Mtx * dest = (Mtx *)smlua_to_cobject(L, 1, LOT_???); <--- UNIMPLEMENTED
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mtxf_to_mtx"); return 0; }
|
|
|
|
Mat4 src;
|
|
smlua_get_mat4(src, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mtxf_to_mtx"); return 0; }
|
|
|
|
mtxf_to_mtx(dest, src);
|
|
|
|
return 1;
|
|
}
|
|
*/
|
|
|
|
/////////////////////////
|
|
// math_util_vec3f.inl //
|
|
/////////////////////////
|
|
|
|
int smlua_func_vec3f_zero(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3f_zero", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f v;
|
|
smlua_get_vec3f(v, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3f_zero"); return 0; }
|
|
|
|
vec3f_zero(v);
|
|
|
|
smlua_push_vec3f(v, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3f_copy(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3f_copy", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f dest;
|
|
smlua_get_vec3f(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3f_copy"); return 0; }
|
|
|
|
Vec3f src;
|
|
smlua_get_vec3f(src, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3f_copy"); return 0; }
|
|
|
|
vec3f_copy(dest, src);
|
|
|
|
smlua_push_vec3f(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3f_set(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3f_set", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f dest;
|
|
smlua_get_vec3f(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3f_set"); return 0; }
|
|
f32 x = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3f_set"); return 0; }
|
|
f32 y = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "vec3f_set"); return 0; }
|
|
f32 z = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "vec3f_set"); return 0; }
|
|
|
|
vec3f_set(dest, x, y, z);
|
|
|
|
smlua_push_vec3f(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3f_add(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3f_add", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f dest;
|
|
smlua_get_vec3f(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3f_add"); return 0; }
|
|
|
|
Vec3f a;
|
|
smlua_get_vec3f(a, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3f_add"); return 0; }
|
|
|
|
vec3f_add(dest, a);
|
|
|
|
smlua_push_vec3f(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3f_sum(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3f_sum", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f dest;
|
|
smlua_get_vec3f(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3f_sum"); return 0; }
|
|
|
|
Vec3f a;
|
|
smlua_get_vec3f(a, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3f_sum"); return 0; }
|
|
|
|
Vec3f b;
|
|
smlua_get_vec3f(b, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "vec3f_sum"); return 0; }
|
|
|
|
vec3f_sum(dest, a, b);
|
|
|
|
smlua_push_vec3f(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3f_sub(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3f_sub", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f dest;
|
|
smlua_get_vec3f(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3f_sub"); return 0; }
|
|
|
|
Vec3f a;
|
|
smlua_get_vec3f(a, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3f_sub"); return 0; }
|
|
|
|
vec3f_sub(dest, a);
|
|
|
|
smlua_push_vec3f(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3f_dif(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3f_dif", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f dest;
|
|
smlua_get_vec3f(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3f_dif"); return 0; }
|
|
|
|
Vec3f a;
|
|
smlua_get_vec3f(a, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3f_dif"); return 0; }
|
|
|
|
Vec3f b;
|
|
smlua_get_vec3f(b, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "vec3f_dif"); return 0; }
|
|
|
|
vec3f_dif(dest, a, b);
|
|
|
|
smlua_push_vec3f(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3f_mul(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3f_mul", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f dest;
|
|
smlua_get_vec3f(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3f_mul"); return 0; }
|
|
f32 a = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3f_mul"); return 0; }
|
|
|
|
vec3f_mul(dest, a);
|
|
|
|
smlua_push_vec3f(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3f_mult(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3f_mult", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f dest;
|
|
smlua_get_vec3f(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3f_mult"); return 0; }
|
|
|
|
Vec3f a;
|
|
smlua_get_vec3f(a, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3f_mult"); return 0; }
|
|
|
|
vec3f_mult(dest, a);
|
|
|
|
smlua_push_vec3f(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3f_prod(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3f_prod", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f dest;
|
|
smlua_get_vec3f(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3f_prod"); return 0; }
|
|
|
|
Vec3f a;
|
|
smlua_get_vec3f(a, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3f_prod"); return 0; }
|
|
|
|
Vec3f b;
|
|
smlua_get_vec3f(b, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "vec3f_prod"); return 0; }
|
|
|
|
vec3f_prod(dest, a, b);
|
|
|
|
smlua_push_vec3f(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3f_div(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3f_div", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f dest;
|
|
smlua_get_vec3f(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3f_div"); return 0; }
|
|
f32 a = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3f_div"); return 0; }
|
|
|
|
vec3f_div(dest, a);
|
|
|
|
smlua_push_vec3f(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3f_length(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3f_length", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f a;
|
|
smlua_get_vec3f(a, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3f_length"); return 0; }
|
|
|
|
lua_pushnumber(L, vec3f_length(a));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3f_normalize(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3f_normalize", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f v;
|
|
smlua_get_vec3f(v, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3f_normalize"); return 0; }
|
|
|
|
vec3f_normalize(v);
|
|
|
|
smlua_push_vec3f(v, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3f_set_magnitude(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3f_set_magnitude", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f v;
|
|
smlua_get_vec3f(v, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3f_set_magnitude"); return 0; }
|
|
f32 mag = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3f_set_magnitude"); return 0; }
|
|
|
|
vec3f_set_magnitude(v, mag);
|
|
|
|
smlua_push_vec3f(v, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3f_dot(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3f_dot", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f a;
|
|
smlua_get_vec3f(a, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3f_dot"); return 0; }
|
|
|
|
Vec3f b;
|
|
smlua_get_vec3f(b, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3f_dot"); return 0; }
|
|
|
|
lua_pushnumber(L, vec3f_dot(a, b));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3f_cross(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3f_cross", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f dest;
|
|
smlua_get_vec3f(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3f_cross"); return 0; }
|
|
|
|
Vec3f a;
|
|
smlua_get_vec3f(a, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3f_cross"); return 0; }
|
|
|
|
Vec3f b;
|
|
smlua_get_vec3f(b, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "vec3f_cross"); return 0; }
|
|
|
|
vec3f_cross(dest, a, b);
|
|
|
|
smlua_push_vec3f(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3f_combine(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 5) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3f_combine", 5, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f dest;
|
|
smlua_get_vec3f(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3f_combine"); return 0; }
|
|
|
|
Vec3f vecA;
|
|
smlua_get_vec3f(vecA, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3f_combine"); return 0; }
|
|
|
|
Vec3f vecB;
|
|
smlua_get_vec3f(vecB, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "vec3f_combine"); return 0; }
|
|
f32 sclA = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "vec3f_combine"); return 0; }
|
|
f32 sclB = smlua_to_number(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "vec3f_combine"); return 0; }
|
|
|
|
vec3f_combine(dest, vecA, vecB, sclA, sclB);
|
|
|
|
smlua_push_vec3f(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3f_dist(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3f_dist", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f v1;
|
|
smlua_get_vec3f(v1, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3f_dist"); return 0; }
|
|
|
|
Vec3f v2;
|
|
smlua_get_vec3f(v2, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3f_dist"); return 0; }
|
|
|
|
lua_pushnumber(L, vec3f_dist(v1, v2));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3f_hdist(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3f_hdist", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f v1;
|
|
smlua_get_vec3f(v1, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3f_hdist"); return 0; }
|
|
|
|
Vec3f v2;
|
|
smlua_get_vec3f(v2, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3f_hdist"); return 0; }
|
|
|
|
lua_pushnumber(L, vec3f_hdist(v1, v2));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3f_is_zero(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3f_is_zero", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f v;
|
|
smlua_get_vec3f(v, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3f_is_zero"); return 0; }
|
|
|
|
lua_pushboolean(L, vec3f_is_zero(v));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3f_to_vec3i(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3f_to_vec3i", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3i dest;
|
|
smlua_get_vec3i(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3f_to_vec3i"); return 0; }
|
|
|
|
Vec3f a;
|
|
smlua_get_vec3f(a, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3f_to_vec3i"); return 0; }
|
|
|
|
vec3f_to_vec3i(dest, a);
|
|
|
|
smlua_push_vec3i(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3f_to_vec3s(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3f_to_vec3s", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3s dest;
|
|
smlua_get_vec3s(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3f_to_vec3s"); return 0; }
|
|
|
|
Vec3f a;
|
|
smlua_get_vec3f(a, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3f_to_vec3s"); return 0; }
|
|
|
|
vec3f_to_vec3s(dest, a);
|
|
|
|
smlua_push_vec3s(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
/////////////////////////
|
|
// math_util_vec3i.inl //
|
|
/////////////////////////
|
|
|
|
int smlua_func_vec3i_zero(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3i_zero", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3i v;
|
|
smlua_get_vec3i(v, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3i_zero"); return 0; }
|
|
|
|
vec3i_zero(v);
|
|
|
|
smlua_push_vec3i(v, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3i_copy(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3i_copy", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3i dest;
|
|
smlua_get_vec3i(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3i_copy"); return 0; }
|
|
|
|
Vec3i src;
|
|
smlua_get_vec3i(src, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3i_copy"); return 0; }
|
|
|
|
vec3i_copy(dest, src);
|
|
|
|
smlua_push_vec3i(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3i_set(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3i_set", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3i dest;
|
|
smlua_get_vec3i(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3i_set"); return 0; }
|
|
s32 x = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3i_set"); return 0; }
|
|
s32 y = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "vec3i_set"); return 0; }
|
|
s32 z = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "vec3i_set"); return 0; }
|
|
|
|
vec3i_set(dest, x, y, z);
|
|
|
|
smlua_push_vec3i(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3i_add(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3i_add", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3i dest;
|
|
smlua_get_vec3i(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3i_add"); return 0; }
|
|
|
|
Vec3i a;
|
|
smlua_get_vec3i(a, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3i_add"); return 0; }
|
|
|
|
vec3i_add(dest, a);
|
|
|
|
smlua_push_vec3i(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3i_sum(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3i_sum", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3i dest;
|
|
smlua_get_vec3i(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3i_sum"); return 0; }
|
|
|
|
Vec3i a;
|
|
smlua_get_vec3i(a, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3i_sum"); return 0; }
|
|
|
|
Vec3i b;
|
|
smlua_get_vec3i(b, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "vec3i_sum"); return 0; }
|
|
|
|
vec3i_sum(dest, a, b);
|
|
|
|
smlua_push_vec3i(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3i_sub(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3i_sub", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3i dest;
|
|
smlua_get_vec3i(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3i_sub"); return 0; }
|
|
|
|
Vec3i a;
|
|
smlua_get_vec3i(a, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3i_sub"); return 0; }
|
|
|
|
vec3i_sub(dest, a);
|
|
|
|
smlua_push_vec3i(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3i_dif(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3i_dif", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3i dest;
|
|
smlua_get_vec3i(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3i_dif"); return 0; }
|
|
|
|
Vec3i a;
|
|
smlua_get_vec3i(a, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3i_dif"); return 0; }
|
|
|
|
Vec3i b;
|
|
smlua_get_vec3i(b, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "vec3i_dif"); return 0; }
|
|
|
|
vec3i_dif(dest, a, b);
|
|
|
|
smlua_push_vec3i(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3i_mul(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3i_mul", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3i dest;
|
|
smlua_get_vec3i(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3i_mul"); return 0; }
|
|
f32 a = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3i_mul"); return 0; }
|
|
|
|
vec3i_mul(dest, a);
|
|
|
|
smlua_push_vec3i(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3i_mult(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3i_mult", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3i dest;
|
|
smlua_get_vec3i(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3i_mult"); return 0; }
|
|
|
|
Vec3i a;
|
|
smlua_get_vec3i(a, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3i_mult"); return 0; }
|
|
|
|
vec3i_mult(dest, a);
|
|
|
|
smlua_push_vec3i(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3i_prod(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3i_prod", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3i dest;
|
|
smlua_get_vec3i(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3i_prod"); return 0; }
|
|
|
|
Vec3i a;
|
|
smlua_get_vec3i(a, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3i_prod"); return 0; }
|
|
|
|
Vec3i b;
|
|
smlua_get_vec3i(b, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "vec3i_prod"); return 0; }
|
|
|
|
vec3i_prod(dest, a, b);
|
|
|
|
smlua_push_vec3i(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3i_div(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3i_div", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3i dest;
|
|
smlua_get_vec3i(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3i_div"); return 0; }
|
|
f32 a = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3i_div"); return 0; }
|
|
|
|
vec3i_div(dest, a);
|
|
|
|
smlua_push_vec3i(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3i_length(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3i_length", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3i a;
|
|
smlua_get_vec3i(a, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3i_length"); return 0; }
|
|
|
|
lua_pushnumber(L, vec3i_length(a));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3i_normalize(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3i_normalize", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3i v;
|
|
smlua_get_vec3i(v, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3i_normalize"); return 0; }
|
|
|
|
vec3i_normalize(v);
|
|
|
|
smlua_push_vec3i(v, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3i_set_magnitude(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3i_set_magnitude", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3i v;
|
|
smlua_get_vec3i(v, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3i_set_magnitude"); return 0; }
|
|
f32 mag = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3i_set_magnitude"); return 0; }
|
|
|
|
vec3i_set_magnitude(v, mag);
|
|
|
|
smlua_push_vec3i(v, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3i_dot(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3i_dot", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3i a;
|
|
smlua_get_vec3i(a, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3i_dot"); return 0; }
|
|
|
|
Vec3i b;
|
|
smlua_get_vec3i(b, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3i_dot"); return 0; }
|
|
|
|
lua_pushnumber(L, vec3i_dot(a, b));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3i_cross(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3i_cross", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3i dest;
|
|
smlua_get_vec3i(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3i_cross"); return 0; }
|
|
|
|
Vec3i a;
|
|
smlua_get_vec3i(a, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3i_cross"); return 0; }
|
|
|
|
Vec3i b;
|
|
smlua_get_vec3i(b, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "vec3i_cross"); return 0; }
|
|
|
|
vec3i_cross(dest, a, b);
|
|
|
|
smlua_push_vec3i(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3i_combine(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 5) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3i_combine", 5, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3i dest;
|
|
smlua_get_vec3i(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3i_combine"); return 0; }
|
|
|
|
Vec3i vecA;
|
|
smlua_get_vec3i(vecA, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3i_combine"); return 0; }
|
|
|
|
Vec3i vecB;
|
|
smlua_get_vec3i(vecB, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "vec3i_combine"); return 0; }
|
|
f32 sclA = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "vec3i_combine"); return 0; }
|
|
f32 sclB = smlua_to_number(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "vec3i_combine"); return 0; }
|
|
|
|
vec3i_combine(dest, vecA, vecB, sclA, sclB);
|
|
|
|
smlua_push_vec3i(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3i_dist(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3i_dist", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3i v1;
|
|
smlua_get_vec3i(v1, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3i_dist"); return 0; }
|
|
|
|
Vec3i v2;
|
|
smlua_get_vec3i(v2, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3i_dist"); return 0; }
|
|
|
|
lua_pushnumber(L, vec3i_dist(v1, v2));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3i_hdist(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3i_hdist", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3i v1;
|
|
smlua_get_vec3i(v1, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3i_hdist"); return 0; }
|
|
|
|
Vec3i v2;
|
|
smlua_get_vec3i(v2, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3i_hdist"); return 0; }
|
|
|
|
lua_pushnumber(L, vec3i_hdist(v1, v2));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3i_is_zero(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3i_is_zero", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3i v;
|
|
smlua_get_vec3i(v, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3i_is_zero"); return 0; }
|
|
|
|
lua_pushboolean(L, vec3i_is_zero(v));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3i_to_vec3f(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3i_to_vec3f", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f dest;
|
|
smlua_get_vec3f(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3i_to_vec3f"); return 0; }
|
|
|
|
Vec3i a;
|
|
smlua_get_vec3i(a, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3i_to_vec3f"); return 0; }
|
|
|
|
vec3i_to_vec3f(dest, a);
|
|
|
|
smlua_push_vec3f(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3i_to_vec3s(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3i_to_vec3s", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3s dest;
|
|
smlua_get_vec3s(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3i_to_vec3s"); return 0; }
|
|
|
|
Vec3i a;
|
|
smlua_get_vec3i(a, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3i_to_vec3s"); return 0; }
|
|
|
|
vec3i_to_vec3s(dest, a);
|
|
|
|
smlua_push_vec3s(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
/////////////////////////
|
|
// math_util_vec3s.inl //
|
|
/////////////////////////
|
|
|
|
int smlua_func_vec3s_zero(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3s_zero", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3s v;
|
|
smlua_get_vec3s(v, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3s_zero"); return 0; }
|
|
|
|
vec3s_zero(v);
|
|
|
|
smlua_push_vec3s(v, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3s_copy(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3s_copy", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3s dest;
|
|
smlua_get_vec3s(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3s_copy"); return 0; }
|
|
|
|
Vec3s src;
|
|
smlua_get_vec3s(src, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3s_copy"); return 0; }
|
|
|
|
vec3s_copy(dest, src);
|
|
|
|
smlua_push_vec3s(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3s_set(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3s_set", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3s dest;
|
|
smlua_get_vec3s(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3s_set"); return 0; }
|
|
s16 x = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3s_set"); return 0; }
|
|
s16 y = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "vec3s_set"); return 0; }
|
|
s16 z = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "vec3s_set"); return 0; }
|
|
|
|
vec3s_set(dest, x, y, z);
|
|
|
|
smlua_push_vec3s(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3s_add(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3s_add", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3s dest;
|
|
smlua_get_vec3s(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3s_add"); return 0; }
|
|
|
|
Vec3s a;
|
|
smlua_get_vec3s(a, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3s_add"); return 0; }
|
|
|
|
vec3s_add(dest, a);
|
|
|
|
smlua_push_vec3s(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3s_sum(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3s_sum", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3s dest;
|
|
smlua_get_vec3s(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3s_sum"); return 0; }
|
|
|
|
Vec3s a;
|
|
smlua_get_vec3s(a, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3s_sum"); return 0; }
|
|
|
|
Vec3s b;
|
|
smlua_get_vec3s(b, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "vec3s_sum"); return 0; }
|
|
|
|
vec3s_sum(dest, a, b);
|
|
|
|
smlua_push_vec3s(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3s_sub(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3s_sub", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3s dest;
|
|
smlua_get_vec3s(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3s_sub"); return 0; }
|
|
|
|
Vec3s a;
|
|
smlua_get_vec3s(a, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3s_sub"); return 0; }
|
|
|
|
vec3s_sub(dest, a);
|
|
|
|
smlua_push_vec3s(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3s_dif(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3s_dif", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3s dest;
|
|
smlua_get_vec3s(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3s_dif"); return 0; }
|
|
|
|
Vec3s a;
|
|
smlua_get_vec3s(a, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3s_dif"); return 0; }
|
|
|
|
Vec3s b;
|
|
smlua_get_vec3s(b, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "vec3s_dif"); return 0; }
|
|
|
|
vec3s_dif(dest, a, b);
|
|
|
|
smlua_push_vec3s(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3s_mul(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3s_mul", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3s dest;
|
|
smlua_get_vec3s(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3s_mul"); return 0; }
|
|
f32 a = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3s_mul"); return 0; }
|
|
|
|
vec3s_mul(dest, a);
|
|
|
|
smlua_push_vec3s(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3s_mult(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3s_mult", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3s dest;
|
|
smlua_get_vec3s(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3s_mult"); return 0; }
|
|
|
|
Vec3s a;
|
|
smlua_get_vec3s(a, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3s_mult"); return 0; }
|
|
|
|
vec3s_mult(dest, a);
|
|
|
|
smlua_push_vec3s(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3s_prod(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3s_prod", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3s dest;
|
|
smlua_get_vec3s(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3s_prod"); return 0; }
|
|
|
|
Vec3s a;
|
|
smlua_get_vec3s(a, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3s_prod"); return 0; }
|
|
|
|
Vec3s b;
|
|
smlua_get_vec3s(b, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "vec3s_prod"); return 0; }
|
|
|
|
vec3s_prod(dest, a, b);
|
|
|
|
smlua_push_vec3s(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3s_div(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3s_div", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3s dest;
|
|
smlua_get_vec3s(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3s_div"); return 0; }
|
|
f32 a = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3s_div"); return 0; }
|
|
|
|
vec3s_div(dest, a);
|
|
|
|
smlua_push_vec3s(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3s_length(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3s_length", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3s a;
|
|
smlua_get_vec3s(a, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3s_length"); return 0; }
|
|
|
|
lua_pushnumber(L, vec3s_length(a));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3s_normalize(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3s_normalize", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3s v;
|
|
smlua_get_vec3s(v, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3s_normalize"); return 0; }
|
|
|
|
vec3s_normalize(v);
|
|
|
|
smlua_push_vec3s(v, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3s_set_magnitude(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3s_set_magnitude", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3s v;
|
|
smlua_get_vec3s(v, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3s_set_magnitude"); return 0; }
|
|
f32 mag = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3s_set_magnitude"); return 0; }
|
|
|
|
vec3s_set_magnitude(v, mag);
|
|
|
|
smlua_push_vec3s(v, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3s_dot(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3s_dot", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3s a;
|
|
smlua_get_vec3s(a, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3s_dot"); return 0; }
|
|
|
|
Vec3s b;
|
|
smlua_get_vec3s(b, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3s_dot"); return 0; }
|
|
|
|
lua_pushnumber(L, vec3s_dot(a, b));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3s_cross(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3s_cross", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3s dest;
|
|
smlua_get_vec3s(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3s_cross"); return 0; }
|
|
|
|
Vec3s a;
|
|
smlua_get_vec3s(a, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3s_cross"); return 0; }
|
|
|
|
Vec3s b;
|
|
smlua_get_vec3s(b, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "vec3s_cross"); return 0; }
|
|
|
|
vec3s_cross(dest, a, b);
|
|
|
|
smlua_push_vec3s(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3s_combine(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 5) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3s_combine", 5, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3s dest;
|
|
smlua_get_vec3s(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3s_combine"); return 0; }
|
|
|
|
Vec3s vecA;
|
|
smlua_get_vec3s(vecA, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3s_combine"); return 0; }
|
|
|
|
Vec3s vecB;
|
|
smlua_get_vec3s(vecB, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "vec3s_combine"); return 0; }
|
|
f32 sclA = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "vec3s_combine"); return 0; }
|
|
f32 sclB = smlua_to_number(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "vec3s_combine"); return 0; }
|
|
|
|
vec3s_combine(dest, vecA, vecB, sclA, sclB);
|
|
|
|
smlua_push_vec3s(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3s_dist(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3s_dist", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3s v1;
|
|
smlua_get_vec3s(v1, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3s_dist"); return 0; }
|
|
|
|
Vec3s v2;
|
|
smlua_get_vec3s(v2, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3s_dist"); return 0; }
|
|
|
|
lua_pushnumber(L, vec3s_dist(v1, v2));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3s_hdist(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3s_hdist", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3s v1;
|
|
smlua_get_vec3s(v1, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3s_hdist"); return 0; }
|
|
|
|
Vec3s v2;
|
|
smlua_get_vec3s(v2, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3s_hdist"); return 0; }
|
|
|
|
lua_pushnumber(L, vec3s_hdist(v1, v2));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3s_is_zero(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3s_is_zero", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3s v;
|
|
smlua_get_vec3s(v, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3s_is_zero"); return 0; }
|
|
|
|
lua_pushboolean(L, vec3s_is_zero(v));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3s_to_vec3f(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3s_to_vec3f", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f dest;
|
|
smlua_get_vec3f(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3s_to_vec3f"); return 0; }
|
|
|
|
Vec3s a;
|
|
smlua_get_vec3s(a, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3s_to_vec3f"); return 0; }
|
|
|
|
vec3s_to_vec3f(dest, a);
|
|
|
|
smlua_push_vec3f(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vec3s_to_vec3i(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vec3s_to_vec3i", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3i dest;
|
|
smlua_get_vec3i(dest, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vec3s_to_vec3i"); return 0; }
|
|
|
|
Vec3s a;
|
|
smlua_get_vec3s(a, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vec3s_to_vec3i"); return 0; }
|
|
|
|
vec3s_to_vec3i(dest, a);
|
|
|
|
smlua_push_vec3i(dest, 1);
|
|
|
|
lua_settop(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
////////////
|
|
// misc.h //
|
|
////////////
|
|
|
|
int smlua_func_smooth_step(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "smooth_step", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
float edge0 = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "smooth_step"); return 0; }
|
|
float edge1 = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "smooth_step"); return 0; }
|
|
float x = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "smooth_step"); return 0; }
|
|
|
|
lua_pushnumber(L, smooth_step(edge0, edge1, x));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_update_all_mario_stars(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "update_all_mario_stars", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
update_all_mario_stars();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_clock_elapsed(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "clock_elapsed", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushnumber(L, clock_elapsed());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_clock_elapsed_f64(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "clock_elapsed_f64", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushnumber(L, clock_elapsed_f64());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_clock_elapsed_ticks(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "clock_elapsed_ticks", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, clock_elapsed_ticks());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_clock_is_date(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "clock_is_date", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 month = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "clock_is_date"); return 0; }
|
|
u8 day = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "clock_is_date"); return 0; }
|
|
|
|
lua_pushboolean(L, clock_is_date(month, day));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_delta_interpolate_f32(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "delta_interpolate_f32", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 a = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "delta_interpolate_f32"); return 0; }
|
|
f32 b = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "delta_interpolate_f32"); return 0; }
|
|
f32 delta = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "delta_interpolate_f32"); return 0; }
|
|
|
|
lua_pushnumber(L, delta_interpolate_f32(a, b, delta));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_delta_interpolate_s32(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "delta_interpolate_s32", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 a = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "delta_interpolate_s32"); return 0; }
|
|
s32 b = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "delta_interpolate_s32"); return 0; }
|
|
f32 delta = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "delta_interpolate_s32"); return 0; }
|
|
|
|
lua_pushinteger(L, delta_interpolate_s32(a, b, delta));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_delta_interpolate_vec3f(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "delta_interpolate_vec3f", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f res;
|
|
smlua_get_vec3f(res, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "delta_interpolate_vec3f"); return 0; }
|
|
|
|
Vec3f a;
|
|
smlua_get_vec3f(a, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "delta_interpolate_vec3f"); return 0; }
|
|
|
|
Vec3f b;
|
|
smlua_get_vec3f(b, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "delta_interpolate_vec3f"); return 0; }
|
|
f32 delta = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "delta_interpolate_vec3f"); return 0; }
|
|
|
|
delta_interpolate_vec3f(res, a, b, delta);
|
|
|
|
smlua_push_vec3f(res, 1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_delta_interpolate_vec3s(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "delta_interpolate_vec3s", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3s res;
|
|
smlua_get_vec3s(res, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "delta_interpolate_vec3s"); return 0; }
|
|
|
|
Vec3s a;
|
|
smlua_get_vec3s(a, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "delta_interpolate_vec3s"); return 0; }
|
|
|
|
Vec3s b;
|
|
smlua_get_vec3s(b, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "delta_interpolate_vec3s"); return 0; }
|
|
f32 delta = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "delta_interpolate_vec3s"); return 0; }
|
|
|
|
delta_interpolate_vec3s(res, a, b, delta);
|
|
|
|
smlua_push_vec3s(res, 1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
//////////////
|
|
// mod_fs.h //
|
|
//////////////
|
|
|
|
int smlua_func_mod_fs_exists(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top < 0 || top > 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected between %u and %u, Received %u", "mod_fs_exists", 0, 1, top);
|
|
return 0;
|
|
}
|
|
|
|
const char* modPath = (const char*) NULL;
|
|
if (top >= 1) {
|
|
modPath = smlua_to_string(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_fs_exists"); return 0; }
|
|
}
|
|
|
|
lua_pushboolean(L, mod_fs_exists(modPath));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mod_fs_get(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top < 0 || top > 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected between %u and %u, Received %u", "mod_fs_get", 0, 1, top);
|
|
return 0;
|
|
}
|
|
|
|
const char* modPath = (const char*) NULL;
|
|
if (top >= 1) {
|
|
modPath = smlua_to_string(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_fs_get"); return 0; }
|
|
}
|
|
|
|
smlua_push_object(L, LOT_MODFS, mod_fs_get(modPath), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mod_fs_reload(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top < 0 || top > 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected between %u and %u, Received %u", "mod_fs_reload", 0, 1, top);
|
|
return 0;
|
|
}
|
|
|
|
const char* modPath = (const char*) NULL;
|
|
if (top >= 1) {
|
|
modPath = smlua_to_string(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_fs_reload"); return 0; }
|
|
}
|
|
|
|
smlua_push_object(L, LOT_MODFS, mod_fs_reload(modPath), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mod_fs_create(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_fs_create", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
smlua_push_object(L, LOT_MODFS, mod_fs_create(), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mod_fs_delete(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_fs_delete", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushboolean(L, mod_fs_delete());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mod_fs_save(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_fs_save", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushboolean(L, mod_fs_save());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mod_fs_set_public(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_fs_set_public", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
bool pub = smlua_to_boolean(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_fs_set_public"); return 0; }
|
|
|
|
lua_pushboolean(L, mod_fs_set_public(pub));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mod_fs_get_filename(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_fs_get_filename", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ModFs* modFs = (struct ModFs*)smlua_to_cobject(L, 1, LOT_MODFS);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_fs_get_filename"); return 0; }
|
|
u16 index = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mod_fs_get_filename"); return 0; }
|
|
|
|
lua_pushstring(L, mod_fs_get_filename(modFs, index));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mod_fs_get_file(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_fs_get_file", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ModFs* modFs = (struct ModFs*)smlua_to_cobject(L, 1, LOT_MODFS);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_fs_get_file"); return 0; }
|
|
const char* filepath = smlua_to_string(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mod_fs_get_file"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_MODFSFILE, mod_fs_get_file(modFs, filepath), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mod_fs_create_file(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_fs_create_file", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ModFs* modFs = (struct ModFs*)smlua_to_cobject(L, 1, LOT_MODFS);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_fs_create_file"); return 0; }
|
|
const char* filepath = smlua_to_string(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mod_fs_create_file"); return 0; }
|
|
bool text = smlua_to_boolean(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "mod_fs_create_file"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_MODFSFILE, mod_fs_create_file(modFs, filepath, text), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mod_fs_move_file(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_fs_move_file", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ModFs* modFs = (struct ModFs*)smlua_to_cobject(L, 1, LOT_MODFS);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_fs_move_file"); return 0; }
|
|
const char* oldpath = smlua_to_string(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mod_fs_move_file"); return 0; }
|
|
const char* newpath = smlua_to_string(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "mod_fs_move_file"); return 0; }
|
|
bool overwriteExisting = smlua_to_boolean(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "mod_fs_move_file"); return 0; }
|
|
|
|
lua_pushboolean(L, mod_fs_move_file(modFs, oldpath, newpath, overwriteExisting));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mod_fs_copy_file(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_fs_copy_file", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ModFs* modFs = (struct ModFs*)smlua_to_cobject(L, 1, LOT_MODFS);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_fs_copy_file"); return 0; }
|
|
const char* srcpath = smlua_to_string(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mod_fs_copy_file"); return 0; }
|
|
const char* dstpath = smlua_to_string(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "mod_fs_copy_file"); return 0; }
|
|
bool overwriteExisting = smlua_to_boolean(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "mod_fs_copy_file"); return 0; }
|
|
|
|
lua_pushboolean(L, mod_fs_copy_file(modFs, srcpath, dstpath, overwriteExisting));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mod_fs_delete_file(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_fs_delete_file", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ModFs* modFs = (struct ModFs*)smlua_to_cobject(L, 1, LOT_MODFS);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_fs_delete_file"); return 0; }
|
|
const char* filepath = smlua_to_string(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mod_fs_delete_file"); return 0; }
|
|
|
|
lua_pushboolean(L, mod_fs_delete_file(modFs, filepath));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mod_fs_clear(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_fs_clear", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ModFs* modFs = (struct ModFs*)smlua_to_cobject(L, 1, LOT_MODFS);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_fs_clear"); return 0; }
|
|
|
|
lua_pushboolean(L, mod_fs_clear(modFs));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mod_fs_file_read_bool(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_fs_file_read_bool", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ModFsFile* file = (struct ModFsFile*)smlua_to_cobject(L, 1, LOT_MODFSFILE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_fs_file_read_bool"); return 0; }
|
|
|
|
lua_pushboolean(L, mod_fs_file_read_bool(file));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mod_fs_file_read_integer(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_fs_file_read_integer", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ModFsFile* file = (struct ModFsFile*)smlua_to_cobject(L, 1, LOT_MODFSFILE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_fs_file_read_integer"); return 0; }
|
|
int intType = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mod_fs_file_read_integer"); return 0; }
|
|
|
|
lua_pushinteger(L, mod_fs_file_read_integer(file, intType));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mod_fs_file_read_number(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_fs_file_read_number", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ModFsFile* file = (struct ModFsFile*)smlua_to_cobject(L, 1, LOT_MODFSFILE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_fs_file_read_number"); return 0; }
|
|
int floatType = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mod_fs_file_read_number"); return 0; }
|
|
|
|
lua_pushnumber(L, mod_fs_file_read_number(file, floatType));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mod_fs_file_read_bytes(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_fs_file_read_bytes", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ModFsFile* file = (struct ModFsFile*)smlua_to_cobject(L, 1, LOT_MODFSFILE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_fs_file_read_bytes"); return 0; }
|
|
u32 length = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mod_fs_file_read_bytes"); return 0; }
|
|
|
|
smlua_push_bytestring(L, mod_fs_file_read_bytes(file, length));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mod_fs_file_read_string(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_fs_file_read_string", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ModFsFile* file = (struct ModFsFile*)smlua_to_cobject(L, 1, LOT_MODFSFILE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_fs_file_read_string"); return 0; }
|
|
|
|
lua_pushstring(L, mod_fs_file_read_string(file));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mod_fs_file_read_line(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_fs_file_read_line", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ModFsFile* file = (struct ModFsFile*)smlua_to_cobject(L, 1, LOT_MODFSFILE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_fs_file_read_line"); return 0; }
|
|
|
|
lua_pushstring(L, mod_fs_file_read_line(file));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mod_fs_file_write_bool(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_fs_file_write_bool", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ModFsFile* file = (struct ModFsFile*)smlua_to_cobject(L, 1, LOT_MODFSFILE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_fs_file_write_bool"); return 0; }
|
|
bool value = smlua_to_boolean(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mod_fs_file_write_bool"); return 0; }
|
|
|
|
lua_pushboolean(L, mod_fs_file_write_bool(file, value));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mod_fs_file_write_integer(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_fs_file_write_integer", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ModFsFile* file = (struct ModFsFile*)smlua_to_cobject(L, 1, LOT_MODFSFILE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_fs_file_write_integer"); return 0; }
|
|
lua_Integer value = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mod_fs_file_write_integer"); return 0; }
|
|
int intType = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "mod_fs_file_write_integer"); return 0; }
|
|
|
|
lua_pushboolean(L, mod_fs_file_write_integer(file, value, intType));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mod_fs_file_write_number(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_fs_file_write_number", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ModFsFile* file = (struct ModFsFile*)smlua_to_cobject(L, 1, LOT_MODFSFILE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_fs_file_write_number"); return 0; }
|
|
lua_Number value = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mod_fs_file_write_number"); return 0; }
|
|
int floatType = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "mod_fs_file_write_number"); return 0; }
|
|
|
|
lua_pushboolean(L, mod_fs_file_write_number(file, value, floatType));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mod_fs_file_write_bytes(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_fs_file_write_bytes", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ModFsFile* file = (struct ModFsFile*)smlua_to_cobject(L, 1, LOT_MODFSFILE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_fs_file_write_bytes"); return 0; }
|
|
ByteString bytestring = smlua_to_bytestring(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mod_fs_file_write_bytes"); return 0; }
|
|
|
|
lua_pushboolean(L, mod_fs_file_write_bytes(file, bytestring));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mod_fs_file_write_string(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_fs_file_write_string", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ModFsFile* file = (struct ModFsFile*)smlua_to_cobject(L, 1, LOT_MODFSFILE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_fs_file_write_string"); return 0; }
|
|
const char* str = smlua_to_string(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mod_fs_file_write_string"); return 0; }
|
|
|
|
lua_pushboolean(L, mod_fs_file_write_string(file, str));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mod_fs_file_write_line(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_fs_file_write_line", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ModFsFile* file = (struct ModFsFile*)smlua_to_cobject(L, 1, LOT_MODFSFILE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_fs_file_write_line"); return 0; }
|
|
const char* str = smlua_to_string(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mod_fs_file_write_line"); return 0; }
|
|
|
|
lua_pushboolean(L, mod_fs_file_write_line(file, str));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mod_fs_file_seek(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_fs_file_seek", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ModFsFile* file = (struct ModFsFile*)smlua_to_cobject(L, 1, LOT_MODFSFILE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_fs_file_seek"); return 0; }
|
|
s32 offset = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mod_fs_file_seek"); return 0; }
|
|
int origin = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "mod_fs_file_seek"); return 0; }
|
|
|
|
lua_pushboolean(L, mod_fs_file_seek(file, offset, origin));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mod_fs_file_is_eof(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_fs_file_is_eof", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ModFsFile* file = (struct ModFsFile*)smlua_to_cobject(L, 1, LOT_MODFSFILE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_fs_file_is_eof"); return 0; }
|
|
|
|
lua_pushboolean(L, mod_fs_file_is_eof(file));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mod_fs_file_fill(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_fs_file_fill", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ModFsFile* file = (struct ModFsFile*)smlua_to_cobject(L, 1, LOT_MODFSFILE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_fs_file_fill"); return 0; }
|
|
u8 byte = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mod_fs_file_fill"); return 0; }
|
|
u32 length = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "mod_fs_file_fill"); return 0; }
|
|
|
|
lua_pushboolean(L, mod_fs_file_fill(file, byte, length));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mod_fs_file_erase(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_fs_file_erase", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ModFsFile* file = (struct ModFsFile*)smlua_to_cobject(L, 1, LOT_MODFSFILE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_fs_file_erase"); return 0; }
|
|
u32 length = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mod_fs_file_erase"); return 0; }
|
|
|
|
lua_pushboolean(L, mod_fs_file_erase(file, length));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mod_fs_file_set_public(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_fs_file_set_public", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ModFsFile* file = (struct ModFsFile*)smlua_to_cobject(L, 1, LOT_MODFSFILE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_fs_file_set_public"); return 0; }
|
|
bool pub = smlua_to_boolean(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mod_fs_file_set_public"); return 0; }
|
|
|
|
lua_pushboolean(L, mod_fs_file_set_public(file, pub));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mod_fs_hide_errors(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_fs_hide_errors", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
bool hide = smlua_to_boolean(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_fs_hide_errors"); return 0; }
|
|
|
|
mod_fs_hide_errors(hide);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mod_fs_get_last_error(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_fs_get_last_error", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushstring(L, mod_fs_get_last_error());
|
|
|
|
return 1;
|
|
}
|
|
|
|
///////////////////
|
|
// mod_storage.h //
|
|
///////////////////
|
|
|
|
int smlua_func_mod_storage_save(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_storage_save", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
const char* key = smlua_to_string(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_storage_save"); return 0; }
|
|
const char* value = smlua_to_string(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mod_storage_save"); return 0; }
|
|
|
|
lua_pushboolean(L, mod_storage_save(key, value));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mod_storage_save_number(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_storage_save_number", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
const char* key = smlua_to_string(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_storage_save_number"); return 0; }
|
|
f32 value = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mod_storage_save_number"); return 0; }
|
|
|
|
lua_pushboolean(L, mod_storage_save_number(key, value));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mod_storage_save_bool(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_storage_save_bool", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
const char* key = smlua_to_string(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_storage_save_bool"); return 0; }
|
|
bool value = smlua_to_boolean(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mod_storage_save_bool"); return 0; }
|
|
|
|
lua_pushboolean(L, mod_storage_save_bool(key, value));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mod_storage_load(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_storage_load", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
const char* key = smlua_to_string(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_storage_load"); return 0; }
|
|
|
|
lua_pushstring(L, mod_storage_load(key));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mod_storage_load_number(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_storage_load_number", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
const char* key = smlua_to_string(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_storage_load_number"); return 0; }
|
|
|
|
lua_pushnumber(L, mod_storage_load_number(key));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mod_storage_load_bool(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_storage_load_bool", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
const char* key = smlua_to_string(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_storage_load_bool"); return 0; }
|
|
|
|
lua_pushboolean(L, mod_storage_load_bool(key));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mod_storage_exists(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_storage_exists", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
const char* key = smlua_to_string(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_storage_exists"); return 0; }
|
|
|
|
lua_pushboolean(L, mod_storage_exists(key));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mod_storage_remove(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_storage_remove", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
const char* key = smlua_to_string(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_storage_remove"); return 0; }
|
|
|
|
lua_pushboolean(L, mod_storage_remove(key));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mod_storage_clear(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_storage_clear", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushboolean(L, mod_storage_clear());
|
|
|
|
return 1;
|
|
}
|
|
|
|
//////////////////////
|
|
// network_player.h //
|
|
//////////////////////
|
|
|
|
int smlua_func_network_player_connected_count(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "network_player_connected_count", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, network_player_connected_count());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_network_player_set_description(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 6) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "network_player_set_description", 6, top);
|
|
return 0;
|
|
}
|
|
|
|
struct NetworkPlayer* np = (struct NetworkPlayer*)smlua_to_cobject(L, 1, LOT_NETWORKPLAYER);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "network_player_set_description"); return 0; }
|
|
const char* description = smlua_to_string(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "network_player_set_description"); return 0; }
|
|
u8 r = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "network_player_set_description"); return 0; }
|
|
u8 g = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "network_player_set_description"); return 0; }
|
|
u8 b = smlua_to_integer(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "network_player_set_description"); return 0; }
|
|
u8 a = smlua_to_integer(L, 6);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 6, "network_player_set_description"); return 0; }
|
|
|
|
network_player_set_description(np, description, r, g, b, a);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_network_player_set_override_location(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "network_player_set_override_location", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct NetworkPlayer* np = (struct NetworkPlayer*)smlua_to_cobject(L, 1, LOT_NETWORKPLAYER);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "network_player_set_override_location"); return 0; }
|
|
const char* location = smlua_to_string(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "network_player_set_override_location"); return 0; }
|
|
|
|
network_player_set_override_location(np, location);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_network_player_from_global_index(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "network_player_from_global_index", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 globalIndex = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "network_player_from_global_index"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_NETWORKPLAYER, network_player_from_global_index(globalIndex), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_network_player_from_level(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_network_player_from_level", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 courseNum = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_network_player_from_level"); return 0; }
|
|
s16 actNum = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "get_network_player_from_level"); return 0; }
|
|
s16 levelNum = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "get_network_player_from_level"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_NETWORKPLAYER, get_network_player_from_level(courseNum, actNum, levelNum), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_network_player_from_area(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_network_player_from_area", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 courseNum = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_network_player_from_area"); return 0; }
|
|
s16 actNum = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "get_network_player_from_area"); return 0; }
|
|
s16 levelNum = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "get_network_player_from_area"); return 0; }
|
|
s16 areaIndex = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "get_network_player_from_area"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_NETWORKPLAYER, get_network_player_from_area(courseNum, actNum, levelNum, areaIndex), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_network_player_smallest_global(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_network_player_smallest_global", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
smlua_push_object(L, LOT_NETWORKPLAYER, get_network_player_smallest_global(), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_network_player_get_palette_color_channel(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "network_player_get_palette_color_channel", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct NetworkPlayer* np = (struct NetworkPlayer*)smlua_to_cobject(L, 1, LOT_NETWORKPLAYER);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "network_player_get_palette_color_channel"); return 0; }
|
|
int part = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "network_player_get_palette_color_channel"); return 0; }
|
|
u8 index = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "network_player_get_palette_color_channel"); return 0; }
|
|
|
|
lua_pushinteger(L, network_player_get_palette_color_channel(np, part, index));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_network_player_get_override_palette_color_channel(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "network_player_get_override_palette_color_channel", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct NetworkPlayer* np = (struct NetworkPlayer*)smlua_to_cobject(L, 1, LOT_NETWORKPLAYER);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "network_player_get_override_palette_color_channel"); return 0; }
|
|
int part = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "network_player_get_override_palette_color_channel"); return 0; }
|
|
u8 index = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "network_player_get_override_palette_color_channel"); return 0; }
|
|
|
|
lua_pushinteger(L, network_player_get_override_palette_color_channel(np, part, index));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_network_player_set_override_palette_color(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "network_player_set_override_palette_color", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct NetworkPlayer* np = (struct NetworkPlayer*)smlua_to_cobject(L, 1, LOT_NETWORKPLAYER);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "network_player_set_override_palette_color"); return 0; }
|
|
int part = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "network_player_set_override_palette_color"); return 0; }
|
|
|
|
Color color;
|
|
smlua_get_color(color, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "network_player_set_override_palette_color"); return 0; }
|
|
|
|
network_player_set_override_palette_color(np, part, color);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_network_player_reset_override_palette(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "network_player_reset_override_palette", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct NetworkPlayer* np = (struct NetworkPlayer*)smlua_to_cobject(L, 1, LOT_NETWORKPLAYER);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "network_player_reset_override_palette"); return 0; }
|
|
|
|
network_player_reset_override_palette(np);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_network_player_is_override_palette_same(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "network_player_is_override_palette_same", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct NetworkPlayer* np = (struct NetworkPlayer*)smlua_to_cobject(L, 1, LOT_NETWORKPLAYER);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "network_player_is_override_palette_same"); return 0; }
|
|
|
|
lua_pushboolean(L, network_player_is_override_palette_same(np));
|
|
|
|
return 1;
|
|
}
|
|
|
|
/////////////////////
|
|
// network_utils.h //
|
|
/////////////////////
|
|
|
|
int smlua_func_network_global_index_from_local(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "network_global_index_from_local", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 localIndex = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "network_global_index_from_local"); return 0; }
|
|
|
|
lua_pushinteger(L, network_global_index_from_local(localIndex));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_network_local_index_from_global(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "network_local_index_from_global", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 globalIndex = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "network_local_index_from_global"); return 0; }
|
|
|
|
lua_pushinteger(L, network_local_index_from_global(globalIndex));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_network_is_server(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "network_is_server", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushboolean(L, network_is_server());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_network_is_moderator(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "network_is_moderator", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushboolean(L, network_is_moderator());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_network_get_player_text_color_string(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "network_get_player_text_color_string", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 localIndex = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "network_get_player_text_color_string"); return 0; }
|
|
|
|
lua_pushstring(L, network_get_player_text_color_string(localIndex));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_network_check_singleplayer_pause(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "network_check_singleplayer_pause", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushboolean(L, network_check_singleplayer_pause());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_network_discord_id_from_local_index(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "network_discord_id_from_local_index", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 localIndex = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "network_discord_id_from_local_index"); return 0; }
|
|
|
|
lua_pushstring(L, network_discord_id_from_local_index(localIndex));
|
|
|
|
return 1;
|
|
}
|
|
|
|
/////////////////////
|
|
// obj_behaviors.c //
|
|
/////////////////////
|
|
|
|
int smlua_func_set_yoshi_as_not_dead(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_yoshi_as_not_dead", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void set_yoshi_as_not_dead(void);
|
|
set_yoshi_as_not_dead();
|
|
|
|
return 1;
|
|
}
|
|
|
|
/*
|
|
int smlua_func_geo_obj_transparency_something(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "geo_obj_transparency_something", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 callContext = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "geo_obj_transparency_something"); return 0; }
|
|
// struct GraphNode* node = (struct GraphNode*)smlua_to_cobject(L, 2, LOT_GRAPHNODE); <--- UNIMPLEMENTED
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "geo_obj_transparency_something"); return 0; }
|
|
Mat4 * mtx = (Mat4 *)smlua_to_cobject(L, 3, LOT_MAT4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "geo_obj_transparency_something"); return 0; }
|
|
|
|
extern Gfx UNUSED *geo_obj_transparency_something(s32 callContext, struct GraphNode *node, UNUSED Mat4 *mtx);
|
|
smlua_push_object(L, LOT_GFX, geo_obj_transparency_something(callContext, node, mtx), NULL);
|
|
|
|
return 1;
|
|
}
|
|
*/
|
|
|
|
int smlua_func_absf_2(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "absf_2", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 f = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "absf_2"); return 0; }
|
|
|
|
extern f32 absf_2(f32 f);
|
|
lua_pushnumber(L, absf_2(f));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_find_wall(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 5) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_find_wall", 5, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 objNewX = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_find_wall"); return 0; }
|
|
f32 objY = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_find_wall"); return 0; }
|
|
f32 objNewZ = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_find_wall"); return 0; }
|
|
f32 objVelX = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "obj_find_wall"); return 0; }
|
|
f32 objVelZ = smlua_to_number(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "obj_find_wall"); return 0; }
|
|
|
|
extern s8 obj_find_wall(f32 objNewX, f32 objY, f32 objNewZ, f32 objVelX, f32 objVelZ);
|
|
lua_pushinteger(L, obj_find_wall(objNewX, objY, objNewZ, objVelX, objVelZ));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_turn_obj_away_from_steep_floor(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "turn_obj_away_from_steep_floor", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Surface* objFloor = (struct Surface*)smlua_to_cobject(L, 1, LOT_SURFACE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "turn_obj_away_from_steep_floor"); return 0; }
|
|
f32 floorY = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "turn_obj_away_from_steep_floor"); return 0; }
|
|
f32 objVelX = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "turn_obj_away_from_steep_floor"); return 0; }
|
|
f32 objVelZ = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "turn_obj_away_from_steep_floor"); return 0; }
|
|
|
|
extern s8 turn_obj_away_from_steep_floor(struct Surface *objFloor, f32 floorY, f32 objVelX, f32 objVelZ);
|
|
lua_pushinteger(L, turn_obj_away_from_steep_floor(objFloor, floorY, objVelX, objVelZ));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_orient_graph(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_orient_graph", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_orient_graph"); return 0; }
|
|
f32 normalX = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_orient_graph"); return 0; }
|
|
f32 normalY = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_orient_graph"); return 0; }
|
|
f32 normalZ = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "obj_orient_graph"); return 0; }
|
|
|
|
extern void obj_orient_graph(struct Object *obj, f32 normalX, f32 normalY, f32 normalZ);
|
|
obj_orient_graph(obj, normalX, normalY, normalZ);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_calc_obj_friction(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "calc_obj_friction", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 * objFriction = (f32 *)smlua_to_cpointer(L, 1, LVT_F32_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "calc_obj_friction"); return 0; }
|
|
f32 floor_nY = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "calc_obj_friction"); return 0; }
|
|
|
|
extern void calc_obj_friction(f32 *objFriction, f32 floor_nY);
|
|
calc_obj_friction(objFriction, floor_nY);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_calc_new_obj_vel_and_pos_y(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "calc_new_obj_vel_and_pos_y", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Surface* objFloor = (struct Surface*)smlua_to_cobject(L, 1, LOT_SURFACE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "calc_new_obj_vel_and_pos_y"); return 0; }
|
|
f32 objFloorY = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "calc_new_obj_vel_and_pos_y"); return 0; }
|
|
f32 objVelX = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "calc_new_obj_vel_and_pos_y"); return 0; }
|
|
f32 objVelZ = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "calc_new_obj_vel_and_pos_y"); return 0; }
|
|
|
|
extern void calc_new_obj_vel_and_pos_y(struct Surface *objFloor, f32 objFloorY, f32 objVelX, f32 objVelZ);
|
|
calc_new_obj_vel_and_pos_y(objFloor, objFloorY, objVelX, objVelZ);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_calc_new_obj_vel_and_pos_y_underwater(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 5) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "calc_new_obj_vel_and_pos_y_underwater", 5, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Surface* objFloor = (struct Surface*)smlua_to_cobject(L, 1, LOT_SURFACE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "calc_new_obj_vel_and_pos_y_underwater"); return 0; }
|
|
f32 floorY = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "calc_new_obj_vel_and_pos_y_underwater"); return 0; }
|
|
f32 objVelX = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "calc_new_obj_vel_and_pos_y_underwater"); return 0; }
|
|
f32 objVelZ = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "calc_new_obj_vel_and_pos_y_underwater"); return 0; }
|
|
f32 waterY = smlua_to_number(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "calc_new_obj_vel_and_pos_y_underwater"); return 0; }
|
|
|
|
extern void calc_new_obj_vel_and_pos_y_underwater(struct Surface *objFloor, f32 floorY, f32 objVelX, f32 objVelZ, f32 waterY);
|
|
calc_new_obj_vel_and_pos_y_underwater(objFloor, floorY, objVelX, objVelZ, waterY);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_update_pos_vel_xz(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_update_pos_vel_xz", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void obj_update_pos_vel_xz(void);
|
|
obj_update_pos_vel_xz();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_splash(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_splash", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 waterY = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_splash"); return 0; }
|
|
s32 objY = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_splash"); return 0; }
|
|
|
|
extern void obj_splash(s32 waterY, s32 objY);
|
|
obj_splash(waterY, objY);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_object_step(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "object_step", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern s16 object_step(void);
|
|
lua_pushinteger(L, object_step());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_object_step_without_floor_orient(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "object_step_without_floor_orient", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern s16 object_step_without_floor_orient(void);
|
|
lua_pushinteger(L, object_step_without_floor_orient());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_move_xyz_using_fvel_and_yaw(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_move_xyz_using_fvel_and_yaw", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_move_xyz_using_fvel_and_yaw"); return 0; }
|
|
|
|
extern void obj_move_xyz_using_fvel_and_yaw(struct Object *obj);
|
|
obj_move_xyz_using_fvel_and_yaw(obj);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_is_point_within_radius_of_mario(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "is_point_within_radius_of_mario", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 x = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "is_point_within_radius_of_mario"); return 0; }
|
|
f32 y = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "is_point_within_radius_of_mario"); return 0; }
|
|
f32 z = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "is_point_within_radius_of_mario"); return 0; }
|
|
s32 dist = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "is_point_within_radius_of_mario"); return 0; }
|
|
|
|
extern s8 is_point_within_radius_of_mario(f32 x, f32 y, f32 z, s32 dist);
|
|
lua_pushinteger(L, is_point_within_radius_of_mario(x, y, z, dist));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_is_point_within_radius_of_any_player(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "is_point_within_radius_of_any_player", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 x = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "is_point_within_radius_of_any_player"); return 0; }
|
|
f32 y = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "is_point_within_radius_of_any_player"); return 0; }
|
|
f32 z = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "is_point_within_radius_of_any_player"); return 0; }
|
|
s32 dist = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "is_point_within_radius_of_any_player"); return 0; }
|
|
|
|
extern s8 is_point_within_radius_of_any_player(f32 x, f32 y, f32 z, s32 dist);
|
|
lua_pushinteger(L, is_point_within_radius_of_any_player(x, y, z, dist));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_is_player_active(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "is_player_active", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "is_player_active"); return 0; }
|
|
|
|
extern u8 is_player_active(struct MarioState* m);
|
|
lua_pushinteger(L, is_player_active(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_is_other_player_active(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "is_other_player_active", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern u8 is_other_player_active(void);
|
|
lua_pushinteger(L, is_other_player_active());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_is_player_in_local_area(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "is_player_in_local_area", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "is_player_in_local_area"); return 0; }
|
|
|
|
extern u8 is_player_in_local_area(struct MarioState* m);
|
|
lua_pushinteger(L, is_player_in_local_area(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_nearest_mario_state_to_object(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "nearest_mario_state_to_object", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "nearest_mario_state_to_object"); return 0; }
|
|
|
|
extern struct MarioState* nearest_mario_state_to_object(struct Object *obj);
|
|
smlua_push_object(L, LOT_MARIOSTATE, nearest_mario_state_to_object(obj), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_nearest_possible_mario_state_to_object(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "nearest_possible_mario_state_to_object", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "nearest_possible_mario_state_to_object"); return 0; }
|
|
|
|
extern struct MarioState* nearest_possible_mario_state_to_object(struct Object *obj);
|
|
smlua_push_object(L, LOT_MARIOSTATE, nearest_possible_mario_state_to_object(obj), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_nearest_player_to_object(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "nearest_player_to_object", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "nearest_player_to_object"); return 0; }
|
|
|
|
extern struct Object* nearest_player_to_object(struct Object *obj);
|
|
smlua_push_object(L, LOT_OBJECT, nearest_player_to_object(obj), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_nearest_interacting_mario_state_to_object(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "nearest_interacting_mario_state_to_object", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "nearest_interacting_mario_state_to_object"); return 0; }
|
|
|
|
extern struct MarioState *nearest_interacting_mario_state_to_object(struct Object *obj);
|
|
smlua_push_object(L, LOT_MARIOSTATE, nearest_interacting_mario_state_to_object(obj), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_nearest_interacting_player_to_object(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "nearest_interacting_player_to_object", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "nearest_interacting_player_to_object"); return 0; }
|
|
|
|
extern struct Object *nearest_interacting_player_to_object(struct Object *obj);
|
|
smlua_push_object(L, LOT_OBJECT, nearest_interacting_player_to_object(obj), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_is_nearest_mario_state_to_object(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "is_nearest_mario_state_to_object", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "is_nearest_mario_state_to_object"); return 0; }
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 2, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "is_nearest_mario_state_to_object"); return 0; }
|
|
|
|
extern u8 is_nearest_mario_state_to_object(struct MarioState *m, struct Object *obj);
|
|
lua_pushinteger(L, is_nearest_mario_state_to_object(m, obj));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_is_nearest_player_to_object(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "is_nearest_player_to_object", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* m = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "is_nearest_player_to_object"); return 0; }
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 2, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "is_nearest_player_to_object"); return 0; }
|
|
|
|
extern u8 is_nearest_player_to_object(struct Object *m, struct Object *obj);
|
|
lua_pushinteger(L, is_nearest_player_to_object(m, obj));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_is_point_close_to_object(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 5) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "is_point_close_to_object", 5, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "is_point_close_to_object"); return 0; }
|
|
f32 x = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "is_point_close_to_object"); return 0; }
|
|
f32 y = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "is_point_close_to_object"); return 0; }
|
|
f32 z = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "is_point_close_to_object"); return 0; }
|
|
s32 dist = smlua_to_integer(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "is_point_close_to_object"); return 0; }
|
|
|
|
extern s8 is_point_close_to_object(struct Object *obj, f32 x, f32 y, f32 z, s32 dist);
|
|
lua_pushinteger(L, is_point_close_to_object(obj, x, y, z, dist));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_object_visibility(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_object_visibility", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_object_visibility"); return 0; }
|
|
s32 dist = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "set_object_visibility"); return 0; }
|
|
|
|
extern void set_object_visibility(struct Object *obj, s32 dist);
|
|
set_object_visibility(obj, dist);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_return_home_if_safe(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 5) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_return_home_if_safe", 5, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_return_home_if_safe"); return 0; }
|
|
f32 homeX = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_return_home_if_safe"); return 0; }
|
|
f32 y = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_return_home_if_safe"); return 0; }
|
|
f32 homeZ = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "obj_return_home_if_safe"); return 0; }
|
|
s32 dist = smlua_to_integer(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "obj_return_home_if_safe"); return 0; }
|
|
|
|
extern s8 obj_return_home_if_safe(struct Object *obj, f32 homeX, f32 y, f32 homeZ, s32 dist);
|
|
lua_pushinteger(L, obj_return_home_if_safe(obj, homeX, y, homeZ, dist));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_return_and_displace_home(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 5) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_return_and_displace_home", 5, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_return_and_displace_home"); return 0; }
|
|
f32 homeX = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_return_and_displace_home"); return 0; }
|
|
f32 homeY = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_return_and_displace_home"); return 0; }
|
|
f32 homeZ = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "obj_return_and_displace_home"); return 0; }
|
|
s32 baseDisp = smlua_to_integer(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "obj_return_and_displace_home"); return 0; }
|
|
|
|
extern void obj_return_and_displace_home(struct Object *obj, f32 homeX, UNUSED f32 homeY, f32 homeZ, s32 baseDisp);
|
|
obj_return_and_displace_home(obj, homeX, homeY, homeZ, baseDisp);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_check_if_facing_toward_angle(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_check_if_facing_toward_angle", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
u32 base = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_check_if_facing_toward_angle"); return 0; }
|
|
u32 goal = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_check_if_facing_toward_angle"); return 0; }
|
|
s16 range = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_check_if_facing_toward_angle"); return 0; }
|
|
|
|
extern s8 obj_check_if_facing_toward_angle(u32 base, u32 goal, s16 range);
|
|
lua_pushinteger(L, obj_check_if_facing_toward_angle(base, goal, range));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_find_wall_displacement(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 5) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_find_wall_displacement", 5, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f dist;
|
|
smlua_get_vec3f(dist, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_find_wall_displacement"); return 0; }
|
|
f32 x = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_find_wall_displacement"); return 0; }
|
|
f32 y = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_find_wall_displacement"); return 0; }
|
|
f32 z = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "obj_find_wall_displacement"); return 0; }
|
|
f32 radius = smlua_to_number(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "obj_find_wall_displacement"); return 0; }
|
|
|
|
extern s8 obj_find_wall_displacement(OUT Vec3f dist, f32 x, f32 y, f32 z, f32 radius);
|
|
lua_pushinteger(L, obj_find_wall_displacement(dist, x, y, z, radius));
|
|
|
|
smlua_push_vec3f(dist, 1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_spawn_yellow_coins(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_spawn_yellow_coins", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_spawn_yellow_coins"); return 0; }
|
|
s8 nCoins = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_spawn_yellow_coins"); return 0; }
|
|
|
|
extern void obj_spawn_yellow_coins(struct Object *obj, s8 nCoins);
|
|
obj_spawn_yellow_coins(obj, nCoins);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_flicker_and_disappear(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_flicker_and_disappear", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_flicker_and_disappear"); return 0; }
|
|
s16 lifeSpan = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_flicker_and_disappear"); return 0; }
|
|
|
|
extern s8 obj_flicker_and_disappear(struct Object *obj, s16 lifeSpan);
|
|
lua_pushinteger(L, obj_flicker_and_disappear(obj, lifeSpan));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_current_mario_room_check(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "current_mario_room_check", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 room = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "current_mario_room_check"); return 0; }
|
|
|
|
extern s8 current_mario_room_check(s16 room);
|
|
lua_pushinteger(L, current_mario_room_check(room));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_check_floor_death(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_check_floor_death", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 collisionFlags = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_check_floor_death"); return 0; }
|
|
struct Surface* floor = (struct Surface*)smlua_to_cobject(L, 2, LOT_SURFACE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_check_floor_death"); return 0; }
|
|
|
|
extern void obj_check_floor_death(s16 collisionFlags, struct Surface *floor);
|
|
obj_check_floor_death(collisionFlags, floor);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_lava_death(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_lava_death", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern s8 obj_lava_death(void);
|
|
lua_pushinteger(L, obj_lava_death());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_spawn_orange_number(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "spawn_orange_number", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
s8 behParam = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "spawn_orange_number"); return 0; }
|
|
s16 relX = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "spawn_orange_number"); return 0; }
|
|
s16 relY = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "spawn_orange_number"); return 0; }
|
|
s16 relZ = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "spawn_orange_number"); return 0; }
|
|
|
|
extern void spawn_orange_number(s8 behParam, s16 relX, s16 relY, s16 relZ);
|
|
spawn_orange_number(behParam, relX, relY, relZ);
|
|
|
|
return 1;
|
|
}
|
|
|
|
///////////////////////
|
|
// obj_behaviors_2.c //
|
|
///////////////////////
|
|
|
|
int smlua_func_obj_is_rendering_enabled(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_is_rendering_enabled", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern s32 obj_is_rendering_enabled(void);
|
|
lua_pushinteger(L, obj_is_rendering_enabled());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_get_pitch_from_vel(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_get_pitch_from_vel", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern s16 obj_get_pitch_from_vel(void);
|
|
lua_pushinteger(L, obj_get_pitch_from_vel());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_set_dist_from_home(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_set_dist_from_home", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 distFromHome = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_set_dist_from_home"); return 0; }
|
|
|
|
extern void obj_set_dist_from_home(f32 distFromHome);
|
|
obj_set_dist_from_home(distFromHome);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_is_near_to_and_facing_mario(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_is_near_to_and_facing_mario", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_is_near_to_and_facing_mario"); return 0; }
|
|
f32 maxDist = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_is_near_to_and_facing_mario"); return 0; }
|
|
s16 maxAngleDiff = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_is_near_to_and_facing_mario"); return 0; }
|
|
|
|
extern s32 obj_is_near_to_and_facing_mario(struct MarioState* m, f32 maxDist, s16 maxAngleDiff);
|
|
lua_pushinteger(L, obj_is_near_to_and_facing_mario(m, maxDist, maxAngleDiff));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_platform_on_track_update_pos_or_spawn_ball(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "platform_on_track_update_pos_or_spawn_ball", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 ballIndex = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "platform_on_track_update_pos_or_spawn_ball"); return 0; }
|
|
f32 x = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "platform_on_track_update_pos_or_spawn_ball"); return 0; }
|
|
f32 y = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "platform_on_track_update_pos_or_spawn_ball"); return 0; }
|
|
f32 z = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "platform_on_track_update_pos_or_spawn_ball"); return 0; }
|
|
|
|
extern void platform_on_track_update_pos_or_spawn_ball(s32 ballIndex, f32 x, f32 y, f32 z);
|
|
platform_on_track_update_pos_or_spawn_ball(ballIndex, x, y, z);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_spin_all_dimensions(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_spin_all_dimensions", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 pitchSpeed = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_spin_all_dimensions"); return 0; }
|
|
f32 rollSpeed = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "cur_obj_spin_all_dimensions"); return 0; }
|
|
|
|
extern void cur_obj_spin_all_dimensions(f32 pitchSpeed, f32 rollSpeed);
|
|
cur_obj_spin_all_dimensions(pitchSpeed, rollSpeed);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_rotate_yaw_and_bounce_off_walls(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_rotate_yaw_and_bounce_off_walls", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 targetYaw = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_rotate_yaw_and_bounce_off_walls"); return 0; }
|
|
s16 turnAmount = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_rotate_yaw_and_bounce_off_walls"); return 0; }
|
|
|
|
extern void obj_rotate_yaw_and_bounce_off_walls(s16 targetYaw, s16 turnAmount);
|
|
obj_rotate_yaw_and_bounce_off_walls(targetYaw, turnAmount);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_get_pitch_to_home(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_get_pitch_to_home", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 latDistToHome = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_get_pitch_to_home"); return 0; }
|
|
|
|
extern s16 obj_get_pitch_to_home(f32 latDistToHome);
|
|
lua_pushinteger(L, obj_get_pitch_to_home(latDistToHome));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_compute_vel_from_move_pitch(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_compute_vel_from_move_pitch", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 speed = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_compute_vel_from_move_pitch"); return 0; }
|
|
|
|
extern void obj_compute_vel_from_move_pitch(f32 speed);
|
|
obj_compute_vel_from_move_pitch(speed);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_init_anim_extend(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_init_anim_extend", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 animIndex = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_init_anim_extend"); return 0; }
|
|
|
|
extern void cur_obj_init_anim_extend(s32 animIndex);
|
|
cur_obj_init_anim_extend(animIndex);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_init_anim_and_check_if_end(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_init_anim_and_check_if_end", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 animIndex = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_init_anim_and_check_if_end"); return 0; }
|
|
|
|
extern s32 cur_obj_init_anim_and_check_if_end(s32 animIndex);
|
|
lua_pushinteger(L, cur_obj_init_anim_and_check_if_end(animIndex));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_init_anim_check_frame(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_init_anim_check_frame", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 animIndex = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_init_anim_check_frame"); return 0; }
|
|
s32 animFrame = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "cur_obj_init_anim_check_frame"); return 0; }
|
|
|
|
extern s32 cur_obj_init_anim_check_frame(s32 animIndex, s32 animFrame);
|
|
lua_pushinteger(L, cur_obj_init_anim_check_frame(animIndex, animFrame));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_set_anim_if_at_end(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_set_anim_if_at_end", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 animIndex = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_set_anim_if_at_end"); return 0; }
|
|
|
|
extern s32 cur_obj_set_anim_if_at_end(s32 animIndex);
|
|
lua_pushinteger(L, cur_obj_set_anim_if_at_end(animIndex));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_play_sound_at_anim_range(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_play_sound_at_anim_range", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s8 startFrame = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_play_sound_at_anim_range"); return 0; }
|
|
s8 endFrame = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "cur_obj_play_sound_at_anim_range"); return 0; }
|
|
u32 sound = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "cur_obj_play_sound_at_anim_range"); return 0; }
|
|
|
|
extern s32 cur_obj_play_sound_at_anim_range(s8 startFrame, s8 endFrame, u32 sound);
|
|
lua_pushinteger(L, cur_obj_play_sound_at_anim_range(startFrame, endFrame, sound));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_turn_pitch_toward_mario(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_turn_pitch_toward_mario", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_turn_pitch_toward_mario"); return 0; }
|
|
f32 targetOffsetY = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_turn_pitch_toward_mario"); return 0; }
|
|
s16 turnAmount = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_turn_pitch_toward_mario"); return 0; }
|
|
|
|
extern s16 obj_turn_pitch_toward_mario(struct MarioState* m, f32 targetOffsetY, s16 turnAmount);
|
|
lua_pushinteger(L, obj_turn_pitch_toward_mario(m, targetOffsetY, turnAmount));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_approach_f32_ptr(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "approach_f32_ptr", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 * px = (f32 *)smlua_to_cpointer(L, 1, LVT_F32_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "approach_f32_ptr"); return 0; }
|
|
f32 target = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "approach_f32_ptr"); return 0; }
|
|
f32 delta = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "approach_f32_ptr"); return 0; }
|
|
|
|
extern s32 approach_f32_ptr(f32 *px, f32 target, f32 delta);
|
|
lua_pushinteger(L, approach_f32_ptr(px, target, delta));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_forward_vel_approach(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_forward_vel_approach", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 target = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_forward_vel_approach"); return 0; }
|
|
f32 delta = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_forward_vel_approach"); return 0; }
|
|
|
|
extern s32 obj_forward_vel_approach(f32 target, f32 delta);
|
|
lua_pushinteger(L, obj_forward_vel_approach(target, delta));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_y_vel_approach(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_y_vel_approach", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 target = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_y_vel_approach"); return 0; }
|
|
f32 delta = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_y_vel_approach"); return 0; }
|
|
|
|
extern s32 obj_y_vel_approach(f32 target, f32 delta);
|
|
lua_pushinteger(L, obj_y_vel_approach(target, delta));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_move_pitch_approach(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_move_pitch_approach", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 target = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_move_pitch_approach"); return 0; }
|
|
s16 delta = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_move_pitch_approach"); return 0; }
|
|
|
|
extern s32 obj_move_pitch_approach(s16 target, s16 delta);
|
|
lua_pushinteger(L, obj_move_pitch_approach(target, delta));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_face_pitch_approach(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_face_pitch_approach", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 targetPitch = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_face_pitch_approach"); return 0; }
|
|
s16 deltaPitch = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_face_pitch_approach"); return 0; }
|
|
|
|
extern s32 obj_face_pitch_approach(s16 targetPitch, s16 deltaPitch);
|
|
lua_pushinteger(L, obj_face_pitch_approach(targetPitch, deltaPitch));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_face_yaw_approach(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_face_yaw_approach", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 targetYaw = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_face_yaw_approach"); return 0; }
|
|
s16 deltaYaw = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_face_yaw_approach"); return 0; }
|
|
|
|
extern s32 obj_face_yaw_approach(s16 targetYaw, s16 deltaYaw);
|
|
lua_pushinteger(L, obj_face_yaw_approach(targetYaw, deltaYaw));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_face_roll_approach(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_face_roll_approach", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 targetRoll = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_face_roll_approach"); return 0; }
|
|
s16 deltaRoll = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_face_roll_approach"); return 0; }
|
|
|
|
extern s32 obj_face_roll_approach(s16 targetRoll, s16 deltaRoll);
|
|
lua_pushinteger(L, obj_face_roll_approach(targetRoll, deltaRoll));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_smooth_turn(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 7) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_smooth_turn", 7, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 * angleVel = (s16 *)smlua_to_cpointer(L, 1, LVT_S16_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_smooth_turn"); return 0; }
|
|
s32 * angle = (s32 *)smlua_to_cpointer(L, 2, LVT_S32_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_smooth_turn"); return 0; }
|
|
s16 targetAngle = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_smooth_turn"); return 0; }
|
|
f32 targetSpeedProportion = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "obj_smooth_turn"); return 0; }
|
|
s16 accel = smlua_to_integer(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "obj_smooth_turn"); return 0; }
|
|
s16 minSpeed = smlua_to_integer(L, 6);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 6, "obj_smooth_turn"); return 0; }
|
|
s16 maxSpeed = smlua_to_integer(L, 7);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 7, "obj_smooth_turn"); return 0; }
|
|
|
|
extern s32 obj_smooth_turn(s16 *angleVel, s32 *angle, s16 targetAngle, f32 targetSpeedProportion, s16 accel, s16 minSpeed, s16 maxSpeed);
|
|
lua_pushinteger(L, obj_smooth_turn(angleVel, angle, targetAngle, targetSpeedProportion, accel, minSpeed, maxSpeed));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_roll_to_match_yaw_turn(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_roll_to_match_yaw_turn", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 targetYaw = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_roll_to_match_yaw_turn"); return 0; }
|
|
s16 maxRoll = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_roll_to_match_yaw_turn"); return 0; }
|
|
s16 rollSpeed = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_roll_to_match_yaw_turn"); return 0; }
|
|
|
|
extern void obj_roll_to_match_yaw_turn(s16 targetYaw, s16 maxRoll, s16 rollSpeed);
|
|
obj_roll_to_match_yaw_turn(targetYaw, maxRoll, rollSpeed);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_random_linear_offset(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "random_linear_offset", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 base = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "random_linear_offset"); return 0; }
|
|
s16 range = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "random_linear_offset"); return 0; }
|
|
|
|
extern s16 random_linear_offset(s16 base, s16 range);
|
|
lua_pushinteger(L, random_linear_offset(base, range));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_random_mod_offset(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "random_mod_offset", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 base = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "random_mod_offset"); return 0; }
|
|
s16 step = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "random_mod_offset"); return 0; }
|
|
s16 mod = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "random_mod_offset"); return 0; }
|
|
|
|
extern s16 random_mod_offset(s16 base, s16 step, s16 mod);
|
|
lua_pushinteger(L, random_mod_offset(base, step, mod));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_random_fixed_turn(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_random_fixed_turn", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 delta = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_random_fixed_turn"); return 0; }
|
|
|
|
extern s16 obj_random_fixed_turn(s16 delta);
|
|
lua_pushinteger(L, obj_random_fixed_turn(delta));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_grow_then_shrink(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_grow_then_shrink", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 * scaleVel = (f32 *)smlua_to_cpointer(L, 1, LVT_F32_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_grow_then_shrink"); return 0; }
|
|
f32 shootFireScale = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_grow_then_shrink"); return 0; }
|
|
f32 endScale = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_grow_then_shrink"); return 0; }
|
|
|
|
extern s32 obj_grow_then_shrink(f32 *scaleVel, f32 shootFireScale, f32 endScale);
|
|
lua_pushinteger(L, obj_grow_then_shrink(scaleVel, shootFireScale, endScale));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_oscillate_toward(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 6) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "oscillate_toward", 6, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 * value = (s32 *)smlua_to_cpointer(L, 1, LVT_S32_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "oscillate_toward"); return 0; }
|
|
f32 * vel = (f32 *)smlua_to_cpointer(L, 2, LVT_F32_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "oscillate_toward"); return 0; }
|
|
s32 target = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "oscillate_toward"); return 0; }
|
|
f32 velCloseToZero = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "oscillate_toward"); return 0; }
|
|
f32 accel = smlua_to_number(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "oscillate_toward"); return 0; }
|
|
f32 slowdown = smlua_to_number(L, 6);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 6, "oscillate_toward"); return 0; }
|
|
|
|
extern s32 oscillate_toward(s32 *value, f32 *vel, s32 target, f32 velCloseToZero, f32 accel, f32 slowdown);
|
|
lua_pushinteger(L, oscillate_toward(value, vel, target, velCloseToZero, accel, slowdown));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_update_blinking(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_update_blinking", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 * blinkTimer = (s32 *)smlua_to_cpointer(L, 1, LVT_S32_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_update_blinking"); return 0; }
|
|
s16 baseCycleLength = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_update_blinking"); return 0; }
|
|
s16 cycleLengthRange = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_update_blinking"); return 0; }
|
|
s16 blinkLength = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "obj_update_blinking"); return 0; }
|
|
|
|
extern void obj_update_blinking(s32 *blinkTimer, s16 baseCycleLength, s16 cycleLengthRange, s16 blinkLength);
|
|
obj_update_blinking(blinkTimer, baseCycleLength, cycleLengthRange, blinkLength);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_resolve_object_collisions(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_resolve_object_collisions", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 * targetYaw = (s32 *)smlua_to_cpointer(L, 1, LVT_S32_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_resolve_object_collisions"); return 0; }
|
|
|
|
extern s32 obj_resolve_object_collisions(s32 *targetYaw);
|
|
lua_pushinteger(L, obj_resolve_object_collisions(targetYaw));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_bounce_off_walls_edges_objects(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_bounce_off_walls_edges_objects", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 * targetYaw = (s32 *)smlua_to_cpointer(L, 1, LVT_S32_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_bounce_off_walls_edges_objects"); return 0; }
|
|
|
|
extern s32 obj_bounce_off_walls_edges_objects(s32 *targetYaw);
|
|
lua_pushinteger(L, obj_bounce_off_walls_edges_objects(targetYaw));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_resolve_collisions_and_turn(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_resolve_collisions_and_turn", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 targetYaw = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_resolve_collisions_and_turn"); return 0; }
|
|
s16 turnSpeed = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_resolve_collisions_and_turn"); return 0; }
|
|
|
|
extern s32 obj_resolve_collisions_and_turn(s16 targetYaw, s16 turnSpeed);
|
|
lua_pushinteger(L, obj_resolve_collisions_and_turn(targetYaw, turnSpeed));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_die_if_health_non_positive(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_die_if_health_non_positive", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void obj_die_if_health_non_positive(void);
|
|
obj_die_if_health_non_positive();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_unused_die(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_unused_die", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void obj_unused_die(void);
|
|
obj_unused_die();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_set_knockback_action(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_set_knockback_action", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 attackType = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_set_knockback_action"); return 0; }
|
|
|
|
extern void obj_set_knockback_action(s32 attackType);
|
|
obj_set_knockback_action(attackType);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_set_squished_action(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_set_squished_action", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void obj_set_squished_action(void);
|
|
obj_set_squished_action();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_die_if_above_lava_and_health_non_positive(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_die_if_above_lava_and_health_non_positive", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern s32 obj_die_if_above_lava_and_health_non_positive(void);
|
|
lua_pushinteger(L, obj_die_if_above_lava_and_health_non_positive());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_handle_attacks(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_handle_attacks", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ObjectHitbox* hitbox = (struct ObjectHitbox*)smlua_to_cobject(L, 1, LOT_OBJECTHITBOX);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_handle_attacks"); return 0; }
|
|
s32 attackedMarioAction = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_handle_attacks"); return 0; }
|
|
u8 * attackHandlers = (u8 *)smlua_to_cpointer(L, 3, LVT_U8_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_handle_attacks"); return 0; }
|
|
|
|
extern s32 obj_handle_attacks(struct ObjectHitbox *hitbox, s32 attackedMarioAction, u8 *attackHandlers);
|
|
lua_pushinteger(L, obj_handle_attacks(hitbox, attackedMarioAction, attackHandlers));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_act_knockback(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_act_knockback", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 baseScale = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_act_knockback"); return 0; }
|
|
|
|
extern void obj_act_knockback(UNUSED f32 baseScale);
|
|
obj_act_knockback(baseScale);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_act_squished(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_act_squished", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 baseScale = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_act_squished"); return 0; }
|
|
|
|
extern void obj_act_squished(f32 baseScale);
|
|
obj_act_squished(baseScale);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_update_standard_actions(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_update_standard_actions", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 scale = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_update_standard_actions"); return 0; }
|
|
|
|
extern s32 obj_update_standard_actions(f32 scale);
|
|
lua_pushinteger(L, obj_update_standard_actions(scale));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_check_attacks(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_check_attacks", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ObjectHitbox* hitbox = (struct ObjectHitbox*)smlua_to_cobject(L, 1, LOT_OBJECTHITBOX);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_check_attacks"); return 0; }
|
|
s32 attackedMarioAction = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_check_attacks"); return 0; }
|
|
|
|
extern s32 obj_check_attacks(struct ObjectHitbox *hitbox, s32 attackedMarioAction);
|
|
lua_pushinteger(L, obj_check_attacks(hitbox, attackedMarioAction));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_move_for_one_second(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_move_for_one_second", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 endAction = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_move_for_one_second"); return 0; }
|
|
|
|
extern s32 obj_move_for_one_second(s32 endAction);
|
|
lua_pushinteger(L, obj_move_for_one_second(endAction));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_treat_far_home_as_mario(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "treat_far_home_as_mario", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 threshold = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "treat_far_home_as_mario"); return 0; }
|
|
s32* distanceToPlayer = (s32*)smlua_to_cpointer(L, 2, LVT_S32_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "treat_far_home_as_mario"); return 0; }
|
|
s32* angleToPlayer = (s32*)smlua_to_cpointer(L, 3, LVT_S32_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "treat_far_home_as_mario"); return 0; }
|
|
|
|
extern void treat_far_home_as_mario(f32 threshold, s32* distanceToPlayer, s32* angleToPlayer);
|
|
treat_far_home_as_mario(threshold, distanceToPlayer, angleToPlayer);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_spit_fire(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 8) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_spit_fire", 8, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 relativePosX = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_spit_fire"); return 0; }
|
|
s16 relativePosY = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_spit_fire"); return 0; }
|
|
s16 relativePosZ = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_spit_fire"); return 0; }
|
|
f32 scale = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "obj_spit_fire"); return 0; }
|
|
s32 model = smlua_to_integer(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "obj_spit_fire"); return 0; }
|
|
f32 startSpeed = smlua_to_number(L, 6);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 6, "obj_spit_fire"); return 0; }
|
|
f32 endSpeed = smlua_to_number(L, 7);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 7, "obj_spit_fire"); return 0; }
|
|
s16 movePitch = smlua_to_integer(L, 8);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 8, "obj_spit_fire"); return 0; }
|
|
|
|
extern struct Object* obj_spit_fire(s16 relativePosX, s16 relativePosY, s16 relativePosZ, f32 scale, s32 model, f32 startSpeed, f32 endSpeed, s16 movePitch);
|
|
smlua_push_object(L, LOT_OBJECT, obj_spit_fire(relativePosX, relativePosY, relativePosZ, scale, model, startSpeed, endSpeed, movePitch), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
//////////////////////
|
|
// object_helpers.c //
|
|
//////////////////////
|
|
|
|
int smlua_func_clear_move_flag(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "clear_move_flag", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
u32 * bitSet = (u32 *)smlua_to_cpointer(L, 1, LVT_U32_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "clear_move_flag"); return 0; }
|
|
s32 flag = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "clear_move_flag"); return 0; }
|
|
|
|
extern s32 clear_move_flag(u32 *bitSet, s32 flag);
|
|
lua_pushinteger(L, clear_move_flag(bitSet, flag));
|
|
|
|
return 1;
|
|
}
|
|
|
|
/*
|
|
int smlua_func_geo_update_projectile_pos_from_parent(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "geo_update_projectile_pos_from_parent", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 callContext = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "geo_update_projectile_pos_from_parent"); return 0; }
|
|
// struct GraphNode* node = (struct GraphNode*)smlua_to_cobject(L, 2, LOT_GRAPHNODE); <--- UNIMPLEMENTED
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "geo_update_projectile_pos_from_parent"); return 0; }
|
|
|
|
Mat4 mtx;
|
|
smlua_get_mat4(mtx, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "geo_update_projectile_pos_from_parent"); return 0; }
|
|
|
|
extern Gfx *geo_update_projectile_pos_from_parent(s32 callContext, UNUSED struct GraphNode *node, Mat4 mtx);
|
|
smlua_push_object(L, LOT_GFX, geo_update_projectile_pos_from_parent(callContext, node, mtx), NULL);
|
|
|
|
return 1;
|
|
}
|
|
*/
|
|
|
|
/*
|
|
int smlua_func_geo_update_layer_transparency(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "geo_update_layer_transparency", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 callContext = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "geo_update_layer_transparency"); return 0; }
|
|
// struct GraphNode* node = (struct GraphNode*)smlua_to_cobject(L, 2, LOT_GRAPHNODE); <--- UNIMPLEMENTED
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "geo_update_layer_transparency"); return 0; }
|
|
// void * context = (void *)smlua_to_cobject(L, 3, LOT_???); <--- UNIMPLEMENTED
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "geo_update_layer_transparency"); return 0; }
|
|
|
|
extern Gfx *geo_update_layer_transparency(s32 callContext, struct GraphNode *node, UNUSED void *context);
|
|
smlua_push_object(L, LOT_GFX, geo_update_layer_transparency(callContext, node, context), NULL);
|
|
|
|
return 1;
|
|
}
|
|
*/
|
|
|
|
/*
|
|
int smlua_func_geo_switch_anim_state(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "geo_switch_anim_state", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 callContext = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "geo_switch_anim_state"); return 0; }
|
|
// struct GraphNode* node = (struct GraphNode*)smlua_to_cobject(L, 2, LOT_GRAPHNODE); <--- UNIMPLEMENTED
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "geo_switch_anim_state"); return 0; }
|
|
|
|
extern Gfx *geo_switch_anim_state(s32 callContext, struct GraphNode *node);
|
|
smlua_push_object(L, LOT_GFX, geo_switch_anim_state(callContext, node), NULL);
|
|
|
|
return 1;
|
|
}
|
|
*/
|
|
|
|
int smlua_func_set_room_override(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_room_override", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 room = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_room_override"); return 0; }
|
|
|
|
extern void set_room_override(s16 room);
|
|
set_room_override(room);
|
|
|
|
return 1;
|
|
}
|
|
|
|
/*
|
|
int smlua_func_geo_switch_area(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "geo_switch_area", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 callContext = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "geo_switch_area"); return 0; }
|
|
// struct GraphNode* node = (struct GraphNode*)smlua_to_cobject(L, 2, LOT_GRAPHNODE); <--- UNIMPLEMENTED
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "geo_switch_area"); return 0; }
|
|
|
|
extern Gfx *geo_switch_area(s32 callContext, struct GraphNode *node);
|
|
smlua_push_object(L, LOT_GFX, geo_switch_area(callContext, node), NULL);
|
|
|
|
return 1;
|
|
}
|
|
*/
|
|
|
|
/*
|
|
int smlua_func_geo_choose_area_ext(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "geo_choose_area_ext", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 callContext = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "geo_choose_area_ext"); return 0; }
|
|
// struct GraphNode* node = (struct GraphNode*)smlua_to_cobject(L, 2, LOT_GRAPHNODE); <--- UNIMPLEMENTED
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "geo_choose_area_ext"); return 0; }
|
|
|
|
Mat4 mtx;
|
|
smlua_get_mat4(mtx, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "geo_choose_area_ext"); return 0; }
|
|
|
|
extern Gfx *geo_choose_area_ext(UNUSED s32 callContext, struct GraphNode *node, UNUSED Mat4 mtx);
|
|
smlua_push_object(L, LOT_GFX, geo_choose_area_ext(callContext, node, mtx), NULL);
|
|
|
|
return 1;
|
|
}
|
|
*/
|
|
|
|
int smlua_func_obj_update_pos_from_parent_transformation(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_update_pos_from_parent_transformation", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Mat4 a0;
|
|
smlua_get_mat4(a0, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_update_pos_from_parent_transformation"); return 0; }
|
|
struct Object* a1 = (struct Object*)smlua_to_cobject(L, 2, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_update_pos_from_parent_transformation"); return 0; }
|
|
|
|
extern void obj_update_pos_from_parent_transformation(Mat4 a0, struct Object *a1);
|
|
obj_update_pos_from_parent_transformation(a0, a1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_apply_scale_to_matrix(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_apply_scale_to_matrix", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_apply_scale_to_matrix"); return 0; }
|
|
|
|
Mat4 dst;
|
|
smlua_get_mat4(dst, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_apply_scale_to_matrix"); return 0; }
|
|
|
|
Mat4 src;
|
|
smlua_get_mat4(src, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_apply_scale_to_matrix"); return 0; }
|
|
|
|
extern void obj_apply_scale_to_matrix(struct Object *obj, OUT Mat4 dst, Mat4 src);
|
|
obj_apply_scale_to_matrix(obj, dst, src);
|
|
|
|
smlua_push_mat4(dst, 2);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_create_transformation_from_matrices(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "create_transformation_from_matrices", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Mat4 a0;
|
|
smlua_get_mat4(a0, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "create_transformation_from_matrices"); return 0; }
|
|
|
|
Mat4 a1;
|
|
smlua_get_mat4(a1, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "create_transformation_from_matrices"); return 0; }
|
|
|
|
Mat4 a2;
|
|
smlua_get_mat4(a2, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "create_transformation_from_matrices"); return 0; }
|
|
|
|
extern void create_transformation_from_matrices(OUT Mat4 a0, Mat4 a1, Mat4 a2);
|
|
create_transformation_from_matrices(a0, a1, a2);
|
|
|
|
smlua_push_mat4(a0, 1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_set_held_state(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_set_held_state", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_set_held_state"); return 0; }
|
|
BehaviorScript * heldBehavior = (BehaviorScript *)smlua_to_cpointer(L, 2, LVT_BEHAVIORSCRIPT_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_set_held_state"); return 0; }
|
|
|
|
extern void obj_set_held_state(struct Object *obj, const BehaviorScript *heldBehavior);
|
|
obj_set_held_state(obj, heldBehavior);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_lateral_dist_between_objects(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "lateral_dist_between_objects", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj1 = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "lateral_dist_between_objects"); return 0; }
|
|
struct Object* obj2 = (struct Object*)smlua_to_cobject(L, 2, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "lateral_dist_between_objects"); return 0; }
|
|
|
|
extern f32 lateral_dist_between_objects(struct Object *obj1, struct Object *obj2);
|
|
lua_pushnumber(L, lateral_dist_between_objects(obj1, obj2));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_dist_between_objects(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "dist_between_objects", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj1 = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "dist_between_objects"); return 0; }
|
|
struct Object* obj2 = (struct Object*)smlua_to_cobject(L, 2, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "dist_between_objects"); return 0; }
|
|
|
|
extern f32 dist_between_objects(struct Object *obj1, struct Object *obj2);
|
|
lua_pushnumber(L, dist_between_objects(obj1, obj2));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_dist_between_object_and_point(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "dist_between_object_and_point", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "dist_between_object_and_point"); return 0; }
|
|
f32 pointX = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "dist_between_object_and_point"); return 0; }
|
|
f32 pointY = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "dist_between_object_and_point"); return 0; }
|
|
f32 pointZ = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "dist_between_object_and_point"); return 0; }
|
|
|
|
extern f32 dist_between_object_and_point(struct Object *obj, f32 pointX, f32 pointY, f32 pointZ);
|
|
lua_pushnumber(L, dist_between_object_and_point(obj, pointX, pointY, pointZ));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_forward_vel_approach_upward(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_forward_vel_approach_upward", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 target = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_forward_vel_approach_upward"); return 0; }
|
|
f32 increment = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "cur_obj_forward_vel_approach_upward"); return 0; }
|
|
|
|
extern void cur_obj_forward_vel_approach_upward(f32 target, f32 increment);
|
|
cur_obj_forward_vel_approach_upward(target, increment);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_approach_f32_signed(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "approach_f32_signed", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 * value = (f32 *)smlua_to_cpointer(L, 1, LVT_F32_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "approach_f32_signed"); return 0; }
|
|
f32 target = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "approach_f32_signed"); return 0; }
|
|
f32 increment = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "approach_f32_signed"); return 0; }
|
|
|
|
extern s32 approach_f32_signed(f32 *value, f32 target, f32 increment);
|
|
lua_pushinteger(L, approach_f32_signed(value, target, increment));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_approach_f32_symmetric(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "approach_f32_symmetric", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 value = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "approach_f32_symmetric"); return 0; }
|
|
f32 target = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "approach_f32_symmetric"); return 0; }
|
|
f32 increment = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "approach_f32_symmetric"); return 0; }
|
|
|
|
extern f32 approach_f32_symmetric(f32 value, f32 target, f32 increment);
|
|
lua_pushnumber(L, approach_f32_symmetric(value, target, increment));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_approach_s16_symmetric(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "approach_s16_symmetric", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 value = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "approach_s16_symmetric"); return 0; }
|
|
s16 target = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "approach_s16_symmetric"); return 0; }
|
|
s16 increment = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "approach_s16_symmetric"); return 0; }
|
|
|
|
extern s16 approach_s16_symmetric(s16 value, s16 target, s16 increment);
|
|
lua_pushinteger(L, approach_s16_symmetric(value, target, increment));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_rotate_yaw_toward(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_rotate_yaw_toward", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 target = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_rotate_yaw_toward"); return 0; }
|
|
s16 increment = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "cur_obj_rotate_yaw_toward"); return 0; }
|
|
|
|
extern s32 cur_obj_rotate_yaw_toward(s16 target, s16 increment);
|
|
lua_pushinteger(L, cur_obj_rotate_yaw_toward(target, increment));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_angle_to_object(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_angle_to_object", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj1 = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_angle_to_object"); return 0; }
|
|
struct Object* obj2 = (struct Object*)smlua_to_cobject(L, 2, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_angle_to_object"); return 0; }
|
|
|
|
extern s16 obj_angle_to_object(struct Object *obj1, struct Object *obj2);
|
|
lua_pushinteger(L, obj_angle_to_object(obj1, obj2));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_pitch_to_object(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_pitch_to_object", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_pitch_to_object"); return 0; }
|
|
struct Object* target = (struct Object*)smlua_to_cobject(L, 2, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_pitch_to_object"); return 0; }
|
|
|
|
extern s16 obj_pitch_to_object(struct Object* obj, struct Object* target);
|
|
lua_pushinteger(L, obj_pitch_to_object(obj, target));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_angle_to_point(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_angle_to_point", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_angle_to_point"); return 0; }
|
|
f32 pointX = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_angle_to_point"); return 0; }
|
|
f32 pointZ = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_angle_to_point"); return 0; }
|
|
|
|
extern s16 obj_angle_to_point(struct Object *obj, f32 pointX, f32 pointZ);
|
|
lua_pushinteger(L, obj_angle_to_point(obj, pointX, pointZ));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_turn_toward_object(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_turn_toward_object", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_turn_toward_object"); return 0; }
|
|
struct Object* target = (struct Object*)smlua_to_cobject(L, 2, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_turn_toward_object"); return 0; }
|
|
s16 angleIndex = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_turn_toward_object"); return 0; }
|
|
s16 turnAmount = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "obj_turn_toward_object"); return 0; }
|
|
|
|
extern s16 obj_turn_toward_object(struct Object *obj, struct Object *target, s16 angleIndex, s16 turnAmount);
|
|
lua_pushinteger(L, obj_turn_toward_object(obj, target, angleIndex, turnAmount));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_set_parent_relative_pos(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_set_parent_relative_pos", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_set_parent_relative_pos"); return 0; }
|
|
s16 relX = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_set_parent_relative_pos"); return 0; }
|
|
s16 relY = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_set_parent_relative_pos"); return 0; }
|
|
s16 relZ = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "obj_set_parent_relative_pos"); return 0; }
|
|
|
|
extern void obj_set_parent_relative_pos(struct Object *obj, s16 relX, s16 relY, s16 relZ);
|
|
obj_set_parent_relative_pos(obj, relX, relY, relZ);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_set_pos(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_set_pos", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_set_pos"); return 0; }
|
|
s16 x = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_set_pos"); return 0; }
|
|
s16 y = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_set_pos"); return 0; }
|
|
s16 z = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "obj_set_pos"); return 0; }
|
|
|
|
extern void obj_set_pos(struct Object *obj, s16 x, s16 y, s16 z);
|
|
obj_set_pos(obj, x, y, z);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_set_angle(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_set_angle", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_set_angle"); return 0; }
|
|
s16 pitch = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_set_angle"); return 0; }
|
|
s16 yaw = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_set_angle"); return 0; }
|
|
s16 roll = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "obj_set_angle"); return 0; }
|
|
|
|
extern void obj_set_angle(struct Object *obj, s16 pitch, s16 yaw, s16 roll);
|
|
obj_set_angle(obj, pitch, yaw, roll);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_set_move_angle(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_set_move_angle", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_set_move_angle"); return 0; }
|
|
s16 pitch = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_set_move_angle"); return 0; }
|
|
s16 yaw = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_set_move_angle"); return 0; }
|
|
s16 roll = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "obj_set_move_angle"); return 0; }
|
|
|
|
extern void obj_set_move_angle(struct Object *obj, s16 pitch, s16 yaw, s16 roll);
|
|
obj_set_move_angle(obj, pitch, yaw, roll);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_set_face_angle(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_set_face_angle", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_set_face_angle"); return 0; }
|
|
s16 pitch = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_set_face_angle"); return 0; }
|
|
s16 yaw = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_set_face_angle"); return 0; }
|
|
s16 roll = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "obj_set_face_angle"); return 0; }
|
|
|
|
extern void obj_set_face_angle(struct Object *obj, s16 pitch, s16 yaw, s16 roll);
|
|
obj_set_face_angle(obj, pitch, yaw, roll);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_set_gfx_angle(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_set_gfx_angle", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_set_gfx_angle"); return 0; }
|
|
s16 pitch = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_set_gfx_angle"); return 0; }
|
|
s16 yaw = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_set_gfx_angle"); return 0; }
|
|
s16 roll = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "obj_set_gfx_angle"); return 0; }
|
|
|
|
extern void obj_set_gfx_angle(struct Object *obj, s16 pitch, s16 yaw, s16 roll);
|
|
obj_set_gfx_angle(obj, pitch, yaw, roll);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_set_gfx_pos(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_set_gfx_pos", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_set_gfx_pos"); return 0; }
|
|
f32 x = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_set_gfx_pos"); return 0; }
|
|
f32 y = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_set_gfx_pos"); return 0; }
|
|
f32 z = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "obj_set_gfx_pos"); return 0; }
|
|
|
|
extern void obj_set_gfx_pos(struct Object *obj, f32 x, f32 y, f32 z);
|
|
obj_set_gfx_pos(obj, x, y, z);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_set_gfx_scale(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_set_gfx_scale", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_set_gfx_scale"); return 0; }
|
|
f32 x = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_set_gfx_scale"); return 0; }
|
|
f32 y = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_set_gfx_scale"); return 0; }
|
|
f32 z = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "obj_set_gfx_scale"); return 0; }
|
|
|
|
extern void obj_set_gfx_scale(struct Object *obj, f32 x, f32 y, f32 z);
|
|
obj_set_gfx_scale(obj, x, y, z);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_spawn_water_droplet(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "spawn_water_droplet", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* parent = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "spawn_water_droplet"); return 0; }
|
|
struct WaterDropletParams* params = (struct WaterDropletParams*)smlua_to_cobject(L, 2, LOT_WATERDROPLETPARAMS);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "spawn_water_droplet"); return 0; }
|
|
|
|
extern struct Object *spawn_water_droplet(struct Object *parent, struct WaterDropletParams *params);
|
|
smlua_push_object(L, LOT_OBJECT, spawn_water_droplet(parent, params), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_build_relative_transform(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_build_relative_transform", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_build_relative_transform"); return 0; }
|
|
|
|
extern void obj_build_relative_transform(struct Object *obj);
|
|
obj_build_relative_transform(obj);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_move_using_vel(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_move_using_vel", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void cur_obj_move_using_vel(void);
|
|
cur_obj_move_using_vel();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_copy_graph_y_offset(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_copy_graph_y_offset", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* dst = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_copy_graph_y_offset"); return 0; }
|
|
struct Object* src = (struct Object*)smlua_to_cobject(L, 2, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_copy_graph_y_offset"); return 0; }
|
|
|
|
extern void obj_copy_graph_y_offset(struct Object *dst, struct Object *src);
|
|
obj_copy_graph_y_offset(dst, src);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_copy_pos_and_angle(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_copy_pos_and_angle", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* dst = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_copy_pos_and_angle"); return 0; }
|
|
struct Object* src = (struct Object*)smlua_to_cobject(L, 2, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_copy_pos_and_angle"); return 0; }
|
|
|
|
extern void obj_copy_pos_and_angle(struct Object *dst, struct Object *src);
|
|
obj_copy_pos_and_angle(dst, src);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_copy_pos(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_copy_pos", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* dst = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_copy_pos"); return 0; }
|
|
struct Object* src = (struct Object*)smlua_to_cobject(L, 2, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_copy_pos"); return 0; }
|
|
|
|
extern void obj_copy_pos(struct Object *dst, struct Object *src);
|
|
obj_copy_pos(dst, src);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_copy_angle(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_copy_angle", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* dst = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_copy_angle"); return 0; }
|
|
struct Object* src = (struct Object*)smlua_to_cobject(L, 2, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_copy_angle"); return 0; }
|
|
|
|
extern void obj_copy_angle(struct Object *dst, struct Object *src);
|
|
obj_copy_angle(dst, src);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_set_gfx_pos_from_pos(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_set_gfx_pos_from_pos", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_set_gfx_pos_from_pos"); return 0; }
|
|
|
|
extern void obj_set_gfx_pos_from_pos(struct Object *obj);
|
|
obj_set_gfx_pos_from_pos(obj);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_init_animation(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_init_animation", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_init_animation"); return 0; }
|
|
s32 animIndex = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_init_animation"); return 0; }
|
|
|
|
extern void obj_init_animation(struct Object *obj, s32 animIndex);
|
|
obj_init_animation(obj, animIndex);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_linear_mtxf_mul_vec3f(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "linear_mtxf_mul_vec3f", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Mat4 m;
|
|
smlua_get_mat4(m, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "linear_mtxf_mul_vec3f"); return 0; }
|
|
|
|
Vec3f dst;
|
|
smlua_get_vec3f(dst, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "linear_mtxf_mul_vec3f"); return 0; }
|
|
|
|
Vec3f v;
|
|
smlua_get_vec3f(v, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "linear_mtxf_mul_vec3f"); return 0; }
|
|
|
|
extern void linear_mtxf_mul_vec3f(Mat4 m, OUT Vec3f dst, Vec3f v);
|
|
linear_mtxf_mul_vec3f(m, dst, v);
|
|
|
|
smlua_push_vec3f(dst, 2);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_linear_mtxf_transpose_mul_vec3f(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "linear_mtxf_transpose_mul_vec3f", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Mat4 m;
|
|
smlua_get_mat4(m, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "linear_mtxf_transpose_mul_vec3f"); return 0; }
|
|
|
|
Vec3f dst;
|
|
smlua_get_vec3f(dst, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "linear_mtxf_transpose_mul_vec3f"); return 0; }
|
|
|
|
Vec3f v;
|
|
smlua_get_vec3f(v, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "linear_mtxf_transpose_mul_vec3f"); return 0; }
|
|
|
|
extern void linear_mtxf_transpose_mul_vec3f(Mat4 m, OUT Vec3f dst, Vec3f v);
|
|
linear_mtxf_transpose_mul_vec3f(m, dst, v);
|
|
|
|
smlua_push_vec3f(dst, 2);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_apply_scale_to_transform(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_apply_scale_to_transform", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_apply_scale_to_transform"); return 0; }
|
|
|
|
extern void obj_apply_scale_to_transform(struct Object *obj);
|
|
obj_apply_scale_to_transform(obj);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_copy_scale(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_copy_scale", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* dst = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_copy_scale"); return 0; }
|
|
struct Object* src = (struct Object*)smlua_to_cobject(L, 2, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_copy_scale"); return 0; }
|
|
|
|
extern void obj_copy_scale(struct Object *dst, struct Object *src);
|
|
obj_copy_scale(dst, src);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_scale_xyz(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_scale_xyz", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_scale_xyz"); return 0; }
|
|
f32 xScale = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_scale_xyz"); return 0; }
|
|
f32 yScale = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_scale_xyz"); return 0; }
|
|
f32 zScale = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "obj_scale_xyz"); return 0; }
|
|
|
|
extern void obj_scale_xyz(struct Object *obj, f32 xScale, f32 yScale, f32 zScale);
|
|
obj_scale_xyz(obj, xScale, yScale, zScale);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_scale(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_scale", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_scale"); return 0; }
|
|
f32 scale = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_scale"); return 0; }
|
|
|
|
extern void obj_scale(struct Object *obj, f32 scale);
|
|
obj_scale(obj, scale);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_scale(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_scale", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 scale = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_scale"); return 0; }
|
|
|
|
extern void cur_obj_scale(f32 scale);
|
|
cur_obj_scale(scale);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_init_animation(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_init_animation", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 animIndex = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_init_animation"); return 0; }
|
|
|
|
extern void cur_obj_init_animation(s32 animIndex);
|
|
cur_obj_init_animation(animIndex);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_init_animation_with_sound(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_init_animation_with_sound", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 animIndex = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_init_animation_with_sound"); return 0; }
|
|
|
|
extern void cur_obj_init_animation_with_sound(s32 animIndex);
|
|
cur_obj_init_animation_with_sound(animIndex);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_init_animation_with_accel_and_sound(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_init_animation_with_accel_and_sound", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_init_animation_with_accel_and_sound"); return 0; }
|
|
s32 animIndex = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_init_animation_with_accel_and_sound"); return 0; }
|
|
f32 accel = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_init_animation_with_accel_and_sound"); return 0; }
|
|
|
|
extern void obj_init_animation_with_accel_and_sound(struct Object *obj, s32 animIndex, f32 accel);
|
|
obj_init_animation_with_accel_and_sound(obj, animIndex, accel);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_init_animation_with_accel_and_sound(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_init_animation_with_accel_and_sound", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 animIndex = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_init_animation_with_accel_and_sound"); return 0; }
|
|
f32 accel = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "cur_obj_init_animation_with_accel_and_sound"); return 0; }
|
|
|
|
extern void cur_obj_init_animation_with_accel_and_sound(s32 animIndex, f32 accel);
|
|
cur_obj_init_animation_with_accel_and_sound(animIndex, accel);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_init_animation_with_sound(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_init_animation_with_sound", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_init_animation_with_sound"); return 0; }
|
|
struct AnimationTable* animations = (struct AnimationTable*)smlua_to_cobject(L, 2, LOT_ANIMATIONTABLE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_init_animation_with_sound"); return 0; }
|
|
s32 animIndex = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_init_animation_with_sound"); return 0; }
|
|
|
|
extern void obj_init_animation_with_sound(struct Object *obj, const struct AnimationTable* animations, s32 animIndex);
|
|
obj_init_animation_with_sound(obj, animations, animIndex);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_enable_rendering_and_become_tangible(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_enable_rendering_and_become_tangible", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_enable_rendering_and_become_tangible"); return 0; }
|
|
|
|
extern void cur_obj_enable_rendering_and_become_tangible(struct Object *obj);
|
|
cur_obj_enable_rendering_and_become_tangible(obj);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_enable_rendering(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_enable_rendering", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void cur_obj_enable_rendering(void);
|
|
cur_obj_enable_rendering();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_disable_rendering_and_become_intangible(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_disable_rendering_and_become_intangible", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_disable_rendering_and_become_intangible"); return 0; }
|
|
|
|
extern void cur_obj_disable_rendering_and_become_intangible(struct Object *obj);
|
|
cur_obj_disable_rendering_and_become_intangible(obj);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_disable_rendering(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_disable_rendering", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void cur_obj_disable_rendering(void);
|
|
cur_obj_disable_rendering();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_unhide(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_unhide", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void cur_obj_unhide(void);
|
|
cur_obj_unhide();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_hide(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_hide", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void cur_obj_hide(void);
|
|
cur_obj_hide();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_set_pos_relative(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_set_pos_relative", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* other = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_set_pos_relative"); return 0; }
|
|
f32 dleft = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "cur_obj_set_pos_relative"); return 0; }
|
|
f32 dy = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "cur_obj_set_pos_relative"); return 0; }
|
|
f32 dforward = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "cur_obj_set_pos_relative"); return 0; }
|
|
|
|
extern void cur_obj_set_pos_relative(struct Object *other, f32 dleft, f32 dy, f32 dforward);
|
|
cur_obj_set_pos_relative(other, dleft, dy, dforward);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_set_pos_relative_to_parent(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_set_pos_relative_to_parent", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 dleft = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_set_pos_relative_to_parent"); return 0; }
|
|
f32 dy = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "cur_obj_set_pos_relative_to_parent"); return 0; }
|
|
f32 dforward = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "cur_obj_set_pos_relative_to_parent"); return 0; }
|
|
|
|
extern void cur_obj_set_pos_relative_to_parent(f32 dleft, f32 dy, f32 dforward);
|
|
cur_obj_set_pos_relative_to_parent(dleft, dy, dforward);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_enable_rendering_2(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_enable_rendering_2", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void cur_obj_enable_rendering_2(void);
|
|
cur_obj_enable_rendering_2();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_unused_init_on_floor(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_unused_init_on_floor", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void cur_obj_unused_init_on_floor(void);
|
|
cur_obj_unused_init_on_floor();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_set_face_angle_to_move_angle(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_set_face_angle_to_move_angle", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_set_face_angle_to_move_angle"); return 0; }
|
|
|
|
extern void obj_set_face_angle_to_move_angle(struct Object *obj);
|
|
obj_set_face_angle_to_move_angle(obj);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_object_list_from_behavior(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_object_list_from_behavior", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
BehaviorScript * behavior = (BehaviorScript *)smlua_to_cpointer(L, 1, LVT_BEHAVIORSCRIPT_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_object_list_from_behavior"); return 0; }
|
|
|
|
extern u32 get_object_list_from_behavior(const BehaviorScript *behavior);
|
|
lua_pushinteger(L, get_object_list_from_behavior(behavior));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_nearest_object_with_behavior(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_nearest_object_with_behavior", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
BehaviorScript * behavior = (BehaviorScript *)smlua_to_cpointer(L, 1, LVT_BEHAVIORSCRIPT_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_nearest_object_with_behavior"); return 0; }
|
|
|
|
extern struct Object *cur_obj_nearest_object_with_behavior(const BehaviorScript *behavior);
|
|
smlua_push_object(L, LOT_OBJECT, cur_obj_nearest_object_with_behavior(behavior), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_dist_to_nearest_object_with_behavior(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_dist_to_nearest_object_with_behavior", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
BehaviorScript * behavior = (BehaviorScript *)smlua_to_cpointer(L, 1, LVT_BEHAVIORSCRIPT_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_dist_to_nearest_object_with_behavior"); return 0; }
|
|
|
|
extern f32 cur_obj_dist_to_nearest_object_with_behavior(const BehaviorScript *behavior);
|
|
lua_pushnumber(L, cur_obj_dist_to_nearest_object_with_behavior(behavior));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_find_nearest_pole(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_find_nearest_pole", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern struct Object* cur_obj_find_nearest_pole(void);
|
|
smlua_push_object(L, LOT_OBJECT, cur_obj_find_nearest_pole(), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_find_nearest_object_with_behavior(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_find_nearest_object_with_behavior", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
BehaviorScript * behavior = (BehaviorScript *)smlua_to_cpointer(L, 1, LVT_BEHAVIORSCRIPT_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_find_nearest_object_with_behavior"); return 0; }
|
|
f32 * dist = (f32 *)smlua_to_cpointer(L, 2, LVT_F32_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "cur_obj_find_nearest_object_with_behavior"); return 0; }
|
|
|
|
extern struct Object *cur_obj_find_nearest_object_with_behavior(const BehaviorScript *behavior, f32 *dist);
|
|
smlua_push_object(L, LOT_OBJECT, cur_obj_find_nearest_object_with_behavior(behavior, dist), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_count_objects_with_behavior(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_count_objects_with_behavior", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
BehaviorScript* behavior = (BehaviorScript*)smlua_to_cpointer(L, 1, LVT_BEHAVIORSCRIPT_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_count_objects_with_behavior"); return 0; }
|
|
f32 dist = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "cur_obj_count_objects_with_behavior"); return 0; }
|
|
|
|
extern u16 cur_obj_count_objects_with_behavior(const BehaviorScript* behavior, f32 dist);
|
|
lua_pushinteger(L, cur_obj_count_objects_with_behavior(behavior, dist));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_find_unimportant_object(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "find_unimportant_object", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern struct Object *find_unimportant_object(void);
|
|
smlua_push_object(L, LOT_OBJECT, find_unimportant_object(), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_count_unimportant_objects(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "count_unimportant_objects", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern s32 count_unimportant_objects(void);
|
|
lua_pushinteger(L, count_unimportant_objects());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_count_objects_with_behavior(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "count_objects_with_behavior", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
BehaviorScript * behavior = (BehaviorScript *)smlua_to_cpointer(L, 1, LVT_BEHAVIORSCRIPT_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "count_objects_with_behavior"); return 0; }
|
|
|
|
extern s32 count_objects_with_behavior(const BehaviorScript *behavior);
|
|
lua_pushinteger(L, count_objects_with_behavior(behavior));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_find_object_with_behavior(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "find_object_with_behavior", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
BehaviorScript * behavior = (BehaviorScript *)smlua_to_cpointer(L, 1, LVT_BEHAVIORSCRIPT_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "find_object_with_behavior"); return 0; }
|
|
|
|
extern struct Object *find_object_with_behavior(const BehaviorScript *behavior);
|
|
smlua_push_object(L, LOT_OBJECT, find_object_with_behavior(behavior), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_find_nearby_held_actor(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_find_nearby_held_actor", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
BehaviorScript * behavior = (BehaviorScript *)smlua_to_cpointer(L, 1, LVT_BEHAVIORSCRIPT_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_find_nearby_held_actor"); return 0; }
|
|
f32 maxDist = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "cur_obj_find_nearby_held_actor"); return 0; }
|
|
|
|
extern struct Object *cur_obj_find_nearby_held_actor(const BehaviorScript *behavior, f32 maxDist);
|
|
smlua_push_object(L, LOT_OBJECT, cur_obj_find_nearby_held_actor(behavior, maxDist), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_reset_timer_and_subaction(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_reset_timer_and_subaction", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void cur_obj_reset_timer_and_subaction(void);
|
|
cur_obj_reset_timer_and_subaction();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_change_action(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_change_action", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 action = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_change_action"); return 0; }
|
|
|
|
extern void cur_obj_change_action(s32 action);
|
|
cur_obj_change_action(action);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_set_vel_from_mario_vel(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_set_vel_from_mario_vel", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_set_vel_from_mario_vel"); return 0; }
|
|
f32 f12 = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "cur_obj_set_vel_from_mario_vel"); return 0; }
|
|
f32 f14 = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "cur_obj_set_vel_from_mario_vel"); return 0; }
|
|
|
|
extern void cur_obj_set_vel_from_mario_vel(struct MarioState* m, f32 f12, f32 f14);
|
|
cur_obj_set_vel_from_mario_vel(m, f12, f14);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_reverse_animation(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_reverse_animation", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void cur_obj_reverse_animation(void);
|
|
cur_obj_reverse_animation();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_extend_animation_if_at_end(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_extend_animation_if_at_end", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void cur_obj_extend_animation_if_at_end(void);
|
|
cur_obj_extend_animation_if_at_end();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_check_if_near_animation_end(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_check_if_near_animation_end", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern s32 cur_obj_check_if_near_animation_end(void);
|
|
lua_pushinteger(L, cur_obj_check_if_near_animation_end());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_check_if_at_animation_end(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_check_if_at_animation_end", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern s32 cur_obj_check_if_at_animation_end(void);
|
|
lua_pushinteger(L, cur_obj_check_if_at_animation_end());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_check_anim_frame(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_check_anim_frame", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 frame = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_check_anim_frame"); return 0; }
|
|
|
|
extern s32 cur_obj_check_anim_frame(s32 frame);
|
|
lua_pushinteger(L, cur_obj_check_anim_frame(frame));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_check_anim_frame_in_range(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_check_anim_frame_in_range", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 startFrame = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_check_anim_frame_in_range"); return 0; }
|
|
s32 rangeLength = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "cur_obj_check_anim_frame_in_range"); return 0; }
|
|
|
|
extern s32 cur_obj_check_anim_frame_in_range(s32 startFrame, s32 rangeLength);
|
|
lua_pushinteger(L, cur_obj_check_anim_frame_in_range(startFrame, rangeLength));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_check_frame_prior_current_frame(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_check_frame_prior_current_frame", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 * a0 = (s16 *)smlua_to_cpointer(L, 1, LVT_S16_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_check_frame_prior_current_frame"); return 0; }
|
|
|
|
extern s32 cur_obj_check_frame_prior_current_frame(s16 *a0);
|
|
lua_pushinteger(L, cur_obj_check_frame_prior_current_frame(a0));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_is_in_air_action(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mario_is_in_air_action", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mario_is_in_air_action"); return 0; }
|
|
|
|
extern s32 mario_is_in_air_action(struct MarioState* m);
|
|
lua_pushinteger(L, mario_is_in_air_action(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_is_dive_sliding(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mario_is_dive_sliding", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mario_is_dive_sliding"); return 0; }
|
|
|
|
extern s32 mario_is_dive_sliding(struct MarioState* m);
|
|
lua_pushinteger(L, mario_is_dive_sliding(m));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_set_y_vel_and_animation(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_set_y_vel_and_animation", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 sp18 = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_set_y_vel_and_animation"); return 0; }
|
|
s32 sp1C = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "cur_obj_set_y_vel_and_animation"); return 0; }
|
|
|
|
extern void cur_obj_set_y_vel_and_animation(f32 sp18, s32 sp1C);
|
|
cur_obj_set_y_vel_and_animation(sp18, sp1C);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_unrender_and_reset_state(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_unrender_and_reset_state", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 sp18 = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_unrender_and_reset_state"); return 0; }
|
|
s32 sp1C = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "cur_obj_unrender_and_reset_state"); return 0; }
|
|
|
|
extern void cur_obj_unrender_and_reset_state(s32 sp18, s32 sp1C);
|
|
cur_obj_unrender_and_reset_state(sp18, sp1C);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_move_after_thrown_or_dropped(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_move_after_thrown_or_dropped", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 forwardVel = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_move_after_thrown_or_dropped"); return 0; }
|
|
f32 velY = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "cur_obj_move_after_thrown_or_dropped"); return 0; }
|
|
|
|
extern void cur_obj_move_after_thrown_or_dropped(f32 forwardVel, f32 velY);
|
|
cur_obj_move_after_thrown_or_dropped(forwardVel, velY);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_get_thrown_or_placed(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_get_thrown_or_placed", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 forwardVel = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_get_thrown_or_placed"); return 0; }
|
|
f32 velY = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "cur_obj_get_thrown_or_placed"); return 0; }
|
|
s32 thrownAction = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "cur_obj_get_thrown_or_placed"); return 0; }
|
|
|
|
extern void cur_obj_get_thrown_or_placed(f32 forwardVel, f32 velY, s32 thrownAction);
|
|
cur_obj_get_thrown_or_placed(forwardVel, velY, thrownAction);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_get_dropped(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_get_dropped", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void cur_obj_get_dropped(void);
|
|
cur_obj_get_dropped();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_set_flag(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mario_set_flag", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 flag = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mario_set_flag"); return 0; }
|
|
|
|
extern void mario_set_flag(s32 flag);
|
|
mario_set_flag(flag);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_clear_interact_status_flag(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_clear_interact_status_flag", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 flag = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_clear_interact_status_flag"); return 0; }
|
|
|
|
extern s32 cur_obj_clear_interact_status_flag(s32 flag);
|
|
lua_pushinteger(L, cur_obj_clear_interact_status_flag(flag));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_mark_for_deletion(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_mark_for_deletion", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_mark_for_deletion"); return 0; }
|
|
|
|
extern void obj_mark_for_deletion(struct Object *obj);
|
|
obj_mark_for_deletion(obj);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_disable(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_disable", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void cur_obj_disable(void);
|
|
cur_obj_disable();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_become_intangible(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_become_intangible", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void cur_obj_become_intangible(void);
|
|
cur_obj_become_intangible();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_become_tangible(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_become_tangible", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void cur_obj_become_tangible(void);
|
|
cur_obj_become_tangible();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_become_tangible(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_become_tangible", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_become_tangible"); return 0; }
|
|
|
|
extern void obj_become_tangible(struct Object *obj);
|
|
obj_become_tangible(obj);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_update_floor_height(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_update_floor_height", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void cur_obj_update_floor_height(void);
|
|
cur_obj_update_floor_height();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_update_floor_height_and_get_floor(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_update_floor_height_and_get_floor", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern struct Surface *cur_obj_update_floor_height_and_get_floor(void);
|
|
smlua_push_object(L, LOT_SURFACE, cur_obj_update_floor_height_and_get_floor(), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_apply_drag_to_value(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "apply_drag_to_value", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 * value = (f32 *)smlua_to_cpointer(L, 1, LVT_F32_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "apply_drag_to_value"); return 0; }
|
|
f32 dragStrength = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "apply_drag_to_value"); return 0; }
|
|
|
|
extern void apply_drag_to_value(f32 *value, f32 dragStrength);
|
|
apply_drag_to_value(value, dragStrength);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_apply_drag_xz(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_apply_drag_xz", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 dragStrength = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_apply_drag_xz"); return 0; }
|
|
|
|
extern void cur_obj_apply_drag_xz(f32 dragStrength);
|
|
cur_obj_apply_drag_xz(dragStrength);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_move_xz(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_move_xz", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 steepSlopeNormalY = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_move_xz"); return 0; }
|
|
s32 careAboutEdgesAndSteepSlopes = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "cur_obj_move_xz"); return 0; }
|
|
|
|
extern s32 cur_obj_move_xz(f32 steepSlopeNormalY, s32 careAboutEdgesAndSteepSlopes);
|
|
lua_pushinteger(L, cur_obj_move_xz(steepSlopeNormalY, careAboutEdgesAndSteepSlopes));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_move_update_underwater_flags(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_move_update_underwater_flags", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void cur_obj_move_update_underwater_flags(void);
|
|
cur_obj_move_update_underwater_flags();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_move_update_ground_air_flags(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_move_update_ground_air_flags", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 gravity = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_move_update_ground_air_flags"); return 0; }
|
|
f32 bounciness = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "cur_obj_move_update_ground_air_flags"); return 0; }
|
|
|
|
extern void cur_obj_move_update_ground_air_flags(UNUSED f32 gravity, f32 bounciness);
|
|
cur_obj_move_update_ground_air_flags(gravity, bounciness);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_move_y_and_get_water_level(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_move_y_and_get_water_level", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 gravity = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_move_y_and_get_water_level"); return 0; }
|
|
f32 buoyancy = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "cur_obj_move_y_and_get_water_level"); return 0; }
|
|
|
|
extern f32 cur_obj_move_y_and_get_water_level(f32 gravity, f32 buoyancy);
|
|
lua_pushnumber(L, cur_obj_move_y_and_get_water_level(gravity, buoyancy));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_move_y(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_move_y", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 gravity = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_move_y"); return 0; }
|
|
f32 bounciness = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "cur_obj_move_y"); return 0; }
|
|
f32 buoyancy = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "cur_obj_move_y"); return 0; }
|
|
|
|
extern void cur_obj_move_y(f32 gravity, f32 bounciness, f32 buoyancy);
|
|
cur_obj_move_y(gravity, bounciness, buoyancy);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_unused_resolve_wall_collisions(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_unused_resolve_wall_collisions", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 offsetY = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_unused_resolve_wall_collisions"); return 0; }
|
|
f32 radius = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "cur_obj_unused_resolve_wall_collisions"); return 0; }
|
|
|
|
extern void cur_obj_unused_resolve_wall_collisions(f32 offsetY, f32 radius);
|
|
cur_obj_unused_resolve_wall_collisions(offsetY, radius);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_abs_angle_diff(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "abs_angle_diff", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 x0 = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "abs_angle_diff"); return 0; }
|
|
s16 x1 = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "abs_angle_diff"); return 0; }
|
|
|
|
extern s16 abs_angle_diff(s16 x0, s16 x1);
|
|
lua_pushinteger(L, abs_angle_diff(x0, x1));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_move_xz_using_fvel_and_yaw(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_move_xz_using_fvel_and_yaw", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void cur_obj_move_xz_using_fvel_and_yaw(void);
|
|
cur_obj_move_xz_using_fvel_and_yaw();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_move_y_with_terminal_vel(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_move_y_with_terminal_vel", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void cur_obj_move_y_with_terminal_vel(void);
|
|
cur_obj_move_y_with_terminal_vel();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_compute_vel_xz(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_compute_vel_xz", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void cur_obj_compute_vel_xz(void);
|
|
cur_obj_compute_vel_xz();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_increment_velocity_toward_range(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "increment_velocity_toward_range", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 value = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "increment_velocity_toward_range"); return 0; }
|
|
f32 center = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "increment_velocity_toward_range"); return 0; }
|
|
f32 zeroThreshold = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "increment_velocity_toward_range"); return 0; }
|
|
f32 increment = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "increment_velocity_toward_range"); return 0; }
|
|
|
|
extern f32 increment_velocity_toward_range(f32 value, f32 center, f32 zeroThreshold, f32 increment);
|
|
lua_pushnumber(L, increment_velocity_toward_range(value, center, zeroThreshold, increment));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_check_if_collided_with_object(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_check_if_collided_with_object", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj1 = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_check_if_collided_with_object"); return 0; }
|
|
struct Object* obj2 = (struct Object*)smlua_to_cobject(L, 2, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_check_if_collided_with_object"); return 0; }
|
|
|
|
extern s32 obj_check_if_collided_with_object(struct Object *obj1, struct Object *obj2);
|
|
lua_pushinteger(L, obj_check_if_collided_with_object(obj1, obj2));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_set_behavior(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_set_behavior", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
BehaviorScript * behavior = (BehaviorScript *)smlua_to_cpointer(L, 1, LVT_BEHAVIORSCRIPT_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_set_behavior"); return 0; }
|
|
|
|
extern void cur_obj_set_behavior(const BehaviorScript *behavior);
|
|
cur_obj_set_behavior(behavior);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_set_behavior(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_set_behavior", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_set_behavior"); return 0; }
|
|
BehaviorScript * behavior = (BehaviorScript *)smlua_to_cpointer(L, 2, LVT_BEHAVIORSCRIPT_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_set_behavior"); return 0; }
|
|
|
|
extern void obj_set_behavior(struct Object *obj, const BehaviorScript *behavior);
|
|
obj_set_behavior(obj, behavior);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_has_behavior(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_has_behavior", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
BehaviorScript * behavior = (BehaviorScript *)smlua_to_cpointer(L, 1, LVT_BEHAVIORSCRIPT_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_has_behavior"); return 0; }
|
|
|
|
extern s32 cur_obj_has_behavior(const BehaviorScript *behavior);
|
|
lua_pushinteger(L, cur_obj_has_behavior(behavior));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_has_behavior(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_has_behavior", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_has_behavior"); return 0; }
|
|
BehaviorScript * behavior = (BehaviorScript *)smlua_to_cpointer(L, 2, LVT_BEHAVIORSCRIPT_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_has_behavior"); return 0; }
|
|
|
|
extern s32 obj_has_behavior(struct Object *obj, const BehaviorScript *behavior);
|
|
lua_pushinteger(L, obj_has_behavior(obj, behavior));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_lateral_dist_from_obj_to_home(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_lateral_dist_from_obj_to_home", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_lateral_dist_from_obj_to_home"); return 0; }
|
|
|
|
extern f32 cur_obj_lateral_dist_from_obj_to_home(struct Object *obj);
|
|
lua_pushnumber(L, cur_obj_lateral_dist_from_obj_to_home(obj));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_lateral_dist_from_mario_to_home(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_lateral_dist_from_mario_to_home", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern f32 cur_obj_lateral_dist_from_mario_to_home(void);
|
|
lua_pushnumber(L, cur_obj_lateral_dist_from_mario_to_home());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_lateral_dist_to_home(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_lateral_dist_to_home", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern f32 cur_obj_lateral_dist_to_home(void);
|
|
lua_pushnumber(L, cur_obj_lateral_dist_to_home());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_outside_home_square(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_outside_home_square", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 halfLength = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_outside_home_square"); return 0; }
|
|
|
|
extern s32 cur_obj_outside_home_square(f32 halfLength);
|
|
lua_pushinteger(L, cur_obj_outside_home_square(halfLength));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_outside_home_rectangle(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_outside_home_rectangle", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 minX = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_outside_home_rectangle"); return 0; }
|
|
f32 maxX = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "cur_obj_outside_home_rectangle"); return 0; }
|
|
f32 minZ = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "cur_obj_outside_home_rectangle"); return 0; }
|
|
f32 maxZ = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "cur_obj_outside_home_rectangle"); return 0; }
|
|
|
|
extern s32 cur_obj_outside_home_rectangle(f32 minX, f32 maxX, f32 minZ, f32 maxZ);
|
|
lua_pushinteger(L, cur_obj_outside_home_rectangle(minX, maxX, minZ, maxZ));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_set_pos_to_home(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_set_pos_to_home", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void cur_obj_set_pos_to_home(void);
|
|
cur_obj_set_pos_to_home();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_set_pos_to_home_and_stop(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_set_pos_to_home_and_stop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void cur_obj_set_pos_to_home_and_stop(void);
|
|
cur_obj_set_pos_to_home_and_stop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_shake_y(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_shake_y", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 amount = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_shake_y"); return 0; }
|
|
|
|
extern void cur_obj_shake_y(f32 amount);
|
|
cur_obj_shake_y(amount);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_start_cam_event(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_start_cam_event", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_start_cam_event"); return 0; }
|
|
s32 cameraEvent = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "cur_obj_start_cam_event"); return 0; }
|
|
|
|
extern void cur_obj_start_cam_event(UNUSED struct Object *obj, s32 cameraEvent);
|
|
cur_obj_start_cam_event(obj, cameraEvent);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_mario_interact_hoot_if_in_range(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_mario_interact_hoot_if_in_range", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 sp0 = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_mario_interact_hoot_if_in_range"); return 0; }
|
|
s32 sp4 = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "set_mario_interact_hoot_if_in_range"); return 0; }
|
|
f32 sp8 = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "set_mario_interact_hoot_if_in_range"); return 0; }
|
|
|
|
extern void set_mario_interact_hoot_if_in_range(UNUSED s32 sp0, UNUSED s32 sp4, f32 sp8);
|
|
set_mario_interact_hoot_if_in_range(sp0, sp4, sp8);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_set_billboard(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_set_billboard", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_set_billboard"); return 0; }
|
|
|
|
extern void obj_set_billboard(struct Object *obj);
|
|
obj_set_billboard(obj);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_set_cylboard(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_set_cylboard", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_set_cylboard"); return 0; }
|
|
|
|
extern void obj_set_cylboard(struct Object *obj);
|
|
obj_set_cylboard(obj);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_set_billboard_if_vanilla_cam(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_set_billboard_if_vanilla_cam", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void cur_obj_set_billboard_if_vanilla_cam(void);
|
|
cur_obj_set_billboard_if_vanilla_cam();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_set_hitbox_radius_and_height(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_set_hitbox_radius_and_height", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_set_hitbox_radius_and_height"); return 0; }
|
|
f32 radius = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_set_hitbox_radius_and_height"); return 0; }
|
|
f32 height = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_set_hitbox_radius_and_height"); return 0; }
|
|
|
|
extern void obj_set_hitbox_radius_and_height(struct Object *o, f32 radius, f32 height);
|
|
obj_set_hitbox_radius_and_height(o, radius, height);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_set_hurtbox_radius_and_height(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_set_hurtbox_radius_and_height", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_set_hurtbox_radius_and_height"); return 0; }
|
|
f32 radius = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_set_hurtbox_radius_and_height"); return 0; }
|
|
f32 height = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_set_hurtbox_radius_and_height"); return 0; }
|
|
|
|
extern void obj_set_hurtbox_radius_and_height(struct Object *o, f32 radius, f32 height);
|
|
obj_set_hurtbox_radius_and_height(o, radius, height);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_set_hitbox_radius_and_height(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_set_hitbox_radius_and_height", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 radius = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_set_hitbox_radius_and_height"); return 0; }
|
|
f32 height = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "cur_obj_set_hitbox_radius_and_height"); return 0; }
|
|
|
|
extern void cur_obj_set_hitbox_radius_and_height(f32 radius, f32 height);
|
|
cur_obj_set_hitbox_radius_and_height(radius, height);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_set_hurtbox_radius_and_height(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_set_hurtbox_radius_and_height", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 radius = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_set_hurtbox_radius_and_height"); return 0; }
|
|
f32 height = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "cur_obj_set_hurtbox_radius_and_height"); return 0; }
|
|
|
|
extern void cur_obj_set_hurtbox_radius_and_height(f32 radius, f32 height);
|
|
cur_obj_set_hurtbox_radius_and_height(radius, height);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_spawn_loot_coins(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 6) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_spawn_loot_coins", 6, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_spawn_loot_coins"); return 0; }
|
|
s32 numCoins = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_spawn_loot_coins"); return 0; }
|
|
f32 sp30 = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_spawn_loot_coins"); return 0; }
|
|
BehaviorScript * coinBehavior = (BehaviorScript *)smlua_to_cpointer(L, 4, LVT_BEHAVIORSCRIPT_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "obj_spawn_loot_coins"); return 0; }
|
|
s16 posJitter = smlua_to_integer(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "obj_spawn_loot_coins"); return 0; }
|
|
s16 model = smlua_to_integer(L, 6);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 6, "obj_spawn_loot_coins"); return 0; }
|
|
|
|
extern void obj_spawn_loot_coins(struct Object *obj, s32 numCoins, f32 sp30, const BehaviorScript *coinBehavior, s16 posJitter, s16 model);
|
|
obj_spawn_loot_coins(obj, numCoins, sp30, coinBehavior, posJitter, model);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_spawn_loot_blue_coins(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_spawn_loot_blue_coins", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_spawn_loot_blue_coins"); return 0; }
|
|
s32 numCoins = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_spawn_loot_blue_coins"); return 0; }
|
|
f32 sp28 = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_spawn_loot_blue_coins"); return 0; }
|
|
s16 posJitter = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "obj_spawn_loot_blue_coins"); return 0; }
|
|
|
|
extern void obj_spawn_loot_blue_coins(struct Object *obj, s32 numCoins, f32 sp28, s16 posJitter);
|
|
obj_spawn_loot_blue_coins(obj, numCoins, sp28, posJitter);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_spawn_loot_yellow_coins(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_spawn_loot_yellow_coins", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_spawn_loot_yellow_coins"); return 0; }
|
|
s32 numCoins = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_spawn_loot_yellow_coins"); return 0; }
|
|
f32 sp28 = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_spawn_loot_yellow_coins"); return 0; }
|
|
|
|
extern void obj_spawn_loot_yellow_coins(struct Object *obj, s32 numCoins, f32 sp28);
|
|
obj_spawn_loot_yellow_coins(obj, numCoins, sp28);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_spawn_loot_coin_at_mario_pos(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_spawn_loot_coin_at_mario_pos", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_spawn_loot_coin_at_mario_pos"); return 0; }
|
|
|
|
extern void cur_obj_spawn_loot_coin_at_mario_pos(struct MarioState* m);
|
|
cur_obj_spawn_loot_coin_at_mario_pos(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_abs_y_dist_to_home(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_abs_y_dist_to_home", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern f32 cur_obj_abs_y_dist_to_home(void);
|
|
lua_pushnumber(L, cur_obj_abs_y_dist_to_home());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_advance_looping_anim(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_advance_looping_anim", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern s32 cur_obj_advance_looping_anim(void);
|
|
lua_pushinteger(L, cur_obj_advance_looping_anim());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_detect_steep_floor(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_detect_steep_floor", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 steepAngleDegrees = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_detect_steep_floor"); return 0; }
|
|
|
|
extern s32 cur_obj_detect_steep_floor(s16 steepAngleDegrees);
|
|
lua_pushinteger(L, cur_obj_detect_steep_floor(steepAngleDegrees));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_resolve_wall_collisions(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_resolve_wall_collisions", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern s32 cur_obj_resolve_wall_collisions(void);
|
|
lua_pushinteger(L, cur_obj_resolve_wall_collisions());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_update_floor(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_update_floor", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void cur_obj_update_floor(void);
|
|
cur_obj_update_floor();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_update_floor_and_resolve_wall_collisions(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_update_floor_and_resolve_wall_collisions", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 steepSlopeDegrees = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_update_floor_and_resolve_wall_collisions"); return 0; }
|
|
|
|
extern void cur_obj_update_floor_and_resolve_wall_collisions(s16 steepSlopeDegrees);
|
|
cur_obj_update_floor_and_resolve_wall_collisions(steepSlopeDegrees);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_update_floor_and_walls(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_update_floor_and_walls", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void cur_obj_update_floor_and_walls(void);
|
|
cur_obj_update_floor_and_walls();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_move_standard(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_move_standard", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 steepSlopeAngleDegrees = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_move_standard"); return 0; }
|
|
|
|
extern void cur_obj_move_standard(s16 steepSlopeAngleDegrees);
|
|
cur_obj_move_standard(steepSlopeAngleDegrees);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_within_12k_bounds(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_within_12k_bounds", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern s32 cur_obj_within_12k_bounds(void);
|
|
lua_pushinteger(L, cur_obj_within_12k_bounds());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_move_using_vel_and_gravity(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_move_using_vel_and_gravity", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void cur_obj_move_using_vel_and_gravity(void);
|
|
cur_obj_move_using_vel_and_gravity();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_move_using_fvel_and_gravity(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_move_using_fvel_and_gravity", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void cur_obj_move_using_fvel_and_gravity(void);
|
|
cur_obj_move_using_fvel_and_gravity();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_set_pos_relative(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 5) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_set_pos_relative", 5, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_set_pos_relative"); return 0; }
|
|
struct Object* other = (struct Object*)smlua_to_cobject(L, 2, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_set_pos_relative"); return 0; }
|
|
f32 dleft = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_set_pos_relative"); return 0; }
|
|
f32 dy = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "obj_set_pos_relative"); return 0; }
|
|
f32 dforward = smlua_to_number(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "obj_set_pos_relative"); return 0; }
|
|
|
|
extern void obj_set_pos_relative(struct Object *obj, struct Object *other, f32 dleft, f32 dy, f32 dforward);
|
|
obj_set_pos_relative(obj, other, dleft, dy, dforward);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_angle_to_home(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_angle_to_home", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern s16 cur_obj_angle_to_home(void);
|
|
lua_pushinteger(L, cur_obj_angle_to_home());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_set_gfx_pos_at_obj_pos(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_set_gfx_pos_at_obj_pos", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj1 = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_set_gfx_pos_at_obj_pos"); return 0; }
|
|
struct Object* obj2 = (struct Object*)smlua_to_cobject(L, 2, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_set_gfx_pos_at_obj_pos"); return 0; }
|
|
|
|
extern void obj_set_gfx_pos_at_obj_pos(struct Object *obj1, struct Object *obj2);
|
|
obj_set_gfx_pos_at_obj_pos(obj1, obj2);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_translate_local(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_translate_local", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_translate_local"); return 0; }
|
|
s16 posIndex = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_translate_local"); return 0; }
|
|
s16 localTranslateIndex = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_translate_local"); return 0; }
|
|
|
|
extern void obj_translate_local(struct Object *obj, s16 posIndex, s16 localTranslateIndex);
|
|
obj_translate_local(obj, posIndex, localTranslateIndex);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_build_transform_from_pos_and_angle(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_build_transform_from_pos_and_angle", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_build_transform_from_pos_and_angle"); return 0; }
|
|
s16 posIndex = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_build_transform_from_pos_and_angle"); return 0; }
|
|
s16 angleIndex = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_build_transform_from_pos_and_angle"); return 0; }
|
|
|
|
extern void obj_build_transform_from_pos_and_angle(struct Object *obj, s16 posIndex, s16 angleIndex);
|
|
obj_build_transform_from_pos_and_angle(obj, posIndex, angleIndex);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_set_throw_matrix_from_transform(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_set_throw_matrix_from_transform", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_set_throw_matrix_from_transform"); return 0; }
|
|
|
|
extern void obj_set_throw_matrix_from_transform(struct Object *obj);
|
|
obj_set_throw_matrix_from_transform(obj);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_build_transform_relative_to_parent(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_build_transform_relative_to_parent", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_build_transform_relative_to_parent"); return 0; }
|
|
|
|
extern void obj_build_transform_relative_to_parent(struct Object *obj);
|
|
obj_build_transform_relative_to_parent(obj);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_create_transform_from_self(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_create_transform_from_self", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_create_transform_from_self"); return 0; }
|
|
|
|
extern void obj_create_transform_from_self(struct Object *obj);
|
|
obj_create_transform_from_self(obj);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_rotate_move_angle_using_vel(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_rotate_move_angle_using_vel", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void cur_obj_rotate_move_angle_using_vel(void);
|
|
cur_obj_rotate_move_angle_using_vel();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_rotate_face_angle_using_vel(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_rotate_face_angle_using_vel", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void cur_obj_rotate_face_angle_using_vel(void);
|
|
cur_obj_rotate_face_angle_using_vel();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_set_face_angle_to_move_angle(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_set_face_angle_to_move_angle", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void cur_obj_set_face_angle_to_move_angle(void);
|
|
cur_obj_set_face_angle_to_move_angle();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_follow_path(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_follow_path", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 unusedArg = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_follow_path"); return 0; }
|
|
|
|
extern s32 cur_obj_follow_path(UNUSED s32 unusedArg);
|
|
lua_pushinteger(L, cur_obj_follow_path(unusedArg));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_chain_segment_init(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "chain_segment_init", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ChainSegment* segment = (struct ChainSegment*)smlua_to_cobject(L, 1, LOT_CHAINSEGMENT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "chain_segment_init"); return 0; }
|
|
|
|
extern void chain_segment_init(struct ChainSegment *segment);
|
|
chain_segment_init(segment);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_random_f32_around_zero(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "random_f32_around_zero", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 diameter = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "random_f32_around_zero"); return 0; }
|
|
|
|
extern f32 random_f32_around_zero(f32 diameter);
|
|
lua_pushnumber(L, random_f32_around_zero(diameter));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_scale_random(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_scale_random", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_scale_random"); return 0; }
|
|
f32 rangeLength = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_scale_random"); return 0; }
|
|
f32 minScale = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_scale_random"); return 0; }
|
|
|
|
extern void obj_scale_random(struct Object *obj, f32 rangeLength, f32 minScale);
|
|
obj_scale_random(obj, rangeLength, minScale);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_translate_xyz_random(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_translate_xyz_random", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_translate_xyz_random"); return 0; }
|
|
f32 rangeLength = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_translate_xyz_random"); return 0; }
|
|
|
|
extern void obj_translate_xyz_random(struct Object *obj, f32 rangeLength);
|
|
obj_translate_xyz_random(obj, rangeLength);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_translate_xz_random(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_translate_xz_random", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_translate_xz_random"); return 0; }
|
|
f32 rangeLength = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_translate_xz_random"); return 0; }
|
|
|
|
extern void obj_translate_xz_random(struct Object *obj, f32 rangeLength);
|
|
obj_translate_xz_random(obj, rangeLength);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_build_vel_from_transform(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_build_vel_from_transform", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* a0 = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_build_vel_from_transform"); return 0; }
|
|
|
|
extern void obj_build_vel_from_transform(struct Object *a0);
|
|
obj_build_vel_from_transform(a0);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_set_pos_via_transform(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_set_pos_via_transform", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void cur_obj_set_pos_via_transform(void);
|
|
cur_obj_set_pos_via_transform();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_reflect_move_angle_off_wall(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_reflect_move_angle_off_wall", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern s16 cur_obj_reflect_move_angle_off_wall(void);
|
|
lua_pushinteger(L, cur_obj_reflect_move_angle_off_wall());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_spawn_particles(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_spawn_particles", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct SpawnParticlesInfo* info = (struct SpawnParticlesInfo*)smlua_to_cobject(L, 1, LOT_SPAWNPARTICLESINFO);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_spawn_particles"); return 0; }
|
|
|
|
extern void cur_obj_spawn_particles(struct SpawnParticlesInfo *info);
|
|
cur_obj_spawn_particles(info);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_set_hitbox(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_set_hitbox", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_set_hitbox"); return 0; }
|
|
struct ObjectHitbox* hitbox = (struct ObjectHitbox*)smlua_to_cobject(L, 2, LOT_OBJECTHITBOX);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_set_hitbox"); return 0; }
|
|
|
|
extern void obj_set_hitbox(struct Object *obj, struct ObjectHitbox *hitbox);
|
|
obj_set_hitbox(obj, hitbox);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_signum_positive(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "signum_positive", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 x = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "signum_positive"); return 0; }
|
|
|
|
extern s32 signum_positive(s32 x);
|
|
lua_pushinteger(L, signum_positive(x));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_wait_then_blink(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_wait_then_blink", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 timeUntilBlinking = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_wait_then_blink"); return 0; }
|
|
s32 numBlinks = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "cur_obj_wait_then_blink"); return 0; }
|
|
|
|
extern s32 cur_obj_wait_then_blink(s32 timeUntilBlinking, s32 numBlinks);
|
|
lua_pushinteger(L, cur_obj_wait_then_blink(timeUntilBlinking, numBlinks));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_is_mario_ground_pounding_platform(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_is_mario_ground_pounding_platform", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern s32 cur_obj_is_mario_ground_pounding_platform(void);
|
|
lua_pushinteger(L, cur_obj_is_mario_ground_pounding_platform());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_is_mario_ground_pounding_platform(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_is_mario_ground_pounding_platform", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_is_mario_ground_pounding_platform"); return 0; }
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 2, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_is_mario_ground_pounding_platform"); return 0; }
|
|
|
|
extern s32 obj_is_mario_ground_pounding_platform(struct MarioState *m, struct Object *obj);
|
|
lua_pushinteger(L, obj_is_mario_ground_pounding_platform(m, obj));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_spawn_mist_particles(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "spawn_mist_particles", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void spawn_mist_particles(void);
|
|
spawn_mist_particles();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_spawn_mist_particles_with_sound(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "spawn_mist_particles_with_sound", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u32 sp18 = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "spawn_mist_particles_with_sound"); return 0; }
|
|
|
|
extern void spawn_mist_particles_with_sound(u32 sp18);
|
|
spawn_mist_particles_with_sound(sp18);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_push_mario_away(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_push_mario_away", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 radius = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_push_mario_away"); return 0; }
|
|
|
|
extern void cur_obj_push_mario_away(f32 radius);
|
|
cur_obj_push_mario_away(radius);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_push_mario_away_from_cylinder(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_push_mario_away_from_cylinder", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 radius = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_push_mario_away_from_cylinder"); return 0; }
|
|
f32 extentY = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "cur_obj_push_mario_away_from_cylinder"); return 0; }
|
|
|
|
extern void cur_obj_push_mario_away_from_cylinder(f32 radius, f32 extentY);
|
|
cur_obj_push_mario_away_from_cylinder(radius, extentY);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_dust_smoke_loop(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_dust_smoke_loop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void bhv_dust_smoke_loop(void);
|
|
bhv_dust_smoke_loop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_stub_obj_helpers_3(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "stub_obj_helpers_3", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 sp0 = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "stub_obj_helpers_3"); return 0; }
|
|
s32 sp4 = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "stub_obj_helpers_3"); return 0; }
|
|
|
|
extern void stub_obj_helpers_3(UNUSED s32 sp0, UNUSED s32 sp4);
|
|
stub_obj_helpers_3(sp0, sp4);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_scale_over_time(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_scale_over_time", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 a0 = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_scale_over_time"); return 0; }
|
|
s32 a1 = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "cur_obj_scale_over_time"); return 0; }
|
|
f32 sp10 = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "cur_obj_scale_over_time"); return 0; }
|
|
f32 sp14 = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "cur_obj_scale_over_time"); return 0; }
|
|
|
|
extern void cur_obj_scale_over_time(s32 a0, s32 a1, f32 sp10, f32 sp14);
|
|
cur_obj_scale_over_time(a0, a1, sp10, sp14);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_set_pos_to_home_with_debug(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_set_pos_to_home_with_debug", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void cur_obj_set_pos_to_home_with_debug(void);
|
|
cur_obj_set_pos_to_home_with_debug();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_stub_obj_helpers_4(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "stub_obj_helpers_4", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void stub_obj_helpers_4(void);
|
|
stub_obj_helpers_4();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_is_mario_on_platform(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_is_mario_on_platform", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern s32 cur_obj_is_mario_on_platform(void);
|
|
lua_pushinteger(L, cur_obj_is_mario_on_platform());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_is_any_player_on_platform(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_is_any_player_on_platform", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern s32 cur_obj_is_any_player_on_platform(void);
|
|
lua_pushinteger(L, cur_obj_is_any_player_on_platform());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_shake_y_until(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_shake_y_until", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 cycles = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_shake_y_until"); return 0; }
|
|
s32 amount = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "cur_obj_shake_y_until"); return 0; }
|
|
|
|
extern s32 cur_obj_shake_y_until(s32 cycles, s32 amount);
|
|
lua_pushinteger(L, cur_obj_shake_y_until(cycles, amount));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_move_up_and_down(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_move_up_and_down", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 a0 = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_move_up_and_down"); return 0; }
|
|
|
|
extern s32 cur_obj_move_up_and_down(s32 a0);
|
|
lua_pushinteger(L, cur_obj_move_up_and_down(a0));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_spawn_star_with_no_lvl_exit(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "spawn_star_with_no_lvl_exit", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 sp20 = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "spawn_star_with_no_lvl_exit"); return 0; }
|
|
s32 sp24 = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "spawn_star_with_no_lvl_exit"); return 0; }
|
|
|
|
extern struct Object *spawn_star_with_no_lvl_exit(s32 sp20, s32 sp24);
|
|
smlua_push_object(L, LOT_OBJECT, spawn_star_with_no_lvl_exit(sp20, sp24), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_spawn_base_star_with_no_lvl_exit(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "spawn_base_star_with_no_lvl_exit", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void spawn_base_star_with_no_lvl_exit(void);
|
|
spawn_base_star_with_no_lvl_exit();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bit_shift_left(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bit_shift_left", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 a0 = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "bit_shift_left"); return 0; }
|
|
|
|
extern s32 bit_shift_left(s32 a0);
|
|
lua_pushinteger(L, bit_shift_left(a0));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_mario_far_away(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_mario_far_away", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern s32 cur_obj_mario_far_away(void);
|
|
lua_pushinteger(L, cur_obj_mario_far_away());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_is_mario_moving_fast_or_in_air(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "is_mario_moving_fast_or_in_air", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 speedThreshold = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "is_mario_moving_fast_or_in_air"); return 0; }
|
|
|
|
extern s32 is_mario_moving_fast_or_in_air(s32 speedThreshold);
|
|
lua_pushinteger(L, is_mario_moving_fast_or_in_air(speedThreshold));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_is_item_in_array(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "is_item_in_array", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s8 item = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "is_item_in_array"); return 0; }
|
|
s8 * array = (s8 *)smlua_to_cpointer(L, 2, LVT_S8_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "is_item_in_array"); return 0; }
|
|
|
|
extern s32 is_item_in_array(s8 item, s8 *array);
|
|
lua_pushinteger(L, is_item_in_array(item, array));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_bhv_init_room(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "bhv_init_room", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void bhv_init_room(void);
|
|
bhv_init_room();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_enable_rendering_if_mario_in_room(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_enable_rendering_if_mario_in_room", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void cur_obj_enable_rendering_if_mario_in_room(void);
|
|
cur_obj_enable_rendering_if_mario_in_room();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_set_hitbox_and_die_if_attacked(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_set_hitbox_and_die_if_attacked", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ObjectHitbox* hitbox = (struct ObjectHitbox*)smlua_to_cobject(L, 1, LOT_OBJECTHITBOX);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_set_hitbox_and_die_if_attacked"); return 0; }
|
|
s32 deathSound = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "cur_obj_set_hitbox_and_die_if_attacked"); return 0; }
|
|
s32 noLootCoins = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "cur_obj_set_hitbox_and_die_if_attacked"); return 0; }
|
|
|
|
extern s32 cur_obj_set_hitbox_and_die_if_attacked(struct ObjectHitbox *hitbox, s32 deathSound, s32 noLootCoins);
|
|
lua_pushinteger(L, cur_obj_set_hitbox_and_die_if_attacked(hitbox, deathSound, noLootCoins));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_explode_and_spawn_coins(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_explode_and_spawn_coins", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 sp18 = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_explode_and_spawn_coins"); return 0; }
|
|
s32 sp1C = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_explode_and_spawn_coins"); return 0; }
|
|
|
|
extern void obj_explode_and_spawn_coins(f32 sp18, s32 sp1C);
|
|
obj_explode_and_spawn_coins(sp18, sp1C);
|
|
|
|
return 1;
|
|
}
|
|
|
|
/*
|
|
int smlua_func_obj_set_collision_data(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_set_collision_data", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_set_collision_data"); return 0; }
|
|
// void * segAddr = (void *)smlua_to_cobject(L, 2, LOT_???); <--- UNIMPLEMENTED
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_set_collision_data"); return 0; }
|
|
|
|
extern void obj_set_collision_data(struct Object *obj, const void *segAddr);
|
|
obj_set_collision_data(obj, segAddr);
|
|
|
|
return 1;
|
|
}
|
|
*/
|
|
|
|
int smlua_func_cur_obj_if_hit_wall_bounce_away(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_if_hit_wall_bounce_away", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void cur_obj_if_hit_wall_bounce_away(void);
|
|
cur_obj_if_hit_wall_bounce_away();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_hide_if_mario_far_away_y(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_hide_if_mario_far_away_y", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 distY = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_hide_if_mario_far_away_y"); return 0; }
|
|
|
|
extern s32 cur_obj_hide_if_mario_far_away_y(f32 distY);
|
|
lua_pushinteger(L, cur_obj_hide_if_mario_far_away_y(distY));
|
|
|
|
return 1;
|
|
}
|
|
|
|
/*
|
|
int smlua_func_geo_offset_klepto_held_object(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "geo_offset_klepto_held_object", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 callContext = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "geo_offset_klepto_held_object"); return 0; }
|
|
// struct GraphNode* node = (struct GraphNode*)smlua_to_cobject(L, 2, LOT_GRAPHNODE); <--- UNIMPLEMENTED
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "geo_offset_klepto_held_object"); return 0; }
|
|
|
|
Mat4 mtx;
|
|
smlua_get_mat4(mtx, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "geo_offset_klepto_held_object"); return 0; }
|
|
|
|
extern Gfx *geo_offset_klepto_held_object(s32 callContext, struct GraphNode *node, UNUSED Mat4 mtx);
|
|
smlua_push_object(L, LOT_GFX, geo_offset_klepto_held_object(callContext, node, mtx), NULL);
|
|
|
|
return 1;
|
|
}
|
|
*/
|
|
|
|
/*
|
|
int smlua_func_geo_offset_klepto_debug(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "geo_offset_klepto_debug", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 callContext = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "geo_offset_klepto_debug"); return 0; }
|
|
// struct GraphNode* a1 = (struct GraphNode*)smlua_to_cobject(L, 2, LOT_GRAPHNODE); <--- UNIMPLEMENTED
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "geo_offset_klepto_debug"); return 0; }
|
|
s32 sp8 = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "geo_offset_klepto_debug"); return 0; }
|
|
|
|
extern s32 geo_offset_klepto_debug(s32 callContext, struct GraphNode *a1, UNUSED s32 sp8);
|
|
lua_pushinteger(L, geo_offset_klepto_debug(callContext, a1, sp8));
|
|
|
|
return 1;
|
|
}
|
|
*/
|
|
|
|
int smlua_func_obj_is_hidden(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_is_hidden", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_is_hidden"); return 0; }
|
|
|
|
extern s32 obj_is_hidden(struct Object *obj);
|
|
lua_pushinteger(L, obj_is_hidden(obj));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_enable_time_stop(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "enable_time_stop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void enable_time_stop(void);
|
|
enable_time_stop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_enable_time_stop_if_alone(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "enable_time_stop_if_alone", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void enable_time_stop_if_alone(void);
|
|
enable_time_stop_if_alone();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_disable_time_stop(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "disable_time_stop", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void disable_time_stop(void);
|
|
disable_time_stop();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_time_stop_flags(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_time_stop_flags", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 flags = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_time_stop_flags"); return 0; }
|
|
|
|
extern void set_time_stop_flags(s32 flags);
|
|
set_time_stop_flags(flags);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_time_stop_flags_if_alone(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_time_stop_flags_if_alone", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 flags = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_time_stop_flags_if_alone"); return 0; }
|
|
|
|
extern void set_time_stop_flags_if_alone(s32 flags);
|
|
set_time_stop_flags_if_alone(flags);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_clear_time_stop_flags(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "clear_time_stop_flags", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 flags = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "clear_time_stop_flags"); return 0; }
|
|
|
|
extern void clear_time_stop_flags(s32 flags);
|
|
clear_time_stop_flags(flags);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_can_mario_activate_textbox(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_can_mario_activate_textbox", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_can_mario_activate_textbox"); return 0; }
|
|
f32 radius = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "cur_obj_can_mario_activate_textbox"); return 0; }
|
|
f32 height = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "cur_obj_can_mario_activate_textbox"); return 0; }
|
|
s32 unused = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "cur_obj_can_mario_activate_textbox"); return 0; }
|
|
|
|
extern s32 cur_obj_can_mario_activate_textbox(struct MarioState* m, f32 radius, f32 height, UNUSED s32 unused);
|
|
lua_pushinteger(L, cur_obj_can_mario_activate_textbox(m, radius, height, unused));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_can_mario_activate_textbox_2(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_can_mario_activate_textbox_2", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_can_mario_activate_textbox_2"); return 0; }
|
|
f32 radius = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "cur_obj_can_mario_activate_textbox_2"); return 0; }
|
|
f32 height = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "cur_obj_can_mario_activate_textbox_2"); return 0; }
|
|
|
|
extern s32 cur_obj_can_mario_activate_textbox_2(struct MarioState* m, f32 radius, f32 height);
|
|
lua_pushinteger(L, cur_obj_can_mario_activate_textbox_2(m, radius, height));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_end_dialog(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_end_dialog", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_end_dialog"); return 0; }
|
|
s32 dialogFlags = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "cur_obj_end_dialog"); return 0; }
|
|
s32 dialogResult = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "cur_obj_end_dialog"); return 0; }
|
|
|
|
extern void cur_obj_end_dialog(struct MarioState* m, s32 dialogFlags, s32 dialogResult);
|
|
cur_obj_end_dialog(m, dialogFlags, dialogResult);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_has_model(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_has_model", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u16 modelID = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_has_model"); return 0; }
|
|
|
|
extern s32 cur_obj_has_model(u16 modelID);
|
|
lua_pushinteger(L, cur_obj_has_model(modelID));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_align_gfx_with_floor(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_align_gfx_with_floor", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void cur_obj_align_gfx_with_floor(void);
|
|
cur_obj_align_gfx_with_floor();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mario_is_within_rectangle(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mario_is_within_rectangle", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 minX = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mario_is_within_rectangle"); return 0; }
|
|
s16 maxX = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "mario_is_within_rectangle"); return 0; }
|
|
s16 minZ = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "mario_is_within_rectangle"); return 0; }
|
|
s16 maxZ = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "mario_is_within_rectangle"); return 0; }
|
|
|
|
extern s32 mario_is_within_rectangle(s16 minX, s16 maxX, s16 minZ, s16 maxZ);
|
|
lua_pushinteger(L, mario_is_within_rectangle(minX, maxX, minZ, maxZ));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_shake_screen(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_shake_screen", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 shake = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_shake_screen"); return 0; }
|
|
|
|
extern void cur_obj_shake_screen(s32 shake);
|
|
cur_obj_shake_screen(shake);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_attack_collided_from_other_object(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_attack_collided_from_other_object", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_attack_collided_from_other_object"); return 0; }
|
|
|
|
extern s32 obj_attack_collided_from_other_object(struct Object *obj);
|
|
lua_pushinteger(L, obj_attack_collided_from_other_object(obj));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_was_attacked_or_ground_pounded(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_was_attacked_or_ground_pounded", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern s32 cur_obj_was_attacked_or_ground_pounded(void);
|
|
lua_pushinteger(L, cur_obj_was_attacked_or_ground_pounded());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_copy_behavior_params(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_copy_behavior_params", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* dst = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_copy_behavior_params"); return 0; }
|
|
struct Object* src = (struct Object*)smlua_to_cobject(L, 2, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_copy_behavior_params"); return 0; }
|
|
|
|
extern void obj_copy_behavior_params(struct Object *dst, struct Object *src);
|
|
obj_copy_behavior_params(dst, src);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_init_animation_and_anim_frame(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_init_animation_and_anim_frame", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 animIndex = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_init_animation_and_anim_frame"); return 0; }
|
|
s32 animFrame = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "cur_obj_init_animation_and_anim_frame"); return 0; }
|
|
|
|
extern void cur_obj_init_animation_and_anim_frame(s32 animIndex, s32 animFrame);
|
|
cur_obj_init_animation_and_anim_frame(animIndex, animFrame);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_init_animation_and_check_if_near_end(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_init_animation_and_check_if_near_end", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 animIndex = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_init_animation_and_check_if_near_end"); return 0; }
|
|
|
|
extern s32 cur_obj_init_animation_and_check_if_near_end(s32 animIndex);
|
|
lua_pushinteger(L, cur_obj_init_animation_and_check_if_near_end(animIndex));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_init_animation_and_extend_if_at_end(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_init_animation_and_extend_if_at_end", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 animIndex = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_init_animation_and_extend_if_at_end"); return 0; }
|
|
|
|
extern void cur_obj_init_animation_and_extend_if_at_end(s32 animIndex);
|
|
cur_obj_init_animation_and_extend_if_at_end(animIndex);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_check_grabbed_mario(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_check_grabbed_mario", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern s32 cur_obj_check_grabbed_mario(void);
|
|
lua_pushinteger(L, cur_obj_check_grabbed_mario());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_player_performed_grab_escape_action(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "player_performed_grab_escape_action", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern s32 player_performed_grab_escape_action(void);
|
|
lua_pushinteger(L, player_performed_grab_escape_action());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_unused_play_footstep_sound(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_unused_play_footstep_sound", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 animFrame1 = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_unused_play_footstep_sound"); return 0; }
|
|
s32 animFrame2 = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "cur_obj_unused_play_footstep_sound"); return 0; }
|
|
s32 sound = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "cur_obj_unused_play_footstep_sound"); return 0; }
|
|
|
|
extern void cur_obj_unused_play_footstep_sound(s32 animFrame1, s32 animFrame2, s32 sound);
|
|
cur_obj_unused_play_footstep_sound(animFrame1, animFrame2, sound);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_enable_time_stop_including_mario(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "enable_time_stop_including_mario", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void enable_time_stop_including_mario(void);
|
|
enable_time_stop_including_mario();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_disable_time_stop_including_mario(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "disable_time_stop_including_mario", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void disable_time_stop_including_mario(void);
|
|
disable_time_stop_including_mario();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_check_interacted(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_check_interacted", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern s32 cur_obj_check_interacted(void);
|
|
lua_pushinteger(L, cur_obj_check_interacted());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_spawn_loot_blue_coin(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_spawn_loot_blue_coin", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void cur_obj_spawn_loot_blue_coin(void);
|
|
cur_obj_spawn_loot_blue_coin();
|
|
|
|
return 1;
|
|
}
|
|
|
|
#ifndef VERSION_JP
|
|
int smlua_func_cur_obj_spawn_star_at_y_offset(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_spawn_star_at_y_offset", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 targetX = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_spawn_star_at_y_offset"); return 0; }
|
|
f32 targetY = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "cur_obj_spawn_star_at_y_offset"); return 0; }
|
|
f32 targetZ = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "cur_obj_spawn_star_at_y_offset"); return 0; }
|
|
f32 offsetY = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "cur_obj_spawn_star_at_y_offset"); return 0; }
|
|
|
|
extern void cur_obj_spawn_star_at_y_offset(f32 targetX, f32 targetY, f32 targetZ, f32 offsetY);
|
|
cur_obj_spawn_star_at_y_offset(targetX, targetY, targetZ, offsetY);
|
|
|
|
return 1;
|
|
}
|
|
#endif
|
|
|
|
int smlua_func_cur_obj_set_home_once(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_set_home_once", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
extern void cur_obj_set_home_once(void);
|
|
cur_obj_set_home_once();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_trajectory_length(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_trajectory_length", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
Trajectory* trajectory = (Trajectory*)smlua_to_cpointer(L, 1, LVT_TRAJECTORY_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_trajectory_length"); return 0; }
|
|
|
|
extern s32 get_trajectory_length(Trajectory* trajectory);
|
|
lua_pushinteger(L, get_trajectory_length(trajectory));
|
|
|
|
return 1;
|
|
}
|
|
|
|
/////////////////////////////
|
|
// object_list_processor.h //
|
|
/////////////////////////////
|
|
|
|
int smlua_func_set_object_respawn_info_bits(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_object_respawn_info_bits", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_object_respawn_info_bits"); return 0; }
|
|
u8 bits = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "set_object_respawn_info_bits"); return 0; }
|
|
|
|
set_object_respawn_info_bits(obj, bits);
|
|
|
|
return 1;
|
|
}
|
|
|
|
/////////////////////////////
|
|
// platform_displacement.h //
|
|
/////////////////////////////
|
|
|
|
int smlua_func_apply_platform_displacement(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "apply_platform_displacement", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "apply_platform_displacement"); return 0; }
|
|
struct Object* platform = (struct Object*)smlua_to_cobject(L, 2, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "apply_platform_displacement"); return 0; }
|
|
|
|
apply_platform_displacement(o, platform);
|
|
|
|
return 1;
|
|
}
|
|
|
|
///////////////////
|
|
// rumble_init.h //
|
|
///////////////////
|
|
|
|
int smlua_func_queue_rumble_data(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "queue_rumble_data", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 a0 = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "queue_rumble_data"); return 0; }
|
|
s16 a1 = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "queue_rumble_data"); return 0; }
|
|
|
|
queue_rumble_data(a0, a1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_queue_rumble_data_object(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "queue_rumble_data_object", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* object = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "queue_rumble_data_object"); return 0; }
|
|
s16 a0 = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "queue_rumble_data_object"); return 0; }
|
|
s16 a1 = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "queue_rumble_data_object"); return 0; }
|
|
|
|
queue_rumble_data_object(object, a0, a1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_queue_rumble_data_mario(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "queue_rumble_data_mario", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "queue_rumble_data_mario"); return 0; }
|
|
s16 a0 = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "queue_rumble_data_mario"); return 0; }
|
|
s16 a1 = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "queue_rumble_data_mario"); return 0; }
|
|
|
|
queue_rumble_data_mario(m, a0, a1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_reset_rumble_timers(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "reset_rumble_timers", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "reset_rumble_timers"); return 0; }
|
|
|
|
reset_rumble_timers(m);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_reset_rumble_timers_2(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "reset_rumble_timers_2", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "reset_rumble_timers_2"); return 0; }
|
|
s32 a0 = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "reset_rumble_timers_2"); return 0; }
|
|
|
|
reset_rumble_timers_2(m, a0);
|
|
|
|
return 1;
|
|
}
|
|
|
|
/////////////////
|
|
// save_file.h //
|
|
/////////////////
|
|
|
|
int smlua_func_get_level_num_from_course_num(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_level_num_from_course_num", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 courseNum = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_level_num_from_course_num"); return 0; }
|
|
|
|
lua_pushinteger(L, get_level_num_from_course_num(courseNum));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_level_course_num(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_level_course_num", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 levelNum = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_level_course_num"); return 0; }
|
|
|
|
lua_pushinteger(L, get_level_course_num(levelNum));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_touch_coin_score_age(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "touch_coin_score_age", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 fileIndex = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "touch_coin_score_age"); return 0; }
|
|
s32 courseIndex = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "touch_coin_score_age"); return 0; }
|
|
|
|
touch_coin_score_age(fileIndex, courseIndex);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_save_file_do_save(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "save_file_do_save", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 fileIndex = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "save_file_do_save"); return 0; }
|
|
s8 forceSave = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "save_file_do_save"); return 0; }
|
|
|
|
save_file_do_save(fileIndex, forceSave);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_save_file_erase(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "save_file_erase", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 fileIndex = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "save_file_erase"); return 0; }
|
|
|
|
save_file_erase(fileIndex);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_save_file_erase_current_backup_save(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "save_file_erase_current_backup_save", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
save_file_erase_current_backup_save();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_save_file_reload(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "save_file_reload", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 load_all = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "save_file_reload"); return 0; }
|
|
|
|
save_file_reload(load_all);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_save_file_get_max_coin_score(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "save_file_get_max_coin_score", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 courseIndex = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "save_file_get_max_coin_score"); return 0; }
|
|
|
|
lua_pushinteger(L, save_file_get_max_coin_score(courseIndex));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_save_file_get_course_star_count(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "save_file_get_course_star_count", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 fileIndex = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "save_file_get_course_star_count"); return 0; }
|
|
s32 courseIndex = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "save_file_get_course_star_count"); return 0; }
|
|
|
|
lua_pushinteger(L, save_file_get_course_star_count(fileIndex, courseIndex));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_save_file_get_total_star_count(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "save_file_get_total_star_count", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 fileIndex = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "save_file_get_total_star_count"); return 0; }
|
|
s32 minCourse = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "save_file_get_total_star_count"); return 0; }
|
|
s32 maxCourse = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "save_file_get_total_star_count"); return 0; }
|
|
|
|
lua_pushinteger(L, save_file_get_total_star_count(fileIndex, minCourse, maxCourse));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_save_file_set_flags(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "save_file_set_flags", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u32 flags = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "save_file_set_flags"); return 0; }
|
|
|
|
save_file_set_flags(flags);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_save_file_clear_flags(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "save_file_clear_flags", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u32 flags = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "save_file_clear_flags"); return 0; }
|
|
|
|
save_file_clear_flags(flags);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_save_file_get_flags(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "save_file_get_flags", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, save_file_get_flags());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_save_file_get_star_flags(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "save_file_get_star_flags", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 fileIndex = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "save_file_get_star_flags"); return 0; }
|
|
s32 courseIndex = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "save_file_get_star_flags"); return 0; }
|
|
|
|
lua_pushinteger(L, save_file_get_star_flags(fileIndex, courseIndex));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_save_file_set_star_flags(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "save_file_set_star_flags", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 fileIndex = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "save_file_set_star_flags"); return 0; }
|
|
s32 courseIndex = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "save_file_set_star_flags"); return 0; }
|
|
u32 starFlags = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "save_file_set_star_flags"); return 0; }
|
|
|
|
save_file_set_star_flags(fileIndex, courseIndex, starFlags);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_save_file_remove_star_flags(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "save_file_remove_star_flags", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 fileIndex = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "save_file_remove_star_flags"); return 0; }
|
|
s32 courseIndex = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "save_file_remove_star_flags"); return 0; }
|
|
u32 starFlagsToRemove = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "save_file_remove_star_flags"); return 0; }
|
|
|
|
save_file_remove_star_flags(fileIndex, courseIndex, starFlagsToRemove);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_save_file_get_course_coin_score(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "save_file_get_course_coin_score", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 fileIndex = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "save_file_get_course_coin_score"); return 0; }
|
|
s32 courseIndex = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "save_file_get_course_coin_score"); return 0; }
|
|
|
|
lua_pushinteger(L, save_file_get_course_coin_score(fileIndex, courseIndex));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_save_file_set_course_coin_score(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "save_file_set_course_coin_score", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 fileIndex = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "save_file_set_course_coin_score"); return 0; }
|
|
s32 courseIndex = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "save_file_set_course_coin_score"); return 0; }
|
|
u8 coinScore = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "save_file_set_course_coin_score"); return 0; }
|
|
|
|
save_file_set_course_coin_score(fileIndex, courseIndex, coinScore);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_save_file_is_cannon_unlocked(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "save_file_is_cannon_unlocked", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 fileIndex = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "save_file_is_cannon_unlocked"); return 0; }
|
|
s32 courseIndex = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "save_file_is_cannon_unlocked"); return 0; }
|
|
|
|
lua_pushinteger(L, save_file_is_cannon_unlocked(fileIndex, courseIndex));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_save_file_get_cap_pos(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "save_file_get_cap_pos", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3s capPos;
|
|
smlua_get_vec3s(capPos, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "save_file_get_cap_pos"); return 0; }
|
|
|
|
lua_pushinteger(L, save_file_get_cap_pos(capPos));
|
|
|
|
smlua_push_vec3s(capPos, 1);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_save_file_get_sound_mode(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "save_file_get_sound_mode", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, save_file_get_sound_mode());
|
|
|
|
return 1;
|
|
}
|
|
|
|
/////////////////
|
|
// seqplayer.h //
|
|
/////////////////
|
|
|
|
int smlua_func_sequence_player_get_tempo(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "sequence_player_get_tempo", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 player = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "sequence_player_get_tempo"); return 0; }
|
|
|
|
lua_pushinteger(L, sequence_player_get_tempo(player));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_sequence_player_set_tempo(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "sequence_player_set_tempo", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 player = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "sequence_player_set_tempo"); return 0; }
|
|
u16 tempo = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "sequence_player_set_tempo"); return 0; }
|
|
|
|
sequence_player_set_tempo(player, tempo);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_sequence_player_get_tempo_acc(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "sequence_player_get_tempo_acc", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 player = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "sequence_player_get_tempo_acc"); return 0; }
|
|
|
|
lua_pushinteger(L, sequence_player_get_tempo_acc(player));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_sequence_player_set_tempo_acc(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "sequence_player_set_tempo_acc", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 player = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "sequence_player_set_tempo_acc"); return 0; }
|
|
u16 tempoAcc = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "sequence_player_set_tempo_acc"); return 0; }
|
|
|
|
sequence_player_set_tempo_acc(player, tempoAcc);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_sequence_player_get_transposition(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "sequence_player_get_transposition", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 player = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "sequence_player_get_transposition"); return 0; }
|
|
|
|
lua_pushinteger(L, sequence_player_get_transposition(player));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_sequence_player_set_transposition(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "sequence_player_set_transposition", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 player = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "sequence_player_set_transposition"); return 0; }
|
|
u16 transposition = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "sequence_player_set_transposition"); return 0; }
|
|
|
|
sequence_player_set_transposition(player, transposition);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_sequence_player_get_volume(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "sequence_player_get_volume", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 player = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "sequence_player_get_volume"); return 0; }
|
|
|
|
lua_pushnumber(L, sequence_player_get_volume(player));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_sequence_player_get_fade_volume(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "sequence_player_get_fade_volume", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 player = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "sequence_player_get_fade_volume"); return 0; }
|
|
|
|
lua_pushnumber(L, sequence_player_get_fade_volume(player));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_sequence_player_get_mute_volume_scale(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "sequence_player_get_mute_volume_scale", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 player = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "sequence_player_get_mute_volume_scale"); return 0; }
|
|
|
|
lua_pushnumber(L, sequence_player_get_mute_volume_scale(player));
|
|
|
|
return 1;
|
|
}
|
|
|
|
////////////////////////
|
|
// smlua_anim_utils.h //
|
|
////////////////////////
|
|
|
|
int smlua_func_get_mario_vanilla_animation(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_mario_vanilla_animation", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u16 index = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_mario_vanilla_animation"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_ANIMATION, get_mario_vanilla_animation(index), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_smlua_anim_util_set_animation(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "smlua_anim_util_set_animation", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "smlua_anim_util_set_animation"); return 0; }
|
|
const char* name = smlua_to_string(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "smlua_anim_util_set_animation"); return 0; }
|
|
|
|
smlua_anim_util_set_animation(obj, name);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_smlua_anim_util_get_current_animation_name(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "smlua_anim_util_get_current_animation_name", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* obj = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "smlua_anim_util_get_current_animation_name"); return 0; }
|
|
|
|
lua_pushstring(L, smlua_anim_util_get_current_animation_name(obj));
|
|
|
|
return 1;
|
|
}
|
|
|
|
/////////////////////////
|
|
// smlua_audio_utils.h //
|
|
/////////////////////////
|
|
|
|
int smlua_func_smlua_audio_utils_reset_all(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "smlua_audio_utils_reset_all", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
smlua_audio_utils_reset_all();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_smlua_audio_utils_replace_sequence(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "smlua_audio_utils_replace_sequence", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 sequenceId = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "smlua_audio_utils_replace_sequence"); return 0; }
|
|
u8 bankId = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "smlua_audio_utils_replace_sequence"); return 0; }
|
|
u8 defaultVolume = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "smlua_audio_utils_replace_sequence"); return 0; }
|
|
const char* m64Name = smlua_to_string(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "smlua_audio_utils_replace_sequence"); return 0; }
|
|
|
|
smlua_audio_utils_replace_sequence(sequenceId, bankId, defaultVolume, m64Name);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_audio_stream_load(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "audio_stream_load", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
const char* filename = smlua_to_string(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "audio_stream_load"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_MODAUDIO, audio_stream_load(filename), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_audio_stream_destroy(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "audio_stream_destroy", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ModAudio* audio = (struct ModAudio*)smlua_to_cobject(L, 1, LOT_MODAUDIO);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "audio_stream_destroy"); return 0; }
|
|
|
|
audio_stream_destroy(audio);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_audio_stream_play(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "audio_stream_play", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ModAudio* audio = (struct ModAudio*)smlua_to_cobject(L, 1, LOT_MODAUDIO);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "audio_stream_play"); return 0; }
|
|
bool restart = smlua_to_boolean(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "audio_stream_play"); return 0; }
|
|
f32 volume = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "audio_stream_play"); return 0; }
|
|
|
|
audio_stream_play(audio, restart, volume);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_audio_stream_pause(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "audio_stream_pause", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ModAudio* audio = (struct ModAudio*)smlua_to_cobject(L, 1, LOT_MODAUDIO);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "audio_stream_pause"); return 0; }
|
|
|
|
audio_stream_pause(audio);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_audio_stream_stop(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "audio_stream_stop", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ModAudio* audio = (struct ModAudio*)smlua_to_cobject(L, 1, LOT_MODAUDIO);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "audio_stream_stop"); return 0; }
|
|
|
|
audio_stream_stop(audio);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_audio_stream_get_position(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "audio_stream_get_position", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ModAudio* audio = (struct ModAudio*)smlua_to_cobject(L, 1, LOT_MODAUDIO);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "audio_stream_get_position"); return 0; }
|
|
|
|
lua_pushnumber(L, audio_stream_get_position(audio));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_audio_stream_set_position(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "audio_stream_set_position", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ModAudio* audio = (struct ModAudio*)smlua_to_cobject(L, 1, LOT_MODAUDIO);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "audio_stream_set_position"); return 0; }
|
|
f32 pos = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "audio_stream_set_position"); return 0; }
|
|
|
|
audio_stream_set_position(audio, pos);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_audio_stream_get_looping(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "audio_stream_get_looping", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ModAudio* audio = (struct ModAudio*)smlua_to_cobject(L, 1, LOT_MODAUDIO);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "audio_stream_get_looping"); return 0; }
|
|
|
|
lua_pushboolean(L, audio_stream_get_looping(audio));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_audio_stream_set_looping(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "audio_stream_set_looping", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ModAudio* audio = (struct ModAudio*)smlua_to_cobject(L, 1, LOT_MODAUDIO);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "audio_stream_set_looping"); return 0; }
|
|
bool looping = smlua_to_boolean(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "audio_stream_set_looping"); return 0; }
|
|
|
|
audio_stream_set_looping(audio, looping);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_audio_stream_set_loop_points(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "audio_stream_set_loop_points", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ModAudio* audio = (struct ModAudio*)smlua_to_cobject(L, 1, LOT_MODAUDIO);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "audio_stream_set_loop_points"); return 0; }
|
|
s64 loopStart = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "audio_stream_set_loop_points"); return 0; }
|
|
s64 loopEnd = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "audio_stream_set_loop_points"); return 0; }
|
|
|
|
audio_stream_set_loop_points(audio, loopStart, loopEnd);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_audio_stream_get_frequency(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "audio_stream_get_frequency", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ModAudio* audio = (struct ModAudio*)smlua_to_cobject(L, 1, LOT_MODAUDIO);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "audio_stream_get_frequency"); return 0; }
|
|
|
|
lua_pushnumber(L, audio_stream_get_frequency(audio));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_audio_stream_set_frequency(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "audio_stream_set_frequency", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ModAudio* audio = (struct ModAudio*)smlua_to_cobject(L, 1, LOT_MODAUDIO);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "audio_stream_set_frequency"); return 0; }
|
|
f32 freq = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "audio_stream_set_frequency"); return 0; }
|
|
|
|
audio_stream_set_frequency(audio, freq);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_audio_stream_get_volume(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "audio_stream_get_volume", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ModAudio* audio = (struct ModAudio*)smlua_to_cobject(L, 1, LOT_MODAUDIO);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "audio_stream_get_volume"); return 0; }
|
|
|
|
lua_pushnumber(L, audio_stream_get_volume(audio));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_audio_stream_set_volume(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "audio_stream_set_volume", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ModAudio* audio = (struct ModAudio*)smlua_to_cobject(L, 1, LOT_MODAUDIO);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "audio_stream_set_volume"); return 0; }
|
|
f32 volume = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "audio_stream_set_volume"); return 0; }
|
|
|
|
audio_stream_set_volume(audio, volume);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_audio_sample_load(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "audio_sample_load", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
const char* filename = smlua_to_string(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "audio_sample_load"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_MODAUDIO, audio_sample_load(filename), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_audio_sample_destroy(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "audio_sample_destroy", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ModAudio* audio = (struct ModAudio*)smlua_to_cobject(L, 1, LOT_MODAUDIO);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "audio_sample_destroy"); return 0; }
|
|
|
|
audio_sample_destroy(audio);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_audio_sample_stop(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "audio_sample_stop", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ModAudio* audio = (struct ModAudio*)smlua_to_cobject(L, 1, LOT_MODAUDIO);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "audio_sample_stop"); return 0; }
|
|
|
|
audio_sample_stop(audio);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_audio_sample_play(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "audio_sample_play", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ModAudio* audio = (struct ModAudio*)smlua_to_cobject(L, 1, LOT_MODAUDIO);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "audio_sample_play"); return 0; }
|
|
|
|
Vec3f position;
|
|
smlua_get_vec3f(position, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "audio_sample_play"); return 0; }
|
|
f32 volume = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "audio_sample_play"); return 0; }
|
|
|
|
audio_sample_play(audio, position, volume);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_allocate_sequence(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "allocate_sequence", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, allocate_sequence());
|
|
|
|
return 1;
|
|
}
|
|
|
|
//////////////////////////
|
|
// smlua_camera_utils.h //
|
|
//////////////////////////
|
|
|
|
int smlua_func_camera_reset_overrides(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_reset_overrides", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
camera_reset_overrides();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_freeze(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_freeze", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
camera_freeze();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_unfreeze(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_unfreeze", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
camera_unfreeze();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_is_frozen(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_is_frozen", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushboolean(L, camera_is_frozen());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_romhack_allow_only_mods(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_romhack_allow_only_mods", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 allow = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "camera_romhack_allow_only_mods"); return 0; }
|
|
|
|
camera_romhack_allow_only_mods(allow);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_set_romhack_override(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_set_romhack_override", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
int rco = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "camera_set_romhack_override"); return 0; }
|
|
|
|
camera_set_romhack_override(rco);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_romhack_allow_centering(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_romhack_allow_centering", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 allow = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "camera_romhack_allow_centering"); return 0; }
|
|
|
|
camera_romhack_allow_centering(allow);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_allow_toxic_gas_camera(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_allow_toxic_gas_camera", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 allow = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "camera_allow_toxic_gas_camera"); return 0; }
|
|
|
|
camera_allow_toxic_gas_camera(allow);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_romhack_allow_dpad_usage(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_romhack_allow_dpad_usage", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 allow = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "camera_romhack_allow_dpad_usage"); return 0; }
|
|
|
|
camera_romhack_allow_dpad_usage(allow);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_rom_hack_cam_set_collisions(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "rom_hack_cam_set_collisions", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 enable = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "rom_hack_cam_set_collisions"); return 0; }
|
|
|
|
rom_hack_cam_set_collisions(enable);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_romhack_set_zoomed_in_dist(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_romhack_set_zoomed_in_dist", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u32 val = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "camera_romhack_set_zoomed_in_dist"); return 0; }
|
|
|
|
camera_romhack_set_zoomed_in_dist(val);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_romhack_set_zoomed_out_dist(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_romhack_set_zoomed_out_dist", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u32 val = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "camera_romhack_set_zoomed_out_dist"); return 0; }
|
|
|
|
camera_romhack_set_zoomed_out_dist(val);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_romhack_set_zoomed_in_height(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_romhack_set_zoomed_in_height", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u32 val = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "camera_romhack_set_zoomed_in_height"); return 0; }
|
|
|
|
camera_romhack_set_zoomed_in_height(val);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_romhack_set_zoomed_out_height(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_romhack_set_zoomed_out_height", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u32 val = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "camera_romhack_set_zoomed_out_height"); return 0; }
|
|
|
|
camera_romhack_set_zoomed_out_height(val);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_romhack_get_zoomed_in_dist(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_romhack_get_zoomed_in_dist", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, camera_romhack_get_zoomed_in_dist());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_romhack_get_zoomed_out_dist(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_romhack_get_zoomed_out_dist", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, camera_romhack_get_zoomed_out_dist());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_romhack_get_zoomed_in_height(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_romhack_get_zoomed_in_height", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, camera_romhack_get_zoomed_in_height());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_romhack_get_zoomed_out_height(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_romhack_get_zoomed_out_height", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, camera_romhack_get_zoomed_out_height());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_get_romhack_override(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_get_romhack_override", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, camera_get_romhack_override());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_romhack_get_allow_centering(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_romhack_get_allow_centering", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, camera_romhack_get_allow_centering());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_get_allow_toxic_gas_camera(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_get_allow_toxic_gas_camera", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, camera_get_allow_toxic_gas_camera());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_romhack_get_allow_dpad_usage(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_romhack_get_allow_dpad_usage", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, camera_romhack_get_allow_dpad_usage());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_romhack_get_collisions(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_romhack_get_collisions", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, camera_romhack_get_collisions());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_config_is_free_cam_enabled(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_config_is_free_cam_enabled", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushboolean(L, camera_config_is_free_cam_enabled());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_config_is_analog_cam_enabled(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_config_is_analog_cam_enabled", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushboolean(L, camera_config_is_analog_cam_enabled());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_config_is_dpad_enabled(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_config_is_dpad_enabled", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushboolean(L, camera_config_is_dpad_enabled());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_config_is_collision_enabled(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_config_is_collision_enabled", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushboolean(L, camera_config_is_collision_enabled());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_config_is_mouse_look_enabled(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_config_is_mouse_look_enabled", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushboolean(L, camera_config_is_mouse_look_enabled());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_config_is_x_inverted(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_config_is_x_inverted", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushboolean(L, camera_config_is_x_inverted());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_config_is_y_inverted(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_config_is_y_inverted", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushboolean(L, camera_config_is_y_inverted());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_config_get_x_sensitivity(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_config_get_x_sensitivity", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, camera_config_get_x_sensitivity());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_config_get_y_sensitivity(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_config_get_y_sensitivity", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, camera_config_get_y_sensitivity());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_config_get_aggression(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_config_get_aggression", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, camera_config_get_aggression());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_config_get_pan_level(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_config_get_pan_level", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, camera_config_get_pan_level());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_config_get_deceleration(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_config_get_deceleration", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, camera_config_get_deceleration());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_config_get_centering(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_config_get_centering", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushboolean(L, camera_config_get_centering());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_config_enable_free_cam(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_config_enable_free_cam", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
bool enable = smlua_to_boolean(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "camera_config_enable_free_cam"); return 0; }
|
|
|
|
camera_config_enable_free_cam(enable);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_config_enable_analog_cam(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_config_enable_analog_cam", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
bool enable = smlua_to_boolean(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "camera_config_enable_analog_cam"); return 0; }
|
|
|
|
camera_config_enable_analog_cam(enable);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_config_enable_centering(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_config_enable_centering", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
bool enable = smlua_to_boolean(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "camera_config_enable_centering"); return 0; }
|
|
|
|
camera_config_enable_centering(enable);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_config_enable_dpad(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_config_enable_dpad", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
bool enable = smlua_to_boolean(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "camera_config_enable_dpad"); return 0; }
|
|
|
|
camera_config_enable_dpad(enable);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_config_enable_collisions(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_config_enable_collisions", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
bool enable = smlua_to_boolean(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "camera_config_enable_collisions"); return 0; }
|
|
|
|
camera_config_enable_collisions(enable);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_config_enable_mouse_look(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_config_enable_mouse_look", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
bool enable = smlua_to_boolean(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "camera_config_enable_mouse_look"); return 0; }
|
|
|
|
camera_config_enable_mouse_look(enable);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_config_invert_x(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_config_invert_x", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
bool invert = smlua_to_boolean(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "camera_config_invert_x"); return 0; }
|
|
|
|
camera_config_invert_x(invert);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_config_invert_y(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_config_invert_y", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
bool invert = smlua_to_boolean(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "camera_config_invert_y"); return 0; }
|
|
|
|
camera_config_invert_y(invert);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_config_set_x_sensitivity(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_config_set_x_sensitivity", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u32 value = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "camera_config_set_x_sensitivity"); return 0; }
|
|
|
|
camera_config_set_x_sensitivity(value);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_config_set_y_sensitivity(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_config_set_y_sensitivity", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u32 value = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "camera_config_set_y_sensitivity"); return 0; }
|
|
|
|
camera_config_set_y_sensitivity(value);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_config_set_aggression(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_config_set_aggression", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u32 value = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "camera_config_set_aggression"); return 0; }
|
|
|
|
camera_config_set_aggression(value);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_config_set_pan_level(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_config_set_pan_level", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u32 value = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "camera_config_set_pan_level"); return 0; }
|
|
|
|
camera_config_set_pan_level(value);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_config_set_deceleration(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_config_set_deceleration", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u32 value = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "camera_config_set_deceleration"); return 0; }
|
|
|
|
camera_config_set_deceleration(value);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_get_checking_surfaces(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_get_checking_surfaces", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushboolean(L, camera_get_checking_surfaces());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_camera_set_checking_surfaces(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "camera_set_checking_surfaces", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
bool value = smlua_to_boolean(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "camera_set_checking_surfaces"); return 0; }
|
|
|
|
camera_set_checking_surfaces(value);
|
|
|
|
return 1;
|
|
}
|
|
|
|
/////////////////////////////
|
|
// smlua_collision_utils.h //
|
|
/////////////////////////////
|
|
|
|
int smlua_func_collision_find_floor(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "collision_find_floor", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 x = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "collision_find_floor"); return 0; }
|
|
f32 y = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "collision_find_floor"); return 0; }
|
|
f32 z = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "collision_find_floor"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_SURFACE, collision_find_floor(x, y, z), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_collision_find_ceil(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "collision_find_ceil", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 x = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "collision_find_ceil"); return 0; }
|
|
f32 y = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "collision_find_ceil"); return 0; }
|
|
f32 z = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "collision_find_ceil"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_SURFACE, collision_find_ceil(x, y, z), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_water_surface_pseudo_floor(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_water_surface_pseudo_floor", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
smlua_push_object(L, LOT_SURFACE, get_water_surface_pseudo_floor(), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_smlua_collision_util_get(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "smlua_collision_util_get", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
const char* name = smlua_to_string(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "smlua_collision_util_get"); return 0; }
|
|
|
|
smlua_push_pointer(L, LVT_COLLISION_P, (void*)smlua_collision_util_get(name), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_collision_get_temp_wall_collision_data(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "collision_get_temp_wall_collision_data", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
smlua_push_object(L, LOT_WALLCOLLISIONDATA, collision_get_temp_wall_collision_data(), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_surface_from_wcd_index(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_surface_from_wcd_index", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct WallCollisionData* wcd = (struct WallCollisionData*)smlua_to_cobject(L, 1, LOT_WALLCOLLISIONDATA);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_surface_from_wcd_index"); return 0; }
|
|
s8 index = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "get_surface_from_wcd_index"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_SURFACE, get_surface_from_wcd_index(wcd, index), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_smlua_collision_util_get_current_terrain_collision(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "smlua_collision_util_get_current_terrain_collision", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
smlua_push_pointer(L, LVT_COLLISION_P, (void*)smlua_collision_util_get_current_terrain_collision(), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_smlua_collision_util_get_level_collision(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "smlua_collision_util_get_level_collision", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
u32 level = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "smlua_collision_util_get_level_collision"); return 0; }
|
|
u16 area = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "smlua_collision_util_get_level_collision"); return 0; }
|
|
|
|
smlua_push_pointer(L, LVT_COLLISION_P, (void*)smlua_collision_util_get_level_collision(level, area), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_smlua_collision_util_find_surface_types(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "smlua_collision_util_find_surface_types", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
Collision* data = (Collision*)smlua_to_cpointer(L, 1, LVT_COLLISION_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "smlua_collision_util_find_surface_types"); return 0; }
|
|
|
|
smlua_collision_util_find_surface_types(data);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_surface_is_quicksand(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "surface_is_quicksand", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Surface* surf = (struct Surface*)smlua_to_cobject(L, 1, LOT_SURFACE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "surface_is_quicksand"); return 0; }
|
|
|
|
lua_pushboolean(L, surface_is_quicksand(surf));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_surface_is_not_hard(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "surface_is_not_hard", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Surface* surf = (struct Surface*)smlua_to_cobject(L, 1, LOT_SURFACE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "surface_is_not_hard"); return 0; }
|
|
|
|
lua_pushboolean(L, surface_is_not_hard(surf));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_surface_is_painting_warp(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "surface_is_painting_warp", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Surface* surf = (struct Surface*)smlua_to_cobject(L, 1, LOT_SURFACE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "surface_is_painting_warp"); return 0; }
|
|
|
|
lua_pushboolean(L, surface_is_painting_warp(surf));
|
|
|
|
return 1;
|
|
}
|
|
|
|
////////////////////////
|
|
// smlua_deprecated.h //
|
|
////////////////////////
|
|
|
|
int smlua_func_djui_hud_set_render_behind_hud(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_hud_set_render_behind_hud", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
bool enable = smlua_to_boolean(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "djui_hud_set_render_behind_hud"); return 0; }
|
|
|
|
djui_hud_set_render_behind_hud(enable);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_audio_stream_get_tempo(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "audio_stream_get_tempo", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ModAudio* audio = (struct ModAudio*)smlua_to_cobject(L, 1, LOT_MODAUDIO);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "audio_stream_get_tempo"); return 0; }
|
|
|
|
lua_pushnumber(L, audio_stream_get_tempo(audio));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_audio_stream_set_tempo(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "audio_stream_set_tempo", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ModAudio* audio = (struct ModAudio*)smlua_to_cobject(L, 1, LOT_MODAUDIO);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "audio_stream_set_tempo"); return 0; }
|
|
f32 tempo = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "audio_stream_set_tempo"); return 0; }
|
|
|
|
audio_stream_set_tempo(audio, tempo);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_audio_stream_set_speed(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "audio_stream_set_speed", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
struct ModAudio* audio = (struct ModAudio*)smlua_to_cobject(L, 1, LOT_MODAUDIO);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "audio_stream_set_speed"); return 0; }
|
|
f32 initial_freq = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "audio_stream_set_speed"); return 0; }
|
|
f32 speed = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "audio_stream_set_speed"); return 0; }
|
|
bool pitch = smlua_to_boolean(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "audio_stream_set_speed"); return 0; }
|
|
|
|
audio_stream_set_speed(audio, initial_freq, speed, pitch);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_network_player_color_to_palette(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "network_player_color_to_palette", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct NetworkPlayer* np = (struct NetworkPlayer*)smlua_to_cobject(L, 1, LOT_NETWORKPLAYER);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "network_player_color_to_palette"); return 0; }
|
|
int part = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "network_player_color_to_palette"); return 0; }
|
|
|
|
Color color;
|
|
smlua_get_color(color, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "network_player_color_to_palette"); return 0; }
|
|
|
|
network_player_color_to_palette(np, part, color);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_network_player_palette_to_color(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "network_player_palette_to_color", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct NetworkPlayer* np = (struct NetworkPlayer*)smlua_to_cobject(L, 1, LOT_NETWORKPLAYER);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "network_player_palette_to_color"); return 0; }
|
|
int part = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "network_player_palette_to_color"); return 0; }
|
|
|
|
Color out;
|
|
smlua_get_color(out, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "network_player_palette_to_color"); return 0; }
|
|
|
|
network_player_palette_to_color(np, part, out);
|
|
|
|
smlua_push_color(out, 3);
|
|
|
|
return 1;
|
|
}
|
|
|
|
///////////////////////
|
|
// smlua_gfx_utils.h //
|
|
///////////////////////
|
|
|
|
int smlua_func_set_override_fov(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_override_fov", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 fov = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_override_fov"); return 0; }
|
|
|
|
set_override_fov(fov);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_override_near(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_override_near", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 near = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_override_near"); return 0; }
|
|
|
|
set_override_near(near);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_override_far(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_override_far", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 far = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_override_far"); return 0; }
|
|
|
|
set_override_far(far);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_lighting_dir(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_lighting_dir", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 index = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_lighting_dir"); return 0; }
|
|
|
|
lua_pushnumber(L, get_lighting_dir(index));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_lighting_dir(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_lighting_dir", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 index = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_lighting_dir"); return 0; }
|
|
f32 value = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "set_lighting_dir"); return 0; }
|
|
|
|
set_lighting_dir(index, value);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_lighting_color(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_lighting_color", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 index = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_lighting_color"); return 0; }
|
|
|
|
lua_pushinteger(L, get_lighting_color(index));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_lighting_color_ambient(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_lighting_color_ambient", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 index = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_lighting_color_ambient"); return 0; }
|
|
|
|
lua_pushinteger(L, get_lighting_color_ambient(index));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_lighting_color(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_lighting_color", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 index = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_lighting_color"); return 0; }
|
|
u8 value = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "set_lighting_color"); return 0; }
|
|
|
|
set_lighting_color(index, value);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_lighting_color_ambient(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_lighting_color_ambient", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 index = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_lighting_color_ambient"); return 0; }
|
|
u8 value = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "set_lighting_color_ambient"); return 0; }
|
|
|
|
set_lighting_color_ambient(index, value);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_vertex_color(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_vertex_color", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 index = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_vertex_color"); return 0; }
|
|
|
|
lua_pushinteger(L, get_vertex_color(index));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_vertex_color(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_vertex_color", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 index = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_vertex_color"); return 0; }
|
|
u8 value = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "set_vertex_color"); return 0; }
|
|
|
|
set_vertex_color(index, value);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_fog_color(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_fog_color", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 index = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_fog_color"); return 0; }
|
|
|
|
lua_pushinteger(L, get_fog_color(index));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_fog_color(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_fog_color", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 index = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_fog_color"); return 0; }
|
|
u8 value = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "set_fog_color"); return 0; }
|
|
|
|
set_fog_color(index, value);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_fog_intensity(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_fog_intensity", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushnumber(L, get_fog_intensity());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_fog_intensity(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_fog_intensity", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 intensity = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_fog_intensity"); return 0; }
|
|
|
|
set_fog_intensity(intensity);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_skybox(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_skybox", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, get_skybox());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_override_skybox(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_override_skybox", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s8 background = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_override_skybox"); return 0; }
|
|
|
|
set_override_skybox(background);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_skybox_color(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_skybox_color", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 index = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_skybox_color"); return 0; }
|
|
|
|
lua_pushinteger(L, get_skybox_color(index));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_skybox_color(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_skybox_color", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 index = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_skybox_color"); return 0; }
|
|
u8 value = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "set_skybox_color"); return 0; }
|
|
|
|
set_skybox_color(index, value);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_gfx_parse(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "gfx_parse", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
Gfx * cmd = (Gfx *)smlua_to_cobject(L, 1, LOT_GFX);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "gfx_parse"); return 0; }
|
|
LuaFunction func = smlua_to_lua_function(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "gfx_parse"); return 0; }
|
|
|
|
gfx_parse(cmd, func);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_gfx_get_op(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "gfx_get_op", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
Gfx * cmd = (Gfx *)smlua_to_cobject(L, 1, LOT_GFX);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "gfx_get_op"); return 0; }
|
|
|
|
lua_pushinteger(L, gfx_get_op(cmd));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_gfx_get_display_list(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "gfx_get_display_list", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
Gfx * cmd = (Gfx *)smlua_to_cobject(L, 1, LOT_GFX);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "gfx_get_display_list"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_GFX, gfx_get_display_list(cmd), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_gfx_get_vertex_buffer(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "gfx_get_vertex_buffer", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
Gfx * cmd = (Gfx *)smlua_to_cobject(L, 1, LOT_GFX);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "gfx_get_vertex_buffer"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_VTX, gfx_get_vertex_buffer(cmd), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_gfx_get_vertex_count(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "gfx_get_vertex_count", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
Gfx * cmd = (Gfx *)smlua_to_cobject(L, 1, LOT_GFX);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "gfx_get_vertex_count"); return 0; }
|
|
|
|
lua_pushinteger(L, gfx_get_vertex_count(cmd));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_gfx_get_texture(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "gfx_get_texture", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
Gfx * cmd = (Gfx *)smlua_to_cobject(L, 1, LOT_GFX);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "gfx_get_texture"); return 0; }
|
|
|
|
smlua_push_pointer(L, LVT_U8_P, (void*)gfx_get_texture(cmd), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_gfx_get_length(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "gfx_get_length", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
Gfx * gfx = (Gfx *)smlua_to_cobject(L, 1, LOT_GFX);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "gfx_get_length"); return 0; }
|
|
|
|
lua_pushinteger(L, gfx_get_length(gfx));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_gfx_get_command(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "gfx_get_command", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
Gfx * gfx = (Gfx *)smlua_to_cobject(L, 1, LOT_GFX);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "gfx_get_command"); return 0; }
|
|
u32 offset = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "gfx_get_command"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_GFX, gfx_get_command(gfx, offset), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_gfx_get_next_command(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "gfx_get_next_command", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
Gfx * gfx = (Gfx *)smlua_to_cobject(L, 1, LOT_GFX);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "gfx_get_next_command"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_GFX, gfx_get_next_command(gfx), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_gfx_copy(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "gfx_copy", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
Gfx * dest = (Gfx *)smlua_to_cobject(L, 1, LOT_GFX);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "gfx_copy"); return 0; }
|
|
Gfx * src = (Gfx *)smlua_to_cobject(L, 2, LOT_GFX);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "gfx_copy"); return 0; }
|
|
u32 length = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "gfx_copy"); return 0; }
|
|
|
|
gfx_copy(dest, src, length);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_gfx_create(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "gfx_create", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
const char* name = smlua_to_string(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "gfx_create"); return 0; }
|
|
u32 length = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "gfx_create"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_GFX, gfx_create(name, length), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_gfx_resize(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "gfx_resize", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
Gfx * gfx = (Gfx *)smlua_to_cobject(L, 1, LOT_GFX);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "gfx_resize"); return 0; }
|
|
u32 newLength = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "gfx_resize"); return 0; }
|
|
|
|
gfx_resize(gfx, newLength);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_gfx_delete(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "gfx_delete", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
Gfx * gfx = (Gfx *)smlua_to_cobject(L, 1, LOT_GFX);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "gfx_delete"); return 0; }
|
|
|
|
gfx_delete(gfx);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_gfx_delete_all(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "gfx_delete_all", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
gfx_delete_all();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vtx_get_count(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vtx_get_count", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
Vtx * vtx = (Vtx *)smlua_to_cobject(L, 1, LOT_VTX);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vtx_get_count"); return 0; }
|
|
|
|
lua_pushinteger(L, vtx_get_count(vtx));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vtx_get_vertex(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vtx_get_vertex", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
Vtx * vtx = (Vtx *)smlua_to_cobject(L, 1, LOT_VTX);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vtx_get_vertex"); return 0; }
|
|
u32 offset = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vtx_get_vertex"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_VTX, vtx_get_vertex(vtx, offset), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vtx_get_next_vertex(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vtx_get_next_vertex", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
Vtx * vtx = (Vtx *)smlua_to_cobject(L, 1, LOT_VTX);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vtx_get_next_vertex"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_VTX, vtx_get_next_vertex(vtx), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vtx_copy(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vtx_copy", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
Vtx * dest = (Vtx *)smlua_to_cobject(L, 1, LOT_VTX);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vtx_copy"); return 0; }
|
|
Vtx * src = (Vtx *)smlua_to_cobject(L, 2, LOT_VTX);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vtx_copy"); return 0; }
|
|
u32 count = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "vtx_copy"); return 0; }
|
|
|
|
vtx_copy(dest, src, count);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vtx_create(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vtx_create", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
const char* name = smlua_to_string(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vtx_create"); return 0; }
|
|
u32 count = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vtx_create"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_VTX, vtx_create(name, count), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vtx_resize(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vtx_resize", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
Vtx * vtx = (Vtx *)smlua_to_cobject(L, 1, LOT_VTX);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vtx_resize"); return 0; }
|
|
u32 newCount = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "vtx_resize"); return 0; }
|
|
|
|
vtx_resize(vtx, newCount);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vtx_delete(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vtx_delete", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
Vtx * vtx = (Vtx *)smlua_to_cobject(L, 1, LOT_VTX);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "vtx_delete"); return 0; }
|
|
|
|
vtx_delete(vtx);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_vtx_delete_all(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "vtx_delete_all", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
vtx_delete_all();
|
|
|
|
return 1;
|
|
}
|
|
|
|
/////////////////////////
|
|
// smlua_level_utils.h //
|
|
/////////////////////////
|
|
|
|
int smlua_func_smlua_level_util_change_area(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "smlua_level_util_change_area", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 areaIndex = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "smlua_level_util_change_area"); return 0; }
|
|
|
|
smlua_level_util_change_area(areaIndex);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_smlua_level_util_get_info(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "smlua_level_util_get_info", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 levelNum = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "smlua_level_util_get_info"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_CUSTOMLEVELINFO, smlua_level_util_get_info(levelNum), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_smlua_level_util_get_info_from_short_name(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "smlua_level_util_get_info_from_short_name", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
const char* shortName = smlua_to_string(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "smlua_level_util_get_info_from_short_name"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_CUSTOMLEVELINFO, smlua_level_util_get_info_from_short_name(shortName), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_smlua_level_util_get_info_from_course_num(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "smlua_level_util_get_info_from_course_num", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 courseNum = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "smlua_level_util_get_info_from_course_num"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_CUSTOMLEVELINFO, smlua_level_util_get_info_from_course_num(courseNum), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_level_register(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 8) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "level_register", 8, top);
|
|
return 0;
|
|
}
|
|
|
|
const char* scriptEntryName = smlua_to_string(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "level_register"); return 0; }
|
|
s16 courseNum = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "level_register"); return 0; }
|
|
const char* fullName = smlua_to_string(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "level_register"); return 0; }
|
|
const char* shortName = smlua_to_string(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "level_register"); return 0; }
|
|
u32 acousticReach = smlua_to_integer(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "level_register"); return 0; }
|
|
u32 echoLevel1 = smlua_to_integer(L, 6);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 6, "level_register"); return 0; }
|
|
u32 echoLevel2 = smlua_to_integer(L, 7);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 7, "level_register"); return 0; }
|
|
u32 echoLevel3 = smlua_to_integer(L, 8);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 8, "level_register"); return 0; }
|
|
|
|
lua_pushinteger(L, level_register(scriptEntryName, courseNum, fullName, shortName, acousticReach, echoLevel1, echoLevel2, echoLevel3));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_level_is_vanilla_level(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "level_is_vanilla_level", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 levelNum = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "level_is_vanilla_level"); return 0; }
|
|
|
|
lua_pushboolean(L, level_is_vanilla_level(levelNum));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_warp_to_warpnode(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "warp_to_warpnode", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 aLevel = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "warp_to_warpnode"); return 0; }
|
|
s32 aArea = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "warp_to_warpnode"); return 0; }
|
|
s32 aAct = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "warp_to_warpnode"); return 0; }
|
|
s32 aWarpId = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "warp_to_warpnode"); return 0; }
|
|
|
|
lua_pushboolean(L, warp_to_warpnode(aLevel, aArea, aAct, aWarpId));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_warp_to_level(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "warp_to_level", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 aLevel = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "warp_to_level"); return 0; }
|
|
s32 aArea = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "warp_to_level"); return 0; }
|
|
s32 aAct = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "warp_to_level"); return 0; }
|
|
|
|
lua_pushboolean(L, warp_to_level(aLevel, aArea, aAct));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_warp_restart_level(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "warp_restart_level", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushboolean(L, warp_restart_level());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_warp_to_start_level(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "warp_to_start_level", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushboolean(L, warp_to_start_level());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_warp_exit_level(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "warp_exit_level", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 aDelay = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "warp_exit_level"); return 0; }
|
|
|
|
lua_pushboolean(L, warp_exit_level(aDelay));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_warp_to_castle(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "warp_to_castle", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 aLevel = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "warp_to_castle"); return 0; }
|
|
|
|
lua_pushboolean(L, warp_to_castle(aLevel));
|
|
|
|
return 1;
|
|
}
|
|
|
|
////////////////////////
|
|
// smlua_misc_utils.h //
|
|
////////////////////////
|
|
|
|
int smlua_func_get_network_area_timer(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_network_area_timer", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, get_network_area_timer());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_area_update_counter(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_area_update_counter", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, get_area_update_counter());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_temp_s32_pointer(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_temp_s32_pointer", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 initialValue = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_temp_s32_pointer"); return 0; }
|
|
|
|
smlua_push_pointer(L, LVT_S32_P, (void*)get_temp_s32_pointer(initialValue), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_deref_s32_pointer(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "deref_s32_pointer", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32* pointer = (s32*)smlua_to_cpointer(L, 1, LVT_S32_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "deref_s32_pointer"); return 0; }
|
|
|
|
lua_pushinteger(L, deref_s32_pointer(pointer));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_popup_create_global(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_popup_create_global", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
const char* message = smlua_to_string(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "djui_popup_create_global"); return 0; }
|
|
int lines = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "djui_popup_create_global"); return 0; }
|
|
|
|
djui_popup_create_global(message, lines);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_is_popup_disabled(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_is_popup_disabled", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushboolean(L, djui_is_popup_disabled());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_set_popup_disabled_override(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_set_popup_disabled_override", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
bool value = smlua_to_boolean(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "djui_set_popup_disabled_override"); return 0; }
|
|
|
|
djui_set_popup_disabled_override(value);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_reset_popup_disabled_override(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_reset_popup_disabled_override", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
djui_reset_popup_disabled_override();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_is_playerlist_open(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_is_playerlist_open", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushboolean(L, djui_is_playerlist_open());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_attempting_to_open_playerlist(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_attempting_to_open_playerlist", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushboolean(L, djui_attempting_to_open_playerlist());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_get_playerlist_page_index(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_get_playerlist_page_index", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, djui_get_playerlist_page_index());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_menu_get_font(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_menu_get_font", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, djui_menu_get_font());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_djui_menu_get_theme(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_menu_get_theme", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
smlua_push_object(L, LOT_DJUITHEME, djui_menu_get_theme(), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_dialog_box_state(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_dialog_box_state", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, get_dialog_box_state());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_dialog_id(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_dialog_id", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, get_dialog_id());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_last_star_or_key(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_last_star_or_key", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, get_last_star_or_key());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_last_star_or_key(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_last_star_or_key", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 value = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_last_star_or_key"); return 0; }
|
|
|
|
set_last_star_or_key(value);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_last_completed_course_num(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_last_completed_course_num", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, get_last_completed_course_num());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_last_completed_course_num(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_last_completed_course_num", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 courseNum = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_last_completed_course_num"); return 0; }
|
|
|
|
set_last_completed_course_num(courseNum);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_last_completed_star_num(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_last_completed_star_num", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, get_last_completed_star_num());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_last_completed_star_num(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_last_completed_star_num", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 starNum = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_last_completed_star_num"); return 0; }
|
|
|
|
set_last_completed_star_num(starNum);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_got_file_coin_hi_score(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_got_file_coin_hi_score", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushboolean(L, get_got_file_coin_hi_score());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_got_file_coin_hi_score(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_got_file_coin_hi_score", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
bool value = smlua_to_boolean(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_got_file_coin_hi_score"); return 0; }
|
|
|
|
set_got_file_coin_hi_score(value);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_save_file_modified(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_save_file_modified", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushboolean(L, get_save_file_modified());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_save_file_modified(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_save_file_modified", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
bool value = smlua_to_boolean(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_save_file_modified"); return 0; }
|
|
|
|
set_save_file_modified(value);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_hud_hide(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "hud_hide", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
hud_hide();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_hud_show(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "hud_show", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
hud_show();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_hud_is_hidden(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "hud_is_hidden", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushboolean(L, hud_is_hidden());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_hud_get_value(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "hud_get_value", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
int type = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "hud_get_value"); return 0; }
|
|
|
|
lua_pushinteger(L, hud_get_value(type));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_hud_set_value(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "hud_set_value", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
int type = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "hud_set_value"); return 0; }
|
|
s32 value = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "hud_set_value"); return 0; }
|
|
|
|
hud_set_value(type, value);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_hud_render_power_meter(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 5) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "hud_render_power_meter", 5, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 health = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "hud_render_power_meter"); return 0; }
|
|
f32 x = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "hud_render_power_meter"); return 0; }
|
|
f32 y = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "hud_render_power_meter"); return 0; }
|
|
f32 width = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "hud_render_power_meter"); return 0; }
|
|
f32 height = smlua_to_number(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "hud_render_power_meter"); return 0; }
|
|
|
|
hud_render_power_meter(health, x, y, width, height);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_hud_render_power_meter_interpolated(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 9) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "hud_render_power_meter_interpolated", 9, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 health = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "hud_render_power_meter_interpolated"); return 0; }
|
|
f32 prevX = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "hud_render_power_meter_interpolated"); return 0; }
|
|
f32 prevY = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "hud_render_power_meter_interpolated"); return 0; }
|
|
f32 prevWidth = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "hud_render_power_meter_interpolated"); return 0; }
|
|
f32 prevHeight = smlua_to_number(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "hud_render_power_meter_interpolated"); return 0; }
|
|
f32 x = smlua_to_number(L, 6);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 6, "hud_render_power_meter_interpolated"); return 0; }
|
|
f32 y = smlua_to_number(L, 7);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 7, "hud_render_power_meter_interpolated"); return 0; }
|
|
f32 width = smlua_to_number(L, 8);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 8, "hud_render_power_meter_interpolated"); return 0; }
|
|
f32 height = smlua_to_number(L, 9);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 9, "hud_render_power_meter_interpolated"); return 0; }
|
|
|
|
hud_render_power_meter_interpolated(health, prevX, prevY, prevWidth, prevHeight, x, y, width, height);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_hud_get_flash(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "hud_get_flash", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, hud_get_flash());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_hud_set_flash(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "hud_set_flash", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s8 value = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "hud_set_flash"); return 0; }
|
|
|
|
hud_set_flash(value);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_is_game_paused(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "is_game_paused", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushboolean(L, is_game_paused());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_is_transition_playing(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "is_transition_playing", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushboolean(L, is_transition_playing());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_allocate_mario_action(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "allocate_mario_action", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u32 actFlags = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "allocate_mario_action"); return 0; }
|
|
|
|
lua_pushinteger(L, allocate_mario_action(actFlags));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_hand_foot_pos_x(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_hand_foot_pos_x", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_hand_foot_pos_x"); return 0; }
|
|
u8 index = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "get_hand_foot_pos_x"); return 0; }
|
|
|
|
lua_pushnumber(L, get_hand_foot_pos_x(m, index));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_hand_foot_pos_y(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_hand_foot_pos_y", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_hand_foot_pos_y"); return 0; }
|
|
u8 index = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "get_hand_foot_pos_y"); return 0; }
|
|
|
|
lua_pushnumber(L, get_hand_foot_pos_y(m, index));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_hand_foot_pos_z(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_hand_foot_pos_z", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_hand_foot_pos_z"); return 0; }
|
|
u8 index = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "get_hand_foot_pos_z"); return 0; }
|
|
|
|
lua_pushnumber(L, get_hand_foot_pos_z(m, index));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_mario_anim_part_pos(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_mario_anim_part_pos", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct MarioState* m = (struct MarioState*)smlua_to_cobject(L, 1, LOT_MARIOSTATE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_mario_anim_part_pos"); return 0; }
|
|
u32 animPart = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "get_mario_anim_part_pos"); return 0; }
|
|
|
|
Vec3f pos;
|
|
smlua_get_vec3f(pos, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "get_mario_anim_part_pos"); return 0; }
|
|
|
|
lua_pushboolean(L, get_mario_anim_part_pos(m, animPart, pos));
|
|
|
|
smlua_push_vec3f(pos, 3);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_current_save_file_num(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_current_save_file_num", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, get_current_save_file_num());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_save_file_get_using_backup_slot(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "save_file_get_using_backup_slot", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushboolean(L, save_file_get_using_backup_slot());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_save_file_set_using_backup_slot(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "save_file_set_using_backup_slot", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
bool usingBackupSlot = smlua_to_boolean(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "save_file_set_using_backup_slot"); return 0; }
|
|
|
|
save_file_set_using_backup_slot(usingBackupSlot);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_movtexqc_register(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "movtexqc_register", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
const char* name = smlua_to_string(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "movtexqc_register"); return 0; }
|
|
s16 level = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "movtexqc_register"); return 0; }
|
|
s16 area = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "movtexqc_register"); return 0; }
|
|
s16 type = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "movtexqc_register"); return 0; }
|
|
|
|
movtexqc_register(name, level, area, type);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_water_level(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_water_level", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 index = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_water_level"); return 0; }
|
|
|
|
lua_pushinteger(L, get_water_level(index));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_water_level(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_water_level", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 index = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_water_level"); return 0; }
|
|
s16 height = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "set_water_level"); return 0; }
|
|
bool sync = smlua_to_boolean(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "set_water_level"); return 0; }
|
|
|
|
set_water_level(index, height, sync);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_course_is_main_course(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "course_is_main_course", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u16 courseNum = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "course_is_main_course"); return 0; }
|
|
|
|
lua_pushboolean(L, course_is_main_course(courseNum));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_ttc_speed_setting(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_ttc_speed_setting", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, get_ttc_speed_setting());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_ttc_speed_setting(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_ttc_speed_setting", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 speed = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_ttc_speed_setting"); return 0; }
|
|
|
|
set_ttc_speed_setting(speed);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_time(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_time", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, get_time());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_date_and_time(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_date_and_time", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
smlua_push_object(L, LOT_DATETIME, get_date_and_time(), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_envfx(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_envfx", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, get_envfx());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_override_envfx(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_override_envfx", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 envfx = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_override_envfx"); return 0; }
|
|
|
|
set_override_envfx(envfx);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_global_timer(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_global_timer", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, get_global_timer());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_dialog_response(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_dialog_response", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, get_dialog_response());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_local_discord_id(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_local_discord_id", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushstring(L, get_local_discord_id());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_coopnet_id(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_coopnet_id", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s8 localIndex = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_coopnet_id"); return 0; }
|
|
|
|
lua_pushstring(L, get_coopnet_id(localIndex));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_volume_master(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_volume_master", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushnumber(L, get_volume_master());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_volume_level(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_volume_level", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushnumber(L, get_volume_level());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_volume_sfx(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_volume_sfx", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushnumber(L, get_volume_sfx());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_volume_env(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_volume_env", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushnumber(L, get_volume_env());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_volume_master(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_volume_master", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 volume = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_volume_master"); return 0; }
|
|
|
|
set_volume_master(volume);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_volume_level(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_volume_level", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 volume = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_volume_level"); return 0; }
|
|
|
|
set_volume_level(volume);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_volume_sfx(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_volume_sfx", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 volume = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_volume_sfx"); return 0; }
|
|
|
|
set_volume_sfx(volume);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_volume_env(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_volume_env", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 volume = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_volume_env"); return 0; }
|
|
|
|
set_volume_env(volume);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_environment_region(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_environment_region", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 index = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_environment_region"); return 0; }
|
|
|
|
lua_pushinteger(L, get_environment_region(index));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_environment_region(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_environment_region", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 index = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_environment_region"); return 0; }
|
|
s16 value = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "set_environment_region"); return 0; }
|
|
|
|
set_environment_region(index, value);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_mod_file_exists(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "mod_file_exists", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
const char* filename = smlua_to_string(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "mod_file_exists"); return 0; }
|
|
|
|
lua_pushboolean(L, mod_file_exists(filename));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_active_mod(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_active_mod", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
smlua_push_object(L, LOT_MOD, get_active_mod(), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_window_title(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_window_title", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
const char* title = smlua_to_string(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_window_title"); return 0; }
|
|
|
|
set_window_title(title);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_reset_window_title(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "reset_window_title", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
reset_window_title();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_os_name(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_os_name", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushstring(L, get_os_name());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_geo_get_current_root(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "geo_get_current_root", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
smlua_push_object(L, LOT_GRAPHNODEROOT, geo_get_current_root(), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_geo_get_current_master_list(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "geo_get_current_master_list", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
smlua_push_object(L, LOT_GRAPHNODEMASTERLIST, geo_get_current_master_list(), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_geo_get_current_perspective(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "geo_get_current_perspective", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
smlua_push_object(L, LOT_GRAPHNODEPERSPECTIVE, geo_get_current_perspective(), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_geo_get_current_camera(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "geo_get_current_camera", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
smlua_push_object(L, LOT_GRAPHNODECAMERA, geo_get_current_camera(), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_geo_get_current_held_object(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "geo_get_current_held_object", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
smlua_push_object(L, LOT_GRAPHNODEHELDOBJECT, geo_get_current_held_object(), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_texture_to_lua_table(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "texture_to_lua_table", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u8 * tex = (u8 *)smlua_to_cpointer(L, 1, LVT_U8_P);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "texture_to_lua_table"); return 0; }
|
|
|
|
texture_to_lua_table(tex);
|
|
|
|
return 1;
|
|
}
|
|
|
|
/////////////////////////
|
|
// smlua_model_utils.h //
|
|
/////////////////////////
|
|
|
|
int smlua_func_smlua_model_util_get_id(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "smlua_model_util_get_id", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
const char* name = smlua_to_string(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "smlua_model_util_get_id"); return 0; }
|
|
|
|
lua_pushinteger(L, smlua_model_util_get_id(name));
|
|
|
|
return 1;
|
|
}
|
|
|
|
///////////////////////
|
|
// smlua_obj_utils.h //
|
|
///////////////////////
|
|
|
|
int smlua_func_spawn_sync_object(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 6) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "spawn_sync_object", 6, top);
|
|
return 0;
|
|
}
|
|
|
|
int behaviorId = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "spawn_sync_object"); return 0; }
|
|
int modelId = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "spawn_sync_object"); return 0; }
|
|
f32 x = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "spawn_sync_object"); return 0; }
|
|
f32 y = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "spawn_sync_object"); return 0; }
|
|
f32 z = smlua_to_number(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "spawn_sync_object"); return 0; }
|
|
LuaFunction objSetupFunction = smlua_to_lua_function(L, 6);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 6, "spawn_sync_object"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_OBJECT, spawn_sync_object(behaviorId, modelId, x, y, z, objSetupFunction), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_spawn_non_sync_object(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 6) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "spawn_non_sync_object", 6, top);
|
|
return 0;
|
|
}
|
|
|
|
int behaviorId = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "spawn_non_sync_object"); return 0; }
|
|
int modelId = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "spawn_non_sync_object"); return 0; }
|
|
f32 x = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "spawn_non_sync_object"); return 0; }
|
|
f32 y = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "spawn_non_sync_object"); return 0; }
|
|
f32 z = smlua_to_number(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "spawn_non_sync_object"); return 0; }
|
|
LuaFunction objSetupFunction = smlua_to_lua_function(L, 6);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 6, "spawn_non_sync_object"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_OBJECT, spawn_non_sync_object(behaviorId, modelId, x, y, z, objSetupFunction), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_has_behavior_id(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_has_behavior_id", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_has_behavior_id"); return 0; }
|
|
int behaviorId = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_has_behavior_id"); return 0; }
|
|
|
|
lua_pushinteger(L, obj_has_behavior_id(o, behaviorId));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_has_model_extended(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_has_model_extended", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_has_model_extended"); return 0; }
|
|
int modelId = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_has_model_extended"); return 0; }
|
|
|
|
lua_pushinteger(L, obj_has_model_extended(o, modelId));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_get_model_id_extended(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_get_model_id_extended", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_get_model_id_extended"); return 0; }
|
|
|
|
lua_pushinteger(L, obj_get_model_id_extended(o));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_set_model_extended(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_set_model_extended", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_set_model_extended"); return 0; }
|
|
int modelId = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_set_model_extended"); return 0; }
|
|
|
|
obj_set_model_extended(o, modelId);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_trajectory(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_trajectory", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
const char* name = smlua_to_string(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "get_trajectory"); return 0; }
|
|
|
|
smlua_push_pointer(L, LVT_TRAJECTORY_P, (void*)get_trajectory(name), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_geo_get_current_object(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "geo_get_current_object", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
smlua_push_object(L, LOT_OBJECT, geo_get_current_object(), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_current_object(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_current_object", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
smlua_push_object(L, LOT_OBJECT, get_current_object(), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_dialog_object(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_dialog_object", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
smlua_push_object(L, LOT_OBJECT, get_dialog_object(), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_cutscene_focus(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_cutscene_focus", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
smlua_push_object(L, LOT_OBJECT, get_cutscene_focus(), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_secondary_camera_focus(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_secondary_camera_focus", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
smlua_push_object(L, LOT_OBJECT, get_secondary_camera_focus(), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_cutscene_focus(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_cutscene_focus", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_cutscene_focus"); return 0; }
|
|
|
|
set_cutscene_focus(o);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_secondary_camera_focus(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_secondary_camera_focus", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_secondary_camera_focus"); return 0; }
|
|
|
|
set_secondary_camera_focus(o);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_get_first(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_get_first", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
int objList = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_get_first"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_OBJECT, obj_get_first(objList), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_get_first_with_behavior_id(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_get_first_with_behavior_id", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
int behaviorId = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_get_first_with_behavior_id"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_OBJECT, obj_get_first_with_behavior_id(behaviorId), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_get_first_with_behavior_id_and_field_s32(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_get_first_with_behavior_id_and_field_s32", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
int behaviorId = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_get_first_with_behavior_id_and_field_s32"); return 0; }
|
|
s32 fieldIndex = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_get_first_with_behavior_id_and_field_s32"); return 0; }
|
|
s32 value = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_get_first_with_behavior_id_and_field_s32"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_OBJECT, obj_get_first_with_behavior_id_and_field_s32(behaviorId, fieldIndex, value), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_get_first_with_behavior_id_and_field_f32(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_get_first_with_behavior_id_and_field_f32", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
int behaviorId = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_get_first_with_behavior_id_and_field_f32"); return 0; }
|
|
s32 fieldIndex = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_get_first_with_behavior_id_and_field_f32"); return 0; }
|
|
f32 value = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_get_first_with_behavior_id_and_field_f32"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_OBJECT, obj_get_first_with_behavior_id_and_field_f32(behaviorId, fieldIndex, value), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_get_next(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_get_next", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_get_next"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_OBJECT, obj_get_next(o), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_get_next_with_same_behavior_id(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_get_next_with_same_behavior_id", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_get_next_with_same_behavior_id"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_OBJECT, obj_get_next_with_same_behavior_id(o), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_get_next_with_same_behavior_id_and_field_s32(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_get_next_with_same_behavior_id_and_field_s32", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_get_next_with_same_behavior_id_and_field_s32"); return 0; }
|
|
s32 fieldIndex = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_get_next_with_same_behavior_id_and_field_s32"); return 0; }
|
|
s32 value = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_get_next_with_same_behavior_id_and_field_s32"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_OBJECT, obj_get_next_with_same_behavior_id_and_field_s32(o, fieldIndex, value), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_get_next_with_same_behavior_id_and_field_f32(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_get_next_with_same_behavior_id_and_field_f32", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_get_next_with_same_behavior_id_and_field_f32"); return 0; }
|
|
s32 fieldIndex = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_get_next_with_same_behavior_id_and_field_f32"); return 0; }
|
|
f32 value = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_get_next_with_same_behavior_id_and_field_f32"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_OBJECT, obj_get_next_with_same_behavior_id_and_field_f32(o, fieldIndex, value), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_get_nearest_object_with_behavior_id(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_get_nearest_object_with_behavior_id", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_get_nearest_object_with_behavior_id"); return 0; }
|
|
int behaviorId = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_get_nearest_object_with_behavior_id"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_OBJECT, obj_get_nearest_object_with_behavior_id(o, behaviorId), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_count_objects_with_behavior_id(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_count_objects_with_behavior_id", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
int behaviorId = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_count_objects_with_behavior_id"); return 0; }
|
|
|
|
lua_pushinteger(L, obj_count_objects_with_behavior_id(behaviorId));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_get_collided_object(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_get_collided_object", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_get_collided_object"); return 0; }
|
|
s16 index = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_get_collided_object"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_OBJECT, obj_get_collided_object(o, index), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_get_field_u32(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_get_field_u32", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_get_field_u32"); return 0; }
|
|
s32 fieldIndex = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_get_field_u32"); return 0; }
|
|
|
|
lua_pushinteger(L, obj_get_field_u32(o, fieldIndex));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_get_field_s32(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_get_field_s32", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_get_field_s32"); return 0; }
|
|
s32 fieldIndex = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_get_field_s32"); return 0; }
|
|
|
|
lua_pushinteger(L, obj_get_field_s32(o, fieldIndex));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_get_field_f32(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_get_field_f32", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_get_field_f32"); return 0; }
|
|
s32 fieldIndex = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_get_field_f32"); return 0; }
|
|
|
|
lua_pushnumber(L, obj_get_field_f32(o, fieldIndex));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_get_field_s16(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_get_field_s16", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_get_field_s16"); return 0; }
|
|
s32 fieldIndex = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_get_field_s16"); return 0; }
|
|
s32 fieldSubIndex = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_get_field_s16"); return 0; }
|
|
|
|
lua_pushinteger(L, obj_get_field_s16(o, fieldIndex, fieldSubIndex));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_set_field_u32(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_set_field_u32", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_set_field_u32"); return 0; }
|
|
s32 fieldIndex = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_set_field_u32"); return 0; }
|
|
u32 value = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_set_field_u32"); return 0; }
|
|
|
|
obj_set_field_u32(o, fieldIndex, value);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_set_field_s32(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_set_field_s32", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_set_field_s32"); return 0; }
|
|
s32 fieldIndex = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_set_field_s32"); return 0; }
|
|
s32 value = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_set_field_s32"); return 0; }
|
|
|
|
obj_set_field_s32(o, fieldIndex, value);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_set_field_f32(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_set_field_f32", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_set_field_f32"); return 0; }
|
|
s32 fieldIndex = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_set_field_f32"); return 0; }
|
|
f32 value = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_set_field_f32"); return 0; }
|
|
|
|
obj_set_field_f32(o, fieldIndex, value);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_set_field_s16(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_set_field_s16", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_set_field_s16"); return 0; }
|
|
s32 fieldIndex = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_set_field_s16"); return 0; }
|
|
s32 fieldSubIndex = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_set_field_s16"); return 0; }
|
|
s16 value = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "obj_set_field_s16"); return 0; }
|
|
|
|
obj_set_field_s16(o, fieldIndex, fieldSubIndex, value);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_get_temp_spawn_particles_info(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_get_temp_spawn_particles_info", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
int modelId = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_get_temp_spawn_particles_info"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_SPAWNPARTICLESINFO, obj_get_temp_spawn_particles_info(modelId), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_get_temp_object_hitbox(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "get_temp_object_hitbox", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
smlua_push_object(L, LOT_OBJECTHITBOX, get_temp_object_hitbox(), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_is_attackable(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_is_attackable", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_is_attackable"); return 0; }
|
|
|
|
lua_pushboolean(L, obj_is_attackable(o));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_is_breakable_object(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_is_breakable_object", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_is_breakable_object"); return 0; }
|
|
|
|
lua_pushboolean(L, obj_is_breakable_object(o));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_is_bully(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_is_bully", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_is_bully"); return 0; }
|
|
|
|
lua_pushboolean(L, obj_is_bully(o));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_is_coin(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_is_coin", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_is_coin"); return 0; }
|
|
|
|
lua_pushboolean(L, obj_is_coin(o));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_is_exclamation_box(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_is_exclamation_box", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_is_exclamation_box"); return 0; }
|
|
|
|
lua_pushboolean(L, obj_is_exclamation_box(o));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_is_grabbable(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_is_grabbable", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_is_grabbable"); return 0; }
|
|
|
|
lua_pushboolean(L, obj_is_grabbable(o));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_is_mushroom_1up(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_is_mushroom_1up", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_is_mushroom_1up"); return 0; }
|
|
|
|
lua_pushboolean(L, obj_is_mushroom_1up(o));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_is_secret(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_is_secret", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_is_secret"); return 0; }
|
|
|
|
lua_pushboolean(L, obj_is_secret(o));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_is_valid_for_interaction(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_is_valid_for_interaction", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_is_valid_for_interaction"); return 0; }
|
|
|
|
lua_pushboolean(L, obj_is_valid_for_interaction(o));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_check_hitbox_overlap(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_check_hitbox_overlap", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o1 = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_check_hitbox_overlap"); return 0; }
|
|
struct Object* o2 = (struct Object*)smlua_to_cobject(L, 2, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_check_hitbox_overlap"); return 0; }
|
|
|
|
lua_pushboolean(L, obj_check_hitbox_overlap(o1, o2));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_check_overlap_with_hitbox_params(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 7) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_check_overlap_with_hitbox_params", 7, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_check_overlap_with_hitbox_params"); return 0; }
|
|
f32 x = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_check_overlap_with_hitbox_params"); return 0; }
|
|
f32 y = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_check_overlap_with_hitbox_params"); return 0; }
|
|
f32 z = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "obj_check_overlap_with_hitbox_params"); return 0; }
|
|
f32 h = smlua_to_number(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "obj_check_overlap_with_hitbox_params"); return 0; }
|
|
f32 r = smlua_to_number(L, 6);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 6, "obj_check_overlap_with_hitbox_params"); return 0; }
|
|
f32 d = smlua_to_number(L, 7);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 7, "obj_check_overlap_with_hitbox_params"); return 0; }
|
|
|
|
lua_pushboolean(L, obj_check_overlap_with_hitbox_params(o, x, y, z, h, r, d));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_set_vel(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_set_vel", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_set_vel"); return 0; }
|
|
f32 vx = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_set_vel"); return 0; }
|
|
f32 vy = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_set_vel"); return 0; }
|
|
f32 vz = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "obj_set_vel"); return 0; }
|
|
|
|
obj_set_vel(o, vx, vy, vz);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_move_xyz(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_move_xyz", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_move_xyz"); return 0; }
|
|
f32 dx = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_move_xyz"); return 0; }
|
|
f32 dy = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "obj_move_xyz"); return 0; }
|
|
f32 dz = smlua_to_number(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "obj_move_xyz"); return 0; }
|
|
|
|
obj_move_xyz(o, dx, dy, dz);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_whirlpools(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 6) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_whirlpools", 6, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 x = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_whirlpools"); return 0; }
|
|
f32 y = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "set_whirlpools"); return 0; }
|
|
f32 z = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "set_whirlpools"); return 0; }
|
|
s16 strength = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "set_whirlpools"); return 0; }
|
|
s16 area = smlua_to_integer(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "set_whirlpools"); return 0; }
|
|
s32 index = smlua_to_integer(L, 6);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 6, "set_whirlpools"); return 0; }
|
|
|
|
set_whirlpools(x, y, z, strength, area, index);
|
|
|
|
return 1;
|
|
}
|
|
|
|
////////////////////////
|
|
// smlua_text_utils.h //
|
|
////////////////////////
|
|
|
|
int smlua_func_smlua_text_utils_reset_all(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "smlua_text_utils_reset_all", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
smlua_text_utils_reset_all();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_smlua_text_utils_dialog_get(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "smlua_text_utils_dialog_get", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
int dialogId = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "smlua_text_utils_dialog_get"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_DIALOGENTRY, smlua_text_utils_dialog_get(dialogId), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_smlua_text_utils_dialog_replace(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 6) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "smlua_text_utils_dialog_replace", 6, top);
|
|
return 0;
|
|
}
|
|
|
|
int dialogId = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "smlua_text_utils_dialog_replace"); return 0; }
|
|
u32 unused = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "smlua_text_utils_dialog_replace"); return 0; }
|
|
s8 linesPerBox = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "smlua_text_utils_dialog_replace"); return 0; }
|
|
s16 leftOffset = smlua_to_integer(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "smlua_text_utils_dialog_replace"); return 0; }
|
|
s16 width = smlua_to_integer(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "smlua_text_utils_dialog_replace"); return 0; }
|
|
const char* str = smlua_to_string(L, 6);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 6, "smlua_text_utils_dialog_replace"); return 0; }
|
|
|
|
smlua_text_utils_dialog_replace(dialogId, unused, linesPerBox, leftOffset, width, str);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_smlua_text_utils_dialog_is_replaced(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "smlua_text_utils_dialog_is_replaced", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
int dialogId = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "smlua_text_utils_dialog_is_replaced"); return 0; }
|
|
|
|
lua_pushboolean(L, smlua_text_utils_dialog_is_replaced(dialogId));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_smlua_text_utils_course_acts_replace(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 8) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "smlua_text_utils_course_acts_replace", 8, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 courseNum = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "smlua_text_utils_course_acts_replace"); return 0; }
|
|
const char* courseName = smlua_to_string(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "smlua_text_utils_course_acts_replace"); return 0; }
|
|
const char* act1 = smlua_to_string(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "smlua_text_utils_course_acts_replace"); return 0; }
|
|
const char* act2 = smlua_to_string(L, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "smlua_text_utils_course_acts_replace"); return 0; }
|
|
const char* act3 = smlua_to_string(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "smlua_text_utils_course_acts_replace"); return 0; }
|
|
const char* act4 = smlua_to_string(L, 6);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 6, "smlua_text_utils_course_acts_replace"); return 0; }
|
|
const char* act5 = smlua_to_string(L, 7);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 7, "smlua_text_utils_course_acts_replace"); return 0; }
|
|
const char* act6 = smlua_to_string(L, 8);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 8, "smlua_text_utils_course_acts_replace"); return 0; }
|
|
|
|
smlua_text_utils_course_acts_replace(courseNum, courseName, act1, act2, act3, act4, act5, act6);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_smlua_text_utils_secret_star_replace(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "smlua_text_utils_secret_star_replace", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 courseNum = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "smlua_text_utils_secret_star_replace"); return 0; }
|
|
const char* courseName = smlua_to_string(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "smlua_text_utils_secret_star_replace"); return 0; }
|
|
|
|
smlua_text_utils_secret_star_replace(courseNum, courseName);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_smlua_text_utils_course_name_replace(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "smlua_text_utils_course_name_replace", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 courseNum = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "smlua_text_utils_course_name_replace"); return 0; }
|
|
const char* name = smlua_to_string(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "smlua_text_utils_course_name_replace"); return 0; }
|
|
|
|
smlua_text_utils_course_name_replace(courseNum, name);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_smlua_text_utils_course_name_get(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "smlua_text_utils_course_name_get", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 courseNum = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "smlua_text_utils_course_name_get"); return 0; }
|
|
|
|
lua_pushstring(L, smlua_text_utils_course_name_get(courseNum));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_smlua_text_utils_course_name_mod_index(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "smlua_text_utils_course_name_mod_index", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 courseNum = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "smlua_text_utils_course_name_mod_index"); return 0; }
|
|
|
|
lua_pushinteger(L, smlua_text_utils_course_name_mod_index(courseNum));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_smlua_text_utils_course_name_reset(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "smlua_text_utils_course_name_reset", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 courseNum = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "smlua_text_utils_course_name_reset"); return 0; }
|
|
|
|
smlua_text_utils_course_name_reset(courseNum);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_smlua_text_utils_act_name_replace(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "smlua_text_utils_act_name_replace", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 courseNum = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "smlua_text_utils_act_name_replace"); return 0; }
|
|
u8 actNum = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "smlua_text_utils_act_name_replace"); return 0; }
|
|
const char* name = smlua_to_string(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "smlua_text_utils_act_name_replace"); return 0; }
|
|
|
|
smlua_text_utils_act_name_replace(courseNum, actNum, name);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_smlua_text_utils_act_name_get(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "smlua_text_utils_act_name_get", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 courseNum = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "smlua_text_utils_act_name_get"); return 0; }
|
|
u8 actNum = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "smlua_text_utils_act_name_get"); return 0; }
|
|
|
|
lua_pushstring(L, smlua_text_utils_act_name_get(courseNum, actNum));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_smlua_text_utils_act_name_mod_index(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "smlua_text_utils_act_name_mod_index", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 courseNum = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "smlua_text_utils_act_name_mod_index"); return 0; }
|
|
u8 actNum = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "smlua_text_utils_act_name_mod_index"); return 0; }
|
|
|
|
lua_pushinteger(L, smlua_text_utils_act_name_mod_index(courseNum, actNum));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_smlua_text_utils_act_name_reset(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "smlua_text_utils_act_name_reset", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 courseNum = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "smlua_text_utils_act_name_reset"); return 0; }
|
|
u8 actNum = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "smlua_text_utils_act_name_reset"); return 0; }
|
|
|
|
smlua_text_utils_act_name_reset(courseNum, actNum);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_smlua_text_utils_castle_secret_stars_replace(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "smlua_text_utils_castle_secret_stars_replace", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
const char* name = smlua_to_string(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "smlua_text_utils_castle_secret_stars_replace"); return 0; }
|
|
|
|
smlua_text_utils_castle_secret_stars_replace(name);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_smlua_text_utils_castle_secret_stars_get(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "smlua_text_utils_castle_secret_stars_get", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushstring(L, smlua_text_utils_castle_secret_stars_get());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_smlua_text_utils_castle_secret_stars_mod_index(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "smlua_text_utils_castle_secret_stars_mod_index", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushinteger(L, smlua_text_utils_castle_secret_stars_mod_index());
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_smlua_text_utils_castle_secret_stars_reset(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "smlua_text_utils_castle_secret_stars_reset", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
smlua_text_utils_castle_secret_stars_reset();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_smlua_text_utils_extra_text_replace(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "smlua_text_utils_extra_text_replace", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 index = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "smlua_text_utils_extra_text_replace"); return 0; }
|
|
const char* text = smlua_to_string(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "smlua_text_utils_extra_text_replace"); return 0; }
|
|
|
|
smlua_text_utils_extra_text_replace(index, text);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_smlua_text_utils_extra_text_get(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "smlua_text_utils_extra_text_get", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 index = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "smlua_text_utils_extra_text_get"); return 0; }
|
|
|
|
lua_pushstring(L, smlua_text_utils_extra_text_get(index));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_smlua_text_utils_extra_text_mod_index(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "smlua_text_utils_extra_text_mod_index", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 index = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "smlua_text_utils_extra_text_mod_index"); return 0; }
|
|
|
|
lua_pushinteger(L, smlua_text_utils_extra_text_mod_index(index));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_smlua_text_utils_extra_text_reset(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "smlua_text_utils_extra_text_reset", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 index = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "smlua_text_utils_extra_text_reset"); return 0; }
|
|
|
|
smlua_text_utils_extra_text_reset(index);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_smlua_text_utils_get_language(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "smlua_text_utils_get_language", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
lua_pushstring(L, smlua_text_utils_get_language());
|
|
|
|
return 1;
|
|
}
|
|
|
|
//////////////////
|
|
// sound_init.h //
|
|
//////////////////
|
|
|
|
int smlua_func_reset_volume(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "reset_volume", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
reset_volume();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_raise_background_noise(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "raise_background_noise", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 a = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "raise_background_noise"); return 0; }
|
|
|
|
raise_background_noise(a);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_lower_background_noise(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "lower_background_noise", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 a = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "lower_background_noise"); return 0; }
|
|
|
|
lower_background_noise(a);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_disable_background_sound(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "disable_background_sound", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
disable_background_sound();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_enable_background_sound(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "enable_background_sound", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
enable_background_sound();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_menu_sounds(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_menu_sounds", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 soundMenuFlags = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "play_menu_sounds"); return 0; }
|
|
|
|
play_menu_sounds(soundMenuFlags);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_painting_eject_sound(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_painting_eject_sound", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
play_painting_eject_sound();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_infinite_stairs_music(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_infinite_stairs_music", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
play_infinite_stairs_music();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_set_background_music(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_background_music", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
u16 a = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_background_music"); return 0; }
|
|
u16 seqArgs = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "set_background_music"); return 0; }
|
|
s16 fadeTimer = smlua_to_integer(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "set_background_music"); return 0; }
|
|
|
|
set_background_music(a, seqArgs, fadeTimer);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_fadeout_music(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "fadeout_music", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 fadeOutTime = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "fadeout_music"); return 0; }
|
|
|
|
fadeout_music(fadeOutTime);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_fadeout_level_music(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "fadeout_level_music", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 fadeTimer = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "fadeout_level_music"); return 0; }
|
|
|
|
fadeout_level_music(fadeTimer);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_cutscene_music(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_cutscene_music", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u16 seqArgs = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "play_cutscene_music"); return 0; }
|
|
|
|
play_cutscene_music(seqArgs);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_shell_music(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_shell_music", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
play_shell_music();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_stop_shell_music(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "stop_shell_music", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
stop_shell_music();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_play_cap_music(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "play_cap_music", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u16 seqArgs = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "play_cap_music"); return 0; }
|
|
|
|
play_cap_music(seqArgs);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_fadeout_cap_music(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "fadeout_cap_music", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
fadeout_cap_music();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_stop_cap_music(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "stop_cap_music", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
stop_cap_music();
|
|
|
|
return 1;
|
|
}
|
|
|
|
///////////////////
|
|
// spawn_sound.h //
|
|
///////////////////
|
|
|
|
int smlua_func_cur_obj_play_sound_1(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_play_sound_1", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 soundMagic = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_play_sound_1"); return 0; }
|
|
|
|
cur_obj_play_sound_1(soundMagic);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_cur_obj_play_sound_2(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "cur_obj_play_sound_2", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 soundMagic = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "cur_obj_play_sound_2"); return 0; }
|
|
|
|
cur_obj_play_sound_2(soundMagic);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_create_sound_spawner(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "create_sound_spawner", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s32 soundMagic = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "create_sound_spawner"); return 0; }
|
|
|
|
create_sound_spawner(soundMagic);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_calc_dist_to_volume_range_1(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "calc_dist_to_volume_range_1", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 distance = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "calc_dist_to_volume_range_1"); return 0; }
|
|
|
|
lua_pushinteger(L, calc_dist_to_volume_range_1(distance));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_calc_dist_to_volume_range_2(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "calc_dist_to_volume_range_2", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 distance = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "calc_dist_to_volume_range_2"); return 0; }
|
|
|
|
lua_pushinteger(L, calc_dist_to_volume_range_2(distance));
|
|
|
|
return 1;
|
|
}
|
|
|
|
/////////////////////////
|
|
// surface_collision.h //
|
|
/////////////////////////
|
|
|
|
int smlua_func_find_wall_collisions(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "find_wall_collisions", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
struct WallCollisionData* colData = (struct WallCollisionData*)smlua_to_cobject(L, 1, LOT_WALLCOLLISIONDATA);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "find_wall_collisions"); return 0; }
|
|
|
|
lua_pushinteger(L, find_wall_collisions(colData));
|
|
|
|
return 1;
|
|
}
|
|
|
|
/*
|
|
int smlua_func_find_ceil(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "find_ceil", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 posX = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "find_ceil"); return 0; }
|
|
f32 posY = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "find_ceil"); return 0; }
|
|
f32 posZ = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "find_ceil"); return 0; }
|
|
// struct Surface** pceil = (struct Surface**)smlua_to_cobject(L, 4, LOT_???); <--- UNIMPLEMENTED
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "find_ceil"); return 0; }
|
|
|
|
lua_pushnumber(L, find_ceil(posX, posY, posZ, pceil));
|
|
|
|
return 1;
|
|
}
|
|
*/
|
|
|
|
int smlua_func_find_ceil_height(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "find_ceil_height", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 x = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "find_ceil_height"); return 0; }
|
|
f32 y = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "find_ceil_height"); return 0; }
|
|
f32 z = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "find_ceil_height"); return 0; }
|
|
|
|
lua_pushnumber(L, find_ceil_height(x, y, z));
|
|
|
|
return 1;
|
|
}
|
|
|
|
/*
|
|
int smlua_func_find_floor_height_and_data(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "find_floor_height_and_data", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 xPos = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "find_floor_height_and_data"); return 0; }
|
|
f32 yPos = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "find_floor_height_and_data"); return 0; }
|
|
f32 zPos = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "find_floor_height_and_data"); return 0; }
|
|
// struct FloorGeometry** floorGeo = (struct FloorGeometry**)smlua_to_cobject(L, 4, LOT_???); <--- UNIMPLEMENTED
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "find_floor_height_and_data"); return 0; }
|
|
|
|
lua_pushnumber(L, find_floor_height_and_data(xPos, yPos, zPos, floorGeo));
|
|
|
|
return 1;
|
|
}
|
|
*/
|
|
|
|
int smlua_func_find_floor_height(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "find_floor_height", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 x = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "find_floor_height"); return 0; }
|
|
f32 y = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "find_floor_height"); return 0; }
|
|
f32 z = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "find_floor_height"); return 0; }
|
|
|
|
lua_pushnumber(L, find_floor_height(x, y, z));
|
|
|
|
return 1;
|
|
}
|
|
|
|
/*
|
|
int smlua_func_find_floor(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 4) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "find_floor", 4, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 xPos = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "find_floor"); return 0; }
|
|
f32 yPos = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "find_floor"); return 0; }
|
|
f32 zPos = smlua_to_number(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "find_floor"); return 0; }
|
|
// struct Surface** pfloor = (struct Surface**)smlua_to_cobject(L, 4, LOT_???); <--- UNIMPLEMENTED
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "find_floor"); return 0; }
|
|
|
|
lua_pushnumber(L, find_floor(xPos, yPos, zPos, pfloor));
|
|
|
|
return 1;
|
|
}
|
|
*/
|
|
|
|
int smlua_func_find_water_level(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "find_water_level", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 x = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "find_water_level"); return 0; }
|
|
f32 z = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "find_water_level"); return 0; }
|
|
|
|
lua_pushnumber(L, find_water_level(x, z));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_find_poison_gas_level(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "find_poison_gas_level", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
f32 x = smlua_to_number(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "find_poison_gas_level"); return 0; }
|
|
f32 z = smlua_to_number(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "find_poison_gas_level"); return 0; }
|
|
|
|
lua_pushnumber(L, find_poison_gas_level(x, z));
|
|
|
|
return 1;
|
|
}
|
|
|
|
/*
|
|
int smlua_func_find_surface_on_ray(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 5) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "find_surface_on_ray", 5, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f orig;
|
|
smlua_get_vec3f(orig, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "find_surface_on_ray"); return 0; }
|
|
|
|
Vec3f dir;
|
|
smlua_get_vec3f(dir, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "find_surface_on_ray"); return 0; }
|
|
// struct Surface** hit_surface = (struct Surface**)smlua_to_cobject(L, 3, LOT_???); <--- UNIMPLEMENTED
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "find_surface_on_ray"); return 0; }
|
|
|
|
Vec3f hit_pos;
|
|
smlua_get_vec3f(hit_pos, 4);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 4, "find_surface_on_ray"); return 0; }
|
|
f32 precision = smlua_to_number(L, 5);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 5, "find_surface_on_ray"); return 0; }
|
|
|
|
find_surface_on_ray(orig, dir, hit_surface, hit_pos, precision);
|
|
|
|
return 1;
|
|
}
|
|
*/
|
|
|
|
int smlua_func_set_find_wall_direction(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "set_find_wall_direction", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
Vec3f dir;
|
|
smlua_get_vec3f(dir, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "set_find_wall_direction"); return 0; }
|
|
bool active = smlua_to_boolean(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "set_find_wall_direction"); return 0; }
|
|
bool airborne = smlua_to_boolean(L, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "set_find_wall_direction"); return 0; }
|
|
|
|
set_find_wall_direction(dir, active, airborne);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_closest_point_to_triangle(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 3) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "closest_point_to_triangle", 3, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Surface* surf = (struct Surface*)smlua_to_cobject(L, 1, LOT_SURFACE);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "closest_point_to_triangle"); return 0; }
|
|
|
|
Vec3f src;
|
|
smlua_get_vec3f(src, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "closest_point_to_triangle"); return 0; }
|
|
|
|
Vec3f out;
|
|
smlua_get_vec3f(out, 3);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "closest_point_to_triangle"); return 0; }
|
|
|
|
closest_point_to_triangle(surf, src, out);
|
|
|
|
smlua_push_vec3f(out, 3);
|
|
|
|
return 1;
|
|
}
|
|
|
|
////////////////////
|
|
// surface_load.h //
|
|
////////////////////
|
|
|
|
int smlua_func_load_object_collision_model(UNUSED lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 0) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "load_object_collision_model", 0, top);
|
|
return 0;
|
|
}
|
|
|
|
|
|
load_object_collision_model();
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_obj_get_surface_from_index(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 2) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "obj_get_surface_from_index", 2, top);
|
|
return 0;
|
|
}
|
|
|
|
struct Object* o = (struct Object*)smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "obj_get_surface_from_index"); return 0; }
|
|
u32 index = smlua_to_integer(L, 2);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "obj_get_surface_from_index"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_SURFACE, obj_get_surface_from_index(o, index), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_surface_has_force(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "surface_has_force", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
s16 surfaceType = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "surface_has_force"); return 0; }
|
|
|
|
lua_pushboolean(L, surface_has_force(surfaceType));
|
|
|
|
return 1;
|
|
}
|
|
|
|
///////////////////
|
|
// sync_object.h //
|
|
///////////////////
|
|
|
|
int smlua_func_sync_object_get_object(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "sync_object_get_object", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u32 syncId = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "sync_object_get_object"); return 0; }
|
|
|
|
smlua_push_object(L, LOT_OBJECT, sync_object_get_object(syncId), NULL);
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_sync_object_is_initialized(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "sync_object_is_initialized", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u32 syncId = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "sync_object_is_initialized"); return 0; }
|
|
|
|
lua_pushboolean(L, sync_object_is_initialized(syncId));
|
|
|
|
return 1;
|
|
}
|
|
|
|
int smlua_func_sync_object_is_owned_locally(lua_State* L) {
|
|
if (L == NULL) { return 0; }
|
|
|
|
int top = lua_gettop(L);
|
|
if (top != 1) {
|
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "sync_object_is_owned_locally", 1, top);
|
|
return 0;
|
|
}
|
|
|
|
u32 syncId = smlua_to_integer(L, 1);
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "sync_object_is_owned_locally"); return 0; }
|
|
|
|
lua_pushboolean(L, sync_object_is_owned_locally(syncId));
|
|
|
|
return 1;
|
|
}
|
|
|
|
|
|
|
|
void smlua_bind_functions_autogen(void) {
|
|
lua_State* L = gLuaState;
|
|
|
|
// area.h
|
|
smlua_bind_function(L, "get_mario_spawn_type", smlua_func_get_mario_spawn_type);
|
|
smlua_bind_function(L, "area_get_warp_node", smlua_func_area_get_warp_node);
|
|
smlua_bind_function(L, "area_get_any_warp_node", smlua_func_area_get_any_warp_node);
|
|
smlua_bind_function(L, "area_get_warp_node_from_params", smlua_func_area_get_warp_node_from_params);
|
|
smlua_bind_function(L, "play_transition", smlua_func_play_transition);
|
|
smlua_bind_function(L, "play_transition_after_delay", smlua_func_play_transition_after_delay);
|
|
|
|
// behavior_actions.h
|
|
smlua_bind_function(L, "spawn_mist_particles_variable", smlua_func_spawn_mist_particles_variable);
|
|
smlua_bind_function(L, "bhv_spawn_star_no_level_exit", smlua_func_bhv_spawn_star_no_level_exit);
|
|
smlua_bind_function(L, "spawn_triangle_break_particles", smlua_func_spawn_triangle_break_particles);
|
|
smlua_bind_function(L, "spawn_mist_from_global", smlua_func_spawn_mist_from_global);
|
|
smlua_bind_function(L, "clear_particle_flags", smlua_func_clear_particle_flags);
|
|
smlua_bind_function(L, "spawn_wind_particles", smlua_func_spawn_wind_particles);
|
|
smlua_bind_function(L, "check_if_moving_over_floor", smlua_func_check_if_moving_over_floor);
|
|
smlua_bind_function(L, "arc_to_goal_pos", smlua_func_arc_to_goal_pos);
|
|
smlua_bind_function(L, "tox_box_move", smlua_func_tox_box_move);
|
|
smlua_bind_function(L, "play_penguin_walking_sound", smlua_func_play_penguin_walking_sound);
|
|
smlua_bind_function(L, "update_angle_from_move_flags", smlua_func_update_angle_from_move_flags);
|
|
smlua_bind_function(L, "cur_obj_spawn_strong_wind_particles", smlua_func_cur_obj_spawn_strong_wind_particles);
|
|
smlua_bind_function(L, "bhv_star_door_loop_2", smlua_func_bhv_star_door_loop_2);
|
|
smlua_bind_function(L, "bhv_cap_switch_loop", smlua_func_bhv_cap_switch_loop);
|
|
smlua_bind_function(L, "bhv_tiny_star_particles_init", smlua_func_bhv_tiny_star_particles_init);
|
|
smlua_bind_function(L, "bhv_grindel_thwomp_loop", smlua_func_bhv_grindel_thwomp_loop);
|
|
smlua_bind_function(L, "bhv_koopa_shell_underwater_loop", smlua_func_bhv_koopa_shell_underwater_loop);
|
|
smlua_bind_function(L, "bhv_door_init", smlua_func_bhv_door_init);
|
|
smlua_bind_function(L, "bhv_door_loop", smlua_func_bhv_door_loop);
|
|
smlua_bind_function(L, "bhv_star_door_loop", smlua_func_bhv_star_door_loop);
|
|
smlua_bind_function(L, "bhv_mr_i_loop", smlua_func_bhv_mr_i_loop);
|
|
smlua_bind_function(L, "bhv_mr_i_body_loop", smlua_func_bhv_mr_i_body_loop);
|
|
smlua_bind_function(L, "bhv_mr_i_particle_loop", smlua_func_bhv_mr_i_particle_loop);
|
|
smlua_bind_function(L, "bhv_piranha_particle_loop", smlua_func_bhv_piranha_particle_loop);
|
|
smlua_bind_function(L, "bhv_giant_pole_loop", smlua_func_bhv_giant_pole_loop);
|
|
smlua_bind_function(L, "bhv_pole_init", smlua_func_bhv_pole_init);
|
|
smlua_bind_function(L, "bhv_pole_base_loop", smlua_func_bhv_pole_base_loop);
|
|
smlua_bind_function(L, "bhv_thi_huge_island_top_loop", smlua_func_bhv_thi_huge_island_top_loop);
|
|
smlua_bind_function(L, "bhv_thi_tiny_island_top_loop", smlua_func_bhv_thi_tiny_island_top_loop);
|
|
smlua_bind_function(L, "bhv_king_bobomb_loop", smlua_func_bhv_king_bobomb_loop);
|
|
smlua_bind_function(L, "bhv_bobomb_anchor_mario_loop", smlua_func_bhv_bobomb_anchor_mario_loop);
|
|
smlua_bind_function(L, "bhv_beta_chest_bottom_init", smlua_func_bhv_beta_chest_bottom_init);
|
|
smlua_bind_function(L, "bhv_beta_chest_bottom_loop", smlua_func_bhv_beta_chest_bottom_loop);
|
|
smlua_bind_function(L, "bhv_beta_chest_lid_loop", smlua_func_bhv_beta_chest_lid_loop);
|
|
smlua_bind_function(L, "bhv_bubble_wave_init", smlua_func_bhv_bubble_wave_init);
|
|
smlua_bind_function(L, "bhv_bubble_maybe_loop", smlua_func_bhv_bubble_maybe_loop);
|
|
smlua_bind_function(L, "bhv_bubble_player_loop", smlua_func_bhv_bubble_player_loop);
|
|
smlua_bind_function(L, "bhv_water_air_bubble_init", smlua_func_bhv_water_air_bubble_init);
|
|
smlua_bind_function(L, "bhv_water_air_bubble_loop", smlua_func_bhv_water_air_bubble_loop);
|
|
smlua_bind_function(L, "bhv_particle_init", smlua_func_bhv_particle_init);
|
|
smlua_bind_function(L, "bhv_particle_loop", smlua_func_bhv_particle_loop);
|
|
smlua_bind_function(L, "bhv_water_waves_init", smlua_func_bhv_water_waves_init);
|
|
smlua_bind_function(L, "bhv_small_bubbles_loop", smlua_func_bhv_small_bubbles_loop);
|
|
smlua_bind_function(L, "bhv_fish_group_loop", smlua_func_bhv_fish_group_loop);
|
|
smlua_bind_function(L, "bhv_cannon_base_loop", smlua_func_bhv_cannon_base_loop);
|
|
smlua_bind_function(L, "bhv_cannon_barrel_loop", smlua_func_bhv_cannon_barrel_loop);
|
|
smlua_bind_function(L, "bhv_cannon_base_unused_loop", smlua_func_bhv_cannon_base_unused_loop);
|
|
smlua_bind_function(L, "common_anchor_mario_behavior", smlua_func_common_anchor_mario_behavior);
|
|
smlua_bind_function(L, "bhv_chuckya_loop", smlua_func_bhv_chuckya_loop);
|
|
smlua_bind_function(L, "bhv_chuckya_anchor_mario_loop", smlua_func_bhv_chuckya_anchor_mario_loop);
|
|
smlua_bind_function(L, "bhv_rotating_platform_loop", smlua_func_bhv_rotating_platform_loop);
|
|
smlua_bind_function(L, "bhv_wf_breakable_wall_loop", smlua_func_bhv_wf_breakable_wall_loop);
|
|
smlua_bind_function(L, "bhv_kickable_board_loop", smlua_func_bhv_kickable_board_loop);
|
|
smlua_bind_function(L, "bhv_tower_door_loop", smlua_func_bhv_tower_door_loop);
|
|
smlua_bind_function(L, "bhv_wf_rotating_wooden_platform_init", smlua_func_bhv_wf_rotating_wooden_platform_init);
|
|
smlua_bind_function(L, "bhv_wf_rotating_wooden_platform_loop", smlua_func_bhv_wf_rotating_wooden_platform_loop);
|
|
smlua_bind_function(L, "bhv_fading_warp_loop", smlua_func_bhv_fading_warp_loop);
|
|
smlua_bind_function(L, "bhv_warp_loop", smlua_func_bhv_warp_loop);
|
|
smlua_bind_function(L, "bhv_white_puff_exploding_loop", smlua_func_bhv_white_puff_exploding_loop);
|
|
smlua_bind_function(L, "bhv_spawned_star_init", smlua_func_bhv_spawned_star_init);
|
|
smlua_bind_function(L, "bhv_spawned_star_loop", smlua_func_bhv_spawned_star_loop);
|
|
smlua_bind_function(L, "bhv_coin_init", smlua_func_bhv_coin_init);
|
|
smlua_bind_function(L, "bhv_coin_loop", smlua_func_bhv_coin_loop);
|
|
smlua_bind_function(L, "bhv_coin_inside_boo_loop", smlua_func_bhv_coin_inside_boo_loop);
|
|
smlua_bind_function(L, "bhv_coin_formation_init", smlua_func_bhv_coin_formation_init);
|
|
smlua_bind_function(L, "bhv_coin_formation_spawn_loop", smlua_func_bhv_coin_formation_spawn_loop);
|
|
smlua_bind_function(L, "bhv_coin_formation_loop", smlua_func_bhv_coin_formation_loop);
|
|
smlua_bind_function(L, "bhv_temp_coin_loop", smlua_func_bhv_temp_coin_loop);
|
|
smlua_bind_function(L, "bhv_coin_sparkles_loop", smlua_func_bhv_coin_sparkles_loop);
|
|
smlua_bind_function(L, "bhv_golden_coin_sparkles_loop", smlua_func_bhv_golden_coin_sparkles_loop);
|
|
smlua_bind_function(L, "bhv_wall_tiny_star_particle_loop", smlua_func_bhv_wall_tiny_star_particle_loop);
|
|
smlua_bind_function(L, "bhv_pound_tiny_star_particle_loop", smlua_func_bhv_pound_tiny_star_particle_loop);
|
|
smlua_bind_function(L, "bhv_pound_tiny_star_particle_init", smlua_func_bhv_pound_tiny_star_particle_init);
|
|
smlua_bind_function(L, "bhv_punch_tiny_triangle_loop", smlua_func_bhv_punch_tiny_triangle_loop);
|
|
smlua_bind_function(L, "bhv_punch_tiny_triangle_init", smlua_func_bhv_punch_tiny_triangle_init);
|
|
smlua_bind_function(L, "bhv_tumbling_bridge_platform_loop", smlua_func_bhv_tumbling_bridge_platform_loop);
|
|
smlua_bind_function(L, "bhv_tumbling_bridge_loop", smlua_func_bhv_tumbling_bridge_loop);
|
|
smlua_bind_function(L, "bhv_elevator_init", smlua_func_bhv_elevator_init);
|
|
smlua_bind_function(L, "bhv_elevator_loop", smlua_func_bhv_elevator_loop);
|
|
smlua_bind_function(L, "bhv_water_mist_loop", smlua_func_bhv_water_mist_loop);
|
|
smlua_bind_function(L, "bhv_water_mist_spawn_loop", smlua_func_bhv_water_mist_spawn_loop);
|
|
smlua_bind_function(L, "bhv_water_mist_2_loop", smlua_func_bhv_water_mist_2_loop);
|
|
smlua_bind_function(L, "bhv_pound_white_puffs_init", smlua_func_bhv_pound_white_puffs_init);
|
|
smlua_bind_function(L, "bhv_ground_sand_init", smlua_func_bhv_ground_sand_init);
|
|
smlua_bind_function(L, "bhv_ground_snow_init", smlua_func_bhv_ground_snow_init);
|
|
smlua_bind_function(L, "bhv_wind_loop", smlua_func_bhv_wind_loop);
|
|
smlua_bind_function(L, "bhv_unused_particle_spawn_loop", smlua_func_bhv_unused_particle_spawn_loop);
|
|
smlua_bind_function(L, "bhv_ukiki_cage_star_loop", smlua_func_bhv_ukiki_cage_star_loop);
|
|
smlua_bind_function(L, "bhv_ukiki_cage_loop", smlua_func_bhv_ukiki_cage_loop);
|
|
smlua_bind_function(L, "bhv_bitfs_sinking_platform_loop", smlua_func_bhv_bitfs_sinking_platform_loop);
|
|
smlua_bind_function(L, "bhv_bitfs_sinking_cage_platform_loop", smlua_func_bhv_bitfs_sinking_cage_platform_loop);
|
|
smlua_bind_function(L, "bhv_ddd_moving_pole_loop", smlua_func_bhv_ddd_moving_pole_loop);
|
|
smlua_bind_function(L, "bhv_platform_normals_init", smlua_func_bhv_platform_normals_init);
|
|
smlua_bind_function(L, "bhv_tilting_inverted_pyramid_loop", smlua_func_bhv_tilting_inverted_pyramid_loop);
|
|
smlua_bind_function(L, "bhv_squishable_platform_loop", smlua_func_bhv_squishable_platform_loop);
|
|
smlua_bind_function(L, "bhv_beta_moving_flames_spawn_loop", smlua_func_bhv_beta_moving_flames_spawn_loop);
|
|
smlua_bind_function(L, "bhv_beta_moving_flames_loop", smlua_func_bhv_beta_moving_flames_loop);
|
|
smlua_bind_function(L, "bhv_rr_rotating_bridge_platform_loop", smlua_func_bhv_rr_rotating_bridge_platform_loop);
|
|
smlua_bind_function(L, "bhv_flamethrower_loop", smlua_func_bhv_flamethrower_loop);
|
|
smlua_bind_function(L, "bhv_flamethrower_flame_loop", smlua_func_bhv_flamethrower_flame_loop);
|
|
smlua_bind_function(L, "bhv_bouncing_fireball_loop", smlua_func_bhv_bouncing_fireball_loop);
|
|
smlua_bind_function(L, "bhv_bouncing_fireball_flame_loop", smlua_func_bhv_bouncing_fireball_flame_loop);
|
|
smlua_bind_function(L, "bhv_bowser_shock_wave_loop", smlua_func_bhv_bowser_shock_wave_loop);
|
|
smlua_bind_function(L, "bhv_flame_mario_loop", smlua_func_bhv_flame_mario_loop);
|
|
smlua_bind_function(L, "bhv_black_smoke_mario_loop", smlua_func_bhv_black_smoke_mario_loop);
|
|
smlua_bind_function(L, "bhv_black_smoke_bowser_loop", smlua_func_bhv_black_smoke_bowser_loop);
|
|
smlua_bind_function(L, "bhv_black_smoke_upward_loop", smlua_func_bhv_black_smoke_upward_loop);
|
|
smlua_bind_function(L, "bhv_beta_fish_splash_spawner_loop", smlua_func_bhv_beta_fish_splash_spawner_loop);
|
|
smlua_bind_function(L, "bhv_spindrift_loop", smlua_func_bhv_spindrift_loop);
|
|
smlua_bind_function(L, "bhv_tower_platform_group_init", smlua_func_bhv_tower_platform_group_init);
|
|
smlua_bind_function(L, "bhv_tower_platform_group_loop", smlua_func_bhv_tower_platform_group_loop);
|
|
smlua_bind_function(L, "bhv_wf_sliding_tower_platform_loop", smlua_func_bhv_wf_sliding_tower_platform_loop);
|
|
smlua_bind_function(L, "bhv_wf_elevator_tower_platform_loop", smlua_func_bhv_wf_elevator_tower_platform_loop);
|
|
smlua_bind_function(L, "bhv_wf_solid_tower_platform_loop", smlua_func_bhv_wf_solid_tower_platform_loop);
|
|
smlua_bind_function(L, "bhv_snow_leaf_particle_spawn_init", smlua_func_bhv_snow_leaf_particle_spawn_init);
|
|
smlua_bind_function(L, "bhv_tree_snow_or_leaf_loop", smlua_func_bhv_tree_snow_or_leaf_loop);
|
|
smlua_bind_function(L, "bhv_piranha_plant_bubble_loop", smlua_func_bhv_piranha_plant_bubble_loop);
|
|
smlua_bind_function(L, "bhv_piranha_plant_waking_bubbles_loop", smlua_func_bhv_piranha_plant_waking_bubbles_loop);
|
|
smlua_bind_function(L, "bhv_purple_switch_loop", smlua_func_bhv_purple_switch_loop);
|
|
smlua_bind_function(L, "bhv_hidden_object_loop", smlua_func_bhv_hidden_object_loop);
|
|
smlua_bind_function(L, "bhv_breakable_box_loop", smlua_func_bhv_breakable_box_loop);
|
|
smlua_bind_function(L, "bhv_pushable_loop", smlua_func_bhv_pushable_loop);
|
|
smlua_bind_function(L, "bhv_small_water_wave_loop", smlua_func_bhv_small_water_wave_loop);
|
|
smlua_bind_function(L, "bhv_yellow_coin_init", smlua_func_bhv_yellow_coin_init);
|
|
smlua_bind_function(L, "bhv_yellow_coin_loop", smlua_func_bhv_yellow_coin_loop);
|
|
smlua_bind_function(L, "bhv_squarish_path_moving_loop", smlua_func_bhv_squarish_path_moving_loop);
|
|
smlua_bind_function(L, "bhv_squarish_path_parent_init", smlua_func_bhv_squarish_path_parent_init);
|
|
smlua_bind_function(L, "bhv_squarish_path_parent_loop", smlua_func_bhv_squarish_path_parent_loop);
|
|
smlua_bind_function(L, "bhv_heave_ho_loop", smlua_func_bhv_heave_ho_loop);
|
|
smlua_bind_function(L, "bhv_heave_ho_throw_mario_loop", smlua_func_bhv_heave_ho_throw_mario_loop);
|
|
smlua_bind_function(L, "bhv_ccm_touched_star_spawn_loop", smlua_func_bhv_ccm_touched_star_spawn_loop);
|
|
smlua_bind_function(L, "bhv_unused_poundable_platform", smlua_func_bhv_unused_poundable_platform);
|
|
smlua_bind_function(L, "bhv_beta_trampoline_top_loop", smlua_func_bhv_beta_trampoline_top_loop);
|
|
smlua_bind_function(L, "bhv_beta_trampoline_spring_loop", smlua_func_bhv_beta_trampoline_spring_loop);
|
|
smlua_bind_function(L, "bhv_jumping_box_loop", smlua_func_bhv_jumping_box_loop);
|
|
smlua_bind_function(L, "bhv_boo_cage_init", smlua_func_bhv_boo_cage_init);
|
|
smlua_bind_function(L, "bhv_boo_cage_loop", smlua_func_bhv_boo_cage_loop);
|
|
smlua_bind_function(L, "bhv_bowser_key_init", smlua_func_bhv_bowser_key_init);
|
|
smlua_bind_function(L, "bhv_bowser_key_loop", smlua_func_bhv_bowser_key_loop);
|
|
smlua_bind_function(L, "bhv_grand_star_init", smlua_func_bhv_grand_star_init);
|
|
smlua_bind_function(L, "bhv_grand_star_loop", smlua_func_bhv_grand_star_loop);
|
|
smlua_bind_function(L, "bhv_beta_boo_key_loop", smlua_func_bhv_beta_boo_key_loop);
|
|
smlua_bind_function(L, "bhv_alpha_boo_key_loop", smlua_func_bhv_alpha_boo_key_loop);
|
|
smlua_bind_function(L, "bhv_bullet_bill_init", smlua_func_bhv_bullet_bill_init);
|
|
smlua_bind_function(L, "bhv_bullet_bill_loop", smlua_func_bhv_bullet_bill_loop);
|
|
smlua_bind_function(L, "bhv_white_puff_smoke_init", smlua_func_bhv_white_puff_smoke_init);
|
|
smlua_bind_function(L, "bhv_bowser_tail_anchor_init", smlua_func_bhv_bowser_tail_anchor_init);
|
|
smlua_bind_function(L, "bhv_bowser_tail_anchor_loop", smlua_func_bhv_bowser_tail_anchor_loop);
|
|
smlua_bind_function(L, "bhv_bowser_init", smlua_func_bhv_bowser_init);
|
|
smlua_bind_function(L, "bhv_bowser_loop", smlua_func_bhv_bowser_loop);
|
|
smlua_bind_function(L, "bhv_bowser_body_anchor_init", smlua_func_bhv_bowser_body_anchor_init);
|
|
smlua_bind_function(L, "bhv_bowser_body_anchor_loop", smlua_func_bhv_bowser_body_anchor_loop);
|
|
smlua_bind_function(L, "bhv_bowser_flame_spawn_loop", smlua_func_bhv_bowser_flame_spawn_loop);
|
|
smlua_bind_function(L, "bhv_tilting_bowser_lava_platform_init", smlua_func_bhv_tilting_bowser_lava_platform_init);
|
|
smlua_bind_function(L, "bhv_falling_bowser_platform_loop", smlua_func_bhv_falling_bowser_platform_loop);
|
|
smlua_bind_function(L, "bhv_blue_bowser_flame_init", smlua_func_bhv_blue_bowser_flame_init);
|
|
smlua_bind_function(L, "bhv_blue_bowser_flame_loop", smlua_func_bhv_blue_bowser_flame_loop);
|
|
smlua_bind_function(L, "bhv_flame_floating_landing_init", smlua_func_bhv_flame_floating_landing_init);
|
|
smlua_bind_function(L, "bhv_flame_floating_landing_loop", smlua_func_bhv_flame_floating_landing_loop);
|
|
smlua_bind_function(L, "bhv_blue_flames_group_loop", smlua_func_bhv_blue_flames_group_loop);
|
|
smlua_bind_function(L, "bhv_flame_bouncing_init", smlua_func_bhv_flame_bouncing_init);
|
|
smlua_bind_function(L, "bhv_flame_bouncing_loop", smlua_func_bhv_flame_bouncing_loop);
|
|
smlua_bind_function(L, "bhv_flame_moving_forward_growing_init", smlua_func_bhv_flame_moving_forward_growing_init);
|
|
smlua_bind_function(L, "bhv_flame_moving_forward_growing_loop", smlua_func_bhv_flame_moving_forward_growing_loop);
|
|
smlua_bind_function(L, "bhv_flame_bowser_init", smlua_func_bhv_flame_bowser_init);
|
|
smlua_bind_function(L, "bhv_flame_bowser_loop", smlua_func_bhv_flame_bowser_loop);
|
|
smlua_bind_function(L, "bhv_flame_large_burning_out_init", smlua_func_bhv_flame_large_burning_out_init);
|
|
smlua_bind_function(L, "bhv_blue_fish_movement_loop", smlua_func_bhv_blue_fish_movement_loop);
|
|
smlua_bind_function(L, "bhv_tank_fish_group_loop", smlua_func_bhv_tank_fish_group_loop);
|
|
smlua_bind_function(L, "bhv_checkerboard_elevator_group_init", smlua_func_bhv_checkerboard_elevator_group_init);
|
|
smlua_bind_function(L, "bhv_checkerboard_elevator_group_loop", smlua_func_bhv_checkerboard_elevator_group_loop);
|
|
smlua_bind_function(L, "bhv_checkerboard_platform_init", smlua_func_bhv_checkerboard_platform_init);
|
|
smlua_bind_function(L, "bhv_checkerboard_platform_loop", smlua_func_bhv_checkerboard_platform_loop);
|
|
smlua_bind_function(L, "bhv_bowser_key_unlock_door_loop", smlua_func_bhv_bowser_key_unlock_door_loop);
|
|
smlua_bind_function(L, "bhv_bowser_key_course_exit_loop", smlua_func_bhv_bowser_key_course_exit_loop);
|
|
smlua_bind_function(L, "bhv_invisible_objects_under_bridge_init", smlua_func_bhv_invisible_objects_under_bridge_init);
|
|
smlua_bind_function(L, "bhv_invisible_objects_under_bridge_loop", smlua_func_bhv_invisible_objects_under_bridge_loop);
|
|
smlua_bind_function(L, "bhv_water_level_pillar_init", smlua_func_bhv_water_level_pillar_init);
|
|
smlua_bind_function(L, "bhv_water_level_pillar_loop", smlua_func_bhv_water_level_pillar_loop);
|
|
smlua_bind_function(L, "bhv_ddd_warp_loop", smlua_func_bhv_ddd_warp_loop);
|
|
smlua_bind_function(L, "bhv_moat_grills_loop", smlua_func_bhv_moat_grills_loop);
|
|
smlua_bind_function(L, "bhv_rotating_clock_arm_loop", smlua_func_bhv_rotating_clock_arm_loop);
|
|
smlua_bind_function(L, "bhv_ukiki_init", smlua_func_bhv_ukiki_init);
|
|
smlua_bind_function(L, "bhv_ukiki_loop", smlua_func_bhv_ukiki_loop);
|
|
smlua_bind_function(L, "bhv_lll_sinking_rock_block_loop", smlua_func_bhv_lll_sinking_rock_block_loop);
|
|
smlua_bind_function(L, "bhv_lll_moving_octagonal_mesh_platform_loop", smlua_func_bhv_lll_moving_octagonal_mesh_platform_loop);
|
|
smlua_bind_function(L, "bhv_lll_rotating_block_fire_bars_loop", smlua_func_bhv_lll_rotating_block_fire_bars_loop);
|
|
smlua_bind_function(L, "bhv_lll_rotating_hex_flame_loop", smlua_func_bhv_lll_rotating_hex_flame_loop);
|
|
smlua_bind_function(L, "bhv_lll_wood_piece_loop", smlua_func_bhv_lll_wood_piece_loop);
|
|
smlua_bind_function(L, "bhv_lll_floating_wood_bridge_loop", smlua_func_bhv_lll_floating_wood_bridge_loop);
|
|
smlua_bind_function(L, "bhv_volcano_flames_loop", smlua_func_bhv_volcano_flames_loop);
|
|
smlua_bind_function(L, "bhv_lll_rotating_hexagonal_ring_loop", smlua_func_bhv_lll_rotating_hexagonal_ring_loop);
|
|
smlua_bind_function(L, "bhv_lll_sinking_rectangular_platform_loop", smlua_func_bhv_lll_sinking_rectangular_platform_loop);
|
|
smlua_bind_function(L, "bhv_lll_sinking_square_platforms_loop", smlua_func_bhv_lll_sinking_square_platforms_loop);
|
|
smlua_bind_function(L, "bhv_koopa_shell_loop", smlua_func_bhv_koopa_shell_loop);
|
|
smlua_bind_function(L, "bhv_koopa_shell_flame_loop", smlua_func_bhv_koopa_shell_flame_loop);
|
|
smlua_bind_function(L, "bhv_tox_box_loop", smlua_func_bhv_tox_box_loop);
|
|
smlua_bind_function(L, "mario_moving_fast_enough_to_make_piranha_plant_bite", smlua_func_mario_moving_fast_enough_to_make_piranha_plant_bite);
|
|
smlua_bind_function(L, "bhv_piranha_plant_loop", smlua_func_bhv_piranha_plant_loop);
|
|
smlua_bind_function(L, "bhv_lll_bowser_puzzle_piece_loop", smlua_func_bhv_lll_bowser_puzzle_piece_loop);
|
|
smlua_bind_function(L, "bhv_lll_bowser_puzzle_loop", smlua_func_bhv_lll_bowser_puzzle_loop);
|
|
smlua_bind_function(L, "bhv_tuxies_mother_loop", smlua_func_bhv_tuxies_mother_loop);
|
|
smlua_bind_function(L, "bhv_small_penguin_loop", smlua_func_bhv_small_penguin_loop);
|
|
smlua_bind_function(L, "bhv_fish_spawner_loop", smlua_func_bhv_fish_spawner_loop);
|
|
smlua_bind_function(L, "bhv_fish_loop", smlua_func_bhv_fish_loop);
|
|
smlua_bind_function(L, "bhv_wdw_express_elevator_loop", smlua_func_bhv_wdw_express_elevator_loop);
|
|
smlua_bind_function(L, "bhv_bub_spawner_loop", smlua_func_bhv_bub_spawner_loop);
|
|
smlua_bind_function(L, "bhv_bub_loop", smlua_func_bhv_bub_loop);
|
|
smlua_bind_function(L, "bhv_exclamation_box_init", smlua_func_bhv_exclamation_box_init);
|
|
smlua_bind_function(L, "bhv_exclamation_box_loop", smlua_func_bhv_exclamation_box_loop);
|
|
smlua_bind_function(L, "bhv_rotating_exclamation_box_loop", smlua_func_bhv_rotating_exclamation_box_loop);
|
|
smlua_bind_function(L, "bhv_sound_spawner_init", smlua_func_bhv_sound_spawner_init);
|
|
smlua_bind_function(L, "bhv_bowsers_sub_loop", smlua_func_bhv_bowsers_sub_loop);
|
|
smlua_bind_function(L, "bhv_sushi_shark_loop", smlua_func_bhv_sushi_shark_loop);
|
|
smlua_bind_function(L, "bhv_sushi_shark_collision_loop", smlua_func_bhv_sushi_shark_collision_loop);
|
|
smlua_bind_function(L, "bhv_jrb_sliding_box_loop", smlua_func_bhv_jrb_sliding_box_loop);
|
|
smlua_bind_function(L, "bhv_ship_part_3_loop", smlua_func_bhv_ship_part_3_loop);
|
|
smlua_bind_function(L, "bhv_sunken_ship_part_loop", smlua_func_bhv_sunken_ship_part_loop);
|
|
smlua_bind_function(L, "bhv_white_puff_1_loop", smlua_func_bhv_white_puff_1_loop);
|
|
smlua_bind_function(L, "bhv_white_puff_2_loop", smlua_func_bhv_white_puff_2_loop);
|
|
smlua_bind_function(L, "bhv_blue_coin_number_loop", smlua_func_bhv_blue_coin_number_loop);
|
|
smlua_bind_function(L, "bhv_blue_coin_switch_init", smlua_func_bhv_blue_coin_switch_init);
|
|
smlua_bind_function(L, "bhv_blue_coin_switch_loop", smlua_func_bhv_blue_coin_switch_loop);
|
|
smlua_bind_function(L, "bhv_hidden_blue_coin_loop", smlua_func_bhv_hidden_blue_coin_loop);
|
|
smlua_bind_function(L, "bhv_openable_cage_door_loop", smlua_func_bhv_openable_cage_door_loop);
|
|
smlua_bind_function(L, "bhv_openable_grill_loop", smlua_func_bhv_openable_grill_loop);
|
|
smlua_bind_function(L, "bhv_water_level_diamond_loop", smlua_func_bhv_water_level_diamond_loop);
|
|
smlua_bind_function(L, "bhv_init_changing_water_level_loop", smlua_func_bhv_init_changing_water_level_loop);
|
|
smlua_bind_function(L, "bhv_tweester_sand_particle_loop", smlua_func_bhv_tweester_sand_particle_loop);
|
|
smlua_bind_function(L, "bhv_tweester_loop", smlua_func_bhv_tweester_loop);
|
|
smlua_bind_function(L, "bhv_merry_go_round_boo_manager_loop", smlua_func_bhv_merry_go_round_boo_manager_loop);
|
|
smlua_bind_function(L, "bhv_animated_texture_loop", smlua_func_bhv_animated_texture_loop);
|
|
smlua_bind_function(L, "bhv_boo_in_castle_loop", smlua_func_bhv_boo_in_castle_loop);
|
|
smlua_bind_function(L, "bhv_boo_with_cage_init", smlua_func_bhv_boo_with_cage_init);
|
|
smlua_bind_function(L, "bhv_boo_with_cage_loop", smlua_func_bhv_boo_with_cage_loop);
|
|
smlua_bind_function(L, "bhv_boo_init", smlua_func_bhv_boo_init);
|
|
smlua_bind_function(L, "bhv_big_boo_loop", smlua_func_bhv_big_boo_loop);
|
|
smlua_bind_function(L, "bhv_courtyard_boo_triplet_init", smlua_func_bhv_courtyard_boo_triplet_init);
|
|
smlua_bind_function(L, "obj_set_secondary_camera_focus", smlua_func_obj_set_secondary_camera_focus);
|
|
smlua_bind_function(L, "bhv_boo_loop", smlua_func_bhv_boo_loop);
|
|
smlua_bind_function(L, "bhv_boo_boss_spawned_bridge_loop", smlua_func_bhv_boo_boss_spawned_bridge_loop);
|
|
smlua_bind_function(L, "bhv_bbh_tilting_trap_platform_loop", smlua_func_bhv_bbh_tilting_trap_platform_loop);
|
|
smlua_bind_function(L, "bhv_haunted_bookshelf_loop", smlua_func_bhv_haunted_bookshelf_loop);
|
|
smlua_bind_function(L, "bhv_merry_go_round_loop", smlua_func_bhv_merry_go_round_loop);
|
|
#ifndef VERSION_JP
|
|
smlua_bind_function(L, "bhv_play_music_track_when_touched_loop", smlua_func_bhv_play_music_track_when_touched_loop);
|
|
#endif
|
|
smlua_bind_function(L, "bhv_beta_bowser_anchor_loop", smlua_func_bhv_beta_bowser_anchor_loop);
|
|
smlua_bind_function(L, "bhv_static_checkered_platform_loop", smlua_func_bhv_static_checkered_platform_loop);
|
|
smlua_bind_function(L, "bhv_castle_floor_trap_init", smlua_func_bhv_castle_floor_trap_init);
|
|
smlua_bind_function(L, "bhv_castle_floor_trap_loop", smlua_func_bhv_castle_floor_trap_loop);
|
|
smlua_bind_function(L, "bhv_floor_trap_in_castle_loop", smlua_func_bhv_floor_trap_in_castle_loop);
|
|
smlua_bind_function(L, "bhv_sparkle_spawn_loop", smlua_func_bhv_sparkle_spawn_loop);
|
|
smlua_bind_function(L, "bhv_scuttlebug_loop", smlua_func_bhv_scuttlebug_loop);
|
|
smlua_bind_function(L, "bhv_scuttlebug_spawn_loop", smlua_func_bhv_scuttlebug_spawn_loop);
|
|
smlua_bind_function(L, "bhv_whomp_loop", smlua_func_bhv_whomp_loop);
|
|
smlua_bind_function(L, "bhv_water_splash_spawn_droplets", smlua_func_bhv_water_splash_spawn_droplets);
|
|
smlua_bind_function(L, "bhv_water_droplet_loop", smlua_func_bhv_water_droplet_loop);
|
|
smlua_bind_function(L, "bhv_water_droplet_splash_init", smlua_func_bhv_water_droplet_splash_init);
|
|
smlua_bind_function(L, "bhv_bubble_splash_init", smlua_func_bhv_bubble_splash_init);
|
|
smlua_bind_function(L, "bhv_idle_water_wave_loop", smlua_func_bhv_idle_water_wave_loop);
|
|
smlua_bind_function(L, "bhv_shallow_water_splash_init", smlua_func_bhv_shallow_water_splash_init);
|
|
smlua_bind_function(L, "bhv_wave_trail_shrink", smlua_func_bhv_wave_trail_shrink);
|
|
smlua_bind_function(L, "bhv_strong_wind_particle_loop", smlua_func_bhv_strong_wind_particle_loop);
|
|
smlua_bind_function(L, "bhv_sl_snowman_wind_loop", smlua_func_bhv_sl_snowman_wind_loop);
|
|
smlua_bind_function(L, "bhv_sl_walking_penguin_loop", smlua_func_bhv_sl_walking_penguin_loop);
|
|
smlua_bind_function(L, "bhv_menu_button_init", smlua_func_bhv_menu_button_init);
|
|
smlua_bind_function(L, "bhv_menu_button_loop", smlua_func_bhv_menu_button_loop);
|
|
smlua_bind_function(L, "bhv_menu_button_manager_init", smlua_func_bhv_menu_button_manager_init);
|
|
smlua_bind_function(L, "bhv_menu_button_manager_loop", smlua_func_bhv_menu_button_manager_loop);
|
|
smlua_bind_function(L, "bhv_act_selector_star_type_loop", smlua_func_bhv_act_selector_star_type_loop);
|
|
smlua_bind_function(L, "bhv_act_selector_init", smlua_func_bhv_act_selector_init);
|
|
smlua_bind_function(L, "bhv_act_selector_loop", smlua_func_bhv_act_selector_loop);
|
|
smlua_bind_function(L, "bhv_moving_yellow_coin_init", smlua_func_bhv_moving_yellow_coin_init);
|
|
smlua_bind_function(L, "bhv_moving_yellow_coin_loop", smlua_func_bhv_moving_yellow_coin_loop);
|
|
smlua_bind_function(L, "bhv_moving_blue_coin_init", smlua_func_bhv_moving_blue_coin_init);
|
|
smlua_bind_function(L, "bhv_moving_blue_coin_loop", smlua_func_bhv_moving_blue_coin_loop);
|
|
smlua_bind_function(L, "bhv_blue_coin_sliding_jumping_init", smlua_func_bhv_blue_coin_sliding_jumping_init);
|
|
smlua_bind_function(L, "bhv_blue_coin_sliding_loop", smlua_func_bhv_blue_coin_sliding_loop);
|
|
smlua_bind_function(L, "bhv_blue_coin_jumping_loop", smlua_func_bhv_blue_coin_jumping_loop);
|
|
smlua_bind_function(L, "bhv_seaweed_init", smlua_func_bhv_seaweed_init);
|
|
smlua_bind_function(L, "bhv_seaweed_bundle_init", smlua_func_bhv_seaweed_bundle_init);
|
|
smlua_bind_function(L, "bhv_bobomb_init", smlua_func_bhv_bobomb_init);
|
|
smlua_bind_function(L, "bhv_bobomb_loop", smlua_func_bhv_bobomb_loop);
|
|
smlua_bind_function(L, "bhv_bobomb_fuse_smoke_init", smlua_func_bhv_bobomb_fuse_smoke_init);
|
|
smlua_bind_function(L, "bhv_bobomb_buddy_init", smlua_func_bhv_bobomb_buddy_init);
|
|
smlua_bind_function(L, "bhv_bobomb_buddy_loop", smlua_func_bhv_bobomb_buddy_loop);
|
|
smlua_bind_function(L, "bhv_cannon_closed_init", smlua_func_bhv_cannon_closed_init);
|
|
smlua_bind_function(L, "bhv_cannon_closed_loop", smlua_func_bhv_cannon_closed_loop);
|
|
smlua_bind_function(L, "bhv_whirlpool_init", smlua_func_bhv_whirlpool_init);
|
|
smlua_bind_function(L, "bhv_whirlpool_loop", smlua_func_bhv_whirlpool_loop);
|
|
smlua_bind_function(L, "bhv_jet_stream_loop", smlua_func_bhv_jet_stream_loop);
|
|
smlua_bind_function(L, "bhv_homing_amp_init", smlua_func_bhv_homing_amp_init);
|
|
smlua_bind_function(L, "bhv_homing_amp_loop", smlua_func_bhv_homing_amp_loop);
|
|
smlua_bind_function(L, "bhv_circling_amp_init", smlua_func_bhv_circling_amp_init);
|
|
smlua_bind_function(L, "bhv_circling_amp_loop", smlua_func_bhv_circling_amp_loop);
|
|
smlua_bind_function(L, "bhv_butterfly_init", smlua_func_bhv_butterfly_init);
|
|
smlua_bind_function(L, "bhv_butterfly_loop", smlua_func_bhv_butterfly_loop);
|
|
smlua_bind_function(L, "bhv_hoot_init", smlua_func_bhv_hoot_init);
|
|
smlua_bind_function(L, "bhv_hoot_loop", smlua_func_bhv_hoot_loop);
|
|
smlua_bind_function(L, "bhv_beta_holdable_object_init", smlua_func_bhv_beta_holdable_object_init);
|
|
smlua_bind_function(L, "bhv_beta_holdable_object_loop", smlua_func_bhv_beta_holdable_object_loop);
|
|
smlua_bind_function(L, "bhv_object_bubble_init", smlua_func_bhv_object_bubble_init);
|
|
smlua_bind_function(L, "bhv_object_bubble_loop", smlua_func_bhv_object_bubble_loop);
|
|
smlua_bind_function(L, "bhv_object_water_wave_init", smlua_func_bhv_object_water_wave_init);
|
|
smlua_bind_function(L, "bhv_object_water_wave_loop", smlua_func_bhv_object_water_wave_loop);
|
|
smlua_bind_function(L, "bhv_explosion_init", smlua_func_bhv_explosion_init);
|
|
smlua_bind_function(L, "bhv_explosion_loop", smlua_func_bhv_explosion_loop);
|
|
smlua_bind_function(L, "bhv_bobomb_bully_death_smoke_init", smlua_func_bhv_bobomb_bully_death_smoke_init);
|
|
smlua_bind_function(L, "bhv_bobomb_explosion_bubble_init", smlua_func_bhv_bobomb_explosion_bubble_init);
|
|
smlua_bind_function(L, "bhv_bobomb_explosion_bubble_loop", smlua_func_bhv_bobomb_explosion_bubble_loop);
|
|
smlua_bind_function(L, "bhv_respawner_loop", smlua_func_bhv_respawner_loop);
|
|
smlua_bind_function(L, "bhv_small_bully_init", smlua_func_bhv_small_bully_init);
|
|
smlua_bind_function(L, "bhv_bully_loop", smlua_func_bhv_bully_loop);
|
|
smlua_bind_function(L, "bhv_big_bully_init", smlua_func_bhv_big_bully_init);
|
|
smlua_bind_function(L, "bhv_big_bully_with_minions_init", smlua_func_bhv_big_bully_with_minions_init);
|
|
smlua_bind_function(L, "bhv_big_bully_with_minions_loop", smlua_func_bhv_big_bully_with_minions_loop);
|
|
smlua_bind_function(L, "bhv_jet_stream_ring_spawner_loop", smlua_func_bhv_jet_stream_ring_spawner_loop);
|
|
smlua_bind_function(L, "bhv_jet_stream_water_ring_init", smlua_func_bhv_jet_stream_water_ring_init);
|
|
smlua_bind_function(L, "bhv_jet_stream_water_ring_loop", smlua_func_bhv_jet_stream_water_ring_loop);
|
|
smlua_bind_function(L, "bhv_manta_ray_water_ring_init", smlua_func_bhv_manta_ray_water_ring_init);
|
|
smlua_bind_function(L, "bhv_manta_ray_water_ring_loop", smlua_func_bhv_manta_ray_water_ring_loop);
|
|
smlua_bind_function(L, "bhv_bowser_bomb_loop", smlua_func_bhv_bowser_bomb_loop);
|
|
smlua_bind_function(L, "bhv_bowser_bomb_explosion_loop", smlua_func_bhv_bowser_bomb_explosion_loop);
|
|
smlua_bind_function(L, "bhv_bowser_bomb_smoke_loop", smlua_func_bhv_bowser_bomb_smoke_loop);
|
|
smlua_bind_function(L, "bhv_celebration_star_init", smlua_func_bhv_celebration_star_init);
|
|
smlua_bind_function(L, "bhv_celebration_star_loop", smlua_func_bhv_celebration_star_loop);
|
|
smlua_bind_function(L, "bhv_celebration_star_sparkle_loop", smlua_func_bhv_celebration_star_sparkle_loop);
|
|
smlua_bind_function(L, "bhv_star_key_collection_puff_spawner_loop", smlua_func_bhv_star_key_collection_puff_spawner_loop);
|
|
smlua_bind_function(L, "bhv_lll_drawbridge_spawner_init", smlua_func_bhv_lll_drawbridge_spawner_init);
|
|
smlua_bind_function(L, "bhv_lll_drawbridge_spawner_loop", smlua_func_bhv_lll_drawbridge_spawner_loop);
|
|
smlua_bind_function(L, "bhv_lll_drawbridge_loop", smlua_func_bhv_lll_drawbridge_loop);
|
|
smlua_bind_function(L, "bhv_small_bomp_init", smlua_func_bhv_small_bomp_init);
|
|
smlua_bind_function(L, "bhv_small_bomp_loop", smlua_func_bhv_small_bomp_loop);
|
|
smlua_bind_function(L, "bhv_large_bomp_init", smlua_func_bhv_large_bomp_init);
|
|
smlua_bind_function(L, "bhv_large_bomp_loop", smlua_func_bhv_large_bomp_loop);
|
|
smlua_bind_function(L, "bhv_wf_sliding_platform_init", smlua_func_bhv_wf_sliding_platform_init);
|
|
smlua_bind_function(L, "bhv_wf_sliding_platform_loop", smlua_func_bhv_wf_sliding_platform_loop);
|
|
smlua_bind_function(L, "bhv_moneybag_init", smlua_func_bhv_moneybag_init);
|
|
smlua_bind_function(L, "bhv_moneybag_loop", smlua_func_bhv_moneybag_loop);
|
|
smlua_bind_function(L, "bhv_moneybag_hidden_loop", smlua_func_bhv_moneybag_hidden_loop);
|
|
smlua_bind_function(L, "bhv_bob_pit_bowling_ball_init", smlua_func_bhv_bob_pit_bowling_ball_init);
|
|
smlua_bind_function(L, "bhv_bob_pit_bowling_ball_loop", smlua_func_bhv_bob_pit_bowling_ball_loop);
|
|
smlua_bind_function(L, "bhv_free_bowling_ball_init", smlua_func_bhv_free_bowling_ball_init);
|
|
smlua_bind_function(L, "bhv_free_bowling_ball_loop", smlua_func_bhv_free_bowling_ball_loop);
|
|
smlua_bind_function(L, "bhv_bowling_ball_init", smlua_func_bhv_bowling_ball_init);
|
|
smlua_bind_function(L, "bhv_bowling_ball_loop", smlua_func_bhv_bowling_ball_loop);
|
|
smlua_bind_function(L, "bhv_generic_bowling_ball_spawner_init", smlua_func_bhv_generic_bowling_ball_spawner_init);
|
|
smlua_bind_function(L, "bhv_generic_bowling_ball_spawner_loop", smlua_func_bhv_generic_bowling_ball_spawner_loop);
|
|
smlua_bind_function(L, "bhv_thi_bowling_ball_spawner_loop", smlua_func_bhv_thi_bowling_ball_spawner_loop);
|
|
smlua_bind_function(L, "bhv_rr_cruiser_wing_init", smlua_func_bhv_rr_cruiser_wing_init);
|
|
smlua_bind_function(L, "bhv_rr_cruiser_wing_loop", smlua_func_bhv_rr_cruiser_wing_loop);
|
|
smlua_bind_function(L, "bhv_spindel_init", smlua_func_bhv_spindel_init);
|
|
smlua_bind_function(L, "bhv_spindel_loop", smlua_func_bhv_spindel_loop);
|
|
smlua_bind_function(L, "bhv_ssl_moving_pyramid_wall_init", smlua_func_bhv_ssl_moving_pyramid_wall_init);
|
|
smlua_bind_function(L, "bhv_ssl_moving_pyramid_wall_loop", smlua_func_bhv_ssl_moving_pyramid_wall_loop);
|
|
smlua_bind_function(L, "bhv_pyramid_elevator_init", smlua_func_bhv_pyramid_elevator_init);
|
|
smlua_bind_function(L, "bhv_pyramid_elevator_loop", smlua_func_bhv_pyramid_elevator_loop);
|
|
smlua_bind_function(L, "bhv_pyramid_elevator_trajectory_marker_ball_loop", smlua_func_bhv_pyramid_elevator_trajectory_marker_ball_loop);
|
|
smlua_bind_function(L, "bhv_pyramid_top_init", smlua_func_bhv_pyramid_top_init);
|
|
smlua_bind_function(L, "bhv_pyramid_top_loop", smlua_func_bhv_pyramid_top_loop);
|
|
smlua_bind_function(L, "bhv_pyramid_top_fragment_init", smlua_func_bhv_pyramid_top_fragment_init);
|
|
smlua_bind_function(L, "bhv_pyramid_top_fragment_loop", smlua_func_bhv_pyramid_top_fragment_loop);
|
|
smlua_bind_function(L, "bhv_pyramid_pillar_touch_detector_loop", smlua_func_bhv_pyramid_pillar_touch_detector_loop);
|
|
smlua_bind_function(L, "bhv_waterfall_sound_loop", smlua_func_bhv_waterfall_sound_loop);
|
|
smlua_bind_function(L, "bhv_volcano_sound_loop", smlua_func_bhv_volcano_sound_loop);
|
|
smlua_bind_function(L, "bhv_castle_flag_init", smlua_func_bhv_castle_flag_init);
|
|
smlua_bind_function(L, "bhv_birds_sound_loop", smlua_func_bhv_birds_sound_loop);
|
|
smlua_bind_function(L, "bhv_ambient_sounds_init", smlua_func_bhv_ambient_sounds_init);
|
|
smlua_bind_function(L, "bhv_sand_sound_loop", smlua_func_bhv_sand_sound_loop);
|
|
smlua_bind_function(L, "bhv_castle_cannon_grate_init", smlua_func_bhv_castle_cannon_grate_init);
|
|
smlua_bind_function(L, "bhv_snowmans_bottom_init", smlua_func_bhv_snowmans_bottom_init);
|
|
smlua_bind_function(L, "bhv_snowmans_bottom_loop", smlua_func_bhv_snowmans_bottom_loop);
|
|
smlua_bind_function(L, "bhv_snowmans_head_init", smlua_func_bhv_snowmans_head_init);
|
|
smlua_bind_function(L, "bhv_snowmans_head_loop", smlua_func_bhv_snowmans_head_loop);
|
|
smlua_bind_function(L, "bhv_snowmans_body_checkpoint_loop", smlua_func_bhv_snowmans_body_checkpoint_loop);
|
|
smlua_bind_function(L, "bhv_big_boulder_init", smlua_func_bhv_big_boulder_init);
|
|
smlua_bind_function(L, "bhv_big_boulder_loop", smlua_func_bhv_big_boulder_loop);
|
|
smlua_bind_function(L, "bhv_big_boulder_generator_loop", smlua_func_bhv_big_boulder_generator_loop);
|
|
smlua_bind_function(L, "bhv_wing_cap_init", smlua_func_bhv_wing_cap_init);
|
|
smlua_bind_function(L, "bhv_wing_vanish_cap_loop", smlua_func_bhv_wing_vanish_cap_loop);
|
|
smlua_bind_function(L, "bhv_metal_cap_init", smlua_func_bhv_metal_cap_init);
|
|
smlua_bind_function(L, "bhv_metal_cap_loop", smlua_func_bhv_metal_cap_loop);
|
|
smlua_bind_function(L, "bhv_normal_cap_init", smlua_func_bhv_normal_cap_init);
|
|
smlua_bind_function(L, "bhv_normal_cap_loop", smlua_func_bhv_normal_cap_loop);
|
|
smlua_bind_function(L, "bhv_vanish_cap_init", smlua_func_bhv_vanish_cap_init);
|
|
smlua_bind_function(L, "bhv_star_number_loop", smlua_func_bhv_star_number_loop);
|
|
smlua_bind_function(L, "spawn_star_number", smlua_func_spawn_star_number);
|
|
smlua_bind_function(L, "bhv_collect_star_init", smlua_func_bhv_collect_star_init);
|
|
smlua_bind_function(L, "bhv_collect_star_loop", smlua_func_bhv_collect_star_loop);
|
|
smlua_bind_function(L, "bhv_star_spawn_init", smlua_func_bhv_star_spawn_init);
|
|
smlua_bind_function(L, "bhv_star_spawn_loop", smlua_func_bhv_star_spawn_loop);
|
|
smlua_bind_function(L, "bhv_hidden_red_coin_star_init", smlua_func_bhv_hidden_red_coin_star_init);
|
|
smlua_bind_function(L, "bhv_hidden_red_coin_star_loop", smlua_func_bhv_hidden_red_coin_star_loop);
|
|
smlua_bind_function(L, "bhv_red_coin_init", smlua_func_bhv_red_coin_init);
|
|
smlua_bind_function(L, "bhv_red_coin_loop", smlua_func_bhv_red_coin_loop);
|
|
smlua_bind_function(L, "bhv_bowser_course_red_coin_star_loop", smlua_func_bhv_bowser_course_red_coin_star_loop);
|
|
smlua_bind_function(L, "bhv_hidden_star_init", smlua_func_bhv_hidden_star_init);
|
|
smlua_bind_function(L, "bhv_hidden_star_loop", smlua_func_bhv_hidden_star_loop);
|
|
smlua_bind_function(L, "bhv_hidden_star_trigger_loop", smlua_func_bhv_hidden_star_trigger_loop);
|
|
smlua_bind_function(L, "bhv_ttm_rolling_log_init", smlua_func_bhv_ttm_rolling_log_init);
|
|
smlua_bind_function(L, "bhv_rolling_log_loop", smlua_func_bhv_rolling_log_loop);
|
|
smlua_bind_function(L, "bhv_lll_rolling_log_init", smlua_func_bhv_lll_rolling_log_init);
|
|
smlua_bind_function(L, "bhv_1up_trigger_init", smlua_func_bhv_1up_trigger_init);
|
|
smlua_bind_function(L, "bhv_1up_common_init", smlua_func_bhv_1up_common_init);
|
|
smlua_bind_function(L, "bhv_1up_walking_loop", smlua_func_bhv_1up_walking_loop);
|
|
smlua_bind_function(L, "bhv_1up_running_away_loop", smlua_func_bhv_1up_running_away_loop);
|
|
smlua_bind_function(L, "bhv_1up_sliding_loop", smlua_func_bhv_1up_sliding_loop);
|
|
smlua_bind_function(L, "bhv_1up_init", smlua_func_bhv_1up_init);
|
|
smlua_bind_function(L, "bhv_1up_loop", smlua_func_bhv_1up_loop);
|
|
smlua_bind_function(L, "bhv_1up_jump_on_approach_loop", smlua_func_bhv_1up_jump_on_approach_loop);
|
|
smlua_bind_function(L, "bhv_1up_hidden_loop", smlua_func_bhv_1up_hidden_loop);
|
|
smlua_bind_function(L, "bhv_1up_hidden_trigger_loop", smlua_func_bhv_1up_hidden_trigger_loop);
|
|
smlua_bind_function(L, "bhv_1up_hidden_in_pole_loop", smlua_func_bhv_1up_hidden_in_pole_loop);
|
|
smlua_bind_function(L, "bhv_1up_hidden_in_pole_trigger_loop", smlua_func_bhv_1up_hidden_in_pole_trigger_loop);
|
|
smlua_bind_function(L, "bhv_1up_hidden_in_pole_spawner_loop", smlua_func_bhv_1up_hidden_in_pole_spawner_loop);
|
|
smlua_bind_function(L, "bhv_controllable_platform_init", smlua_func_bhv_controllable_platform_init);
|
|
smlua_bind_function(L, "bhv_controllable_platform_loop", smlua_func_bhv_controllable_platform_loop);
|
|
smlua_bind_function(L, "bhv_controllable_platform_sub_loop", smlua_func_bhv_controllable_platform_sub_loop);
|
|
smlua_bind_function(L, "bhv_breakable_box_small_init", smlua_func_bhv_breakable_box_small_init);
|
|
smlua_bind_function(L, "bhv_breakable_box_small_loop", smlua_func_bhv_breakable_box_small_loop);
|
|
smlua_bind_function(L, "bhv_sliding_snow_mound_loop", smlua_func_bhv_sliding_snow_mound_loop);
|
|
smlua_bind_function(L, "bhv_snow_mound_spawn_loop", smlua_func_bhv_snow_mound_spawn_loop);
|
|
smlua_bind_function(L, "bhv_floating_platform_loop", smlua_func_bhv_floating_platform_loop);
|
|
smlua_bind_function(L, "bhv_arrow_lift_loop", smlua_func_bhv_arrow_lift_loop);
|
|
smlua_bind_function(L, "bhv_orange_number_init", smlua_func_bhv_orange_number_init);
|
|
smlua_bind_function(L, "bhv_orange_number_loop", smlua_func_bhv_orange_number_loop);
|
|
smlua_bind_function(L, "bhv_manta_ray_init", smlua_func_bhv_manta_ray_init);
|
|
smlua_bind_function(L, "bhv_manta_ray_loop", smlua_func_bhv_manta_ray_loop);
|
|
smlua_bind_function(L, "bhv_falling_pillar_init", smlua_func_bhv_falling_pillar_init);
|
|
smlua_bind_function(L, "bhv_falling_pillar_loop", smlua_func_bhv_falling_pillar_loop);
|
|
smlua_bind_function(L, "bhv_falling_pillar_hitbox_loop", smlua_func_bhv_falling_pillar_hitbox_loop);
|
|
smlua_bind_function(L, "bhv_jrb_floating_box_loop", smlua_func_bhv_jrb_floating_box_loop);
|
|
smlua_bind_function(L, "bhv_decorative_pendulum_init", smlua_func_bhv_decorative_pendulum_init);
|
|
smlua_bind_function(L, "bhv_decorative_pendulum_loop", smlua_func_bhv_decorative_pendulum_loop);
|
|
smlua_bind_function(L, "bhv_treasure_chest_ship_init", smlua_func_bhv_treasure_chest_ship_init);
|
|
smlua_bind_function(L, "bhv_treasure_chest_ship_loop", smlua_func_bhv_treasure_chest_ship_loop);
|
|
smlua_bind_function(L, "bhv_treasure_chest_jrb_init", smlua_func_bhv_treasure_chest_jrb_init);
|
|
smlua_bind_function(L, "bhv_treasure_chest_jrb_loop", smlua_func_bhv_treasure_chest_jrb_loop);
|
|
smlua_bind_function(L, "bhv_treasure_chest_init", smlua_func_bhv_treasure_chest_init);
|
|
smlua_bind_function(L, "bhv_treasure_chest_loop", smlua_func_bhv_treasure_chest_loop);
|
|
smlua_bind_function(L, "bhv_treasure_chest_bottom_init", smlua_func_bhv_treasure_chest_bottom_init);
|
|
smlua_bind_function(L, "bhv_treasure_chest_bottom_loop", smlua_func_bhv_treasure_chest_bottom_loop);
|
|
smlua_bind_function(L, "bhv_treasure_chest_top_loop", smlua_func_bhv_treasure_chest_top_loop);
|
|
smlua_bind_function(L, "bhv_mips_init", smlua_func_bhv_mips_init);
|
|
smlua_bind_function(L, "bhv_mips_loop", smlua_func_bhv_mips_loop);
|
|
smlua_bind_function(L, "bhv_yoshi_init", smlua_func_bhv_yoshi_init);
|
|
smlua_bind_function(L, "bhv_koopa_init", smlua_func_bhv_koopa_init);
|
|
smlua_bind_function(L, "bhv_koopa_update", smlua_func_bhv_koopa_update);
|
|
smlua_bind_function(L, "bhv_koopa_race_endpoint_update", smlua_func_bhv_koopa_race_endpoint_update);
|
|
smlua_bind_function(L, "bhv_pokey_update", smlua_func_bhv_pokey_update);
|
|
smlua_bind_function(L, "bhv_pokey_body_part_update", smlua_func_bhv_pokey_body_part_update);
|
|
smlua_bind_function(L, "bhv_swoop_update", smlua_func_bhv_swoop_update);
|
|
smlua_bind_function(L, "bhv_fly_guy_update", smlua_func_bhv_fly_guy_update);
|
|
smlua_bind_function(L, "bhv_goomba_init", smlua_func_bhv_goomba_init);
|
|
smlua_bind_function(L, "bhv_goomba_update", smlua_func_bhv_goomba_update);
|
|
smlua_bind_function(L, "bhv_goomba_triplet_spawner_update", smlua_func_bhv_goomba_triplet_spawner_update);
|
|
smlua_bind_function(L, "bhv_chain_chomp_update", smlua_func_bhv_chain_chomp_update);
|
|
smlua_bind_function(L, "bhv_chain_chomp_chain_part_update", smlua_func_bhv_chain_chomp_chain_part_update);
|
|
smlua_bind_function(L, "bhv_wooden_post_update", smlua_func_bhv_wooden_post_update);
|
|
smlua_bind_function(L, "bhv_chain_chomp_gate_init", smlua_func_bhv_chain_chomp_gate_init);
|
|
smlua_bind_function(L, "bhv_chain_chomp_gate_update", smlua_func_bhv_chain_chomp_gate_update);
|
|
smlua_bind_function(L, "bhv_wiggler_update", smlua_func_bhv_wiggler_update);
|
|
smlua_bind_function(L, "bhv_wiggler_body_part_update", smlua_func_bhv_wiggler_body_part_update);
|
|
smlua_bind_function(L, "bhv_enemy_lakitu_update", smlua_func_bhv_enemy_lakitu_update);
|
|
smlua_bind_function(L, "bhv_camera_lakitu_init", smlua_func_bhv_camera_lakitu_init);
|
|
smlua_bind_function(L, "bhv_camera_lakitu_update", smlua_func_bhv_camera_lakitu_update);
|
|
smlua_bind_function(L, "bhv_cloud_update", smlua_func_bhv_cloud_update);
|
|
smlua_bind_function(L, "bhv_cloud_part_update", smlua_func_bhv_cloud_part_update);
|
|
smlua_bind_function(L, "bhv_spiny_update", smlua_func_bhv_spiny_update);
|
|
smlua_bind_function(L, "bhv_monty_mole_init", smlua_func_bhv_monty_mole_init);
|
|
smlua_bind_function(L, "bhv_monty_mole_update", smlua_func_bhv_monty_mole_update);
|
|
smlua_bind_function(L, "bhv_monty_mole_hole_update", smlua_func_bhv_monty_mole_hole_update);
|
|
smlua_bind_function(L, "bhv_monty_mole_rock_update", smlua_func_bhv_monty_mole_rock_update);
|
|
smlua_bind_function(L, "bhv_platform_on_track_init", smlua_func_bhv_platform_on_track_init);
|
|
smlua_bind_function(L, "bhv_platform_on_track_update", smlua_func_bhv_platform_on_track_update);
|
|
smlua_bind_function(L, "bhv_track_ball_update", smlua_func_bhv_track_ball_update);
|
|
smlua_bind_function(L, "bhv_seesaw_platform_init", smlua_func_bhv_seesaw_platform_init);
|
|
smlua_bind_function(L, "bhv_seesaw_platform_update", smlua_func_bhv_seesaw_platform_update);
|
|
smlua_bind_function(L, "bhv_ferris_wheel_axle_init", smlua_func_bhv_ferris_wheel_axle_init);
|
|
smlua_bind_function(L, "bhv_ferris_wheel_platform_init", smlua_func_bhv_ferris_wheel_platform_init);
|
|
smlua_bind_function(L, "bhv_ferris_wheel_platform_update", smlua_func_bhv_ferris_wheel_platform_update);
|
|
smlua_bind_function(L, "bhv_water_bomb_spawner_update", smlua_func_bhv_water_bomb_spawner_update);
|
|
smlua_bind_function(L, "bhv_water_bomb_update", smlua_func_bhv_water_bomb_update);
|
|
smlua_bind_function(L, "bhv_water_bomb_shadow_update", smlua_func_bhv_water_bomb_shadow_update);
|
|
smlua_bind_function(L, "bhv_ttc_rotating_solid_init", smlua_func_bhv_ttc_rotating_solid_init);
|
|
smlua_bind_function(L, "bhv_ttc_rotating_solid_update", smlua_func_bhv_ttc_rotating_solid_update);
|
|
smlua_bind_function(L, "bhv_ttc_pendulum_init", smlua_func_bhv_ttc_pendulum_init);
|
|
smlua_bind_function(L, "bhv_ttc_pendulum_update", smlua_func_bhv_ttc_pendulum_update);
|
|
smlua_bind_function(L, "bhv_ttc_treadmill_init", smlua_func_bhv_ttc_treadmill_init);
|
|
smlua_bind_function(L, "bhv_ttc_treadmill_update", smlua_func_bhv_ttc_treadmill_update);
|
|
smlua_bind_function(L, "bhv_ttc_moving_bar_init", smlua_func_bhv_ttc_moving_bar_init);
|
|
smlua_bind_function(L, "bhv_ttc_moving_bar_update", smlua_func_bhv_ttc_moving_bar_update);
|
|
smlua_bind_function(L, "bhv_ttc_cog_init", smlua_func_bhv_ttc_cog_init);
|
|
smlua_bind_function(L, "bhv_ttc_cog_update", smlua_func_bhv_ttc_cog_update);
|
|
smlua_bind_function(L, "bhv_ttc_pit_block_init", smlua_func_bhv_ttc_pit_block_init);
|
|
smlua_bind_function(L, "bhv_ttc_pit_block_update", smlua_func_bhv_ttc_pit_block_update);
|
|
smlua_bind_function(L, "bhv_ttc_elevator_init", smlua_func_bhv_ttc_elevator_init);
|
|
smlua_bind_function(L, "bhv_ttc_elevator_update", smlua_func_bhv_ttc_elevator_update);
|
|
smlua_bind_function(L, "bhv_ttc_2d_rotator_init", smlua_func_bhv_ttc_2d_rotator_init);
|
|
smlua_bind_function(L, "bhv_ttc_2d_rotator_update", smlua_func_bhv_ttc_2d_rotator_update);
|
|
smlua_bind_function(L, "bhv_ttc_spinner_update", smlua_func_bhv_ttc_spinner_update);
|
|
smlua_bind_function(L, "bhv_mr_blizzard_init", smlua_func_bhv_mr_blizzard_init);
|
|
smlua_bind_function(L, "bhv_mr_blizzard_update", smlua_func_bhv_mr_blizzard_update);
|
|
smlua_bind_function(L, "bhv_mr_blizzard_snowball", smlua_func_bhv_mr_blizzard_snowball);
|
|
smlua_bind_function(L, "bhv_sliding_plat_2_init", smlua_func_bhv_sliding_plat_2_init);
|
|
smlua_bind_function(L, "bhv_sliding_plat_2_loop", smlua_func_bhv_sliding_plat_2_loop);
|
|
smlua_bind_function(L, "bhv_rotating_octagonal_plat_init", smlua_func_bhv_rotating_octagonal_plat_init);
|
|
smlua_bind_function(L, "bhv_rotating_octagonal_plat_loop", smlua_func_bhv_rotating_octagonal_plat_loop);
|
|
smlua_bind_function(L, "bhv_animates_on_floor_switch_press_init", smlua_func_bhv_animates_on_floor_switch_press_init);
|
|
smlua_bind_function(L, "bhv_animates_on_floor_switch_press_loop", smlua_func_bhv_animates_on_floor_switch_press_loop);
|
|
smlua_bind_function(L, "bhv_activated_back_and_forth_platform_init", smlua_func_bhv_activated_back_and_forth_platform_init);
|
|
smlua_bind_function(L, "bhv_activated_back_and_forth_platform_update", smlua_func_bhv_activated_back_and_forth_platform_update);
|
|
smlua_bind_function(L, "bhv_recovery_heart_loop", smlua_func_bhv_recovery_heart_loop);
|
|
smlua_bind_function(L, "bhv_water_bomb_cannon_loop", smlua_func_bhv_water_bomb_cannon_loop);
|
|
smlua_bind_function(L, "bhv_bubble_cannon_barrel_loop", smlua_func_bhv_bubble_cannon_barrel_loop);
|
|
smlua_bind_function(L, "bhv_unagi_init", smlua_func_bhv_unagi_init);
|
|
smlua_bind_function(L, "bhv_unagi_loop", smlua_func_bhv_unagi_loop);
|
|
smlua_bind_function(L, "bhv_unagi_subobject_loop", smlua_func_bhv_unagi_subobject_loop);
|
|
smlua_bind_function(L, "bhv_dorrie_update", smlua_func_bhv_dorrie_update);
|
|
smlua_bind_function(L, "bhv_haunted_chair_init", smlua_func_bhv_haunted_chair_init);
|
|
smlua_bind_function(L, "bhv_haunted_chair_loop", smlua_func_bhv_haunted_chair_loop);
|
|
smlua_bind_function(L, "bhv_mad_piano_update", smlua_func_bhv_mad_piano_update);
|
|
smlua_bind_function(L, "bhv_flying_bookend_loop", smlua_func_bhv_flying_bookend_loop);
|
|
smlua_bind_function(L, "bhv_bookend_spawn_loop", smlua_func_bhv_bookend_spawn_loop);
|
|
smlua_bind_function(L, "bhv_haunted_bookshelf_manager_loop", smlua_func_bhv_haunted_bookshelf_manager_loop);
|
|
smlua_bind_function(L, "bhv_book_switch_loop", smlua_func_bhv_book_switch_loop);
|
|
smlua_bind_function(L, "bhv_fire_piranha_plant_init", smlua_func_bhv_fire_piranha_plant_init);
|
|
smlua_bind_function(L, "bhv_fire_piranha_plant_update", smlua_func_bhv_fire_piranha_plant_update);
|
|
smlua_bind_function(L, "bhv_small_piranha_flame_loop", smlua_func_bhv_small_piranha_flame_loop);
|
|
smlua_bind_function(L, "bhv_fire_spitter_update", smlua_func_bhv_fire_spitter_update);
|
|
smlua_bind_function(L, "bhv_fly_guy_flame_loop", smlua_func_bhv_fly_guy_flame_loop);
|
|
smlua_bind_function(L, "bhv_snufit_loop", smlua_func_bhv_snufit_loop);
|
|
smlua_bind_function(L, "bhv_snufit_balls_loop", smlua_func_bhv_snufit_balls_loop);
|
|
smlua_bind_function(L, "bhv_horizontal_grindel_init", smlua_func_bhv_horizontal_grindel_init);
|
|
smlua_bind_function(L, "bhv_horizontal_grindel_update", smlua_func_bhv_horizontal_grindel_update);
|
|
smlua_bind_function(L, "bhv_eyerok_boss_init", smlua_func_bhv_eyerok_boss_init);
|
|
smlua_bind_function(L, "bhv_eyerok_boss_loop", smlua_func_bhv_eyerok_boss_loop);
|
|
smlua_bind_function(L, "bhv_eyerok_hand_loop", smlua_func_bhv_eyerok_hand_loop);
|
|
smlua_bind_function(L, "bhv_klepto_init", smlua_func_bhv_klepto_init);
|
|
smlua_bind_function(L, "bhv_klepto_update", smlua_func_bhv_klepto_update);
|
|
smlua_bind_function(L, "bhv_bird_update", smlua_func_bhv_bird_update);
|
|
smlua_bind_function(L, "bhv_racing_penguin_init", smlua_func_bhv_racing_penguin_init);
|
|
smlua_bind_function(L, "bhv_racing_penguin_update", smlua_func_bhv_racing_penguin_update);
|
|
smlua_bind_function(L, "bhv_penguin_race_finish_line_update", smlua_func_bhv_penguin_race_finish_line_update);
|
|
smlua_bind_function(L, "bhv_penguin_race_shortcut_check_update", smlua_func_bhv_penguin_race_shortcut_check_update);
|
|
smlua_bind_function(L, "bhv_coffin_spawner_loop", smlua_func_bhv_coffin_spawner_loop);
|
|
smlua_bind_function(L, "bhv_coffin_loop", smlua_func_bhv_coffin_loop);
|
|
smlua_bind_function(L, "bhv_clam_loop", smlua_func_bhv_clam_loop);
|
|
smlua_bind_function(L, "bhv_skeeter_update", smlua_func_bhv_skeeter_update);
|
|
smlua_bind_function(L, "bhv_skeeter_wave_update", smlua_func_bhv_skeeter_wave_update);
|
|
smlua_bind_function(L, "bhv_swing_platform_init", smlua_func_bhv_swing_platform_init);
|
|
smlua_bind_function(L, "bhv_swing_platform_update", smlua_func_bhv_swing_platform_update);
|
|
smlua_bind_function(L, "bhv_donut_platform_spawner_update", smlua_func_bhv_donut_platform_spawner_update);
|
|
smlua_bind_function(L, "bhv_donut_platform_update", smlua_func_bhv_donut_platform_update);
|
|
smlua_bind_function(L, "bhv_ddd_pole_init", smlua_func_bhv_ddd_pole_init);
|
|
smlua_bind_function(L, "bhv_ddd_pole_update", smlua_func_bhv_ddd_pole_update);
|
|
smlua_bind_function(L, "bhv_red_coin_star_marker_init", smlua_func_bhv_red_coin_star_marker_init);
|
|
smlua_bind_function(L, "bhv_triplet_butterfly_update", smlua_func_bhv_triplet_butterfly_update);
|
|
smlua_bind_function(L, "bhv_bubba_loop", smlua_func_bhv_bubba_loop);
|
|
smlua_bind_function(L, "bhv_intro_lakitu_loop", smlua_func_bhv_intro_lakitu_loop);
|
|
smlua_bind_function(L, "bhv_intro_peach_loop", smlua_func_bhv_intro_peach_loop);
|
|
smlua_bind_function(L, "bhv_end_birds_1_loop", smlua_func_bhv_end_birds_1_loop);
|
|
smlua_bind_function(L, "bhv_end_birds_2_loop", smlua_func_bhv_end_birds_2_loop);
|
|
smlua_bind_function(L, "bhv_intro_scene_loop", smlua_func_bhv_intro_scene_loop);
|
|
smlua_bind_function(L, "bhv_yoshi_loop", smlua_func_bhv_yoshi_loop);
|
|
smlua_bind_function(L, "bhv_volcano_trap_loop", smlua_func_bhv_volcano_trap_loop);
|
|
smlua_bind_function(L, "uv_update_scroll", smlua_func_uv_update_scroll);
|
|
smlua_bind_function(L, "bhv_ambient_light_init", smlua_func_bhv_ambient_light_init);
|
|
smlua_bind_function(L, "bhv_point_light_init", smlua_func_bhv_point_light_init);
|
|
smlua_bind_function(L, "bhv_point_light_loop", smlua_func_bhv_point_light_loop);
|
|
//smlua_bind_function(L, "geo_move_mario_part_from_parent", smlua_func_geo_move_mario_part_from_parent); <--- UNIMPLEMENTED
|
|
//smlua_bind_function(L, "geo_bits_bowser_coloring", smlua_func_geo_bits_bowser_coloring); <--- UNIMPLEMENTED
|
|
//smlua_bind_function(L, "geo_update_body_rot_from_parent", smlua_func_geo_update_body_rot_from_parent); <--- UNIMPLEMENTED
|
|
//smlua_bind_function(L, "geo_switch_bowser_eyes", smlua_func_geo_switch_bowser_eyes); <--- UNIMPLEMENTED
|
|
//smlua_bind_function(L, "geo_switch_tuxie_mother_eyes", smlua_func_geo_switch_tuxie_mother_eyes); <--- UNIMPLEMENTED
|
|
//smlua_bind_function(L, "geo_update_held_mario_pos", smlua_func_geo_update_held_mario_pos); <--- UNIMPLEMENTED
|
|
//smlua_bind_function(L, "geo_snufit_move_mask", smlua_func_geo_snufit_move_mask); <--- UNIMPLEMENTED
|
|
//smlua_bind_function(L, "geo_snufit_scale_body", smlua_func_geo_snufit_scale_body); <--- UNIMPLEMENTED
|
|
//smlua_bind_function(L, "geo_scale_bowser_key", smlua_func_geo_scale_bowser_key); <--- UNIMPLEMENTED
|
|
smlua_bind_function(L, "spawn_default_star", smlua_func_spawn_default_star);
|
|
smlua_bind_function(L, "spawn_red_coin_cutscene_star", smlua_func_spawn_red_coin_cutscene_star);
|
|
smlua_bind_function(L, "spawn_no_exit_star", smlua_func_spawn_no_exit_star);
|
|
|
|
// behavior_script.h
|
|
smlua_bind_function(L, "random_u16", smlua_func_random_u16);
|
|
smlua_bind_function(L, "random_float", smlua_func_random_float);
|
|
smlua_bind_function(L, "random_sign", smlua_func_random_sign);
|
|
smlua_bind_function(L, "obj_update_gfx_pos_and_angle", smlua_func_obj_update_gfx_pos_and_angle);
|
|
smlua_bind_function(L, "position_based_random_u16", smlua_func_position_based_random_u16);
|
|
smlua_bind_function(L, "position_based_random_float_position", smlua_func_position_based_random_float_position);
|
|
smlua_bind_function(L, "draw_distance_scalar", smlua_func_draw_distance_scalar);
|
|
|
|
// behavior_table.h
|
|
smlua_bind_function(L, "get_id_from_behavior", smlua_func_get_id_from_behavior);
|
|
smlua_bind_function(L, "get_id_from_vanilla_behavior", smlua_func_get_id_from_vanilla_behavior);
|
|
smlua_bind_function(L, "get_behavior_from_id", smlua_func_get_behavior_from_id);
|
|
smlua_bind_function(L, "get_behavior_name_from_id", smlua_func_get_behavior_name_from_id);
|
|
smlua_bind_function(L, "get_id_from_behavior_name", smlua_func_get_id_from_behavior_name);
|
|
|
|
// camera.h
|
|
smlua_bind_function(L, "skip_camera_interpolation", smlua_func_skip_camera_interpolation);
|
|
smlua_bind_function(L, "set_camera_shake_from_hit", smlua_func_set_camera_shake_from_hit);
|
|
smlua_bind_function(L, "set_environmental_camera_shake", smlua_func_set_environmental_camera_shake);
|
|
smlua_bind_function(L, "set_camera_shake_from_point", smlua_func_set_camera_shake_from_point);
|
|
smlua_bind_function(L, "move_mario_head_c_up", smlua_func_move_mario_head_c_up);
|
|
smlua_bind_function(L, "transition_next_state", smlua_func_transition_next_state);
|
|
smlua_bind_function(L, "set_camera_mode", smlua_func_set_camera_mode);
|
|
smlua_bind_function(L, "soft_reset_camera", smlua_func_soft_reset_camera);
|
|
smlua_bind_function(L, "reset_camera", smlua_func_reset_camera);
|
|
smlua_bind_function(L, "select_mario_cam_mode", smlua_func_select_mario_cam_mode);
|
|
//smlua_bind_function(L, "geo_camera_main", smlua_func_geo_camera_main); <--- UNIMPLEMENTED
|
|
smlua_bind_function(L, "object_pos_to_vec3f", smlua_func_object_pos_to_vec3f);
|
|
smlua_bind_function(L, "vec3f_to_object_pos", smlua_func_vec3f_to_object_pos);
|
|
smlua_bind_function(L, "object_face_angle_to_vec3s", smlua_func_object_face_angle_to_vec3s);
|
|
smlua_bind_function(L, "vec3s_to_object_face_angle", smlua_func_vec3s_to_object_face_angle);
|
|
smlua_bind_function(L, "object_move_angle_to_vec3s", smlua_func_object_move_angle_to_vec3s);
|
|
smlua_bind_function(L, "vec3s_to_object_move_angle", smlua_func_vec3s_to_object_move_angle);
|
|
smlua_bind_function(L, "cam_select_alt_mode", smlua_func_cam_select_alt_mode);
|
|
smlua_bind_function(L, "set_cam_angle", smlua_func_set_cam_angle);
|
|
smlua_bind_function(L, "set_handheld_shake", smlua_func_set_handheld_shake);
|
|
smlua_bind_function(L, "shake_camera_handheld", smlua_func_shake_camera_handheld);
|
|
smlua_bind_function(L, "find_c_buttons_pressed", smlua_func_find_c_buttons_pressed);
|
|
smlua_bind_function(L, "collide_with_walls", smlua_func_collide_with_walls);
|
|
smlua_bind_function(L, "clamp_pitch", smlua_func_clamp_pitch);
|
|
smlua_bind_function(L, "is_within_100_units_of_mario", smlua_func_is_within_100_units_of_mario);
|
|
smlua_bind_function(L, "set_or_approach_f32_asymptotic", smlua_func_set_or_approach_f32_asymptotic);
|
|
smlua_bind_function(L, "approach_f32_asymptotic_bool", smlua_func_approach_f32_asymptotic_bool);
|
|
smlua_bind_function(L, "approach_f32_asymptotic", smlua_func_approach_f32_asymptotic);
|
|
smlua_bind_function(L, "approach_s16_asymptotic_bool", smlua_func_approach_s16_asymptotic_bool);
|
|
smlua_bind_function(L, "approach_s16_asymptotic", smlua_func_approach_s16_asymptotic);
|
|
smlua_bind_function(L, "approach_vec3f_asymptotic", smlua_func_approach_vec3f_asymptotic);
|
|
smlua_bind_function(L, "set_or_approach_vec3f_asymptotic", smlua_func_set_or_approach_vec3f_asymptotic);
|
|
smlua_bind_function(L, "camera_approach_s16_symmetric_bool", smlua_func_camera_approach_s16_symmetric_bool);
|
|
smlua_bind_function(L, "set_or_approach_s16_symmetric", smlua_func_set_or_approach_s16_symmetric);
|
|
smlua_bind_function(L, "camera_approach_f32_symmetric_bool", smlua_func_camera_approach_f32_symmetric_bool);
|
|
smlua_bind_function(L, "camera_approach_f32_symmetric", smlua_func_camera_approach_f32_symmetric);
|
|
smlua_bind_function(L, "random_vec3s", smlua_func_random_vec3s);
|
|
smlua_bind_function(L, "clamp_positions_and_find_yaw", smlua_func_clamp_positions_and_find_yaw);
|
|
smlua_bind_function(L, "is_range_behind_surface", smlua_func_is_range_behind_surface);
|
|
smlua_bind_function(L, "scale_along_line", smlua_func_scale_along_line);
|
|
smlua_bind_function(L, "calculate_pitch", smlua_func_calculate_pitch);
|
|
smlua_bind_function(L, "calculate_yaw", smlua_func_calculate_yaw);
|
|
smlua_bind_function(L, "calculate_angles", smlua_func_calculate_angles);
|
|
smlua_bind_function(L, "calc_abs_dist", smlua_func_calc_abs_dist);
|
|
smlua_bind_function(L, "calc_hor_dist", smlua_func_calc_hor_dist);
|
|
smlua_bind_function(L, "rotate_in_xz", smlua_func_rotate_in_xz);
|
|
smlua_bind_function(L, "rotate_in_yz", smlua_func_rotate_in_yz);
|
|
smlua_bind_function(L, "set_camera_pitch_shake", smlua_func_set_camera_pitch_shake);
|
|
smlua_bind_function(L, "set_camera_yaw_shake", smlua_func_set_camera_yaw_shake);
|
|
smlua_bind_function(L, "set_camera_roll_shake", smlua_func_set_camera_roll_shake);
|
|
smlua_bind_function(L, "set_pitch_shake_from_point", smlua_func_set_pitch_shake_from_point);
|
|
smlua_bind_function(L, "shake_camera_pitch", smlua_func_shake_camera_pitch);
|
|
smlua_bind_function(L, "shake_camera_yaw", smlua_func_shake_camera_yaw);
|
|
smlua_bind_function(L, "shake_camera_roll", smlua_func_shake_camera_roll);
|
|
smlua_bind_function(L, "offset_yaw_outward_radial", smlua_func_offset_yaw_outward_radial);
|
|
smlua_bind_function(L, "play_camera_buzz_if_cdown", smlua_func_play_camera_buzz_if_cdown);
|
|
smlua_bind_function(L, "play_camera_buzz_if_cbutton", smlua_func_play_camera_buzz_if_cbutton);
|
|
smlua_bind_function(L, "play_camera_buzz_if_c_sideways", smlua_func_play_camera_buzz_if_c_sideways);
|
|
smlua_bind_function(L, "play_sound_cbutton_up", smlua_func_play_sound_cbutton_up);
|
|
smlua_bind_function(L, "play_sound_cbutton_down", smlua_func_play_sound_cbutton_down);
|
|
smlua_bind_function(L, "play_sound_cbutton_side", smlua_func_play_sound_cbutton_side);
|
|
smlua_bind_function(L, "play_sound_button_change_blocked", smlua_func_play_sound_button_change_blocked);
|
|
smlua_bind_function(L, "play_sound_rbutton_changed", smlua_func_play_sound_rbutton_changed);
|
|
smlua_bind_function(L, "play_sound_if_cam_switched_to_lakitu_or_mario", smlua_func_play_sound_if_cam_switched_to_lakitu_or_mario);
|
|
smlua_bind_function(L, "radial_camera_input", smlua_func_radial_camera_input);
|
|
smlua_bind_function(L, "trigger_cutscene_dialog", smlua_func_trigger_cutscene_dialog);
|
|
smlua_bind_function(L, "handle_c_button_movement", smlua_func_handle_c_button_movement);
|
|
smlua_bind_function(L, "start_cutscene", smlua_func_start_cutscene);
|
|
smlua_bind_function(L, "get_cutscene_from_mario_status", smlua_func_get_cutscene_from_mario_status);
|
|
smlua_bind_function(L, "warp_camera", smlua_func_warp_camera);
|
|
smlua_bind_function(L, "approach_camera_height", smlua_func_approach_camera_height);
|
|
smlua_bind_function(L, "offset_rotated", smlua_func_offset_rotated);
|
|
smlua_bind_function(L, "next_lakitu_state", smlua_func_next_lakitu_state);
|
|
smlua_bind_function(L, "set_fixed_cam_axis_sa_lobby", smlua_func_set_fixed_cam_axis_sa_lobby);
|
|
smlua_bind_function(L, "camera_course_processing", smlua_func_camera_course_processing);
|
|
smlua_bind_function(L, "resolve_geometry_collisions", smlua_func_resolve_geometry_collisions);
|
|
smlua_bind_function(L, "rotate_camera_around_walls", smlua_func_rotate_camera_around_walls);
|
|
smlua_bind_function(L, "find_mario_floor_and_ceil", smlua_func_find_mario_floor_and_ceil);
|
|
smlua_bind_function(L, "start_object_cutscene_without_focus", smlua_func_start_object_cutscene_without_focus);
|
|
smlua_bind_function(L, "cutscene_object_with_dialog", smlua_func_cutscene_object_with_dialog);
|
|
smlua_bind_function(L, "cutscene_object_without_dialog", smlua_func_cutscene_object_without_dialog);
|
|
smlua_bind_function(L, "cutscene_object", smlua_func_cutscene_object);
|
|
smlua_bind_function(L, "play_cutscene", smlua_func_play_cutscene);
|
|
//smlua_bind_function(L, "cutscene_event", smlua_func_cutscene_event); <--- UNIMPLEMENTED
|
|
smlua_bind_function(L, "cutscene_spawn_obj", smlua_func_cutscene_spawn_obj);
|
|
smlua_bind_function(L, "set_fov_shake", smlua_func_set_fov_shake);
|
|
smlua_bind_function(L, "set_fov_function", smlua_func_set_fov_function);
|
|
smlua_bind_function(L, "cutscene_set_fov_shake_preset", smlua_func_cutscene_set_fov_shake_preset);
|
|
smlua_bind_function(L, "set_fov_shake_from_point_preset", smlua_func_set_fov_shake_from_point_preset);
|
|
smlua_bind_function(L, "obj_rotate_towards_point", smlua_func_obj_rotate_towards_point);
|
|
//smlua_bind_function(L, "geo_camera_fov", smlua_func_geo_camera_fov); <--- UNIMPLEMENTED
|
|
smlua_bind_function(L, "set_camera_mode_fixed", smlua_func_set_camera_mode_fixed);
|
|
smlua_bind_function(L, "snap_to_45_degrees", smlua_func_snap_to_45_degrees);
|
|
smlua_bind_function(L, "camera_set_use_course_specific_settings", smlua_func_camera_set_use_course_specific_settings);
|
|
smlua_bind_function(L, "center_rom_hack_camera", smlua_func_center_rom_hack_camera);
|
|
|
|
// characters.h
|
|
smlua_bind_function(L, "get_character", smlua_func_get_character);
|
|
smlua_bind_function(L, "play_character_sound", smlua_func_play_character_sound);
|
|
smlua_bind_function(L, "play_character_sound_offset", smlua_func_play_character_sound_offset);
|
|
smlua_bind_function(L, "play_character_sound_if_no_flag", smlua_func_play_character_sound_if_no_flag);
|
|
smlua_bind_function(L, "get_character_anim_offset", smlua_func_get_character_anim_offset);
|
|
smlua_bind_function(L, "get_character_anim", smlua_func_get_character_anim);
|
|
smlua_bind_function(L, "update_character_anim_offset", smlua_func_update_character_anim_offset);
|
|
|
|
// djui_chat_message.h
|
|
smlua_bind_function(L, "djui_chat_message_create", smlua_func_djui_chat_message_create);
|
|
|
|
// djui_console.h
|
|
smlua_bind_function(L, "djui_console_toggle", smlua_func_djui_console_toggle);
|
|
|
|
// djui_hud_utils.h
|
|
smlua_bind_function(L, "djui_hud_get_resolution", smlua_func_djui_hud_get_resolution);
|
|
smlua_bind_function(L, "djui_hud_set_resolution", smlua_func_djui_hud_set_resolution);
|
|
smlua_bind_function(L, "djui_hud_get_filter", smlua_func_djui_hud_get_filter);
|
|
smlua_bind_function(L, "djui_hud_set_filter", smlua_func_djui_hud_set_filter);
|
|
smlua_bind_function(L, "djui_hud_get_font", smlua_func_djui_hud_get_font);
|
|
smlua_bind_function(L, "djui_hud_set_font", smlua_func_djui_hud_set_font);
|
|
smlua_bind_function(L, "djui_hud_get_color", smlua_func_djui_hud_get_color);
|
|
smlua_bind_function(L, "djui_hud_set_color", smlua_func_djui_hud_set_color);
|
|
smlua_bind_function(L, "djui_hud_reset_color", smlua_func_djui_hud_reset_color);
|
|
smlua_bind_function(L, "djui_hud_get_rotation", smlua_func_djui_hud_get_rotation);
|
|
smlua_bind_function(L, "djui_hud_set_rotation", smlua_func_djui_hud_set_rotation);
|
|
smlua_bind_function(L, "djui_hud_set_rotation_interpolated", smlua_func_djui_hud_set_rotation_interpolated);
|
|
smlua_bind_function(L, "djui_hud_get_screen_width", smlua_func_djui_hud_get_screen_width);
|
|
smlua_bind_function(L, "djui_hud_get_screen_height", smlua_func_djui_hud_get_screen_height);
|
|
smlua_bind_function(L, "djui_hud_get_mouse_x", smlua_func_djui_hud_get_mouse_x);
|
|
smlua_bind_function(L, "djui_hud_get_mouse_y", smlua_func_djui_hud_get_mouse_y);
|
|
smlua_bind_function(L, "djui_hud_get_raw_mouse_x", smlua_func_djui_hud_get_raw_mouse_x);
|
|
smlua_bind_function(L, "djui_hud_get_raw_mouse_y", smlua_func_djui_hud_get_raw_mouse_y);
|
|
smlua_bind_function(L, "djui_hud_set_mouse_locked", smlua_func_djui_hud_set_mouse_locked);
|
|
smlua_bind_function(L, "djui_hud_get_mouse_buttons_down", smlua_func_djui_hud_get_mouse_buttons_down);
|
|
smlua_bind_function(L, "djui_hud_get_mouse_buttons_pressed", smlua_func_djui_hud_get_mouse_buttons_pressed);
|
|
smlua_bind_function(L, "djui_hud_get_mouse_buttons_released", smlua_func_djui_hud_get_mouse_buttons_released);
|
|
smlua_bind_function(L, "djui_hud_get_mouse_scroll_x", smlua_func_djui_hud_get_mouse_scroll_x);
|
|
smlua_bind_function(L, "djui_hud_get_mouse_scroll_y", smlua_func_djui_hud_get_mouse_scroll_y);
|
|
smlua_bind_function(L, "djui_hud_measure_text", smlua_func_djui_hud_measure_text);
|
|
smlua_bind_function(L, "djui_hud_print_text", smlua_func_djui_hud_print_text);
|
|
smlua_bind_function(L, "djui_hud_print_text_interpolated", smlua_func_djui_hud_print_text_interpolated);
|
|
smlua_bind_function(L, "djui_hud_render_texture", smlua_func_djui_hud_render_texture);
|
|
smlua_bind_function(L, "djui_hud_render_texture_tile", smlua_func_djui_hud_render_texture_tile);
|
|
smlua_bind_function(L, "djui_hud_render_texture_interpolated", smlua_func_djui_hud_render_texture_interpolated);
|
|
smlua_bind_function(L, "djui_hud_render_texture_tile_interpolated", smlua_func_djui_hud_render_texture_tile_interpolated);
|
|
smlua_bind_function(L, "djui_hud_render_rect", smlua_func_djui_hud_render_rect);
|
|
smlua_bind_function(L, "djui_hud_render_rect_interpolated", smlua_func_djui_hud_render_rect_interpolated);
|
|
smlua_bind_function(L, "get_current_fov", smlua_func_get_current_fov);
|
|
smlua_bind_function(L, "djui_hud_get_fov_coeff", smlua_func_djui_hud_get_fov_coeff);
|
|
smlua_bind_function(L, "djui_hud_world_pos_to_screen_pos", smlua_func_djui_hud_world_pos_to_screen_pos);
|
|
smlua_bind_function(L, "djui_hud_is_pause_menu_created", smlua_func_djui_hud_is_pause_menu_created);
|
|
smlua_bind_function(L, "djui_open_pause_menu", smlua_func_djui_open_pause_menu);
|
|
|
|
// djui_language.h
|
|
smlua_bind_function(L, "djui_language_get", smlua_func_djui_language_get);
|
|
|
|
// djui_panel_menu.h
|
|
smlua_bind_function(L, "djui_menu_get_rainbow_string_color", smlua_func_djui_menu_get_rainbow_string_color);
|
|
|
|
// djui_popup.h
|
|
smlua_bind_function(L, "djui_popup_create", smlua_func_djui_popup_create);
|
|
|
|
// external.h
|
|
smlua_bind_function(L, "play_sound", smlua_func_play_sound);
|
|
smlua_bind_function(L, "play_sound_with_freq_scale", smlua_func_play_sound_with_freq_scale);
|
|
smlua_bind_function(L, "seq_player_fade_out", smlua_func_seq_player_fade_out);
|
|
smlua_bind_function(L, "fade_volume_scale", smlua_func_fade_volume_scale);
|
|
smlua_bind_function(L, "seq_player_lower_volume", smlua_func_seq_player_lower_volume);
|
|
smlua_bind_function(L, "seq_player_unlower_volume", smlua_func_seq_player_unlower_volume);
|
|
smlua_bind_function(L, "set_audio_muted", smlua_func_set_audio_muted);
|
|
smlua_bind_function(L, "stop_sound", smlua_func_stop_sound);
|
|
smlua_bind_function(L, "stop_sounds_from_source", smlua_func_stop_sounds_from_source);
|
|
smlua_bind_function(L, "stop_sounds_in_continuous_banks", smlua_func_stop_sounds_in_continuous_banks);
|
|
smlua_bind_function(L, "sound_banks_disable", smlua_func_sound_banks_disable);
|
|
smlua_bind_function(L, "sound_banks_enable", smlua_func_sound_banks_enable);
|
|
smlua_bind_function(L, "set_sound_moving_speed", smlua_func_set_sound_moving_speed);
|
|
smlua_bind_function(L, "play_dialog_sound", smlua_func_play_dialog_sound);
|
|
smlua_bind_function(L, "play_music", smlua_func_play_music);
|
|
smlua_bind_function(L, "stop_background_music", smlua_func_stop_background_music);
|
|
smlua_bind_function(L, "fadeout_background_music", smlua_func_fadeout_background_music);
|
|
smlua_bind_function(L, "drop_queued_background_music", smlua_func_drop_queued_background_music);
|
|
smlua_bind_function(L, "get_current_background_music", smlua_func_get_current_background_music);
|
|
smlua_bind_function(L, "get_current_background_music_default_volume", smlua_func_get_current_background_music_default_volume);
|
|
smlua_bind_function(L, "get_current_background_music_target_volume", smlua_func_get_current_background_music_target_volume);
|
|
smlua_bind_function(L, "get_current_background_music_max_target_volume", smlua_func_get_current_background_music_max_target_volume);
|
|
smlua_bind_function(L, "is_current_background_music_volume_lowered", smlua_func_is_current_background_music_volume_lowered);
|
|
smlua_bind_function(L, "play_secondary_music", smlua_func_play_secondary_music);
|
|
smlua_bind_function(L, "stop_secondary_music", smlua_func_stop_secondary_music);
|
|
smlua_bind_function(L, "set_audio_fadeout", smlua_func_set_audio_fadeout);
|
|
smlua_bind_function(L, "play_course_clear", smlua_func_play_course_clear);
|
|
smlua_bind_function(L, "play_peachs_jingle", smlua_func_play_peachs_jingle);
|
|
smlua_bind_function(L, "play_puzzle_jingle", smlua_func_play_puzzle_jingle);
|
|
smlua_bind_function(L, "play_star_fanfare", smlua_func_play_star_fanfare);
|
|
smlua_bind_function(L, "play_power_star_jingle", smlua_func_play_power_star_jingle);
|
|
smlua_bind_function(L, "play_race_fanfare", smlua_func_play_race_fanfare);
|
|
smlua_bind_function(L, "play_toads_jingle", smlua_func_play_toads_jingle);
|
|
smlua_bind_function(L, "sound_reset_background_music_default_volume", smlua_func_sound_reset_background_music_default_volume);
|
|
smlua_bind_function(L, "sound_set_background_music_default_volume", smlua_func_sound_set_background_music_default_volume);
|
|
smlua_bind_function(L, "get_sound_pan", smlua_func_get_sound_pan);
|
|
smlua_bind_function(L, "sound_get_level_intensity", smlua_func_sound_get_level_intensity);
|
|
|
|
// first_person_cam.h
|
|
smlua_bind_function(L, "first_person_check_cancels", smlua_func_first_person_check_cancels);
|
|
smlua_bind_function(L, "get_first_person_enabled", smlua_func_get_first_person_enabled);
|
|
smlua_bind_function(L, "set_first_person_enabled", smlua_func_set_first_person_enabled);
|
|
smlua_bind_function(L, "first_person_reset", smlua_func_first_person_reset);
|
|
|
|
// ingame_menu.h
|
|
smlua_bind_function(L, "create_dialog_box", smlua_func_create_dialog_box);
|
|
smlua_bind_function(L, "create_dialog_box_with_var", smlua_func_create_dialog_box_with_var);
|
|
smlua_bind_function(L, "create_dialog_inverted_box", smlua_func_create_dialog_inverted_box);
|
|
smlua_bind_function(L, "create_dialog_box_with_response", smlua_func_create_dialog_box_with_response);
|
|
smlua_bind_function(L, "reset_dialog_render_state", smlua_func_reset_dialog_render_state);
|
|
smlua_bind_function(L, "set_menu_mode", smlua_func_set_menu_mode);
|
|
smlua_bind_function(L, "set_min_dialog_width", smlua_func_set_min_dialog_width);
|
|
smlua_bind_function(L, "set_dialog_override_pos", smlua_func_set_dialog_override_pos);
|
|
smlua_bind_function(L, "reset_dialog_override_pos", smlua_func_reset_dialog_override_pos);
|
|
smlua_bind_function(L, "set_dialog_override_color", smlua_func_set_dialog_override_color);
|
|
smlua_bind_function(L, "reset_dialog_override_color", smlua_func_reset_dialog_override_color);
|
|
smlua_bind_function(L, "set_dialog_box_state", smlua_func_set_dialog_box_state);
|
|
|
|
// interaction.h
|
|
smlua_bind_function(L, "interact_coin", smlua_func_interact_coin);
|
|
smlua_bind_function(L, "interact_water_ring", smlua_func_interact_water_ring);
|
|
smlua_bind_function(L, "interact_star_or_key", smlua_func_interact_star_or_key);
|
|
smlua_bind_function(L, "interact_bbh_entrance", smlua_func_interact_bbh_entrance);
|
|
smlua_bind_function(L, "interact_warp", smlua_func_interact_warp);
|
|
smlua_bind_function(L, "interact_warp_door", smlua_func_interact_warp_door);
|
|
smlua_bind_function(L, "interact_door", smlua_func_interact_door);
|
|
smlua_bind_function(L, "interact_cannon_base", smlua_func_interact_cannon_base);
|
|
smlua_bind_function(L, "interact_player", smlua_func_interact_player);
|
|
smlua_bind_function(L, "interact_igloo_barrier", smlua_func_interact_igloo_barrier);
|
|
smlua_bind_function(L, "interact_tornado", smlua_func_interact_tornado);
|
|
smlua_bind_function(L, "interact_whirlpool", smlua_func_interact_whirlpool);
|
|
smlua_bind_function(L, "interact_strong_wind", smlua_func_interact_strong_wind);
|
|
smlua_bind_function(L, "interact_flame", smlua_func_interact_flame);
|
|
smlua_bind_function(L, "interact_snufit_bullet", smlua_func_interact_snufit_bullet);
|
|
smlua_bind_function(L, "interact_clam_or_bubba", smlua_func_interact_clam_or_bubba);
|
|
smlua_bind_function(L, "interact_bully", smlua_func_interact_bully);
|
|
smlua_bind_function(L, "interact_shock", smlua_func_interact_shock);
|
|
smlua_bind_function(L, "interact_mr_blizzard", smlua_func_interact_mr_blizzard);
|
|
smlua_bind_function(L, "interact_hit_from_below", smlua_func_interact_hit_from_below);
|
|
smlua_bind_function(L, "interact_bounce_top", smlua_func_interact_bounce_top);
|
|
smlua_bind_function(L, "interact_spiny_walking", smlua_func_interact_spiny_walking);
|
|
smlua_bind_function(L, "interact_damage", smlua_func_interact_damage);
|
|
smlua_bind_function(L, "interact_breakable", smlua_func_interact_breakable);
|
|
smlua_bind_function(L, "interact_koopa_shell", smlua_func_interact_koopa_shell);
|
|
smlua_bind_function(L, "interact_pole", smlua_func_interact_pole);
|
|
smlua_bind_function(L, "interact_hoot", smlua_func_interact_hoot);
|
|
smlua_bind_function(L, "interact_cap", smlua_func_interact_cap);
|
|
smlua_bind_function(L, "interact_grabbable", smlua_func_interact_grabbable);
|
|
smlua_bind_function(L, "interact_text", smlua_func_interact_text);
|
|
smlua_bind_function(L, "mario_obj_angle_to_object", smlua_func_mario_obj_angle_to_object);
|
|
smlua_bind_function(L, "mario_stop_riding_object", smlua_func_mario_stop_riding_object);
|
|
smlua_bind_function(L, "mario_grab_used_object", smlua_func_mario_grab_used_object);
|
|
smlua_bind_function(L, "mario_drop_held_object", smlua_func_mario_drop_held_object);
|
|
smlua_bind_function(L, "mario_throw_held_object", smlua_func_mario_throw_held_object);
|
|
smlua_bind_function(L, "mario_stop_riding_and_holding", smlua_func_mario_stop_riding_and_holding);
|
|
smlua_bind_function(L, "does_mario_have_normal_cap_on_head", smlua_func_does_mario_have_normal_cap_on_head);
|
|
smlua_bind_function(L, "does_mario_have_blown_cap", smlua_func_does_mario_have_blown_cap);
|
|
smlua_bind_function(L, "mario_blow_off_cap", smlua_func_mario_blow_off_cap);
|
|
smlua_bind_function(L, "mario_lose_cap_to_enemy", smlua_func_mario_lose_cap_to_enemy);
|
|
smlua_bind_function(L, "mario_retrieve_cap", smlua_func_mario_retrieve_cap);
|
|
smlua_bind_function(L, "mario_get_collided_object", smlua_func_mario_get_collided_object);
|
|
smlua_bind_function(L, "mario_check_object_grab", smlua_func_mario_check_object_grab);
|
|
smlua_bind_function(L, "get_door_save_file_flag", smlua_func_get_door_save_file_flag);
|
|
smlua_bind_function(L, "passes_pvp_interaction_checks", smlua_func_passes_pvp_interaction_checks);
|
|
smlua_bind_function(L, "should_push_or_pull_door", smlua_func_should_push_or_pull_door);
|
|
smlua_bind_function(L, "take_damage_and_knock_back", smlua_func_take_damage_and_knock_back);
|
|
smlua_bind_function(L, "get_mario_cap_flag", smlua_func_get_mario_cap_flag);
|
|
smlua_bind_function(L, "determine_interaction", smlua_func_determine_interaction);
|
|
|
|
// lag_compensation.h
|
|
smlua_bind_function(L, "lag_compensation_store", smlua_func_lag_compensation_store);
|
|
smlua_bind_function(L, "lag_compensation_get_local_state", smlua_func_lag_compensation_get_local_state);
|
|
smlua_bind_function(L, "lag_compensation_get_local_state_ready", smlua_func_lag_compensation_get_local_state_ready);
|
|
smlua_bind_function(L, "lag_compensation_get_local_state_index", smlua_func_lag_compensation_get_local_state_index);
|
|
|
|
// level_info.h
|
|
smlua_bind_function(L, "get_level_name_ascii", smlua_func_get_level_name_ascii);
|
|
smlua_bind_function(L, "get_level_name_sm64", smlua_func_get_level_name_sm64);
|
|
smlua_bind_function(L, "get_level_name", smlua_func_get_level_name);
|
|
smlua_bind_function(L, "get_star_name_ascii", smlua_func_get_star_name_ascii);
|
|
smlua_bind_function(L, "get_star_name_sm64", smlua_func_get_star_name_sm64);
|
|
smlua_bind_function(L, "get_star_name", smlua_func_get_star_name);
|
|
|
|
// level_script.h
|
|
smlua_bind_function(L, "area_create_warp_node", smlua_func_area_create_warp_node);
|
|
|
|
// level_update.h
|
|
smlua_bind_function(L, "level_control_timer_running", smlua_func_level_control_timer_running);
|
|
smlua_bind_function(L, "fade_into_special_warp", smlua_func_fade_into_special_warp);
|
|
smlua_bind_function(L, "get_instant_warp", smlua_func_get_instant_warp);
|
|
smlua_bind_function(L, "get_painting_warp_node", smlua_func_get_painting_warp_node);
|
|
smlua_bind_function(L, "initiate_painting_warp", smlua_func_initiate_painting_warp);
|
|
smlua_bind_function(L, "level_trigger_warp", smlua_func_level_trigger_warp);
|
|
smlua_bind_function(L, "warp_special", smlua_func_warp_special);
|
|
smlua_bind_function(L, "lvl_set_current_level", smlua_func_lvl_set_current_level);
|
|
|
|
// lighting_engine.h
|
|
smlua_bind_function(L, "le_set_mode", smlua_func_le_set_mode);
|
|
smlua_bind_function(L, "le_get_mode", smlua_func_le_get_mode);
|
|
smlua_bind_function(L, "le_set_tone_mapping", smlua_func_le_set_tone_mapping);
|
|
smlua_bind_function(L, "le_is_enabled", smlua_func_le_is_enabled);
|
|
smlua_bind_function(L, "le_calculate_lighting_color", smlua_func_le_calculate_lighting_color);
|
|
smlua_bind_function(L, "le_calculate_lighting_color_with_normal", smlua_func_le_calculate_lighting_color_with_normal);
|
|
smlua_bind_function(L, "le_calculate_lighting_dir", smlua_func_le_calculate_lighting_dir);
|
|
smlua_bind_function(L, "le_add_light", smlua_func_le_add_light);
|
|
smlua_bind_function(L, "le_remove_light", smlua_func_le_remove_light);
|
|
smlua_bind_function(L, "le_get_light_count", smlua_func_le_get_light_count);
|
|
smlua_bind_function(L, "le_light_exists", smlua_func_le_light_exists);
|
|
smlua_bind_function(L, "le_get_ambient_color", smlua_func_le_get_ambient_color);
|
|
smlua_bind_function(L, "le_set_ambient_color", smlua_func_le_set_ambient_color);
|
|
smlua_bind_function(L, "le_get_light_pos", smlua_func_le_get_light_pos);
|
|
smlua_bind_function(L, "le_set_light_pos", smlua_func_le_set_light_pos);
|
|
smlua_bind_function(L, "le_get_light_color", smlua_func_le_get_light_color);
|
|
smlua_bind_function(L, "le_set_light_color", smlua_func_le_set_light_color);
|
|
smlua_bind_function(L, "le_get_light_radius", smlua_func_le_get_light_radius);
|
|
smlua_bind_function(L, "le_set_light_radius", smlua_func_le_set_light_radius);
|
|
smlua_bind_function(L, "le_get_light_intensity", smlua_func_le_get_light_intensity);
|
|
smlua_bind_function(L, "le_set_light_intensity", smlua_func_le_set_light_intensity);
|
|
smlua_bind_function(L, "le_get_light_use_surface_normals", smlua_func_le_get_light_use_surface_normals);
|
|
smlua_bind_function(L, "le_set_light_use_surface_normals", smlua_func_le_set_light_use_surface_normals);
|
|
|
|
// mario.h
|
|
smlua_bind_function(L, "is_anim_at_end", smlua_func_is_anim_at_end);
|
|
smlua_bind_function(L, "is_anim_past_end", smlua_func_is_anim_past_end);
|
|
smlua_bind_function(L, "set_mario_animation", smlua_func_set_mario_animation);
|
|
smlua_bind_function(L, "set_mario_anim_with_accel", smlua_func_set_mario_anim_with_accel);
|
|
smlua_bind_function(L, "set_character_animation", smlua_func_set_character_animation);
|
|
smlua_bind_function(L, "set_character_anim_with_accel", smlua_func_set_character_anim_with_accel);
|
|
smlua_bind_function(L, "set_anim_to_frame", smlua_func_set_anim_to_frame);
|
|
smlua_bind_function(L, "is_anim_past_frame", smlua_func_is_anim_past_frame);
|
|
smlua_bind_function(L, "find_mario_anim_flags_and_translation", smlua_func_find_mario_anim_flags_and_translation);
|
|
smlua_bind_function(L, "update_mario_pos_for_anim", smlua_func_update_mario_pos_for_anim);
|
|
smlua_bind_function(L, "return_mario_anim_y_translation", smlua_func_return_mario_anim_y_translation);
|
|
smlua_bind_function(L, "play_sound_if_no_flag", smlua_func_play_sound_if_no_flag);
|
|
smlua_bind_function(L, "play_mario_jump_sound", smlua_func_play_mario_jump_sound);
|
|
smlua_bind_function(L, "adjust_sound_for_speed", smlua_func_adjust_sound_for_speed);
|
|
smlua_bind_function(L, "play_sound_and_spawn_particles", smlua_func_play_sound_and_spawn_particles);
|
|
smlua_bind_function(L, "play_mario_action_sound", smlua_func_play_mario_action_sound);
|
|
smlua_bind_function(L, "play_mario_landing_sound", smlua_func_play_mario_landing_sound);
|
|
smlua_bind_function(L, "play_mario_landing_sound_once", smlua_func_play_mario_landing_sound_once);
|
|
smlua_bind_function(L, "play_mario_heavy_landing_sound", smlua_func_play_mario_heavy_landing_sound);
|
|
smlua_bind_function(L, "play_mario_heavy_landing_sound_once", smlua_func_play_mario_heavy_landing_sound_once);
|
|
smlua_bind_function(L, "play_mario_sound", smlua_func_play_mario_sound);
|
|
smlua_bind_function(L, "mario_is_crouching", smlua_func_mario_is_crouching);
|
|
smlua_bind_function(L, "mario_is_ground_pound_landing", smlua_func_mario_is_ground_pound_landing);
|
|
smlua_bind_function(L, "mario_can_bubble", smlua_func_mario_can_bubble);
|
|
smlua_bind_function(L, "mario_set_bubbled", smlua_func_mario_set_bubbled);
|
|
smlua_bind_function(L, "mario_set_forward_vel", smlua_func_mario_set_forward_vel);
|
|
smlua_bind_function(L, "mario_get_floor_class", smlua_func_mario_get_floor_class);
|
|
smlua_bind_function(L, "mario_get_terrain_sound_addend", smlua_func_mario_get_terrain_sound_addend);
|
|
smlua_bind_function(L, "resolve_and_return_wall_collisions", smlua_func_resolve_and_return_wall_collisions);
|
|
smlua_bind_function(L, "resolve_and_return_wall_collisions_data", smlua_func_resolve_and_return_wall_collisions_data);
|
|
//smlua_bind_function(L, "vec3f_find_ceil", smlua_func_vec3f_find_ceil); <--- UNIMPLEMENTED
|
|
//smlua_bind_function(L, "vec3f_mario_ceil", smlua_func_vec3f_mario_ceil); <--- UNIMPLEMENTED
|
|
smlua_bind_function(L, "mario_facing_downhill", smlua_func_mario_facing_downhill);
|
|
smlua_bind_function(L, "mario_floor_is_slippery", smlua_func_mario_floor_is_slippery);
|
|
smlua_bind_function(L, "mario_floor_is_slope", smlua_func_mario_floor_is_slope);
|
|
smlua_bind_function(L, "mario_floor_is_steep", smlua_func_mario_floor_is_steep);
|
|
smlua_bind_function(L, "find_floor_height_relative_polar", smlua_func_find_floor_height_relative_polar);
|
|
smlua_bind_function(L, "find_floor_slope", smlua_func_find_floor_slope);
|
|
smlua_bind_function(L, "update_mario_sound_and_camera", smlua_func_update_mario_sound_and_camera);
|
|
smlua_bind_function(L, "set_steep_jump_action", smlua_func_set_steep_jump_action);
|
|
smlua_bind_function(L, "set_mario_y_vel_based_on_fspeed", smlua_func_set_mario_y_vel_based_on_fspeed);
|
|
smlua_bind_function(L, "set_mario_action", smlua_func_set_mario_action);
|
|
smlua_bind_function(L, "set_jump_from_landing", smlua_func_set_jump_from_landing);
|
|
smlua_bind_function(L, "set_jumping_action", smlua_func_set_jumping_action);
|
|
smlua_bind_function(L, "drop_and_set_mario_action", smlua_func_drop_and_set_mario_action);
|
|
smlua_bind_function(L, "hurt_and_set_mario_action", smlua_func_hurt_and_set_mario_action);
|
|
smlua_bind_function(L, "check_common_action_exits", smlua_func_check_common_action_exits);
|
|
smlua_bind_function(L, "check_common_hold_action_exits", smlua_func_check_common_hold_action_exits);
|
|
smlua_bind_function(L, "transition_submerged_to_walking", smlua_func_transition_submerged_to_walking);
|
|
smlua_bind_function(L, "set_water_plunge_action", smlua_func_set_water_plunge_action);
|
|
smlua_bind_function(L, "execute_mario_action", smlua_func_execute_mario_action);
|
|
smlua_bind_function(L, "force_idle_state", smlua_func_force_idle_state);
|
|
smlua_bind_function(L, "init_single_mario", smlua_func_init_single_mario);
|
|
smlua_bind_function(L, "set_mario_particle_flags", smlua_func_set_mario_particle_flags);
|
|
smlua_bind_function(L, "mario_update_wall", smlua_func_mario_update_wall);
|
|
smlua_bind_function(L, "get_mario_state_from_object", smlua_func_get_mario_state_from_object);
|
|
|
|
// mario_actions_airborne.c
|
|
smlua_bind_function(L, "play_flip_sounds", smlua_func_play_flip_sounds);
|
|
smlua_bind_function(L, "play_far_fall_sound", smlua_func_play_far_fall_sound);
|
|
#ifndef VERSION_JP
|
|
smlua_bind_function(L, "play_knockback_sound", smlua_func_play_knockback_sound);
|
|
#endif
|
|
smlua_bind_function(L, "lava_boost_on_wall", smlua_func_lava_boost_on_wall);
|
|
smlua_bind_function(L, "check_fall_damage", smlua_func_check_fall_damage);
|
|
smlua_bind_function(L, "check_kick_or_dive_in_air", smlua_func_check_kick_or_dive_in_air);
|
|
smlua_bind_function(L, "should_get_stuck_in_ground", smlua_func_should_get_stuck_in_ground);
|
|
smlua_bind_function(L, "check_fall_damage_or_get_stuck", smlua_func_check_fall_damage_or_get_stuck);
|
|
smlua_bind_function(L, "check_horizontal_wind", smlua_func_check_horizontal_wind);
|
|
smlua_bind_function(L, "update_air_with_turn", smlua_func_update_air_with_turn);
|
|
smlua_bind_function(L, "update_air_without_turn", smlua_func_update_air_without_turn);
|
|
smlua_bind_function(L, "update_lava_boost_or_twirling", smlua_func_update_lava_boost_or_twirling);
|
|
smlua_bind_function(L, "update_flying_yaw", smlua_func_update_flying_yaw);
|
|
smlua_bind_function(L, "update_flying_pitch", smlua_func_update_flying_pitch);
|
|
smlua_bind_function(L, "update_flying", smlua_func_update_flying);
|
|
smlua_bind_function(L, "common_air_action_step", smlua_func_common_air_action_step);
|
|
smlua_bind_function(L, "common_air_knockback_step", smlua_func_common_air_knockback_step);
|
|
smlua_bind_function(L, "check_wall_kick", smlua_func_check_wall_kick);
|
|
smlua_bind_function(L, "check_common_airborne_cancels", smlua_func_check_common_airborne_cancels);
|
|
smlua_bind_function(L, "mario_execute_airborne_action", smlua_func_mario_execute_airborne_action);
|
|
|
|
// mario_actions_automatic.c
|
|
smlua_bind_function(L, "add_tree_leaf_particles", smlua_func_add_tree_leaf_particles);
|
|
smlua_bind_function(L, "play_climbing_sounds", smlua_func_play_climbing_sounds);
|
|
smlua_bind_function(L, "set_pole_position", smlua_func_set_pole_position);
|
|
smlua_bind_function(L, "perform_hanging_step", smlua_func_perform_hanging_step);
|
|
smlua_bind_function(L, "update_hang_moving", smlua_func_update_hang_moving);
|
|
smlua_bind_function(L, "update_hang_stationary", smlua_func_update_hang_stationary);
|
|
smlua_bind_function(L, "let_go_of_ledge", smlua_func_let_go_of_ledge);
|
|
smlua_bind_function(L, "climb_up_ledge", smlua_func_climb_up_ledge);
|
|
smlua_bind_function(L, "update_ledge_climb_camera", smlua_func_update_ledge_climb_camera);
|
|
smlua_bind_function(L, "update_ledge_climb", smlua_func_update_ledge_climb);
|
|
smlua_bind_function(L, "mario_pop_bubble", smlua_func_mario_pop_bubble);
|
|
smlua_bind_function(L, "check_common_automatic_cancels", smlua_func_check_common_automatic_cancels);
|
|
smlua_bind_function(L, "mario_execute_automatic_action", smlua_func_mario_execute_automatic_action);
|
|
|
|
// mario_actions_cutscene.c
|
|
smlua_bind_function(L, "get_credits_str_width", smlua_func_get_credits_str_width);
|
|
smlua_bind_function(L, "bhv_end_peach_loop", smlua_func_bhv_end_peach_loop);
|
|
smlua_bind_function(L, "bhv_end_toad_loop", smlua_func_bhv_end_toad_loop);
|
|
smlua_bind_function(L, "get_star_collection_dialog", smlua_func_get_star_collection_dialog);
|
|
smlua_bind_function(L, "handle_save_menu", smlua_func_handle_save_menu);
|
|
smlua_bind_function(L, "cutscene_take_cap_off", smlua_func_cutscene_take_cap_off);
|
|
smlua_bind_function(L, "cutscene_put_cap_on", smlua_func_cutscene_put_cap_on);
|
|
smlua_bind_function(L, "mario_ready_to_speak", smlua_func_mario_ready_to_speak);
|
|
smlua_bind_function(L, "should_start_or_continue_dialog", smlua_func_should_start_or_continue_dialog);
|
|
smlua_bind_function(L, "general_star_dance_handler", smlua_func_general_star_dance_handler);
|
|
smlua_bind_function(L, "common_death_handler", smlua_func_common_death_handler);
|
|
smlua_bind_function(L, "launch_mario_until_land", smlua_func_launch_mario_until_land);
|
|
smlua_bind_function(L, "stuck_in_ground_handler", smlua_func_stuck_in_ground_handler);
|
|
smlua_bind_function(L, "generate_yellow_sparkles", smlua_func_generate_yellow_sparkles);
|
|
smlua_bind_function(L, "mario_execute_cutscene_action", smlua_func_mario_execute_cutscene_action);
|
|
|
|
// mario_actions_moving.c
|
|
smlua_bind_function(L, "tilt_body_running", smlua_func_tilt_body_running);
|
|
smlua_bind_function(L, "play_step_sound", smlua_func_play_step_sound);
|
|
smlua_bind_function(L, "align_with_floor", smlua_func_align_with_floor);
|
|
smlua_bind_function(L, "begin_walking_action", smlua_func_begin_walking_action);
|
|
smlua_bind_function(L, "check_ledge_climb_down", smlua_func_check_ledge_climb_down);
|
|
smlua_bind_function(L, "slide_bonk", smlua_func_slide_bonk);
|
|
smlua_bind_function(L, "set_triple_jump_action", smlua_func_set_triple_jump_action);
|
|
smlua_bind_function(L, "update_sliding_angle", smlua_func_update_sliding_angle);
|
|
smlua_bind_function(L, "update_sliding", smlua_func_update_sliding);
|
|
smlua_bind_function(L, "apply_slope_accel", smlua_func_apply_slope_accel);
|
|
smlua_bind_function(L, "apply_landing_accel", smlua_func_apply_landing_accel);
|
|
smlua_bind_function(L, "update_shell_speed", smlua_func_update_shell_speed);
|
|
smlua_bind_function(L, "apply_slope_decel", smlua_func_apply_slope_decel);
|
|
smlua_bind_function(L, "update_decelerating_speed", smlua_func_update_decelerating_speed);
|
|
smlua_bind_function(L, "update_walking_speed", smlua_func_update_walking_speed);
|
|
smlua_bind_function(L, "should_begin_sliding", smlua_func_should_begin_sliding);
|
|
smlua_bind_function(L, "analog_stick_held_back", smlua_func_analog_stick_held_back);
|
|
smlua_bind_function(L, "check_ground_dive_or_punch", smlua_func_check_ground_dive_or_punch);
|
|
smlua_bind_function(L, "begin_braking_action", smlua_func_begin_braking_action);
|
|
smlua_bind_function(L, "anim_and_audio_for_walk", smlua_func_anim_and_audio_for_walk);
|
|
smlua_bind_function(L, "anim_and_audio_for_hold_walk", smlua_func_anim_and_audio_for_hold_walk);
|
|
smlua_bind_function(L, "anim_and_audio_for_heavy_walk", smlua_func_anim_and_audio_for_heavy_walk);
|
|
smlua_bind_function(L, "push_or_sidle_wall", smlua_func_push_or_sidle_wall);
|
|
smlua_bind_function(L, "tilt_body_walking", smlua_func_tilt_body_walking);
|
|
smlua_bind_function(L, "tilt_body_ground_shell", smlua_func_tilt_body_ground_shell);
|
|
smlua_bind_function(L, "tilt_body_butt_slide", smlua_func_tilt_body_butt_slide);
|
|
smlua_bind_function(L, "common_slide_action", smlua_func_common_slide_action);
|
|
smlua_bind_function(L, "common_slide_action_with_jump", smlua_func_common_slide_action_with_jump);
|
|
smlua_bind_function(L, "stomach_slide_action", smlua_func_stomach_slide_action);
|
|
smlua_bind_function(L, "common_ground_knockback_action", smlua_func_common_ground_knockback_action);
|
|
smlua_bind_function(L, "common_landing_action", smlua_func_common_landing_action);
|
|
//smlua_bind_function(L, "common_landing_cancels", smlua_func_common_landing_cancels); <--- UNIMPLEMENTED
|
|
smlua_bind_function(L, "quicksand_jump_land_action", smlua_func_quicksand_jump_land_action);
|
|
smlua_bind_function(L, "check_common_moving_cancels", smlua_func_check_common_moving_cancels);
|
|
smlua_bind_function(L, "mario_execute_moving_action", smlua_func_mario_execute_moving_action);
|
|
|
|
// mario_actions_object.c
|
|
smlua_bind_function(L, "animated_stationary_ground_step", smlua_func_animated_stationary_ground_step);
|
|
smlua_bind_function(L, "mario_update_punch_sequence", smlua_func_mario_update_punch_sequence);
|
|
smlua_bind_function(L, "check_common_object_cancels", smlua_func_check_common_object_cancels);
|
|
smlua_bind_function(L, "mario_execute_object_action", smlua_func_mario_execute_object_action);
|
|
|
|
// mario_actions_stationary.c
|
|
smlua_bind_function(L, "check_common_idle_cancels", smlua_func_check_common_idle_cancels);
|
|
smlua_bind_function(L, "check_common_hold_idle_cancels", smlua_func_check_common_hold_idle_cancels);
|
|
smlua_bind_function(L, "play_anim_sound", smlua_func_play_anim_sound);
|
|
smlua_bind_function(L, "stopping_step", smlua_func_stopping_step);
|
|
smlua_bind_function(L, "landing_step", smlua_func_landing_step);
|
|
smlua_bind_function(L, "check_common_landing_cancels", smlua_func_check_common_landing_cancels);
|
|
smlua_bind_function(L, "check_common_stationary_cancels", smlua_func_check_common_stationary_cancels);
|
|
smlua_bind_function(L, "mario_execute_stationary_action", smlua_func_mario_execute_stationary_action);
|
|
|
|
// mario_actions_submerged.c
|
|
smlua_bind_function(L, "set_swimming_at_surface_particles", smlua_func_set_swimming_at_surface_particles);
|
|
smlua_bind_function(L, "perform_water_full_step", smlua_func_perform_water_full_step);
|
|
smlua_bind_function(L, "apply_water_current", smlua_func_apply_water_current);
|
|
smlua_bind_function(L, "perform_water_step", smlua_func_perform_water_step);
|
|
smlua_bind_function(L, "float_surface_gfx", smlua_func_float_surface_gfx);
|
|
smlua_bind_function(L, "mario_execute_submerged_action", smlua_func_mario_execute_submerged_action);
|
|
|
|
// mario_misc.h
|
|
smlua_bind_function(L, "bhv_toad_message_init", smlua_func_bhv_toad_message_init);
|
|
smlua_bind_function(L, "bhv_toad_message_loop", smlua_func_bhv_toad_message_loop);
|
|
smlua_bind_function(L, "bhv_unlock_door_star_init", smlua_func_bhv_unlock_door_star_init);
|
|
smlua_bind_function(L, "bhv_unlock_door_star_loop", smlua_func_bhv_unlock_door_star_loop);
|
|
smlua_bind_function(L, "geo_get_mario_state", smlua_func_geo_get_mario_state);
|
|
smlua_bind_function(L, "geo_get_body_state", smlua_func_geo_get_body_state);
|
|
|
|
// mario_step.h
|
|
smlua_bind_function(L, "get_additive_y_vel_for_jumps", smlua_func_get_additive_y_vel_for_jumps);
|
|
smlua_bind_function(L, "mario_bonk_reflection", smlua_func_mario_bonk_reflection);
|
|
smlua_bind_function(L, "init_bully_collision_data", smlua_func_init_bully_collision_data);
|
|
smlua_bind_function(L, "mario_update_quicksand", smlua_func_mario_update_quicksand);
|
|
smlua_bind_function(L, "mario_push_off_steep_floor", smlua_func_mario_push_off_steep_floor);
|
|
smlua_bind_function(L, "mario_update_moving_sand", smlua_func_mario_update_moving_sand);
|
|
smlua_bind_function(L, "mario_update_windy_ground", smlua_func_mario_update_windy_ground);
|
|
smlua_bind_function(L, "stop_and_set_height_to_floor", smlua_func_stop_and_set_height_to_floor);
|
|
smlua_bind_function(L, "stationary_ground_step", smlua_func_stationary_ground_step);
|
|
smlua_bind_function(L, "perform_ground_step", smlua_func_perform_ground_step);
|
|
smlua_bind_function(L, "perform_air_step", smlua_func_perform_air_step);
|
|
smlua_bind_function(L, "set_vel_from_pitch_and_yaw", smlua_func_set_vel_from_pitch_and_yaw);
|
|
|
|
// math_util.h
|
|
smlua_bind_function(L, "sins", smlua_func_sins);
|
|
smlua_bind_function(L, "coss", smlua_func_coss);
|
|
smlua_bind_function(L, "atan2s", smlua_func_atan2s);
|
|
smlua_bind_function(L, "atan2f", smlua_func_atan2f);
|
|
smlua_bind_function(L, "approach_s32", smlua_func_approach_s32);
|
|
smlua_bind_function(L, "approach_f32", smlua_func_approach_f32);
|
|
smlua_bind_function(L, "spline_get_weights", smlua_func_spline_get_weights);
|
|
smlua_bind_function(L, "anim_spline_init", smlua_func_anim_spline_init);
|
|
smlua_bind_function(L, "anim_spline_poll", smlua_func_anim_spline_poll);
|
|
smlua_bind_function(L, "vec3f_rotate_zxy", smlua_func_vec3f_rotate_zxy);
|
|
smlua_bind_function(L, "vec3f_rotate_around_n", smlua_func_vec3f_rotate_around_n);
|
|
smlua_bind_function(L, "vec3f_project", smlua_func_vec3f_project);
|
|
smlua_bind_function(L, "vec3f_transform", smlua_func_vec3f_transform);
|
|
smlua_bind_function(L, "vec3f_get_dist_and_angle", smlua_func_vec3f_get_dist_and_angle);
|
|
smlua_bind_function(L, "vec3f_set_dist_and_angle", smlua_func_vec3f_set_dist_and_angle);
|
|
smlua_bind_function(L, "find_vector_perpendicular_to_plane", smlua_func_find_vector_perpendicular_to_plane);
|
|
smlua_bind_function(L, "mtxf_lookat", smlua_func_mtxf_lookat);
|
|
smlua_bind_function(L, "mtxf_rotate_zxy_and_translate", smlua_func_mtxf_rotate_zxy_and_translate);
|
|
smlua_bind_function(L, "mtxf_rotate_xyz_and_translate", smlua_func_mtxf_rotate_xyz_and_translate);
|
|
smlua_bind_function(L, "mtxf_billboard", smlua_func_mtxf_billboard);
|
|
smlua_bind_function(L, "mtxf_cylboard", smlua_func_mtxf_cylboard);
|
|
smlua_bind_function(L, "mtxf_align_terrain_normal", smlua_func_mtxf_align_terrain_normal);
|
|
smlua_bind_function(L, "mtxf_align_terrain_triangle", smlua_func_mtxf_align_terrain_triangle);
|
|
smlua_bind_function(L, "mtxf_mul", smlua_func_mtxf_mul);
|
|
smlua_bind_function(L, "mtxf_mul_vec3s", smlua_func_mtxf_mul_vec3s);
|
|
smlua_bind_function(L, "mtxf_rotate_xy", smlua_func_mtxf_rotate_xy);
|
|
smlua_bind_function(L, "mtxf_inverse", smlua_func_mtxf_inverse);
|
|
smlua_bind_function(L, "mtxf_inverse_non_affine", smlua_func_mtxf_inverse_non_affine);
|
|
smlua_bind_function(L, "get_pos_from_transform_mtx", smlua_func_get_pos_from_transform_mtx);
|
|
|
|
// math_util.inl
|
|
smlua_bind_function(L, "replace_value_if_not_zero", smlua_func_replace_value_if_not_zero);
|
|
smlua_bind_function(L, "sm64_to_radians", smlua_func_sm64_to_radians);
|
|
smlua_bind_function(L, "radians_to_sm64", smlua_func_radians_to_sm64);
|
|
smlua_bind_function(L, "sm64_to_degrees", smlua_func_sm64_to_degrees);
|
|
smlua_bind_function(L, "degrees_to_sm64", smlua_func_degrees_to_sm64);
|
|
|
|
// math_util_mat4.inl
|
|
smlua_bind_function(L, "mtxf_zero", smlua_func_mtxf_zero);
|
|
smlua_bind_function(L, "mtxf_copy", smlua_func_mtxf_copy);
|
|
smlua_bind_function(L, "mtxf_identity", smlua_func_mtxf_identity);
|
|
smlua_bind_function(L, "mtxf_translate", smlua_func_mtxf_translate);
|
|
smlua_bind_function(L, "mtxf_scale_vec3f", smlua_func_mtxf_scale_vec3f);
|
|
//smlua_bind_function(L, "mtxf_to_mtx", smlua_func_mtxf_to_mtx); <--- UNIMPLEMENTED
|
|
|
|
// math_util_vec3f.inl
|
|
smlua_bind_function(L, "vec3f_zero", smlua_func_vec3f_zero);
|
|
smlua_bind_function(L, "vec3f_copy", smlua_func_vec3f_copy);
|
|
smlua_bind_function(L, "vec3f_set", smlua_func_vec3f_set);
|
|
smlua_bind_function(L, "vec3f_add", smlua_func_vec3f_add);
|
|
smlua_bind_function(L, "vec3f_sum", smlua_func_vec3f_sum);
|
|
smlua_bind_function(L, "vec3f_sub", smlua_func_vec3f_sub);
|
|
smlua_bind_function(L, "vec3f_dif", smlua_func_vec3f_dif);
|
|
smlua_bind_function(L, "vec3f_mul", smlua_func_vec3f_mul);
|
|
smlua_bind_function(L, "vec3f_mult", smlua_func_vec3f_mult);
|
|
smlua_bind_function(L, "vec3f_prod", smlua_func_vec3f_prod);
|
|
smlua_bind_function(L, "vec3f_div", smlua_func_vec3f_div);
|
|
smlua_bind_function(L, "vec3f_length", smlua_func_vec3f_length);
|
|
smlua_bind_function(L, "vec3f_normalize", smlua_func_vec3f_normalize);
|
|
smlua_bind_function(L, "vec3f_set_magnitude", smlua_func_vec3f_set_magnitude);
|
|
smlua_bind_function(L, "vec3f_dot", smlua_func_vec3f_dot);
|
|
smlua_bind_function(L, "vec3f_cross", smlua_func_vec3f_cross);
|
|
smlua_bind_function(L, "vec3f_combine", smlua_func_vec3f_combine);
|
|
smlua_bind_function(L, "vec3f_dist", smlua_func_vec3f_dist);
|
|
smlua_bind_function(L, "vec3f_hdist", smlua_func_vec3f_hdist);
|
|
smlua_bind_function(L, "vec3f_is_zero", smlua_func_vec3f_is_zero);
|
|
smlua_bind_function(L, "vec3f_to_vec3i", smlua_func_vec3f_to_vec3i);
|
|
smlua_bind_function(L, "vec3f_to_vec3s", smlua_func_vec3f_to_vec3s);
|
|
|
|
// math_util_vec3i.inl
|
|
smlua_bind_function(L, "vec3i_zero", smlua_func_vec3i_zero);
|
|
smlua_bind_function(L, "vec3i_copy", smlua_func_vec3i_copy);
|
|
smlua_bind_function(L, "vec3i_set", smlua_func_vec3i_set);
|
|
smlua_bind_function(L, "vec3i_add", smlua_func_vec3i_add);
|
|
smlua_bind_function(L, "vec3i_sum", smlua_func_vec3i_sum);
|
|
smlua_bind_function(L, "vec3i_sub", smlua_func_vec3i_sub);
|
|
smlua_bind_function(L, "vec3i_dif", smlua_func_vec3i_dif);
|
|
smlua_bind_function(L, "vec3i_mul", smlua_func_vec3i_mul);
|
|
smlua_bind_function(L, "vec3i_mult", smlua_func_vec3i_mult);
|
|
smlua_bind_function(L, "vec3i_prod", smlua_func_vec3i_prod);
|
|
smlua_bind_function(L, "vec3i_div", smlua_func_vec3i_div);
|
|
smlua_bind_function(L, "vec3i_length", smlua_func_vec3i_length);
|
|
smlua_bind_function(L, "vec3i_normalize", smlua_func_vec3i_normalize);
|
|
smlua_bind_function(L, "vec3i_set_magnitude", smlua_func_vec3i_set_magnitude);
|
|
smlua_bind_function(L, "vec3i_dot", smlua_func_vec3i_dot);
|
|
smlua_bind_function(L, "vec3i_cross", smlua_func_vec3i_cross);
|
|
smlua_bind_function(L, "vec3i_combine", smlua_func_vec3i_combine);
|
|
smlua_bind_function(L, "vec3i_dist", smlua_func_vec3i_dist);
|
|
smlua_bind_function(L, "vec3i_hdist", smlua_func_vec3i_hdist);
|
|
smlua_bind_function(L, "vec3i_is_zero", smlua_func_vec3i_is_zero);
|
|
smlua_bind_function(L, "vec3i_to_vec3f", smlua_func_vec3i_to_vec3f);
|
|
smlua_bind_function(L, "vec3i_to_vec3s", smlua_func_vec3i_to_vec3s);
|
|
|
|
// math_util_vec3s.inl
|
|
smlua_bind_function(L, "vec3s_zero", smlua_func_vec3s_zero);
|
|
smlua_bind_function(L, "vec3s_copy", smlua_func_vec3s_copy);
|
|
smlua_bind_function(L, "vec3s_set", smlua_func_vec3s_set);
|
|
smlua_bind_function(L, "vec3s_add", smlua_func_vec3s_add);
|
|
smlua_bind_function(L, "vec3s_sum", smlua_func_vec3s_sum);
|
|
smlua_bind_function(L, "vec3s_sub", smlua_func_vec3s_sub);
|
|
smlua_bind_function(L, "vec3s_dif", smlua_func_vec3s_dif);
|
|
smlua_bind_function(L, "vec3s_mul", smlua_func_vec3s_mul);
|
|
smlua_bind_function(L, "vec3s_mult", smlua_func_vec3s_mult);
|
|
smlua_bind_function(L, "vec3s_prod", smlua_func_vec3s_prod);
|
|
smlua_bind_function(L, "vec3s_div", smlua_func_vec3s_div);
|
|
smlua_bind_function(L, "vec3s_length", smlua_func_vec3s_length);
|
|
smlua_bind_function(L, "vec3s_normalize", smlua_func_vec3s_normalize);
|
|
smlua_bind_function(L, "vec3s_set_magnitude", smlua_func_vec3s_set_magnitude);
|
|
smlua_bind_function(L, "vec3s_dot", smlua_func_vec3s_dot);
|
|
smlua_bind_function(L, "vec3s_cross", smlua_func_vec3s_cross);
|
|
smlua_bind_function(L, "vec3s_combine", smlua_func_vec3s_combine);
|
|
smlua_bind_function(L, "vec3s_dist", smlua_func_vec3s_dist);
|
|
smlua_bind_function(L, "vec3s_hdist", smlua_func_vec3s_hdist);
|
|
smlua_bind_function(L, "vec3s_is_zero", smlua_func_vec3s_is_zero);
|
|
smlua_bind_function(L, "vec3s_to_vec3f", smlua_func_vec3s_to_vec3f);
|
|
smlua_bind_function(L, "vec3s_to_vec3i", smlua_func_vec3s_to_vec3i);
|
|
|
|
// misc.h
|
|
smlua_bind_function(L, "smooth_step", smlua_func_smooth_step);
|
|
smlua_bind_function(L, "update_all_mario_stars", smlua_func_update_all_mario_stars);
|
|
smlua_bind_function(L, "clock_elapsed", smlua_func_clock_elapsed);
|
|
smlua_bind_function(L, "clock_elapsed_f64", smlua_func_clock_elapsed_f64);
|
|
smlua_bind_function(L, "clock_elapsed_ticks", smlua_func_clock_elapsed_ticks);
|
|
smlua_bind_function(L, "clock_is_date", smlua_func_clock_is_date);
|
|
smlua_bind_function(L, "delta_interpolate_f32", smlua_func_delta_interpolate_f32);
|
|
smlua_bind_function(L, "delta_interpolate_s32", smlua_func_delta_interpolate_s32);
|
|
smlua_bind_function(L, "delta_interpolate_vec3f", smlua_func_delta_interpolate_vec3f);
|
|
smlua_bind_function(L, "delta_interpolate_vec3s", smlua_func_delta_interpolate_vec3s);
|
|
|
|
// mod_fs.h
|
|
smlua_bind_function(L, "mod_fs_exists", smlua_func_mod_fs_exists);
|
|
smlua_bind_function(L, "mod_fs_get", smlua_func_mod_fs_get);
|
|
smlua_bind_function(L, "mod_fs_reload", smlua_func_mod_fs_reload);
|
|
smlua_bind_function(L, "mod_fs_create", smlua_func_mod_fs_create);
|
|
smlua_bind_function(L, "mod_fs_delete", smlua_func_mod_fs_delete);
|
|
smlua_bind_function(L, "mod_fs_save", smlua_func_mod_fs_save);
|
|
smlua_bind_function(L, "mod_fs_set_public", smlua_func_mod_fs_set_public);
|
|
smlua_bind_function(L, "mod_fs_get_filename", smlua_func_mod_fs_get_filename);
|
|
smlua_bind_function(L, "mod_fs_get_file", smlua_func_mod_fs_get_file);
|
|
smlua_bind_function(L, "mod_fs_create_file", smlua_func_mod_fs_create_file);
|
|
smlua_bind_function(L, "mod_fs_move_file", smlua_func_mod_fs_move_file);
|
|
smlua_bind_function(L, "mod_fs_copy_file", smlua_func_mod_fs_copy_file);
|
|
smlua_bind_function(L, "mod_fs_delete_file", smlua_func_mod_fs_delete_file);
|
|
smlua_bind_function(L, "mod_fs_clear", smlua_func_mod_fs_clear);
|
|
smlua_bind_function(L, "mod_fs_file_read_bool", smlua_func_mod_fs_file_read_bool);
|
|
smlua_bind_function(L, "mod_fs_file_read_integer", smlua_func_mod_fs_file_read_integer);
|
|
smlua_bind_function(L, "mod_fs_file_read_number", smlua_func_mod_fs_file_read_number);
|
|
smlua_bind_function(L, "mod_fs_file_read_bytes", smlua_func_mod_fs_file_read_bytes);
|
|
smlua_bind_function(L, "mod_fs_file_read_string", smlua_func_mod_fs_file_read_string);
|
|
smlua_bind_function(L, "mod_fs_file_read_line", smlua_func_mod_fs_file_read_line);
|
|
smlua_bind_function(L, "mod_fs_file_write_bool", smlua_func_mod_fs_file_write_bool);
|
|
smlua_bind_function(L, "mod_fs_file_write_integer", smlua_func_mod_fs_file_write_integer);
|
|
smlua_bind_function(L, "mod_fs_file_write_number", smlua_func_mod_fs_file_write_number);
|
|
smlua_bind_function(L, "mod_fs_file_write_bytes", smlua_func_mod_fs_file_write_bytes);
|
|
smlua_bind_function(L, "mod_fs_file_write_string", smlua_func_mod_fs_file_write_string);
|
|
smlua_bind_function(L, "mod_fs_file_write_line", smlua_func_mod_fs_file_write_line);
|
|
smlua_bind_function(L, "mod_fs_file_seek", smlua_func_mod_fs_file_seek);
|
|
smlua_bind_function(L, "mod_fs_file_is_eof", smlua_func_mod_fs_file_is_eof);
|
|
smlua_bind_function(L, "mod_fs_file_fill", smlua_func_mod_fs_file_fill);
|
|
smlua_bind_function(L, "mod_fs_file_erase", smlua_func_mod_fs_file_erase);
|
|
smlua_bind_function(L, "mod_fs_file_set_public", smlua_func_mod_fs_file_set_public);
|
|
smlua_bind_function(L, "mod_fs_hide_errors", smlua_func_mod_fs_hide_errors);
|
|
smlua_bind_function(L, "mod_fs_get_last_error", smlua_func_mod_fs_get_last_error);
|
|
|
|
// mod_storage.h
|
|
smlua_bind_function(L, "mod_storage_save", smlua_func_mod_storage_save);
|
|
smlua_bind_function(L, "mod_storage_save_number", smlua_func_mod_storage_save_number);
|
|
smlua_bind_function(L, "mod_storage_save_bool", smlua_func_mod_storage_save_bool);
|
|
smlua_bind_function(L, "mod_storage_load", smlua_func_mod_storage_load);
|
|
smlua_bind_function(L, "mod_storage_load_number", smlua_func_mod_storage_load_number);
|
|
smlua_bind_function(L, "mod_storage_load_bool", smlua_func_mod_storage_load_bool);
|
|
smlua_bind_function(L, "mod_storage_exists", smlua_func_mod_storage_exists);
|
|
smlua_bind_function(L, "mod_storage_remove", smlua_func_mod_storage_remove);
|
|
smlua_bind_function(L, "mod_storage_clear", smlua_func_mod_storage_clear);
|
|
|
|
// network_player.h
|
|
smlua_bind_function(L, "network_player_connected_count", smlua_func_network_player_connected_count);
|
|
smlua_bind_function(L, "network_player_set_description", smlua_func_network_player_set_description);
|
|
smlua_bind_function(L, "network_player_set_override_location", smlua_func_network_player_set_override_location);
|
|
smlua_bind_function(L, "network_player_from_global_index", smlua_func_network_player_from_global_index);
|
|
smlua_bind_function(L, "get_network_player_from_level", smlua_func_get_network_player_from_level);
|
|
smlua_bind_function(L, "get_network_player_from_area", smlua_func_get_network_player_from_area);
|
|
smlua_bind_function(L, "get_network_player_smallest_global", smlua_func_get_network_player_smallest_global);
|
|
smlua_bind_function(L, "network_player_get_palette_color_channel", smlua_func_network_player_get_palette_color_channel);
|
|
smlua_bind_function(L, "network_player_get_override_palette_color_channel", smlua_func_network_player_get_override_palette_color_channel);
|
|
smlua_bind_function(L, "network_player_set_override_palette_color", smlua_func_network_player_set_override_palette_color);
|
|
smlua_bind_function(L, "network_player_reset_override_palette", smlua_func_network_player_reset_override_palette);
|
|
smlua_bind_function(L, "network_player_is_override_palette_same", smlua_func_network_player_is_override_palette_same);
|
|
|
|
// network_utils.h
|
|
smlua_bind_function(L, "network_global_index_from_local", smlua_func_network_global_index_from_local);
|
|
smlua_bind_function(L, "network_local_index_from_global", smlua_func_network_local_index_from_global);
|
|
smlua_bind_function(L, "network_is_server", smlua_func_network_is_server);
|
|
smlua_bind_function(L, "network_is_moderator", smlua_func_network_is_moderator);
|
|
smlua_bind_function(L, "network_get_player_text_color_string", smlua_func_network_get_player_text_color_string);
|
|
smlua_bind_function(L, "network_check_singleplayer_pause", smlua_func_network_check_singleplayer_pause);
|
|
smlua_bind_function(L, "network_discord_id_from_local_index", smlua_func_network_discord_id_from_local_index);
|
|
|
|
// obj_behaviors.c
|
|
smlua_bind_function(L, "set_yoshi_as_not_dead", smlua_func_set_yoshi_as_not_dead);
|
|
//smlua_bind_function(L, "geo_obj_transparency_something", smlua_func_geo_obj_transparency_something); <--- UNIMPLEMENTED
|
|
smlua_bind_function(L, "absf_2", smlua_func_absf_2);
|
|
smlua_bind_function(L, "obj_find_wall", smlua_func_obj_find_wall);
|
|
smlua_bind_function(L, "turn_obj_away_from_steep_floor", smlua_func_turn_obj_away_from_steep_floor);
|
|
smlua_bind_function(L, "obj_orient_graph", smlua_func_obj_orient_graph);
|
|
smlua_bind_function(L, "calc_obj_friction", smlua_func_calc_obj_friction);
|
|
smlua_bind_function(L, "calc_new_obj_vel_and_pos_y", smlua_func_calc_new_obj_vel_and_pos_y);
|
|
smlua_bind_function(L, "calc_new_obj_vel_and_pos_y_underwater", smlua_func_calc_new_obj_vel_and_pos_y_underwater);
|
|
smlua_bind_function(L, "obj_update_pos_vel_xz", smlua_func_obj_update_pos_vel_xz);
|
|
smlua_bind_function(L, "obj_splash", smlua_func_obj_splash);
|
|
smlua_bind_function(L, "object_step", smlua_func_object_step);
|
|
smlua_bind_function(L, "object_step_without_floor_orient", smlua_func_object_step_without_floor_orient);
|
|
smlua_bind_function(L, "obj_move_xyz_using_fvel_and_yaw", smlua_func_obj_move_xyz_using_fvel_and_yaw);
|
|
smlua_bind_function(L, "is_point_within_radius_of_mario", smlua_func_is_point_within_radius_of_mario);
|
|
smlua_bind_function(L, "is_point_within_radius_of_any_player", smlua_func_is_point_within_radius_of_any_player);
|
|
smlua_bind_function(L, "is_player_active", smlua_func_is_player_active);
|
|
smlua_bind_function(L, "is_other_player_active", smlua_func_is_other_player_active);
|
|
smlua_bind_function(L, "is_player_in_local_area", smlua_func_is_player_in_local_area);
|
|
smlua_bind_function(L, "nearest_mario_state_to_object", smlua_func_nearest_mario_state_to_object);
|
|
smlua_bind_function(L, "nearest_possible_mario_state_to_object", smlua_func_nearest_possible_mario_state_to_object);
|
|
smlua_bind_function(L, "nearest_player_to_object", smlua_func_nearest_player_to_object);
|
|
smlua_bind_function(L, "nearest_interacting_mario_state_to_object", smlua_func_nearest_interacting_mario_state_to_object);
|
|
smlua_bind_function(L, "nearest_interacting_player_to_object", smlua_func_nearest_interacting_player_to_object);
|
|
smlua_bind_function(L, "is_nearest_mario_state_to_object", smlua_func_is_nearest_mario_state_to_object);
|
|
smlua_bind_function(L, "is_nearest_player_to_object", smlua_func_is_nearest_player_to_object);
|
|
smlua_bind_function(L, "is_point_close_to_object", smlua_func_is_point_close_to_object);
|
|
smlua_bind_function(L, "set_object_visibility", smlua_func_set_object_visibility);
|
|
smlua_bind_function(L, "obj_return_home_if_safe", smlua_func_obj_return_home_if_safe);
|
|
smlua_bind_function(L, "obj_return_and_displace_home", smlua_func_obj_return_and_displace_home);
|
|
smlua_bind_function(L, "obj_check_if_facing_toward_angle", smlua_func_obj_check_if_facing_toward_angle);
|
|
smlua_bind_function(L, "obj_find_wall_displacement", smlua_func_obj_find_wall_displacement);
|
|
smlua_bind_function(L, "obj_spawn_yellow_coins", smlua_func_obj_spawn_yellow_coins);
|
|
smlua_bind_function(L, "obj_flicker_and_disappear", smlua_func_obj_flicker_and_disappear);
|
|
smlua_bind_function(L, "current_mario_room_check", smlua_func_current_mario_room_check);
|
|
smlua_bind_function(L, "obj_check_floor_death", smlua_func_obj_check_floor_death);
|
|
smlua_bind_function(L, "obj_lava_death", smlua_func_obj_lava_death);
|
|
smlua_bind_function(L, "spawn_orange_number", smlua_func_spawn_orange_number);
|
|
|
|
// obj_behaviors_2.c
|
|
smlua_bind_function(L, "obj_is_rendering_enabled", smlua_func_obj_is_rendering_enabled);
|
|
smlua_bind_function(L, "obj_get_pitch_from_vel", smlua_func_obj_get_pitch_from_vel);
|
|
smlua_bind_function(L, "obj_set_dist_from_home", smlua_func_obj_set_dist_from_home);
|
|
smlua_bind_function(L, "obj_is_near_to_and_facing_mario", smlua_func_obj_is_near_to_and_facing_mario);
|
|
smlua_bind_function(L, "platform_on_track_update_pos_or_spawn_ball", smlua_func_platform_on_track_update_pos_or_spawn_ball);
|
|
smlua_bind_function(L, "cur_obj_spin_all_dimensions", smlua_func_cur_obj_spin_all_dimensions);
|
|
smlua_bind_function(L, "obj_rotate_yaw_and_bounce_off_walls", smlua_func_obj_rotate_yaw_and_bounce_off_walls);
|
|
smlua_bind_function(L, "obj_get_pitch_to_home", smlua_func_obj_get_pitch_to_home);
|
|
smlua_bind_function(L, "obj_compute_vel_from_move_pitch", smlua_func_obj_compute_vel_from_move_pitch);
|
|
smlua_bind_function(L, "cur_obj_init_anim_extend", smlua_func_cur_obj_init_anim_extend);
|
|
smlua_bind_function(L, "cur_obj_init_anim_and_check_if_end", smlua_func_cur_obj_init_anim_and_check_if_end);
|
|
smlua_bind_function(L, "cur_obj_init_anim_check_frame", smlua_func_cur_obj_init_anim_check_frame);
|
|
smlua_bind_function(L, "cur_obj_set_anim_if_at_end", smlua_func_cur_obj_set_anim_if_at_end);
|
|
smlua_bind_function(L, "cur_obj_play_sound_at_anim_range", smlua_func_cur_obj_play_sound_at_anim_range);
|
|
smlua_bind_function(L, "obj_turn_pitch_toward_mario", smlua_func_obj_turn_pitch_toward_mario);
|
|
smlua_bind_function(L, "approach_f32_ptr", smlua_func_approach_f32_ptr);
|
|
smlua_bind_function(L, "obj_forward_vel_approach", smlua_func_obj_forward_vel_approach);
|
|
smlua_bind_function(L, "obj_y_vel_approach", smlua_func_obj_y_vel_approach);
|
|
smlua_bind_function(L, "obj_move_pitch_approach", smlua_func_obj_move_pitch_approach);
|
|
smlua_bind_function(L, "obj_face_pitch_approach", smlua_func_obj_face_pitch_approach);
|
|
smlua_bind_function(L, "obj_face_yaw_approach", smlua_func_obj_face_yaw_approach);
|
|
smlua_bind_function(L, "obj_face_roll_approach", smlua_func_obj_face_roll_approach);
|
|
smlua_bind_function(L, "obj_smooth_turn", smlua_func_obj_smooth_turn);
|
|
smlua_bind_function(L, "obj_roll_to_match_yaw_turn", smlua_func_obj_roll_to_match_yaw_turn);
|
|
smlua_bind_function(L, "random_linear_offset", smlua_func_random_linear_offset);
|
|
smlua_bind_function(L, "random_mod_offset", smlua_func_random_mod_offset);
|
|
smlua_bind_function(L, "obj_random_fixed_turn", smlua_func_obj_random_fixed_turn);
|
|
smlua_bind_function(L, "obj_grow_then_shrink", smlua_func_obj_grow_then_shrink);
|
|
smlua_bind_function(L, "oscillate_toward", smlua_func_oscillate_toward);
|
|
smlua_bind_function(L, "obj_update_blinking", smlua_func_obj_update_blinking);
|
|
smlua_bind_function(L, "obj_resolve_object_collisions", smlua_func_obj_resolve_object_collisions);
|
|
smlua_bind_function(L, "obj_bounce_off_walls_edges_objects", smlua_func_obj_bounce_off_walls_edges_objects);
|
|
smlua_bind_function(L, "obj_resolve_collisions_and_turn", smlua_func_obj_resolve_collisions_and_turn);
|
|
smlua_bind_function(L, "obj_die_if_health_non_positive", smlua_func_obj_die_if_health_non_positive);
|
|
smlua_bind_function(L, "obj_unused_die", smlua_func_obj_unused_die);
|
|
smlua_bind_function(L, "obj_set_knockback_action", smlua_func_obj_set_knockback_action);
|
|
smlua_bind_function(L, "obj_set_squished_action", smlua_func_obj_set_squished_action);
|
|
smlua_bind_function(L, "obj_die_if_above_lava_and_health_non_positive", smlua_func_obj_die_if_above_lava_and_health_non_positive);
|
|
smlua_bind_function(L, "obj_handle_attacks", smlua_func_obj_handle_attacks);
|
|
smlua_bind_function(L, "obj_act_knockback", smlua_func_obj_act_knockback);
|
|
smlua_bind_function(L, "obj_act_squished", smlua_func_obj_act_squished);
|
|
smlua_bind_function(L, "obj_update_standard_actions", smlua_func_obj_update_standard_actions);
|
|
smlua_bind_function(L, "obj_check_attacks", smlua_func_obj_check_attacks);
|
|
smlua_bind_function(L, "obj_move_for_one_second", smlua_func_obj_move_for_one_second);
|
|
smlua_bind_function(L, "treat_far_home_as_mario", smlua_func_treat_far_home_as_mario);
|
|
smlua_bind_function(L, "obj_spit_fire", smlua_func_obj_spit_fire);
|
|
|
|
// object_helpers.c
|
|
smlua_bind_function(L, "clear_move_flag", smlua_func_clear_move_flag);
|
|
//smlua_bind_function(L, "geo_update_projectile_pos_from_parent", smlua_func_geo_update_projectile_pos_from_parent); <--- UNIMPLEMENTED
|
|
//smlua_bind_function(L, "geo_update_layer_transparency", smlua_func_geo_update_layer_transparency); <--- UNIMPLEMENTED
|
|
//smlua_bind_function(L, "geo_switch_anim_state", smlua_func_geo_switch_anim_state); <--- UNIMPLEMENTED
|
|
smlua_bind_function(L, "set_room_override", smlua_func_set_room_override);
|
|
//smlua_bind_function(L, "geo_switch_area", smlua_func_geo_switch_area); <--- UNIMPLEMENTED
|
|
//smlua_bind_function(L, "geo_choose_area_ext", smlua_func_geo_choose_area_ext); <--- UNIMPLEMENTED
|
|
smlua_bind_function(L, "obj_update_pos_from_parent_transformation", smlua_func_obj_update_pos_from_parent_transformation);
|
|
smlua_bind_function(L, "obj_apply_scale_to_matrix", smlua_func_obj_apply_scale_to_matrix);
|
|
smlua_bind_function(L, "create_transformation_from_matrices", smlua_func_create_transformation_from_matrices);
|
|
smlua_bind_function(L, "obj_set_held_state", smlua_func_obj_set_held_state);
|
|
smlua_bind_function(L, "lateral_dist_between_objects", smlua_func_lateral_dist_between_objects);
|
|
smlua_bind_function(L, "dist_between_objects", smlua_func_dist_between_objects);
|
|
smlua_bind_function(L, "dist_between_object_and_point", smlua_func_dist_between_object_and_point);
|
|
smlua_bind_function(L, "cur_obj_forward_vel_approach_upward", smlua_func_cur_obj_forward_vel_approach_upward);
|
|
smlua_bind_function(L, "approach_f32_signed", smlua_func_approach_f32_signed);
|
|
smlua_bind_function(L, "approach_f32_symmetric", smlua_func_approach_f32_symmetric);
|
|
smlua_bind_function(L, "approach_s16_symmetric", smlua_func_approach_s16_symmetric);
|
|
smlua_bind_function(L, "cur_obj_rotate_yaw_toward", smlua_func_cur_obj_rotate_yaw_toward);
|
|
smlua_bind_function(L, "obj_angle_to_object", smlua_func_obj_angle_to_object);
|
|
smlua_bind_function(L, "obj_pitch_to_object", smlua_func_obj_pitch_to_object);
|
|
smlua_bind_function(L, "obj_angle_to_point", smlua_func_obj_angle_to_point);
|
|
smlua_bind_function(L, "obj_turn_toward_object", smlua_func_obj_turn_toward_object);
|
|
smlua_bind_function(L, "obj_set_parent_relative_pos", smlua_func_obj_set_parent_relative_pos);
|
|
smlua_bind_function(L, "obj_set_pos", smlua_func_obj_set_pos);
|
|
smlua_bind_function(L, "obj_set_angle", smlua_func_obj_set_angle);
|
|
smlua_bind_function(L, "obj_set_move_angle", smlua_func_obj_set_move_angle);
|
|
smlua_bind_function(L, "obj_set_face_angle", smlua_func_obj_set_face_angle);
|
|
smlua_bind_function(L, "obj_set_gfx_angle", smlua_func_obj_set_gfx_angle);
|
|
smlua_bind_function(L, "obj_set_gfx_pos", smlua_func_obj_set_gfx_pos);
|
|
smlua_bind_function(L, "obj_set_gfx_scale", smlua_func_obj_set_gfx_scale);
|
|
smlua_bind_function(L, "spawn_water_droplet", smlua_func_spawn_water_droplet);
|
|
smlua_bind_function(L, "obj_build_relative_transform", smlua_func_obj_build_relative_transform);
|
|
smlua_bind_function(L, "cur_obj_move_using_vel", smlua_func_cur_obj_move_using_vel);
|
|
smlua_bind_function(L, "obj_copy_graph_y_offset", smlua_func_obj_copy_graph_y_offset);
|
|
smlua_bind_function(L, "obj_copy_pos_and_angle", smlua_func_obj_copy_pos_and_angle);
|
|
smlua_bind_function(L, "obj_copy_pos", smlua_func_obj_copy_pos);
|
|
smlua_bind_function(L, "obj_copy_angle", smlua_func_obj_copy_angle);
|
|
smlua_bind_function(L, "obj_set_gfx_pos_from_pos", smlua_func_obj_set_gfx_pos_from_pos);
|
|
smlua_bind_function(L, "obj_init_animation", smlua_func_obj_init_animation);
|
|
smlua_bind_function(L, "linear_mtxf_mul_vec3f", smlua_func_linear_mtxf_mul_vec3f);
|
|
smlua_bind_function(L, "linear_mtxf_transpose_mul_vec3f", smlua_func_linear_mtxf_transpose_mul_vec3f);
|
|
smlua_bind_function(L, "obj_apply_scale_to_transform", smlua_func_obj_apply_scale_to_transform);
|
|
smlua_bind_function(L, "obj_copy_scale", smlua_func_obj_copy_scale);
|
|
smlua_bind_function(L, "obj_scale_xyz", smlua_func_obj_scale_xyz);
|
|
smlua_bind_function(L, "obj_scale", smlua_func_obj_scale);
|
|
smlua_bind_function(L, "cur_obj_scale", smlua_func_cur_obj_scale);
|
|
smlua_bind_function(L, "cur_obj_init_animation", smlua_func_cur_obj_init_animation);
|
|
smlua_bind_function(L, "cur_obj_init_animation_with_sound", smlua_func_cur_obj_init_animation_with_sound);
|
|
smlua_bind_function(L, "obj_init_animation_with_accel_and_sound", smlua_func_obj_init_animation_with_accel_and_sound);
|
|
smlua_bind_function(L, "cur_obj_init_animation_with_accel_and_sound", smlua_func_cur_obj_init_animation_with_accel_and_sound);
|
|
smlua_bind_function(L, "obj_init_animation_with_sound", smlua_func_obj_init_animation_with_sound);
|
|
smlua_bind_function(L, "cur_obj_enable_rendering_and_become_tangible", smlua_func_cur_obj_enable_rendering_and_become_tangible);
|
|
smlua_bind_function(L, "cur_obj_enable_rendering", smlua_func_cur_obj_enable_rendering);
|
|
smlua_bind_function(L, "cur_obj_disable_rendering_and_become_intangible", smlua_func_cur_obj_disable_rendering_and_become_intangible);
|
|
smlua_bind_function(L, "cur_obj_disable_rendering", smlua_func_cur_obj_disable_rendering);
|
|
smlua_bind_function(L, "cur_obj_unhide", smlua_func_cur_obj_unhide);
|
|
smlua_bind_function(L, "cur_obj_hide", smlua_func_cur_obj_hide);
|
|
smlua_bind_function(L, "cur_obj_set_pos_relative", smlua_func_cur_obj_set_pos_relative);
|
|
smlua_bind_function(L, "cur_obj_set_pos_relative_to_parent", smlua_func_cur_obj_set_pos_relative_to_parent);
|
|
smlua_bind_function(L, "cur_obj_enable_rendering_2", smlua_func_cur_obj_enable_rendering_2);
|
|
smlua_bind_function(L, "cur_obj_unused_init_on_floor", smlua_func_cur_obj_unused_init_on_floor);
|
|
smlua_bind_function(L, "obj_set_face_angle_to_move_angle", smlua_func_obj_set_face_angle_to_move_angle);
|
|
smlua_bind_function(L, "get_object_list_from_behavior", smlua_func_get_object_list_from_behavior);
|
|
smlua_bind_function(L, "cur_obj_nearest_object_with_behavior", smlua_func_cur_obj_nearest_object_with_behavior);
|
|
smlua_bind_function(L, "cur_obj_dist_to_nearest_object_with_behavior", smlua_func_cur_obj_dist_to_nearest_object_with_behavior);
|
|
smlua_bind_function(L, "cur_obj_find_nearest_pole", smlua_func_cur_obj_find_nearest_pole);
|
|
smlua_bind_function(L, "cur_obj_find_nearest_object_with_behavior", smlua_func_cur_obj_find_nearest_object_with_behavior);
|
|
smlua_bind_function(L, "cur_obj_count_objects_with_behavior", smlua_func_cur_obj_count_objects_with_behavior);
|
|
smlua_bind_function(L, "find_unimportant_object", smlua_func_find_unimportant_object);
|
|
smlua_bind_function(L, "count_unimportant_objects", smlua_func_count_unimportant_objects);
|
|
smlua_bind_function(L, "count_objects_with_behavior", smlua_func_count_objects_with_behavior);
|
|
smlua_bind_function(L, "find_object_with_behavior", smlua_func_find_object_with_behavior);
|
|
smlua_bind_function(L, "cur_obj_find_nearby_held_actor", smlua_func_cur_obj_find_nearby_held_actor);
|
|
smlua_bind_function(L, "cur_obj_reset_timer_and_subaction", smlua_func_cur_obj_reset_timer_and_subaction);
|
|
smlua_bind_function(L, "cur_obj_change_action", smlua_func_cur_obj_change_action);
|
|
smlua_bind_function(L, "cur_obj_set_vel_from_mario_vel", smlua_func_cur_obj_set_vel_from_mario_vel);
|
|
smlua_bind_function(L, "cur_obj_reverse_animation", smlua_func_cur_obj_reverse_animation);
|
|
smlua_bind_function(L, "cur_obj_extend_animation_if_at_end", smlua_func_cur_obj_extend_animation_if_at_end);
|
|
smlua_bind_function(L, "cur_obj_check_if_near_animation_end", smlua_func_cur_obj_check_if_near_animation_end);
|
|
smlua_bind_function(L, "cur_obj_check_if_at_animation_end", smlua_func_cur_obj_check_if_at_animation_end);
|
|
smlua_bind_function(L, "cur_obj_check_anim_frame", smlua_func_cur_obj_check_anim_frame);
|
|
smlua_bind_function(L, "cur_obj_check_anim_frame_in_range", smlua_func_cur_obj_check_anim_frame_in_range);
|
|
smlua_bind_function(L, "cur_obj_check_frame_prior_current_frame", smlua_func_cur_obj_check_frame_prior_current_frame);
|
|
smlua_bind_function(L, "mario_is_in_air_action", smlua_func_mario_is_in_air_action);
|
|
smlua_bind_function(L, "mario_is_dive_sliding", smlua_func_mario_is_dive_sliding);
|
|
smlua_bind_function(L, "cur_obj_set_y_vel_and_animation", smlua_func_cur_obj_set_y_vel_and_animation);
|
|
smlua_bind_function(L, "cur_obj_unrender_and_reset_state", smlua_func_cur_obj_unrender_and_reset_state);
|
|
smlua_bind_function(L, "cur_obj_move_after_thrown_or_dropped", smlua_func_cur_obj_move_after_thrown_or_dropped);
|
|
smlua_bind_function(L, "cur_obj_get_thrown_or_placed", smlua_func_cur_obj_get_thrown_or_placed);
|
|
smlua_bind_function(L, "cur_obj_get_dropped", smlua_func_cur_obj_get_dropped);
|
|
smlua_bind_function(L, "mario_set_flag", smlua_func_mario_set_flag);
|
|
smlua_bind_function(L, "cur_obj_clear_interact_status_flag", smlua_func_cur_obj_clear_interact_status_flag);
|
|
smlua_bind_function(L, "obj_mark_for_deletion", smlua_func_obj_mark_for_deletion);
|
|
smlua_bind_function(L, "cur_obj_disable", smlua_func_cur_obj_disable);
|
|
smlua_bind_function(L, "cur_obj_become_intangible", smlua_func_cur_obj_become_intangible);
|
|
smlua_bind_function(L, "cur_obj_become_tangible", smlua_func_cur_obj_become_tangible);
|
|
smlua_bind_function(L, "obj_become_tangible", smlua_func_obj_become_tangible);
|
|
smlua_bind_function(L, "cur_obj_update_floor_height", smlua_func_cur_obj_update_floor_height);
|
|
smlua_bind_function(L, "cur_obj_update_floor_height_and_get_floor", smlua_func_cur_obj_update_floor_height_and_get_floor);
|
|
smlua_bind_function(L, "apply_drag_to_value", smlua_func_apply_drag_to_value);
|
|
smlua_bind_function(L, "cur_obj_apply_drag_xz", smlua_func_cur_obj_apply_drag_xz);
|
|
smlua_bind_function(L, "cur_obj_move_xz", smlua_func_cur_obj_move_xz);
|
|
smlua_bind_function(L, "cur_obj_move_update_underwater_flags", smlua_func_cur_obj_move_update_underwater_flags);
|
|
smlua_bind_function(L, "cur_obj_move_update_ground_air_flags", smlua_func_cur_obj_move_update_ground_air_flags);
|
|
smlua_bind_function(L, "cur_obj_move_y_and_get_water_level", smlua_func_cur_obj_move_y_and_get_water_level);
|
|
smlua_bind_function(L, "cur_obj_move_y", smlua_func_cur_obj_move_y);
|
|
smlua_bind_function(L, "cur_obj_unused_resolve_wall_collisions", smlua_func_cur_obj_unused_resolve_wall_collisions);
|
|
smlua_bind_function(L, "abs_angle_diff", smlua_func_abs_angle_diff);
|
|
smlua_bind_function(L, "cur_obj_move_xz_using_fvel_and_yaw", smlua_func_cur_obj_move_xz_using_fvel_and_yaw);
|
|
smlua_bind_function(L, "cur_obj_move_y_with_terminal_vel", smlua_func_cur_obj_move_y_with_terminal_vel);
|
|
smlua_bind_function(L, "cur_obj_compute_vel_xz", smlua_func_cur_obj_compute_vel_xz);
|
|
smlua_bind_function(L, "increment_velocity_toward_range", smlua_func_increment_velocity_toward_range);
|
|
smlua_bind_function(L, "obj_check_if_collided_with_object", smlua_func_obj_check_if_collided_with_object);
|
|
smlua_bind_function(L, "cur_obj_set_behavior", smlua_func_cur_obj_set_behavior);
|
|
smlua_bind_function(L, "obj_set_behavior", smlua_func_obj_set_behavior);
|
|
smlua_bind_function(L, "cur_obj_has_behavior", smlua_func_cur_obj_has_behavior);
|
|
smlua_bind_function(L, "obj_has_behavior", smlua_func_obj_has_behavior);
|
|
smlua_bind_function(L, "cur_obj_lateral_dist_from_obj_to_home", smlua_func_cur_obj_lateral_dist_from_obj_to_home);
|
|
smlua_bind_function(L, "cur_obj_lateral_dist_from_mario_to_home", smlua_func_cur_obj_lateral_dist_from_mario_to_home);
|
|
smlua_bind_function(L, "cur_obj_lateral_dist_to_home", smlua_func_cur_obj_lateral_dist_to_home);
|
|
smlua_bind_function(L, "cur_obj_outside_home_square", smlua_func_cur_obj_outside_home_square);
|
|
smlua_bind_function(L, "cur_obj_outside_home_rectangle", smlua_func_cur_obj_outside_home_rectangle);
|
|
smlua_bind_function(L, "cur_obj_set_pos_to_home", smlua_func_cur_obj_set_pos_to_home);
|
|
smlua_bind_function(L, "cur_obj_set_pos_to_home_and_stop", smlua_func_cur_obj_set_pos_to_home_and_stop);
|
|
smlua_bind_function(L, "cur_obj_shake_y", smlua_func_cur_obj_shake_y);
|
|
smlua_bind_function(L, "cur_obj_start_cam_event", smlua_func_cur_obj_start_cam_event);
|
|
smlua_bind_function(L, "set_mario_interact_hoot_if_in_range", smlua_func_set_mario_interact_hoot_if_in_range);
|
|
smlua_bind_function(L, "obj_set_billboard", smlua_func_obj_set_billboard);
|
|
smlua_bind_function(L, "obj_set_cylboard", smlua_func_obj_set_cylboard);
|
|
smlua_bind_function(L, "cur_obj_set_billboard_if_vanilla_cam", smlua_func_cur_obj_set_billboard_if_vanilla_cam);
|
|
smlua_bind_function(L, "obj_set_hitbox_radius_and_height", smlua_func_obj_set_hitbox_radius_and_height);
|
|
smlua_bind_function(L, "obj_set_hurtbox_radius_and_height", smlua_func_obj_set_hurtbox_radius_and_height);
|
|
smlua_bind_function(L, "cur_obj_set_hitbox_radius_and_height", smlua_func_cur_obj_set_hitbox_radius_and_height);
|
|
smlua_bind_function(L, "cur_obj_set_hurtbox_radius_and_height", smlua_func_cur_obj_set_hurtbox_radius_and_height);
|
|
smlua_bind_function(L, "obj_spawn_loot_coins", smlua_func_obj_spawn_loot_coins);
|
|
smlua_bind_function(L, "obj_spawn_loot_blue_coins", smlua_func_obj_spawn_loot_blue_coins);
|
|
smlua_bind_function(L, "obj_spawn_loot_yellow_coins", smlua_func_obj_spawn_loot_yellow_coins);
|
|
smlua_bind_function(L, "cur_obj_spawn_loot_coin_at_mario_pos", smlua_func_cur_obj_spawn_loot_coin_at_mario_pos);
|
|
smlua_bind_function(L, "cur_obj_abs_y_dist_to_home", smlua_func_cur_obj_abs_y_dist_to_home);
|
|
smlua_bind_function(L, "cur_obj_advance_looping_anim", smlua_func_cur_obj_advance_looping_anim);
|
|
smlua_bind_function(L, "cur_obj_detect_steep_floor", smlua_func_cur_obj_detect_steep_floor);
|
|
smlua_bind_function(L, "cur_obj_resolve_wall_collisions", smlua_func_cur_obj_resolve_wall_collisions);
|
|
smlua_bind_function(L, "cur_obj_update_floor", smlua_func_cur_obj_update_floor);
|
|
smlua_bind_function(L, "cur_obj_update_floor_and_resolve_wall_collisions", smlua_func_cur_obj_update_floor_and_resolve_wall_collisions);
|
|
smlua_bind_function(L, "cur_obj_update_floor_and_walls", smlua_func_cur_obj_update_floor_and_walls);
|
|
smlua_bind_function(L, "cur_obj_move_standard", smlua_func_cur_obj_move_standard);
|
|
smlua_bind_function(L, "cur_obj_within_12k_bounds", smlua_func_cur_obj_within_12k_bounds);
|
|
smlua_bind_function(L, "cur_obj_move_using_vel_and_gravity", smlua_func_cur_obj_move_using_vel_and_gravity);
|
|
smlua_bind_function(L, "cur_obj_move_using_fvel_and_gravity", smlua_func_cur_obj_move_using_fvel_and_gravity);
|
|
smlua_bind_function(L, "obj_set_pos_relative", smlua_func_obj_set_pos_relative);
|
|
smlua_bind_function(L, "cur_obj_angle_to_home", smlua_func_cur_obj_angle_to_home);
|
|
smlua_bind_function(L, "obj_set_gfx_pos_at_obj_pos", smlua_func_obj_set_gfx_pos_at_obj_pos);
|
|
smlua_bind_function(L, "obj_translate_local", smlua_func_obj_translate_local);
|
|
smlua_bind_function(L, "obj_build_transform_from_pos_and_angle", smlua_func_obj_build_transform_from_pos_and_angle);
|
|
smlua_bind_function(L, "obj_set_throw_matrix_from_transform", smlua_func_obj_set_throw_matrix_from_transform);
|
|
smlua_bind_function(L, "obj_build_transform_relative_to_parent", smlua_func_obj_build_transform_relative_to_parent);
|
|
smlua_bind_function(L, "obj_create_transform_from_self", smlua_func_obj_create_transform_from_self);
|
|
smlua_bind_function(L, "cur_obj_rotate_move_angle_using_vel", smlua_func_cur_obj_rotate_move_angle_using_vel);
|
|
smlua_bind_function(L, "cur_obj_rotate_face_angle_using_vel", smlua_func_cur_obj_rotate_face_angle_using_vel);
|
|
smlua_bind_function(L, "cur_obj_set_face_angle_to_move_angle", smlua_func_cur_obj_set_face_angle_to_move_angle);
|
|
smlua_bind_function(L, "cur_obj_follow_path", smlua_func_cur_obj_follow_path);
|
|
smlua_bind_function(L, "chain_segment_init", smlua_func_chain_segment_init);
|
|
smlua_bind_function(L, "random_f32_around_zero", smlua_func_random_f32_around_zero);
|
|
smlua_bind_function(L, "obj_scale_random", smlua_func_obj_scale_random);
|
|
smlua_bind_function(L, "obj_translate_xyz_random", smlua_func_obj_translate_xyz_random);
|
|
smlua_bind_function(L, "obj_translate_xz_random", smlua_func_obj_translate_xz_random);
|
|
smlua_bind_function(L, "obj_build_vel_from_transform", smlua_func_obj_build_vel_from_transform);
|
|
smlua_bind_function(L, "cur_obj_set_pos_via_transform", smlua_func_cur_obj_set_pos_via_transform);
|
|
smlua_bind_function(L, "cur_obj_reflect_move_angle_off_wall", smlua_func_cur_obj_reflect_move_angle_off_wall);
|
|
smlua_bind_function(L, "cur_obj_spawn_particles", smlua_func_cur_obj_spawn_particles);
|
|
smlua_bind_function(L, "obj_set_hitbox", smlua_func_obj_set_hitbox);
|
|
smlua_bind_function(L, "signum_positive", smlua_func_signum_positive);
|
|
smlua_bind_function(L, "cur_obj_wait_then_blink", smlua_func_cur_obj_wait_then_blink);
|
|
smlua_bind_function(L, "cur_obj_is_mario_ground_pounding_platform", smlua_func_cur_obj_is_mario_ground_pounding_platform);
|
|
smlua_bind_function(L, "obj_is_mario_ground_pounding_platform", smlua_func_obj_is_mario_ground_pounding_platform);
|
|
smlua_bind_function(L, "spawn_mist_particles", smlua_func_spawn_mist_particles);
|
|
smlua_bind_function(L, "spawn_mist_particles_with_sound", smlua_func_spawn_mist_particles_with_sound);
|
|
smlua_bind_function(L, "cur_obj_push_mario_away", smlua_func_cur_obj_push_mario_away);
|
|
smlua_bind_function(L, "cur_obj_push_mario_away_from_cylinder", smlua_func_cur_obj_push_mario_away_from_cylinder);
|
|
smlua_bind_function(L, "bhv_dust_smoke_loop", smlua_func_bhv_dust_smoke_loop);
|
|
smlua_bind_function(L, "stub_obj_helpers_3", smlua_func_stub_obj_helpers_3);
|
|
smlua_bind_function(L, "cur_obj_scale_over_time", smlua_func_cur_obj_scale_over_time);
|
|
smlua_bind_function(L, "cur_obj_set_pos_to_home_with_debug", smlua_func_cur_obj_set_pos_to_home_with_debug);
|
|
smlua_bind_function(L, "stub_obj_helpers_4", smlua_func_stub_obj_helpers_4);
|
|
smlua_bind_function(L, "cur_obj_is_mario_on_platform", smlua_func_cur_obj_is_mario_on_platform);
|
|
smlua_bind_function(L, "cur_obj_is_any_player_on_platform", smlua_func_cur_obj_is_any_player_on_platform);
|
|
smlua_bind_function(L, "cur_obj_shake_y_until", smlua_func_cur_obj_shake_y_until);
|
|
smlua_bind_function(L, "cur_obj_move_up_and_down", smlua_func_cur_obj_move_up_and_down);
|
|
smlua_bind_function(L, "spawn_star_with_no_lvl_exit", smlua_func_spawn_star_with_no_lvl_exit);
|
|
smlua_bind_function(L, "spawn_base_star_with_no_lvl_exit", smlua_func_spawn_base_star_with_no_lvl_exit);
|
|
smlua_bind_function(L, "bit_shift_left", smlua_func_bit_shift_left);
|
|
smlua_bind_function(L, "cur_obj_mario_far_away", smlua_func_cur_obj_mario_far_away);
|
|
smlua_bind_function(L, "is_mario_moving_fast_or_in_air", smlua_func_is_mario_moving_fast_or_in_air);
|
|
smlua_bind_function(L, "is_item_in_array", smlua_func_is_item_in_array);
|
|
smlua_bind_function(L, "bhv_init_room", smlua_func_bhv_init_room);
|
|
smlua_bind_function(L, "cur_obj_enable_rendering_if_mario_in_room", smlua_func_cur_obj_enable_rendering_if_mario_in_room);
|
|
smlua_bind_function(L, "cur_obj_set_hitbox_and_die_if_attacked", smlua_func_cur_obj_set_hitbox_and_die_if_attacked);
|
|
smlua_bind_function(L, "obj_explode_and_spawn_coins", smlua_func_obj_explode_and_spawn_coins);
|
|
//smlua_bind_function(L, "obj_set_collision_data", smlua_func_obj_set_collision_data); <--- UNIMPLEMENTED
|
|
smlua_bind_function(L, "cur_obj_if_hit_wall_bounce_away", smlua_func_cur_obj_if_hit_wall_bounce_away);
|
|
smlua_bind_function(L, "cur_obj_hide_if_mario_far_away_y", smlua_func_cur_obj_hide_if_mario_far_away_y);
|
|
//smlua_bind_function(L, "geo_offset_klepto_held_object", smlua_func_geo_offset_klepto_held_object); <--- UNIMPLEMENTED
|
|
//smlua_bind_function(L, "geo_offset_klepto_debug", smlua_func_geo_offset_klepto_debug); <--- UNIMPLEMENTED
|
|
smlua_bind_function(L, "obj_is_hidden", smlua_func_obj_is_hidden);
|
|
smlua_bind_function(L, "enable_time_stop", smlua_func_enable_time_stop);
|
|
smlua_bind_function(L, "enable_time_stop_if_alone", smlua_func_enable_time_stop_if_alone);
|
|
smlua_bind_function(L, "disable_time_stop", smlua_func_disable_time_stop);
|
|
smlua_bind_function(L, "set_time_stop_flags", smlua_func_set_time_stop_flags);
|
|
smlua_bind_function(L, "set_time_stop_flags_if_alone", smlua_func_set_time_stop_flags_if_alone);
|
|
smlua_bind_function(L, "clear_time_stop_flags", smlua_func_clear_time_stop_flags);
|
|
smlua_bind_function(L, "cur_obj_can_mario_activate_textbox", smlua_func_cur_obj_can_mario_activate_textbox);
|
|
smlua_bind_function(L, "cur_obj_can_mario_activate_textbox_2", smlua_func_cur_obj_can_mario_activate_textbox_2);
|
|
smlua_bind_function(L, "cur_obj_end_dialog", smlua_func_cur_obj_end_dialog);
|
|
smlua_bind_function(L, "cur_obj_has_model", smlua_func_cur_obj_has_model);
|
|
smlua_bind_function(L, "cur_obj_align_gfx_with_floor", smlua_func_cur_obj_align_gfx_with_floor);
|
|
smlua_bind_function(L, "mario_is_within_rectangle", smlua_func_mario_is_within_rectangle);
|
|
smlua_bind_function(L, "cur_obj_shake_screen", smlua_func_cur_obj_shake_screen);
|
|
smlua_bind_function(L, "obj_attack_collided_from_other_object", smlua_func_obj_attack_collided_from_other_object);
|
|
smlua_bind_function(L, "cur_obj_was_attacked_or_ground_pounded", smlua_func_cur_obj_was_attacked_or_ground_pounded);
|
|
smlua_bind_function(L, "obj_copy_behavior_params", smlua_func_obj_copy_behavior_params);
|
|
smlua_bind_function(L, "cur_obj_init_animation_and_anim_frame", smlua_func_cur_obj_init_animation_and_anim_frame);
|
|
smlua_bind_function(L, "cur_obj_init_animation_and_check_if_near_end", smlua_func_cur_obj_init_animation_and_check_if_near_end);
|
|
smlua_bind_function(L, "cur_obj_init_animation_and_extend_if_at_end", smlua_func_cur_obj_init_animation_and_extend_if_at_end);
|
|
smlua_bind_function(L, "cur_obj_check_grabbed_mario", smlua_func_cur_obj_check_grabbed_mario);
|
|
smlua_bind_function(L, "player_performed_grab_escape_action", smlua_func_player_performed_grab_escape_action);
|
|
smlua_bind_function(L, "cur_obj_unused_play_footstep_sound", smlua_func_cur_obj_unused_play_footstep_sound);
|
|
smlua_bind_function(L, "enable_time_stop_including_mario", smlua_func_enable_time_stop_including_mario);
|
|
smlua_bind_function(L, "disable_time_stop_including_mario", smlua_func_disable_time_stop_including_mario);
|
|
smlua_bind_function(L, "cur_obj_check_interacted", smlua_func_cur_obj_check_interacted);
|
|
smlua_bind_function(L, "cur_obj_spawn_loot_blue_coin", smlua_func_cur_obj_spawn_loot_blue_coin);
|
|
#ifndef VERSION_JP
|
|
smlua_bind_function(L, "cur_obj_spawn_star_at_y_offset", smlua_func_cur_obj_spawn_star_at_y_offset);
|
|
#endif
|
|
smlua_bind_function(L, "cur_obj_set_home_once", smlua_func_cur_obj_set_home_once);
|
|
smlua_bind_function(L, "get_trajectory_length", smlua_func_get_trajectory_length);
|
|
|
|
// object_list_processor.h
|
|
smlua_bind_function(L, "set_object_respawn_info_bits", smlua_func_set_object_respawn_info_bits);
|
|
|
|
// platform_displacement.h
|
|
smlua_bind_function(L, "apply_platform_displacement", smlua_func_apply_platform_displacement);
|
|
|
|
// rumble_init.h
|
|
smlua_bind_function(L, "queue_rumble_data", smlua_func_queue_rumble_data);
|
|
smlua_bind_function(L, "queue_rumble_data_object", smlua_func_queue_rumble_data_object);
|
|
smlua_bind_function(L, "queue_rumble_data_mario", smlua_func_queue_rumble_data_mario);
|
|
smlua_bind_function(L, "reset_rumble_timers", smlua_func_reset_rumble_timers);
|
|
smlua_bind_function(L, "reset_rumble_timers_2", smlua_func_reset_rumble_timers_2);
|
|
|
|
// save_file.h
|
|
smlua_bind_function(L, "get_level_num_from_course_num", smlua_func_get_level_num_from_course_num);
|
|
smlua_bind_function(L, "get_level_course_num", smlua_func_get_level_course_num);
|
|
smlua_bind_function(L, "touch_coin_score_age", smlua_func_touch_coin_score_age);
|
|
smlua_bind_function(L, "save_file_do_save", smlua_func_save_file_do_save);
|
|
smlua_bind_function(L, "save_file_erase", smlua_func_save_file_erase);
|
|
smlua_bind_function(L, "save_file_erase_current_backup_save", smlua_func_save_file_erase_current_backup_save);
|
|
smlua_bind_function(L, "save_file_reload", smlua_func_save_file_reload);
|
|
smlua_bind_function(L, "save_file_get_max_coin_score", smlua_func_save_file_get_max_coin_score);
|
|
smlua_bind_function(L, "save_file_get_course_star_count", smlua_func_save_file_get_course_star_count);
|
|
smlua_bind_function(L, "save_file_get_total_star_count", smlua_func_save_file_get_total_star_count);
|
|
smlua_bind_function(L, "save_file_set_flags", smlua_func_save_file_set_flags);
|
|
smlua_bind_function(L, "save_file_clear_flags", smlua_func_save_file_clear_flags);
|
|
smlua_bind_function(L, "save_file_get_flags", smlua_func_save_file_get_flags);
|
|
smlua_bind_function(L, "save_file_get_star_flags", smlua_func_save_file_get_star_flags);
|
|
smlua_bind_function(L, "save_file_set_star_flags", smlua_func_save_file_set_star_flags);
|
|
smlua_bind_function(L, "save_file_remove_star_flags", smlua_func_save_file_remove_star_flags);
|
|
smlua_bind_function(L, "save_file_get_course_coin_score", smlua_func_save_file_get_course_coin_score);
|
|
smlua_bind_function(L, "save_file_set_course_coin_score", smlua_func_save_file_set_course_coin_score);
|
|
smlua_bind_function(L, "save_file_is_cannon_unlocked", smlua_func_save_file_is_cannon_unlocked);
|
|
smlua_bind_function(L, "save_file_get_cap_pos", smlua_func_save_file_get_cap_pos);
|
|
smlua_bind_function(L, "save_file_get_sound_mode", smlua_func_save_file_get_sound_mode);
|
|
|
|
// seqplayer.h
|
|
smlua_bind_function(L, "sequence_player_get_tempo", smlua_func_sequence_player_get_tempo);
|
|
smlua_bind_function(L, "sequence_player_set_tempo", smlua_func_sequence_player_set_tempo);
|
|
smlua_bind_function(L, "sequence_player_get_tempo_acc", smlua_func_sequence_player_get_tempo_acc);
|
|
smlua_bind_function(L, "sequence_player_set_tempo_acc", smlua_func_sequence_player_set_tempo_acc);
|
|
smlua_bind_function(L, "sequence_player_get_transposition", smlua_func_sequence_player_get_transposition);
|
|
smlua_bind_function(L, "sequence_player_set_transposition", smlua_func_sequence_player_set_transposition);
|
|
smlua_bind_function(L, "sequence_player_get_volume", smlua_func_sequence_player_get_volume);
|
|
smlua_bind_function(L, "sequence_player_get_fade_volume", smlua_func_sequence_player_get_fade_volume);
|
|
smlua_bind_function(L, "sequence_player_get_mute_volume_scale", smlua_func_sequence_player_get_mute_volume_scale);
|
|
|
|
// smlua_anim_utils.h
|
|
smlua_bind_function(L, "get_mario_vanilla_animation", smlua_func_get_mario_vanilla_animation);
|
|
smlua_bind_function(L, "smlua_anim_util_set_animation", smlua_func_smlua_anim_util_set_animation);
|
|
smlua_bind_function(L, "smlua_anim_util_get_current_animation_name", smlua_func_smlua_anim_util_get_current_animation_name);
|
|
|
|
// smlua_audio_utils.h
|
|
smlua_bind_function(L, "smlua_audio_utils_reset_all", smlua_func_smlua_audio_utils_reset_all);
|
|
smlua_bind_function(L, "smlua_audio_utils_replace_sequence", smlua_func_smlua_audio_utils_replace_sequence);
|
|
smlua_bind_function(L, "audio_stream_load", smlua_func_audio_stream_load);
|
|
smlua_bind_function(L, "audio_stream_destroy", smlua_func_audio_stream_destroy);
|
|
smlua_bind_function(L, "audio_stream_play", smlua_func_audio_stream_play);
|
|
smlua_bind_function(L, "audio_stream_pause", smlua_func_audio_stream_pause);
|
|
smlua_bind_function(L, "audio_stream_stop", smlua_func_audio_stream_stop);
|
|
smlua_bind_function(L, "audio_stream_get_position", smlua_func_audio_stream_get_position);
|
|
smlua_bind_function(L, "audio_stream_set_position", smlua_func_audio_stream_set_position);
|
|
smlua_bind_function(L, "audio_stream_get_looping", smlua_func_audio_stream_get_looping);
|
|
smlua_bind_function(L, "audio_stream_set_looping", smlua_func_audio_stream_set_looping);
|
|
smlua_bind_function(L, "audio_stream_set_loop_points", smlua_func_audio_stream_set_loop_points);
|
|
smlua_bind_function(L, "audio_stream_get_frequency", smlua_func_audio_stream_get_frequency);
|
|
smlua_bind_function(L, "audio_stream_set_frequency", smlua_func_audio_stream_set_frequency);
|
|
smlua_bind_function(L, "audio_stream_get_volume", smlua_func_audio_stream_get_volume);
|
|
smlua_bind_function(L, "audio_stream_set_volume", smlua_func_audio_stream_set_volume);
|
|
smlua_bind_function(L, "audio_sample_load", smlua_func_audio_sample_load);
|
|
smlua_bind_function(L, "audio_sample_destroy", smlua_func_audio_sample_destroy);
|
|
smlua_bind_function(L, "audio_sample_stop", smlua_func_audio_sample_stop);
|
|
smlua_bind_function(L, "audio_sample_play", smlua_func_audio_sample_play);
|
|
smlua_bind_function(L, "allocate_sequence", smlua_func_allocate_sequence);
|
|
|
|
// smlua_camera_utils.h
|
|
smlua_bind_function(L, "camera_reset_overrides", smlua_func_camera_reset_overrides);
|
|
smlua_bind_function(L, "camera_freeze", smlua_func_camera_freeze);
|
|
smlua_bind_function(L, "camera_unfreeze", smlua_func_camera_unfreeze);
|
|
smlua_bind_function(L, "camera_is_frozen", smlua_func_camera_is_frozen);
|
|
smlua_bind_function(L, "camera_romhack_allow_only_mods", smlua_func_camera_romhack_allow_only_mods);
|
|
smlua_bind_function(L, "camera_set_romhack_override", smlua_func_camera_set_romhack_override);
|
|
smlua_bind_function(L, "camera_romhack_allow_centering", smlua_func_camera_romhack_allow_centering);
|
|
smlua_bind_function(L, "camera_allow_toxic_gas_camera", smlua_func_camera_allow_toxic_gas_camera);
|
|
smlua_bind_function(L, "camera_romhack_allow_dpad_usage", smlua_func_camera_romhack_allow_dpad_usage);
|
|
smlua_bind_function(L, "rom_hack_cam_set_collisions", smlua_func_rom_hack_cam_set_collisions);
|
|
smlua_bind_function(L, "camera_romhack_set_zoomed_in_dist", smlua_func_camera_romhack_set_zoomed_in_dist);
|
|
smlua_bind_function(L, "camera_romhack_set_zoomed_out_dist", smlua_func_camera_romhack_set_zoomed_out_dist);
|
|
smlua_bind_function(L, "camera_romhack_set_zoomed_in_height", smlua_func_camera_romhack_set_zoomed_in_height);
|
|
smlua_bind_function(L, "camera_romhack_set_zoomed_out_height", smlua_func_camera_romhack_set_zoomed_out_height);
|
|
smlua_bind_function(L, "camera_romhack_get_zoomed_in_dist", smlua_func_camera_romhack_get_zoomed_in_dist);
|
|
smlua_bind_function(L, "camera_romhack_get_zoomed_out_dist", smlua_func_camera_romhack_get_zoomed_out_dist);
|
|
smlua_bind_function(L, "camera_romhack_get_zoomed_in_height", smlua_func_camera_romhack_get_zoomed_in_height);
|
|
smlua_bind_function(L, "camera_romhack_get_zoomed_out_height", smlua_func_camera_romhack_get_zoomed_out_height);
|
|
smlua_bind_function(L, "camera_get_romhack_override", smlua_func_camera_get_romhack_override);
|
|
smlua_bind_function(L, "camera_romhack_get_allow_centering", smlua_func_camera_romhack_get_allow_centering);
|
|
smlua_bind_function(L, "camera_get_allow_toxic_gas_camera", smlua_func_camera_get_allow_toxic_gas_camera);
|
|
smlua_bind_function(L, "camera_romhack_get_allow_dpad_usage", smlua_func_camera_romhack_get_allow_dpad_usage);
|
|
smlua_bind_function(L, "camera_romhack_get_collisions", smlua_func_camera_romhack_get_collisions);
|
|
smlua_bind_function(L, "camera_config_is_free_cam_enabled", smlua_func_camera_config_is_free_cam_enabled);
|
|
smlua_bind_function(L, "camera_config_is_analog_cam_enabled", smlua_func_camera_config_is_analog_cam_enabled);
|
|
smlua_bind_function(L, "camera_config_is_dpad_enabled", smlua_func_camera_config_is_dpad_enabled);
|
|
smlua_bind_function(L, "camera_config_is_collision_enabled", smlua_func_camera_config_is_collision_enabled);
|
|
smlua_bind_function(L, "camera_config_is_mouse_look_enabled", smlua_func_camera_config_is_mouse_look_enabled);
|
|
smlua_bind_function(L, "camera_config_is_x_inverted", smlua_func_camera_config_is_x_inverted);
|
|
smlua_bind_function(L, "camera_config_is_y_inverted", smlua_func_camera_config_is_y_inverted);
|
|
smlua_bind_function(L, "camera_config_get_x_sensitivity", smlua_func_camera_config_get_x_sensitivity);
|
|
smlua_bind_function(L, "camera_config_get_y_sensitivity", smlua_func_camera_config_get_y_sensitivity);
|
|
smlua_bind_function(L, "camera_config_get_aggression", smlua_func_camera_config_get_aggression);
|
|
smlua_bind_function(L, "camera_config_get_pan_level", smlua_func_camera_config_get_pan_level);
|
|
smlua_bind_function(L, "camera_config_get_deceleration", smlua_func_camera_config_get_deceleration);
|
|
smlua_bind_function(L, "camera_config_get_centering", smlua_func_camera_config_get_centering);
|
|
smlua_bind_function(L, "camera_config_enable_free_cam", smlua_func_camera_config_enable_free_cam);
|
|
smlua_bind_function(L, "camera_config_enable_analog_cam", smlua_func_camera_config_enable_analog_cam);
|
|
smlua_bind_function(L, "camera_config_enable_centering", smlua_func_camera_config_enable_centering);
|
|
smlua_bind_function(L, "camera_config_enable_dpad", smlua_func_camera_config_enable_dpad);
|
|
smlua_bind_function(L, "camera_config_enable_collisions", smlua_func_camera_config_enable_collisions);
|
|
smlua_bind_function(L, "camera_config_enable_mouse_look", smlua_func_camera_config_enable_mouse_look);
|
|
smlua_bind_function(L, "camera_config_invert_x", smlua_func_camera_config_invert_x);
|
|
smlua_bind_function(L, "camera_config_invert_y", smlua_func_camera_config_invert_y);
|
|
smlua_bind_function(L, "camera_config_set_x_sensitivity", smlua_func_camera_config_set_x_sensitivity);
|
|
smlua_bind_function(L, "camera_config_set_y_sensitivity", smlua_func_camera_config_set_y_sensitivity);
|
|
smlua_bind_function(L, "camera_config_set_aggression", smlua_func_camera_config_set_aggression);
|
|
smlua_bind_function(L, "camera_config_set_pan_level", smlua_func_camera_config_set_pan_level);
|
|
smlua_bind_function(L, "camera_config_set_deceleration", smlua_func_camera_config_set_deceleration);
|
|
smlua_bind_function(L, "camera_get_checking_surfaces", smlua_func_camera_get_checking_surfaces);
|
|
smlua_bind_function(L, "camera_set_checking_surfaces", smlua_func_camera_set_checking_surfaces);
|
|
|
|
// smlua_collision_utils.h
|
|
smlua_bind_function(L, "collision_find_floor", smlua_func_collision_find_floor);
|
|
smlua_bind_function(L, "collision_find_ceil", smlua_func_collision_find_ceil);
|
|
smlua_bind_function(L, "get_water_surface_pseudo_floor", smlua_func_get_water_surface_pseudo_floor);
|
|
smlua_bind_function(L, "smlua_collision_util_get", smlua_func_smlua_collision_util_get);
|
|
smlua_bind_function(L, "collision_get_temp_wall_collision_data", smlua_func_collision_get_temp_wall_collision_data);
|
|
smlua_bind_function(L, "get_surface_from_wcd_index", smlua_func_get_surface_from_wcd_index);
|
|
smlua_bind_function(L, "smlua_collision_util_get_current_terrain_collision", smlua_func_smlua_collision_util_get_current_terrain_collision);
|
|
smlua_bind_function(L, "smlua_collision_util_get_level_collision", smlua_func_smlua_collision_util_get_level_collision);
|
|
smlua_bind_function(L, "smlua_collision_util_find_surface_types", smlua_func_smlua_collision_util_find_surface_types);
|
|
smlua_bind_function(L, "surface_is_quicksand", smlua_func_surface_is_quicksand);
|
|
smlua_bind_function(L, "surface_is_not_hard", smlua_func_surface_is_not_hard);
|
|
smlua_bind_function(L, "surface_is_painting_warp", smlua_func_surface_is_painting_warp);
|
|
|
|
// smlua_deprecated.h
|
|
smlua_bind_function(L, "djui_hud_set_render_behind_hud", smlua_func_djui_hud_set_render_behind_hud);
|
|
smlua_bind_function(L, "audio_stream_get_tempo", smlua_func_audio_stream_get_tempo);
|
|
smlua_bind_function(L, "audio_stream_set_tempo", smlua_func_audio_stream_set_tempo);
|
|
smlua_bind_function(L, "audio_stream_set_speed", smlua_func_audio_stream_set_speed);
|
|
smlua_bind_function(L, "network_player_color_to_palette", smlua_func_network_player_color_to_palette);
|
|
smlua_bind_function(L, "network_player_palette_to_color", smlua_func_network_player_palette_to_color);
|
|
|
|
// smlua_gfx_utils.h
|
|
smlua_bind_function(L, "set_override_fov", smlua_func_set_override_fov);
|
|
smlua_bind_function(L, "set_override_near", smlua_func_set_override_near);
|
|
smlua_bind_function(L, "set_override_far", smlua_func_set_override_far);
|
|
smlua_bind_function(L, "get_lighting_dir", smlua_func_get_lighting_dir);
|
|
smlua_bind_function(L, "set_lighting_dir", smlua_func_set_lighting_dir);
|
|
smlua_bind_function(L, "get_lighting_color", smlua_func_get_lighting_color);
|
|
smlua_bind_function(L, "get_lighting_color_ambient", smlua_func_get_lighting_color_ambient);
|
|
smlua_bind_function(L, "set_lighting_color", smlua_func_set_lighting_color);
|
|
smlua_bind_function(L, "set_lighting_color_ambient", smlua_func_set_lighting_color_ambient);
|
|
smlua_bind_function(L, "get_vertex_color", smlua_func_get_vertex_color);
|
|
smlua_bind_function(L, "set_vertex_color", smlua_func_set_vertex_color);
|
|
smlua_bind_function(L, "get_fog_color", smlua_func_get_fog_color);
|
|
smlua_bind_function(L, "set_fog_color", smlua_func_set_fog_color);
|
|
smlua_bind_function(L, "get_fog_intensity", smlua_func_get_fog_intensity);
|
|
smlua_bind_function(L, "set_fog_intensity", smlua_func_set_fog_intensity);
|
|
smlua_bind_function(L, "get_skybox", smlua_func_get_skybox);
|
|
smlua_bind_function(L, "set_override_skybox", smlua_func_set_override_skybox);
|
|
smlua_bind_function(L, "get_skybox_color", smlua_func_get_skybox_color);
|
|
smlua_bind_function(L, "set_skybox_color", smlua_func_set_skybox_color);
|
|
smlua_bind_function(L, "gfx_parse", smlua_func_gfx_parse);
|
|
smlua_bind_function(L, "gfx_get_op", smlua_func_gfx_get_op);
|
|
smlua_bind_function(L, "gfx_get_display_list", smlua_func_gfx_get_display_list);
|
|
smlua_bind_function(L, "gfx_get_vertex_buffer", smlua_func_gfx_get_vertex_buffer);
|
|
smlua_bind_function(L, "gfx_get_vertex_count", smlua_func_gfx_get_vertex_count);
|
|
smlua_bind_function(L, "gfx_get_texture", smlua_func_gfx_get_texture);
|
|
smlua_bind_function(L, "gfx_get_length", smlua_func_gfx_get_length);
|
|
smlua_bind_function(L, "gfx_get_command", smlua_func_gfx_get_command);
|
|
smlua_bind_function(L, "gfx_get_next_command", smlua_func_gfx_get_next_command);
|
|
smlua_bind_function(L, "gfx_copy", smlua_func_gfx_copy);
|
|
smlua_bind_function(L, "gfx_create", smlua_func_gfx_create);
|
|
smlua_bind_function(L, "gfx_resize", smlua_func_gfx_resize);
|
|
smlua_bind_function(L, "gfx_delete", smlua_func_gfx_delete);
|
|
smlua_bind_function(L, "gfx_delete_all", smlua_func_gfx_delete_all);
|
|
smlua_bind_function(L, "vtx_get_count", smlua_func_vtx_get_count);
|
|
smlua_bind_function(L, "vtx_get_vertex", smlua_func_vtx_get_vertex);
|
|
smlua_bind_function(L, "vtx_get_next_vertex", smlua_func_vtx_get_next_vertex);
|
|
smlua_bind_function(L, "vtx_copy", smlua_func_vtx_copy);
|
|
smlua_bind_function(L, "vtx_create", smlua_func_vtx_create);
|
|
smlua_bind_function(L, "vtx_resize", smlua_func_vtx_resize);
|
|
smlua_bind_function(L, "vtx_delete", smlua_func_vtx_delete);
|
|
smlua_bind_function(L, "vtx_delete_all", smlua_func_vtx_delete_all);
|
|
|
|
// smlua_level_utils.h
|
|
smlua_bind_function(L, "smlua_level_util_change_area", smlua_func_smlua_level_util_change_area);
|
|
smlua_bind_function(L, "smlua_level_util_get_info", smlua_func_smlua_level_util_get_info);
|
|
smlua_bind_function(L, "smlua_level_util_get_info_from_short_name", smlua_func_smlua_level_util_get_info_from_short_name);
|
|
smlua_bind_function(L, "smlua_level_util_get_info_from_course_num", smlua_func_smlua_level_util_get_info_from_course_num);
|
|
smlua_bind_function(L, "level_register", smlua_func_level_register);
|
|
smlua_bind_function(L, "level_is_vanilla_level", smlua_func_level_is_vanilla_level);
|
|
smlua_bind_function(L, "warp_to_warpnode", smlua_func_warp_to_warpnode);
|
|
smlua_bind_function(L, "warp_to_level", smlua_func_warp_to_level);
|
|
smlua_bind_function(L, "warp_restart_level", smlua_func_warp_restart_level);
|
|
smlua_bind_function(L, "warp_to_start_level", smlua_func_warp_to_start_level);
|
|
smlua_bind_function(L, "warp_exit_level", smlua_func_warp_exit_level);
|
|
smlua_bind_function(L, "warp_to_castle", smlua_func_warp_to_castle);
|
|
|
|
// smlua_misc_utils.h
|
|
smlua_bind_function(L, "get_network_area_timer", smlua_func_get_network_area_timer);
|
|
smlua_bind_function(L, "get_area_update_counter", smlua_func_get_area_update_counter);
|
|
smlua_bind_function(L, "get_temp_s32_pointer", smlua_func_get_temp_s32_pointer);
|
|
smlua_bind_function(L, "deref_s32_pointer", smlua_func_deref_s32_pointer);
|
|
smlua_bind_function(L, "djui_popup_create_global", smlua_func_djui_popup_create_global);
|
|
smlua_bind_function(L, "djui_is_popup_disabled", smlua_func_djui_is_popup_disabled);
|
|
smlua_bind_function(L, "djui_set_popup_disabled_override", smlua_func_djui_set_popup_disabled_override);
|
|
smlua_bind_function(L, "djui_reset_popup_disabled_override", smlua_func_djui_reset_popup_disabled_override);
|
|
smlua_bind_function(L, "djui_is_playerlist_open", smlua_func_djui_is_playerlist_open);
|
|
smlua_bind_function(L, "djui_attempting_to_open_playerlist", smlua_func_djui_attempting_to_open_playerlist);
|
|
smlua_bind_function(L, "djui_get_playerlist_page_index", smlua_func_djui_get_playerlist_page_index);
|
|
smlua_bind_function(L, "djui_menu_get_font", smlua_func_djui_menu_get_font);
|
|
smlua_bind_function(L, "djui_menu_get_theme", smlua_func_djui_menu_get_theme);
|
|
smlua_bind_function(L, "get_dialog_box_state", smlua_func_get_dialog_box_state);
|
|
smlua_bind_function(L, "get_dialog_id", smlua_func_get_dialog_id);
|
|
smlua_bind_function(L, "get_last_star_or_key", smlua_func_get_last_star_or_key);
|
|
smlua_bind_function(L, "set_last_star_or_key", smlua_func_set_last_star_or_key);
|
|
smlua_bind_function(L, "get_last_completed_course_num", smlua_func_get_last_completed_course_num);
|
|
smlua_bind_function(L, "set_last_completed_course_num", smlua_func_set_last_completed_course_num);
|
|
smlua_bind_function(L, "get_last_completed_star_num", smlua_func_get_last_completed_star_num);
|
|
smlua_bind_function(L, "set_last_completed_star_num", smlua_func_set_last_completed_star_num);
|
|
smlua_bind_function(L, "get_got_file_coin_hi_score", smlua_func_get_got_file_coin_hi_score);
|
|
smlua_bind_function(L, "set_got_file_coin_hi_score", smlua_func_set_got_file_coin_hi_score);
|
|
smlua_bind_function(L, "get_save_file_modified", smlua_func_get_save_file_modified);
|
|
smlua_bind_function(L, "set_save_file_modified", smlua_func_set_save_file_modified);
|
|
smlua_bind_function(L, "hud_hide", smlua_func_hud_hide);
|
|
smlua_bind_function(L, "hud_show", smlua_func_hud_show);
|
|
smlua_bind_function(L, "hud_is_hidden", smlua_func_hud_is_hidden);
|
|
smlua_bind_function(L, "hud_get_value", smlua_func_hud_get_value);
|
|
smlua_bind_function(L, "hud_set_value", smlua_func_hud_set_value);
|
|
smlua_bind_function(L, "hud_render_power_meter", smlua_func_hud_render_power_meter);
|
|
smlua_bind_function(L, "hud_render_power_meter_interpolated", smlua_func_hud_render_power_meter_interpolated);
|
|
smlua_bind_function(L, "hud_get_flash", smlua_func_hud_get_flash);
|
|
smlua_bind_function(L, "hud_set_flash", smlua_func_hud_set_flash);
|
|
smlua_bind_function(L, "is_game_paused", smlua_func_is_game_paused);
|
|
smlua_bind_function(L, "is_transition_playing", smlua_func_is_transition_playing);
|
|
smlua_bind_function(L, "allocate_mario_action", smlua_func_allocate_mario_action);
|
|
smlua_bind_function(L, "get_hand_foot_pos_x", smlua_func_get_hand_foot_pos_x);
|
|
smlua_bind_function(L, "get_hand_foot_pos_y", smlua_func_get_hand_foot_pos_y);
|
|
smlua_bind_function(L, "get_hand_foot_pos_z", smlua_func_get_hand_foot_pos_z);
|
|
smlua_bind_function(L, "get_mario_anim_part_pos", smlua_func_get_mario_anim_part_pos);
|
|
smlua_bind_function(L, "get_current_save_file_num", smlua_func_get_current_save_file_num);
|
|
smlua_bind_function(L, "save_file_get_using_backup_slot", smlua_func_save_file_get_using_backup_slot);
|
|
smlua_bind_function(L, "save_file_set_using_backup_slot", smlua_func_save_file_set_using_backup_slot);
|
|
smlua_bind_function(L, "movtexqc_register", smlua_func_movtexqc_register);
|
|
smlua_bind_function(L, "get_water_level", smlua_func_get_water_level);
|
|
smlua_bind_function(L, "set_water_level", smlua_func_set_water_level);
|
|
smlua_bind_function(L, "course_is_main_course", smlua_func_course_is_main_course);
|
|
smlua_bind_function(L, "get_ttc_speed_setting", smlua_func_get_ttc_speed_setting);
|
|
smlua_bind_function(L, "set_ttc_speed_setting", smlua_func_set_ttc_speed_setting);
|
|
smlua_bind_function(L, "get_time", smlua_func_get_time);
|
|
smlua_bind_function(L, "get_date_and_time", smlua_func_get_date_and_time);
|
|
smlua_bind_function(L, "get_envfx", smlua_func_get_envfx);
|
|
smlua_bind_function(L, "set_override_envfx", smlua_func_set_override_envfx);
|
|
smlua_bind_function(L, "get_global_timer", smlua_func_get_global_timer);
|
|
smlua_bind_function(L, "get_dialog_response", smlua_func_get_dialog_response);
|
|
smlua_bind_function(L, "get_local_discord_id", smlua_func_get_local_discord_id);
|
|
smlua_bind_function(L, "get_coopnet_id", smlua_func_get_coopnet_id);
|
|
smlua_bind_function(L, "get_volume_master", smlua_func_get_volume_master);
|
|
smlua_bind_function(L, "get_volume_level", smlua_func_get_volume_level);
|
|
smlua_bind_function(L, "get_volume_sfx", smlua_func_get_volume_sfx);
|
|
smlua_bind_function(L, "get_volume_env", smlua_func_get_volume_env);
|
|
smlua_bind_function(L, "set_volume_master", smlua_func_set_volume_master);
|
|
smlua_bind_function(L, "set_volume_level", smlua_func_set_volume_level);
|
|
smlua_bind_function(L, "set_volume_sfx", smlua_func_set_volume_sfx);
|
|
smlua_bind_function(L, "set_volume_env", smlua_func_set_volume_env);
|
|
smlua_bind_function(L, "get_environment_region", smlua_func_get_environment_region);
|
|
smlua_bind_function(L, "set_environment_region", smlua_func_set_environment_region);
|
|
smlua_bind_function(L, "mod_file_exists", smlua_func_mod_file_exists);
|
|
smlua_bind_function(L, "get_active_mod", smlua_func_get_active_mod);
|
|
smlua_bind_function(L, "set_window_title", smlua_func_set_window_title);
|
|
smlua_bind_function(L, "reset_window_title", smlua_func_reset_window_title);
|
|
smlua_bind_function(L, "get_os_name", smlua_func_get_os_name);
|
|
smlua_bind_function(L, "geo_get_current_root", smlua_func_geo_get_current_root);
|
|
smlua_bind_function(L, "geo_get_current_master_list", smlua_func_geo_get_current_master_list);
|
|
smlua_bind_function(L, "geo_get_current_perspective", smlua_func_geo_get_current_perspective);
|
|
smlua_bind_function(L, "geo_get_current_camera", smlua_func_geo_get_current_camera);
|
|
smlua_bind_function(L, "geo_get_current_held_object", smlua_func_geo_get_current_held_object);
|
|
smlua_bind_function(L, "texture_to_lua_table", smlua_func_texture_to_lua_table);
|
|
|
|
// smlua_model_utils.h
|
|
smlua_bind_function(L, "smlua_model_util_get_id", smlua_func_smlua_model_util_get_id);
|
|
|
|
// smlua_obj_utils.h
|
|
smlua_bind_function(L, "spawn_sync_object", smlua_func_spawn_sync_object);
|
|
smlua_bind_function(L, "spawn_non_sync_object", smlua_func_spawn_non_sync_object);
|
|
smlua_bind_function(L, "obj_has_behavior_id", smlua_func_obj_has_behavior_id);
|
|
smlua_bind_function(L, "obj_has_model_extended", smlua_func_obj_has_model_extended);
|
|
smlua_bind_function(L, "obj_get_model_id_extended", smlua_func_obj_get_model_id_extended);
|
|
smlua_bind_function(L, "obj_set_model_extended", smlua_func_obj_set_model_extended);
|
|
smlua_bind_function(L, "get_trajectory", smlua_func_get_trajectory);
|
|
smlua_bind_function(L, "geo_get_current_object", smlua_func_geo_get_current_object);
|
|
smlua_bind_function(L, "get_current_object", smlua_func_get_current_object);
|
|
smlua_bind_function(L, "get_dialog_object", smlua_func_get_dialog_object);
|
|
smlua_bind_function(L, "get_cutscene_focus", smlua_func_get_cutscene_focus);
|
|
smlua_bind_function(L, "get_secondary_camera_focus", smlua_func_get_secondary_camera_focus);
|
|
smlua_bind_function(L, "set_cutscene_focus", smlua_func_set_cutscene_focus);
|
|
smlua_bind_function(L, "set_secondary_camera_focus", smlua_func_set_secondary_camera_focus);
|
|
smlua_bind_function(L, "obj_get_first", smlua_func_obj_get_first);
|
|
smlua_bind_function(L, "obj_get_first_with_behavior_id", smlua_func_obj_get_first_with_behavior_id);
|
|
smlua_bind_function(L, "obj_get_first_with_behavior_id_and_field_s32", smlua_func_obj_get_first_with_behavior_id_and_field_s32);
|
|
smlua_bind_function(L, "obj_get_first_with_behavior_id_and_field_f32", smlua_func_obj_get_first_with_behavior_id_and_field_f32);
|
|
smlua_bind_function(L, "obj_get_next", smlua_func_obj_get_next);
|
|
smlua_bind_function(L, "obj_get_next_with_same_behavior_id", smlua_func_obj_get_next_with_same_behavior_id);
|
|
smlua_bind_function(L, "obj_get_next_with_same_behavior_id_and_field_s32", smlua_func_obj_get_next_with_same_behavior_id_and_field_s32);
|
|
smlua_bind_function(L, "obj_get_next_with_same_behavior_id_and_field_f32", smlua_func_obj_get_next_with_same_behavior_id_and_field_f32);
|
|
smlua_bind_function(L, "obj_get_nearest_object_with_behavior_id", smlua_func_obj_get_nearest_object_with_behavior_id);
|
|
smlua_bind_function(L, "obj_count_objects_with_behavior_id", smlua_func_obj_count_objects_with_behavior_id);
|
|
smlua_bind_function(L, "obj_get_collided_object", smlua_func_obj_get_collided_object);
|
|
smlua_bind_function(L, "obj_get_field_u32", smlua_func_obj_get_field_u32);
|
|
smlua_bind_function(L, "obj_get_field_s32", smlua_func_obj_get_field_s32);
|
|
smlua_bind_function(L, "obj_get_field_f32", smlua_func_obj_get_field_f32);
|
|
smlua_bind_function(L, "obj_get_field_s16", smlua_func_obj_get_field_s16);
|
|
smlua_bind_function(L, "obj_set_field_u32", smlua_func_obj_set_field_u32);
|
|
smlua_bind_function(L, "obj_set_field_s32", smlua_func_obj_set_field_s32);
|
|
smlua_bind_function(L, "obj_set_field_f32", smlua_func_obj_set_field_f32);
|
|
smlua_bind_function(L, "obj_set_field_s16", smlua_func_obj_set_field_s16);
|
|
smlua_bind_function(L, "obj_get_temp_spawn_particles_info", smlua_func_obj_get_temp_spawn_particles_info);
|
|
smlua_bind_function(L, "get_temp_object_hitbox", smlua_func_get_temp_object_hitbox);
|
|
smlua_bind_function(L, "obj_is_attackable", smlua_func_obj_is_attackable);
|
|
smlua_bind_function(L, "obj_is_breakable_object", smlua_func_obj_is_breakable_object);
|
|
smlua_bind_function(L, "obj_is_bully", smlua_func_obj_is_bully);
|
|
smlua_bind_function(L, "obj_is_coin", smlua_func_obj_is_coin);
|
|
smlua_bind_function(L, "obj_is_exclamation_box", smlua_func_obj_is_exclamation_box);
|
|
smlua_bind_function(L, "obj_is_grabbable", smlua_func_obj_is_grabbable);
|
|
smlua_bind_function(L, "obj_is_mushroom_1up", smlua_func_obj_is_mushroom_1up);
|
|
smlua_bind_function(L, "obj_is_secret", smlua_func_obj_is_secret);
|
|
smlua_bind_function(L, "obj_is_valid_for_interaction", smlua_func_obj_is_valid_for_interaction);
|
|
smlua_bind_function(L, "obj_check_hitbox_overlap", smlua_func_obj_check_hitbox_overlap);
|
|
smlua_bind_function(L, "obj_check_overlap_with_hitbox_params", smlua_func_obj_check_overlap_with_hitbox_params);
|
|
smlua_bind_function(L, "obj_set_vel", smlua_func_obj_set_vel);
|
|
smlua_bind_function(L, "obj_move_xyz", smlua_func_obj_move_xyz);
|
|
smlua_bind_function(L, "set_whirlpools", smlua_func_set_whirlpools);
|
|
|
|
// smlua_text_utils.h
|
|
smlua_bind_function(L, "smlua_text_utils_reset_all", smlua_func_smlua_text_utils_reset_all);
|
|
smlua_bind_function(L, "smlua_text_utils_dialog_get", smlua_func_smlua_text_utils_dialog_get);
|
|
smlua_bind_function(L, "smlua_text_utils_dialog_replace", smlua_func_smlua_text_utils_dialog_replace);
|
|
smlua_bind_function(L, "smlua_text_utils_dialog_is_replaced", smlua_func_smlua_text_utils_dialog_is_replaced);
|
|
smlua_bind_function(L, "smlua_text_utils_course_acts_replace", smlua_func_smlua_text_utils_course_acts_replace);
|
|
smlua_bind_function(L, "smlua_text_utils_secret_star_replace", smlua_func_smlua_text_utils_secret_star_replace);
|
|
smlua_bind_function(L, "smlua_text_utils_course_name_replace", smlua_func_smlua_text_utils_course_name_replace);
|
|
smlua_bind_function(L, "smlua_text_utils_course_name_get", smlua_func_smlua_text_utils_course_name_get);
|
|
smlua_bind_function(L, "smlua_text_utils_course_name_mod_index", smlua_func_smlua_text_utils_course_name_mod_index);
|
|
smlua_bind_function(L, "smlua_text_utils_course_name_reset", smlua_func_smlua_text_utils_course_name_reset);
|
|
smlua_bind_function(L, "smlua_text_utils_act_name_replace", smlua_func_smlua_text_utils_act_name_replace);
|
|
smlua_bind_function(L, "smlua_text_utils_act_name_get", smlua_func_smlua_text_utils_act_name_get);
|
|
smlua_bind_function(L, "smlua_text_utils_act_name_mod_index", smlua_func_smlua_text_utils_act_name_mod_index);
|
|
smlua_bind_function(L, "smlua_text_utils_act_name_reset", smlua_func_smlua_text_utils_act_name_reset);
|
|
smlua_bind_function(L, "smlua_text_utils_castle_secret_stars_replace", smlua_func_smlua_text_utils_castle_secret_stars_replace);
|
|
smlua_bind_function(L, "smlua_text_utils_castle_secret_stars_get", smlua_func_smlua_text_utils_castle_secret_stars_get);
|
|
smlua_bind_function(L, "smlua_text_utils_castle_secret_stars_mod_index", smlua_func_smlua_text_utils_castle_secret_stars_mod_index);
|
|
smlua_bind_function(L, "smlua_text_utils_castle_secret_stars_reset", smlua_func_smlua_text_utils_castle_secret_stars_reset);
|
|
smlua_bind_function(L, "smlua_text_utils_extra_text_replace", smlua_func_smlua_text_utils_extra_text_replace);
|
|
smlua_bind_function(L, "smlua_text_utils_extra_text_get", smlua_func_smlua_text_utils_extra_text_get);
|
|
smlua_bind_function(L, "smlua_text_utils_extra_text_mod_index", smlua_func_smlua_text_utils_extra_text_mod_index);
|
|
smlua_bind_function(L, "smlua_text_utils_extra_text_reset", smlua_func_smlua_text_utils_extra_text_reset);
|
|
smlua_bind_function(L, "smlua_text_utils_get_language", smlua_func_smlua_text_utils_get_language);
|
|
|
|
// sound_init.h
|
|
smlua_bind_function(L, "reset_volume", smlua_func_reset_volume);
|
|
smlua_bind_function(L, "raise_background_noise", smlua_func_raise_background_noise);
|
|
smlua_bind_function(L, "lower_background_noise", smlua_func_lower_background_noise);
|
|
smlua_bind_function(L, "disable_background_sound", smlua_func_disable_background_sound);
|
|
smlua_bind_function(L, "enable_background_sound", smlua_func_enable_background_sound);
|
|
smlua_bind_function(L, "play_menu_sounds", smlua_func_play_menu_sounds);
|
|
smlua_bind_function(L, "play_painting_eject_sound", smlua_func_play_painting_eject_sound);
|
|
smlua_bind_function(L, "play_infinite_stairs_music", smlua_func_play_infinite_stairs_music);
|
|
smlua_bind_function(L, "set_background_music", smlua_func_set_background_music);
|
|
smlua_bind_function(L, "fadeout_music", smlua_func_fadeout_music);
|
|
smlua_bind_function(L, "fadeout_level_music", smlua_func_fadeout_level_music);
|
|
smlua_bind_function(L, "play_cutscene_music", smlua_func_play_cutscene_music);
|
|
smlua_bind_function(L, "play_shell_music", smlua_func_play_shell_music);
|
|
smlua_bind_function(L, "stop_shell_music", smlua_func_stop_shell_music);
|
|
smlua_bind_function(L, "play_cap_music", smlua_func_play_cap_music);
|
|
smlua_bind_function(L, "fadeout_cap_music", smlua_func_fadeout_cap_music);
|
|
smlua_bind_function(L, "stop_cap_music", smlua_func_stop_cap_music);
|
|
|
|
// spawn_sound.h
|
|
smlua_bind_function(L, "cur_obj_play_sound_1", smlua_func_cur_obj_play_sound_1);
|
|
smlua_bind_function(L, "cur_obj_play_sound_2", smlua_func_cur_obj_play_sound_2);
|
|
smlua_bind_function(L, "create_sound_spawner", smlua_func_create_sound_spawner);
|
|
smlua_bind_function(L, "calc_dist_to_volume_range_1", smlua_func_calc_dist_to_volume_range_1);
|
|
smlua_bind_function(L, "calc_dist_to_volume_range_2", smlua_func_calc_dist_to_volume_range_2);
|
|
|
|
// surface_collision.h
|
|
smlua_bind_function(L, "find_wall_collisions", smlua_func_find_wall_collisions);
|
|
//smlua_bind_function(L, "find_ceil", smlua_func_find_ceil); <--- UNIMPLEMENTED
|
|
smlua_bind_function(L, "find_ceil_height", smlua_func_find_ceil_height);
|
|
//smlua_bind_function(L, "find_floor_height_and_data", smlua_func_find_floor_height_and_data); <--- UNIMPLEMENTED
|
|
smlua_bind_function(L, "find_floor_height", smlua_func_find_floor_height);
|
|
//smlua_bind_function(L, "find_floor", smlua_func_find_floor); <--- UNIMPLEMENTED
|
|
smlua_bind_function(L, "find_water_level", smlua_func_find_water_level);
|
|
smlua_bind_function(L, "find_poison_gas_level", smlua_func_find_poison_gas_level);
|
|
//smlua_bind_function(L, "find_surface_on_ray", smlua_func_find_surface_on_ray); <--- UNIMPLEMENTED
|
|
smlua_bind_function(L, "set_find_wall_direction", smlua_func_set_find_wall_direction);
|
|
smlua_bind_function(L, "closest_point_to_triangle", smlua_func_closest_point_to_triangle);
|
|
|
|
// surface_load.h
|
|
smlua_bind_function(L, "load_object_collision_model", smlua_func_load_object_collision_model);
|
|
smlua_bind_function(L, "obj_get_surface_from_index", smlua_func_obj_get_surface_from_index);
|
|
smlua_bind_function(L, "surface_has_force", smlua_func_surface_has_force);
|
|
|
|
// sync_object.h
|
|
smlua_bind_function(L, "sync_object_get_object", smlua_func_sync_object_get_object);
|
|
smlua_bind_function(L, "sync_object_is_initialized", smlua_func_sync_object_is_initialized);
|
|
smlua_bind_function(L, "sync_object_is_owned_locally", smlua_func_sync_object_is_owned_locally);
|
|
|
|
}
|