|
|
|
@ -14,6 +14,7 @@
|
|
|
|
|
#include "include/level_misc_macros.h"
|
|
|
|
|
#include "include/macro_presets.h"
|
|
|
|
|
#include "utils/smlua_anim_utils.h"
|
|
|
|
|
#include "utils/smlua_collision_utils.h"
|
|
|
|
|
|
|
|
|
|
bool smlua_functions_valid_param_count(lua_State* L, int expected) {
|
|
|
|
|
int top = lua_gettop(L);
|
|
|
|
@ -41,7 +42,7 @@ int smlua_func_sins(lua_State* L) {
|
|
|
|
|
if (!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
|
|
|
|
|
|
s16 x = smlua_to_number(L, 1);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("sins: Failed to convert parameter 1"); return 0; }
|
|
|
|
|
|
|
|
|
|
lua_pushnumber(L, sins(x));
|
|
|
|
|
return 1;
|
|
|
|
@ -51,7 +52,7 @@ int smlua_func_coss(lua_State* L) {
|
|
|
|
|
if (!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
|
|
|
|
|
|
s16 x = smlua_to_number(L, 1);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("coss: Failed to convert parameter 1"); return 0; }
|
|
|
|
|
|
|
|
|
|
lua_pushnumber(L, coss(x));
|
|
|
|
|
return 1;
|
|
|
|
@ -61,9 +62,9 @@ int smlua_func_atan2s(lua_State* L) {
|
|
|
|
|
if (!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
|
|
|
|
|
|
f32 y = smlua_to_number(L, 1);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("atan2s: Failed to convert parameter 1"); return 0; }
|
|
|
|
|
f32 x = smlua_to_number(L, 2);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 2"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("atan2s: Failed to convert parameter 2"); return 0; }
|
|
|
|
|
|
|
|
|
|
lua_pushinteger(L, atan2s(y, x));
|
|
|
|
|
return 1;
|
|
|
|
@ -71,7 +72,7 @@ int smlua_func_atan2s(lua_State* L) {
|
|
|
|
|
|
|
|
|
|
int smlua_func_init_mario_after_warp(lua_State* L) {
|
|
|
|
|
if (network_player_connected_count() >= 2) {
|
|
|
|
|
LOG_LUA_LINE("This function can only be used in single-player");
|
|
|
|
|
LOG_LUA_LINE("init_mario_after_warp can only be used in single-player");
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -87,13 +88,13 @@ int smlua_func_initiate_warp(lua_State* L) {
|
|
|
|
|
if(!smlua_functions_valid_param_count(L, 4)) { return 0; }
|
|
|
|
|
|
|
|
|
|
s16 destLevel = smlua_to_number(L, 1);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("initiate_warp: Failed to convert parameter 1"); return 0; }
|
|
|
|
|
s16 destArea = smlua_to_number(L, 2);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 2"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("initiate_warp: Failed to convert parameter 2"); return 0; }
|
|
|
|
|
s16 destWarpNode = smlua_to_number(L, 3);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 3"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("initiate_warp: Failed to convert parameter 3"); return 0; }
|
|
|
|
|
s32 arg3 = smlua_to_number(L, 4);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 4"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("initiate_warp: Failed to convert parameter 4"); return 0; }
|
|
|
|
|
|
|
|
|
|
extern void initiate_warp(s16 destLevel, s16 destArea, s16 destWarpNode, s32 arg3);
|
|
|
|
|
initiate_warp(destLevel, destArea, destWarpNode, arg3);
|
|
|
|
@ -103,7 +104,7 @@ int smlua_func_initiate_warp(lua_State* L) {
|
|
|
|
|
|
|
|
|
|
int smlua_func_reset_level(lua_State* L) {
|
|
|
|
|
if (network_player_connected_count() >= 2) {
|
|
|
|
|
LOG_LUA_LINE("This function can only be used in single-player");
|
|
|
|
|
LOG_LUA_LINE("reset_level() can only be used in single-player");
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -118,10 +119,10 @@ int smlua_func_network_init_object(lua_State* L) {
|
|
|
|
|
if (!smlua_functions_valid_param_count(L, 3)) { return 0; }
|
|
|
|
|
|
|
|
|
|
struct Object* obj = smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
|
|
|
if (!gSmLuaConvertSuccess || obj == NULL) { LOG_LUA("Failed to convert parameter 1"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess || obj == NULL) { LOG_LUA("network_init_object: Failed to convert parameter 1"); return 0; }
|
|
|
|
|
|
|
|
|
|
bool standardSync = smlua_to_boolean(L, 2);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 2"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("network_init_object: Failed to convert parameter 2"); return 0; }
|
|
|
|
|
|
|
|
|
|
if (lua_type(L, 3) != LUA_TNIL && lua_type(L, 3) != LUA_TTABLE) {
|
|
|
|
|
LOG_LUA_LINE("network_init_object() called with an invalid type for param 3: %u", lua_type(L, 3));
|
|
|
|
@ -130,7 +131,7 @@ int smlua_func_network_init_object(lua_State* L) {
|
|
|
|
|
|
|
|
|
|
struct SyncObject* so = sync_object_init(obj, standardSync ? 4000.0f : SYNC_DISTANCE_ONLY_EVENTS);
|
|
|
|
|
if (so == NULL) {
|
|
|
|
|
LOG_LUA_LINE("Failed to allocate sync object.");
|
|
|
|
|
LOG_LUA_LINE("network_init_object: Failed to allocate sync object.");
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -182,14 +183,14 @@ int smlua_func_network_send_object(lua_State* L) {
|
|
|
|
|
if (!smlua_functions_valid_param_count(L, 2)) { return 0; }
|
|
|
|
|
|
|
|
|
|
struct Object* obj = smlua_to_cobject(L, 1, LOT_OBJECT);
|
|
|
|
|
if (!gSmLuaConvertSuccess || obj == NULL) { LOG_LUA("Failed to convert parameter 1"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess || obj == NULL) { LOG_LUA("network_send_object: Failed to convert parameter 1"); return 0; }
|
|
|
|
|
|
|
|
|
|
bool reliable = smlua_to_boolean(L, 2);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 2"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("network_send_object: Failed to convert parameter 2"); return 0; }
|
|
|
|
|
|
|
|
|
|
struct SyncObject* so = sync_object_get(obj->oSyncID);
|
|
|
|
|
if (!so || so->o != obj) {
|
|
|
|
|
LOG_LUA_LINE("Failed to retrieve sync object.");
|
|
|
|
|
LOG_LUA_LINE("network_send_object: Failed to retrieve sync object.");
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -263,7 +264,7 @@ int smlua_func_djui_hud_render_texture(lua_State* L) {
|
|
|
|
|
|
|
|
|
|
if (smlua_is_cobject(L, 1, LOT_TEXTUREINFO)) {
|
|
|
|
|
texInfo = (struct TextureInfo*)smlua_to_cobject(L, 1, LOT_TEXTUREINFO);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture: Failed to convert parameter 1"); return 0; }
|
|
|
|
|
} else {
|
|
|
|
|
int top = lua_gettop(L);
|
|
|
|
|
lua_pushvalue(L, 1);
|
|
|
|
@ -272,31 +273,31 @@ int smlua_func_djui_hud_render_texture(lua_State* L) {
|
|
|
|
|
lua_gettable(L, top+1);
|
|
|
|
|
tmpTexInfo.texture = smlua_to_cpointer(L, lua_gettop(L), LVT_U8_P);
|
|
|
|
|
lua_pop(L, 1);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1's 'texture' field"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture: Failed to convert parameter 1's 'texture' field"); return 0; }
|
|
|
|
|
|
|
|
|
|
tmpTexInfo.bitSize = smlua_get_integer_field(top+1, "bitSize");
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1's 'bitSize' field"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture: Failed to convert parameter 1's 'bitSize' field"); return 0; }
|
|
|
|
|
|
|
|
|
|
tmpTexInfo.width = smlua_get_integer_field(top+1, "width");
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1's 'width' field"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture: Failed to convert parameter 1's 'width' field"); return 0; }
|
|
|
|
|
|
|
|
|
|
tmpTexInfo.height = smlua_get_integer_field(top+1, "height");
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1's 'height' field"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture: Failed to convert parameter 1's 'height' field"); return 0; }
|
|
|
|
|
|
|
|
|
|
tmpTexInfo.name = smlua_get_string_field(top+1, "name");
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1's 'name' field"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture: Failed to convert parameter 1's 'name' field"); return 0; }
|
|
|
|
|
|
|
|
|
|
lua_settop(L, top);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
f32 x = smlua_to_number(L, 2);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 2"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture: Failed to convert parameter 2"); return 0; }
|
|
|
|
|
f32 y = smlua_to_number(L, 3);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 3"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture: Failed to convert parameter 3"); return 0; }
|
|
|
|
|
f32 scaleW = smlua_to_number(L, 4);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 4"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture: Failed to convert parameter 4"); return 0; }
|
|
|
|
|
f32 scaleH = smlua_to_number(L, 5);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 5"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture: Failed to convert parameter 5"); return 0; }
|
|
|
|
|
|
|
|
|
|
djui_hud_render_texture_raw(texInfo->texture, texInfo->bitSize, texInfo->width, texInfo->height, x, y, scaleW, scaleH);
|
|
|
|
|
|
|
|
|
@ -311,7 +312,7 @@ int smlua_func_djui_hud_render_texture_tile(lua_State* L) {
|
|
|
|
|
|
|
|
|
|
if (smlua_is_cobject(L, 1, LOT_TEXTUREINFO)) {
|
|
|
|
|
texInfo = (struct TextureInfo*)smlua_to_cobject(L, 1, LOT_TEXTUREINFO);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_tile: Failed to convert parameter 1"); return 0; }
|
|
|
|
|
} else {
|
|
|
|
|
int top = lua_gettop(L);
|
|
|
|
|
lua_pushvalue(L, 1);
|
|
|
|
@ -320,39 +321,39 @@ int smlua_func_djui_hud_render_texture_tile(lua_State* L) {
|
|
|
|
|
lua_gettable(L, top+1);
|
|
|
|
|
tmpTexInfo.texture = smlua_to_cpointer(L, lua_gettop(L), LVT_U8_P);
|
|
|
|
|
lua_pop(L, 1);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1's 'texture' field"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_tile: Failed to convert parameter 1's 'texture' field"); return 0; }
|
|
|
|
|
|
|
|
|
|
tmpTexInfo.bitSize = smlua_get_integer_field(top+1, "bitSize");
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1's 'bitSize' field"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_tile: Failed to convert parameter 1's 'bitSize' field"); return 0; }
|
|
|
|
|
|
|
|
|
|
tmpTexInfo.width = smlua_get_integer_field(top+1, "width");
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1's 'width' field"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_tile: Failed to convert parameter 1's 'width' field"); return 0; }
|
|
|
|
|
|
|
|
|
|
tmpTexInfo.height = smlua_get_integer_field(top+1, "height");
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1's 'height' field"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_tile: Failed to convert parameter 1's 'height' field"); return 0; }
|
|
|
|
|
|
|
|
|
|
tmpTexInfo.name = smlua_get_string_field(top+1, "name");
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1's 'name' field"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_tile: Failed to convert parameter 1's 'name' field"); return 0; }
|
|
|
|
|
|
|
|
|
|
lua_settop(L, top);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
f32 x = smlua_to_number(L, 2);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 2"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_tile: Failed to convert parameter 2"); return 0; }
|
|
|
|
|
f32 y = smlua_to_number(L, 3);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 3"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_tile: Failed to convert parameter 3"); return 0; }
|
|
|
|
|
f32 scaleW = smlua_to_number(L, 4);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 4"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_tile: Failed to convert parameter 4"); return 0; }
|
|
|
|
|
f32 scaleH = smlua_to_number(L, 5);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 5"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_tile: Failed to convert parameter 5"); return 0; }
|
|
|
|
|
f32 tileX = smlua_to_number(L, 6);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 6"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_tile: Failed to convert parameter 6"); return 0; }
|
|
|
|
|
f32 tileY = smlua_to_number(L, 7);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 7"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_tile: Failed to convert parameter 7"); return 0; }
|
|
|
|
|
f32 tileW = smlua_to_number(L, 8);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 8"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_tile: Failed to convert parameter 8"); return 0; }
|
|
|
|
|
f32 tileH = smlua_to_number(L, 9);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 9"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_tile: Failed to convert parameter 9"); return 0; }
|
|
|
|
|
|
|
|
|
|
djui_hud_render_texture_tile_raw(texInfo->texture, texInfo->bitSize, texInfo->width, texInfo->height, x, y, scaleW, scaleH, tileX, tileY, tileW, tileH);
|
|
|
|
|
|
|
|
|
@ -367,7 +368,7 @@ int smlua_func_djui_hud_render_texture_interpolated(lua_State* L) {
|
|
|
|
|
|
|
|
|
|
if (smlua_is_cobject(L, 1, LOT_TEXTUREINFO)) {
|
|
|
|
|
texInfo = (struct TextureInfo*)smlua_to_cobject(L, 1, LOT_TEXTUREINFO);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_interpolated: Failed to convert parameter 1"); return 0; }
|
|
|
|
|
} else {
|
|
|
|
|
int top = lua_gettop(L);
|
|
|
|
|
lua_pushvalue(L, 1);
|
|
|
|
@ -376,39 +377,39 @@ int smlua_func_djui_hud_render_texture_interpolated(lua_State* L) {
|
|
|
|
|
lua_gettable(L, top+1);
|
|
|
|
|
tmpTexInfo.texture = smlua_to_cpointer(L, lua_gettop(L), LVT_U8_P);
|
|
|
|
|
lua_pop(L, 1);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1's 'texture' field"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_interpolated: Failed to convert parameter 1's 'texture' field"); return 0; }
|
|
|
|
|
|
|
|
|
|
tmpTexInfo.bitSize = smlua_get_integer_field(top+1, "bitSize");
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1's 'bitSize' field"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_interpolated: Failed to convert parameter 1's 'bitSize' field"); return 0; }
|
|
|
|
|
|
|
|
|
|
tmpTexInfo.width = smlua_get_integer_field(top+1, "width");
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1's 'width' field"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_interpolated: Failed to convert parameter 1's 'width' field"); return 0; }
|
|
|
|
|
|
|
|
|
|
tmpTexInfo.height = smlua_get_integer_field(top+1, "height");
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1's 'height' field"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_interpolated: Failed to convert parameter 1's 'height' field"); return 0; }
|
|
|
|
|
|
|
|
|
|
tmpTexInfo.name = smlua_get_string_field(top+1, "name");
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1's 'name' field"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_interpolated: Failed to convert parameter 1's 'name' field"); return 0; }
|
|
|
|
|
|
|
|
|
|
lua_settop(L, top);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
f32 prevX = smlua_to_number(L, 2);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 2"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_interpolated: Failed to convert parameter 2"); return 0; }
|
|
|
|
|
f32 prevY = smlua_to_number(L, 3);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 3"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_interpolated: Failed to convert parameter 3"); return 0; }
|
|
|
|
|
f32 prevScaleW = smlua_to_number(L, 4);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 4"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_interpolated: Failed to convert parameter 4"); return 0; }
|
|
|
|
|
f32 prevScaleH = smlua_to_number(L, 5);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 5"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_interpolated: Failed to convert parameter 5"); return 0; }
|
|
|
|
|
f32 x = smlua_to_number(L, 6);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 6"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_interpolated: Failed to convert parameter 6"); return 0; }
|
|
|
|
|
f32 y = smlua_to_number(L, 7);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 7"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_interpolated: Failed to convert parameter 7"); return 0; }
|
|
|
|
|
f32 scaleW = smlua_to_number(L, 8);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 8"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_interpolated: Failed to convert parameter 8"); return 0; }
|
|
|
|
|
f32 scaleH = smlua_to_number(L, 9);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 9"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_interpolated: Failed to convert parameter 9"); return 0; }
|
|
|
|
|
|
|
|
|
|
djui_hud_render_texture_interpolated(texInfo, prevX, prevY, prevScaleW, prevScaleH, x, y, scaleW, scaleH);
|
|
|
|
|
|
|
|
|
@ -423,7 +424,7 @@ int smlua_func_djui_hud_render_texture_tile_interpolated(lua_State* L) {
|
|
|
|
|
|
|
|
|
|
if (smlua_is_cobject(L, 1, LOT_TEXTUREINFO)) {
|
|
|
|
|
texInfo = (struct TextureInfo*)smlua_to_cobject(L, 1, LOT_TEXTUREINFO);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_tile_interpolated: Failed to convert parameter 1"); return 0; }
|
|
|
|
|
} else {
|
|
|
|
|
int top = lua_gettop(L);
|
|
|
|
|
lua_pushvalue(L, 1);
|
|
|
|
@ -432,47 +433,47 @@ int smlua_func_djui_hud_render_texture_tile_interpolated(lua_State* L) {
|
|
|
|
|
lua_gettable(L, top+1);
|
|
|
|
|
tmpTexInfo.texture = smlua_to_cpointer(L, lua_gettop(L), LVT_U8_P);
|
|
|
|
|
lua_pop(L, 1);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1's 'texture' field"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_tile_interpolated: Failed to convert parameter 1's 'texture' field"); return 0; }
|
|
|
|
|
|
|
|
|
|
tmpTexInfo.bitSize = smlua_get_integer_field(top+1, "bitSize");
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1's 'bitSize' field"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_tile_interpolated: Failed to convert parameter 1's 'bitSize' field"); return 0; }
|
|
|
|
|
|
|
|
|
|
tmpTexInfo.width = smlua_get_integer_field(top+1, "width");
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1's 'width' field"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_tile_interpolated: Failed to convert parameter 1's 'width' field"); return 0; }
|
|
|
|
|
|
|
|
|
|
tmpTexInfo.height = smlua_get_integer_field(top+1, "height");
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1's 'height' field"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_tile_interpolated: Failed to convert parameter 1's 'height' field"); return 0; }
|
|
|
|
|
|
|
|
|
|
tmpTexInfo.name = smlua_get_string_field(top+1, "name");
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1's 'name' field"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_tile_interpolated: Failed to convert parameter 1's 'name' field"); return 0; }
|
|
|
|
|
|
|
|
|
|
lua_settop(L, top);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
f32 prevX = smlua_to_number(L, 2);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 2"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_tile_interpolated: Failed to convert parameter 2"); return 0; }
|
|
|
|
|
f32 prevY = smlua_to_number(L, 3);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 3"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_tile_interpolated: Failed to convert parameter 3"); return 0; }
|
|
|
|
|
f32 prevScaleW = smlua_to_number(L, 4);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 4"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_tile_interpolated: Failed to convert parameter 4"); return 0; }
|
|
|
|
|
f32 prevScaleH = smlua_to_number(L, 5);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 5"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_tile_interpolated: Failed to convert parameter 5"); return 0; }
|
|
|
|
|
f32 x = smlua_to_number(L, 6);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 6"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_tile_interpolated: Failed to convert parameter 6"); return 0; }
|
|
|
|
|
f32 y = smlua_to_number(L, 7);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 7"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_tile_interpolated: Failed to convert parameter 7"); return 0; }
|
|
|
|
|
f32 scaleW = smlua_to_number(L, 8);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 8"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_tile_interpolated: Failed to convert parameter 8"); return 0; }
|
|
|
|
|
f32 scaleH = smlua_to_number(L, 9);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 9"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_tile_interpolated: Failed to convert parameter 9"); return 0; }
|
|
|
|
|
f32 tileX = smlua_to_number(L, 10);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 10"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_tile_interpolated: Failed to convert parameter 10"); return 0; }
|
|
|
|
|
f32 tileY = smlua_to_number(L, 11);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 11"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_tile_interpolated: Failed to convert parameter 11"); return 0; }
|
|
|
|
|
f32 tileW = smlua_to_number(L, 12);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 12"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_tile_interpolated: Failed to convert parameter 12"); return 0; }
|
|
|
|
|
f32 tileH = smlua_to_number(L, 13);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 13"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("djui_hud_render_texture_tile_interpolated: Failed to convert parameter 13"); return 0; }
|
|
|
|
|
|
|
|
|
|
djui_hud_render_texture_tile_interpolated(texInfo, prevX, prevY, prevScaleW, prevScaleH, x, y, scaleW, scaleH, tileX, tileY, tileW, tileH);
|
|
|
|
|
|
|
|
|
@ -489,7 +490,7 @@ int smlua_func_texture_override_set(lua_State* L) {
|
|
|
|
|
|
|
|
|
|
if (smlua_is_cobject(L, 2, LOT_TEXTUREINFO)) {
|
|
|
|
|
overrideTexInfo = (struct TextureInfo*)smlua_to_cobject(L, 2, LOT_TEXTUREINFO);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 2"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("texture_override_set: Failed to convert parameter 2"); return 0; }
|
|
|
|
|
} else {
|
|
|
|
|
int top = lua_gettop(L);
|
|
|
|
|
lua_pushvalue(L, 2);
|
|
|
|
@ -498,19 +499,19 @@ int smlua_func_texture_override_set(lua_State* L) {
|
|
|
|
|
lua_gettable(L, top+1);
|
|
|
|
|
tmpOverrideTexInfo.texture = smlua_to_cpointer(L, lua_gettop(L), LVT_U8_P);
|
|
|
|
|
lua_pop(L, 1);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 2's 'texture' field"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("texture_override_set: Failed to convert parameter 2's 'texture' field"); return 0; }
|
|
|
|
|
|
|
|
|
|
tmpOverrideTexInfo.bitSize = smlua_get_integer_field(top+1, "bitSize");
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 2's 'bitSize' field"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("texture_override_set: Failed to convert parameter 2's 'bitSize' field"); return 0; }
|
|
|
|
|
|
|
|
|
|
tmpOverrideTexInfo.width = smlua_get_integer_field(top+1, "width");
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 2's 'width' field"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("texture_override_set: Failed to convert parameter 2's 'width' field"); return 0; }
|
|
|
|
|
|
|
|
|
|
tmpOverrideTexInfo.height = smlua_get_integer_field(top+1, "height");
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 2's 'height' field"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("texture_override_set: Failed to convert parameter 2's 'height' field"); return 0; }
|
|
|
|
|
|
|
|
|
|
tmpOverrideTexInfo.name = smlua_get_string_field(top+1, "name");
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 2's 'name' field"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("texture_override_set: Failed to convert parameter 2's 'name' field"); return 0; }
|
|
|
|
|
|
|
|
|
|
lua_settop(L, top);
|
|
|
|
|
}
|
|
|
|
@ -524,7 +525,7 @@ int smlua_func_texture_override_reset(lua_State* L) {
|
|
|
|
|
if (!smlua_functions_valid_param_count(L, 1)) { return 0; }
|
|
|
|
|
|
|
|
|
|
const char* textureName = smlua_to_string(L, 1);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("texture_override_reset: Failed to convert parameter 1"); return 0; }
|
|
|
|
|
|
|
|
|
|
dynos_texture_override_reset(textureName);
|
|
|
|
|
|
|
|
|
@ -760,30 +761,30 @@ int smlua_func_smlua_anim_util_register_animation(lua_State* L) {
|
|
|
|
|
if (!smlua_functions_valid_param_count(L, 8)) { return 0; }
|
|
|
|
|
|
|
|
|
|
const char *name = smlua_to_string(L, 1);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("%s: Failed to convert parameter '%s'", "smlua_anim_util_register_animation", "name"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("smlua_anim_util_register_animation: Failed to convert parameter 'name'"); return 0; }
|
|
|
|
|
|
|
|
|
|
s16 flags = smlua_to_integer(L, 2);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("%s: Failed to convert parameter '%s'", "smlua_anim_util_register_animation", "flags"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("smlua_anim_util_register_animation: Failed to convert parameter 'flags'"); return 0; }
|
|
|
|
|
|
|
|
|
|
s16 animYTransDivisor = smlua_to_integer(L, 3);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("%s: Failed to convert parameter '%s'", "smlua_anim_util_register_animation", "animYTransDivisor"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("smlua_anim_util_register_animation: Failed to convert parameter 'animYTransDivisor'"); return 0; }
|
|
|
|
|
|
|
|
|
|
s16 startFrame = smlua_to_integer(L, 4);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("%s: Failed to convert parameter '%s'", "smlua_anim_util_register_animation", "startFrame"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("smlua_anim_util_register_animation: Failed to convert parameter 'startFrame'"); return 0; }
|
|
|
|
|
|
|
|
|
|
s16 loopStart = smlua_to_integer(L, 5);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("%s: Failed to convert parameter '%s'", "smlua_anim_util_register_animation", "loopStart"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("smlua_anim_util_register_animation: Failed to convert parameter 'loopStart'"); return 0; }
|
|
|
|
|
|
|
|
|
|
s16 loopEnd = smlua_to_integer(L, 6);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("%s: Failed to convert parameter '%s'", "smlua_anim_util_register_animation", "loopEnd"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("smlua_anim_util_register_animation: Failed to convert parameter 'loopEnd'"); return 0; }
|
|
|
|
|
|
|
|
|
|
u32 valuesLength = 0;
|
|
|
|
|
u16 *values = (u16 *) smlua_to_u16_list(L, 7, &valuesLength);
|
|
|
|
|
if (!values) { LOG_LUA("%s: Failed to convert parameter '%s'", "smlua_anim_util_register_animation", "values"); return 0; }
|
|
|
|
|
if (!values) { LOG_LUA("smlua_anim_util_register_animation: Failed to convert parameter 'values'"); return 0; }
|
|
|
|
|
|
|
|
|
|
u32 indexLength = 0;
|
|
|
|
|
u16 *index = (u16 *) smlua_to_u16_list(L, 8, &indexLength);
|
|
|
|
|
if (!index) { LOG_LUA("%s: Failed to convert parameter '%s'", "smlua_anim_util_register_animation", "index"); free(values); return 0; }
|
|
|
|
|
if (!index) { LOG_LUA("smlua_anim_util_register_animation: Failed to convert parameter 'index'"); free(values); return 0; }
|
|
|
|
|
|
|
|
|
|
smlua_anim_util_register_animation(name, flags, animYTransDivisor, startFrame, loopStart, loopEnd, values, valuesLength, index, indexLength);
|
|
|
|
|
|
|
|
|
@ -800,12 +801,12 @@ int smlua_func_log_to_console(lua_State* L) {
|
|
|
|
|
int paramCount = lua_gettop(L);
|
|
|
|
|
|
|
|
|
|
const char* message = smlua_to_string(L, 1);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 1"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("log_to_console: Failed to convert parameter 1 for function"); return 0; }
|
|
|
|
|
|
|
|
|
|
enum ConsoleMessageLevel level = CONSOLE_MESSAGE_INFO;
|
|
|
|
|
if (paramCount >= 2) {
|
|
|
|
|
level = smlua_to_integer(L, 2);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter 2"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("log_to_console: Failed to convert parameter 2 for function"); return 0; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
djui_console_message_create(message, level);
|
|
|
|
@ -818,15 +819,14 @@ int smlua_func_log_to_console(lua_State* L) {
|
|
|
|
|
////////////////////
|
|
|
|
|
|
|
|
|
|
int smlua_func_add_scroll_target(lua_State* L) {
|
|
|
|
|
|
|
|
|
|
// add_scroll_target used to require offset and size of the vertex buffer to be used
|
|
|
|
|
if (!smlua_functions_valid_param_range(L, 2, 4)) { return 0; }
|
|
|
|
|
int paramCount = lua_gettop(L);
|
|
|
|
|
|
|
|
|
|
u32 index = smlua_to_integer(L, 1);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "add_scroll_target"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("add_scroll_target: Failed to convert parameter 1 for function"); return 0; }
|
|
|
|
|
const char* name = smlua_to_string(L, 2);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "add_scroll_target"); return 0; }
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("add_scroll_target: Failed to convert parameter 2 for function"); return 0; }
|
|
|
|
|
|
|
|
|
|
// If the offset and size parameters are provided, use them, although they aren't required.
|
|
|
|
|
u32 offset = 0;
|
|
|
|
@ -844,6 +844,34 @@ int smlua_func_add_scroll_target(lua_State* L) {
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/////////////
|
|
|
|
|
// raycast //
|
|
|
|
|
/////////////
|
|
|
|
|
|
|
|
|
|
int smlua_func_collision_find_surface_on_ray(lua_State* L) {
|
|
|
|
|
if (!smlua_functions_valid_param_range(L, 6, 7)) { return 0; }
|
|
|
|
|
int paramCount = lua_gettop(L);
|
|
|
|
|
|
|
|
|
|
f32 startX = smlua_to_number(L, 1);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("collision_find_surface_on_ray: Failed to convert parameter 1"); return 0; }
|
|
|
|
|
f32 startY = smlua_to_number(L, 2);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("collision_find_surface_on_ray: Failed to convert parameter 2"); return 0; }
|
|
|
|
|
f32 startZ = smlua_to_number(L, 3);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("collision_find_surface_on_ray: Failed to convert parameter 3"); return 0; }
|
|
|
|
|
f32 dirX = smlua_to_number(L, 4);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("collision_find_surface_on_ray: Failed to convert parameter 4"); return 0; }
|
|
|
|
|
f32 dirY = smlua_to_number(L, 5);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("collision_find_surface_on_ray: Failed to convert parameter 5"); return 0; }
|
|
|
|
|
f32 dirZ = smlua_to_number(L, 6);
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("collision_find_surface_on_ray: Failed to convert parameter 6"); return 0; }
|
|
|
|
|
f32 precision = paramCount == 7 ? smlua_to_number(L, 7) : 3.0f;
|
|
|
|
|
if (!gSmLuaConvertSuccess) { LOG_LUA("collision_find_surface_on_ray: Failed to convert parameter 7"); return 0; }
|
|
|
|
|
|
|
|
|
|
collision_find_surface_on_ray(startX, startY, startZ, dirX, dirY, dirZ, precision);
|
|
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//////////
|
|
|
|
|
// bind //
|
|
|
|
|
//////////
|
|
|
|
@ -873,4 +901,5 @@ void smlua_bind_functions(void) {
|
|
|
|
|
smlua_bind_function(L, "smlua_anim_util_register_animation", smlua_func_smlua_anim_util_register_animation);
|
|
|
|
|
smlua_bind_function(L, "log_to_console", smlua_func_log_to_console);
|
|
|
|
|
smlua_bind_function(L, "add_scroll_target", smlua_func_add_scroll_target);
|
|
|
|
|
smlua_bind_function(L, "collision_find_surface_on_ray", smlua_func_collision_find_surface_on_ray);
|
|
|
|
|
}
|
|
|
|
|