remove some dangerous functions

This commit is contained in:
Isaac0-dev 2025-02-13 22:33:17 +10:00
parent 14680f0d25
commit b1b5b93dcc
8 changed files with 350 additions and 498 deletions

View file

@ -809,7 +809,7 @@ def build_param(fid, param, i):
lot = translate_type_to_lot(ptype)
s = ' %s %s = (%s)smlua_to_cobject(L, %d, %s);' % (ptype, pid, ptype, i, lot)
if '???' in lot:
if '???' in lot or "GRAPHNODE" in lot:
s = '//' + s + ' <--- UNIMPLEMENTED'
else:
s = ' ' + s

View file

@ -7972,14 +7972,6 @@ function find_unimportant_object()
-- ...
end
--- @param callContext integer
--- @param a1 GraphNode
--- @param sp8 integer
--- @return integer
function geo_offset_klepto_debug(callContext, a1, sp8)
-- ...
end
--- @param behavior Pointer_BehaviorScript
--- @return integer
function get_object_list_from_behavior(behavior)
@ -9500,13 +9492,6 @@ function course_is_main_course(courseNum)
-- ...
end
--- @param pointer Pointer_integer
--- @return integer
--- Gets the signed 32-bit integer value from `pointer`
function deref_s32_pointer(pointer)
-- ...
end
--- @return boolean
--- Checks if the DJUI playerlist is attempting to be opened
function djui_attempting_to_open_playerlist()
@ -9683,13 +9668,6 @@ function get_save_file_modified()
-- ...
end
--- @param initialValue integer
--- @return Pointer_integer
--- Returns a temporary signed 32-bit integer pointer with its value set to `initialValue`
function get_temp_s32_pointer(initialValue)
-- ...
end
--- @return integer
--- Gets the Unix Timestamp
function get_time()

View file

@ -3758,28 +3758,6 @@
<br />
## [geo_offset_klepto_debug](#geo_offset_klepto_debug)
### Lua Example
`local integerValue = geo_offset_klepto_debug(callContext, a1, sp8)`
### Parameters
| Field | Type |
| ----- | ---- |
| callContext | `integer` |
| a1 | [GraphNode](structs.md#GraphNode) |
| sp8 | `integer` |
### Returns
- `integer`
### C Prototype
`s32 geo_offset_klepto_debug(s32 callContext, struct GraphNode *a1, UNUSED s32 sp8);`
[:arrow_up_small:](#)
<br />
## [get_object_list_from_behavior](#get_object_list_from_behavior)
### Lua Example
@ -8408,6 +8386,320 @@ Warps to `aWarpId` of `aArea` in `aLevel` during `aAct`
[:arrow_up_small:](#)
<br />
---
# functions from smlua_math_utils.h
<br />
## [clamp](#clamp)
### Description
Clamps a signed 32-bit integer `a` between bounds `b` (minimum) and `c` (maximum)
### Lua Example
`local integerValue = clamp(a, b, c)`
### Parameters
| Field | Type |
| ----- | ---- |
| a | `integer` |
| b | `integer` |
| c | `integer` |
### Returns
- `integer`
### C Prototype
`s32 clamp(s32 a, s32 b, s32 c);`
[:arrow_up_small:](#)
<br />
## [clampf](#clampf)
### Description
Clamps a floating-point number `a` between bounds `b` (minimum) and `c` (maximum)
### Lua Example
`local numberValue = clampf(a, b, c)`
### Parameters
| Field | Type |
| ----- | ---- |
| a | `number` |
| b | `number` |
| c | `number` |
### Returns
- `number`
### C Prototype
`f32 clampf(f32 a, f32 b, f32 c);`
[:arrow_up_small:](#)
<br />
## [degrees_to_sm64](#degrees_to_sm64)
### Description
Converts an angle from degrees to SM64 format
### Lua Example
`local integerValue = degrees_to_sm64(degreesAngle)`
### Parameters
| Field | Type |
| ----- | ---- |
| degreesAngle | `number` |
### Returns
- `integer`
### C Prototype
`s16 degrees_to_sm64(f32 degreesAngle);`
[:arrow_up_small:](#)
<br />
## [hypotf](#hypotf)
### Description
Computes the hypotenuse of a right triangle given sides `a` and `b` using the Pythagorean theorem
### Lua Example
`local numberValue = hypotf(a, b)`
### Parameters
| Field | Type |
| ----- | ---- |
| a | `number` |
| b | `number` |
### Returns
- `number`
### C Prototype
`f32 hypotf(f32 a, f32 b);`
[:arrow_up_small:](#)
<br />
## [max](#max)
### Description
Finds the maximum of two signed 32-bit integers
### Lua Example
`local integerValue = max(a, b)`
### Parameters
| Field | Type |
| ----- | ---- |
| a | `integer` |
| b | `integer` |
### Returns
- `integer`
### C Prototype
`s32 max(s32 a, s32 b);`
[:arrow_up_small:](#)
<br />
## [maxf](#maxf)
### Description
Finds the maximum of two floating-point numbers
### Lua Example
`local numberValue = maxf(a, b)`
### Parameters
| Field | Type |
| ----- | ---- |
| a | `number` |
| b | `number` |
### Returns
- `number`
### C Prototype
`f32 maxf(f32 a, f32 b);`
[:arrow_up_small:](#)
<br />
## [min](#min)
### Description
Finds the minimum of two signed 32-bit integers
### Lua Example
`local integerValue = min(a, b)`
### Parameters
| Field | Type |
| ----- | ---- |
| a | `integer` |
| b | `integer` |
### Returns
- `integer`
### C Prototype
`s32 min(s32 a, s32 b);`
[:arrow_up_small:](#)
<br />
## [minf](#minf)
### Description
Finds the minimum of two floating-point numbers
### Lua Example
`local numberValue = minf(a, b)`
### Parameters
| Field | Type |
| ----- | ---- |
| a | `number` |
| b | `number` |
### Returns
- `number`
### C Prototype
`f32 minf(f32 a, f32 b);`
[:arrow_up_small:](#)
<br />
## [radians_to_sm64](#radians_to_sm64)
### Description
Converts an angle from radians to SM64 format
### Lua Example
`local integerValue = radians_to_sm64(radiansAngle)`
### Parameters
| Field | Type |
| ----- | ---- |
| radiansAngle | `number` |
### Returns
- `integer`
### C Prototype
`s16 radians_to_sm64(f32 radiansAngle);`
[:arrow_up_small:](#)
<br />
## [sm64_to_degrees](#sm64_to_degrees)
### Description
Converts an angle from SM64 format to degrees
### Lua Example
`local numberValue = sm64_to_degrees(sm64Angle)`
### Parameters
| Field | Type |
| ----- | ---- |
| sm64Angle | `integer` |
### Returns
- `number`
### C Prototype
`f32 sm64_to_degrees(s16 sm64Angle);`
[:arrow_up_small:](#)
<br />
## [sm64_to_radians](#sm64_to_radians)
### Description
Converts an angle from SM64 format to radians
### Lua Example
`local numberValue = sm64_to_radians(sm64Angle)`
### Parameters
| Field | Type |
| ----- | ---- |
| sm64Angle | `integer` |
### Returns
- `number`
### C Prototype
`f32 sm64_to_radians(s16 sm64Angle);`
[:arrow_up_small:](#)
<br />
## [sqr](#sqr)
### Description
Computes the square of a signed 32-bit integer
### Lua Example
`local integerValue = sqr(x)`
### Parameters
| Field | Type |
| ----- | ---- |
| x | `integer` |
### Returns
- `integer`
### C Prototype
`s32 sqr(s32 x);`
[:arrow_up_small:](#)
<br />
## [sqrf](#sqrf)
### Description
Computes the square of a floating-point number
### Lua Example
`local numberValue = sqrf(x)`
### Parameters
| Field | Type |
| ----- | ---- |
| x | `number` |
### Returns
- `number`
### C Prototype
`f32 sqrf(f32 x);`
[:arrow_up_small:](#)
<br />
---

View file

@ -5,320 +5,6 @@
[< prev](functions-5.md) | [1](functions.md) | [2](functions-2.md) | [3](functions-3.md) | [4](functions-4.md) | [5](functions-5.md) | 6]
---
# functions from smlua_math_utils.h
<br />
## [clamp](#clamp)
### Description
Clamps a signed 32-bit integer `a` between bounds `b` (minimum) and `c` (maximum)
### Lua Example
`local integerValue = clamp(a, b, c)`
### Parameters
| Field | Type |
| ----- | ---- |
| a | `integer` |
| b | `integer` |
| c | `integer` |
### Returns
- `integer`
### C Prototype
`s32 clamp(s32 a, s32 b, s32 c);`
[:arrow_up_small:](#)
<br />
## [clampf](#clampf)
### Description
Clamps a floating-point number `a` between bounds `b` (minimum) and `c` (maximum)
### Lua Example
`local numberValue = clampf(a, b, c)`
### Parameters
| Field | Type |
| ----- | ---- |
| a | `number` |
| b | `number` |
| c | `number` |
### Returns
- `number`
### C Prototype
`f32 clampf(f32 a, f32 b, f32 c);`
[:arrow_up_small:](#)
<br />
## [degrees_to_sm64](#degrees_to_sm64)
### Description
Converts an angle from degrees to SM64 format
### Lua Example
`local integerValue = degrees_to_sm64(degreesAngle)`
### Parameters
| Field | Type |
| ----- | ---- |
| degreesAngle | `number` |
### Returns
- `integer`
### C Prototype
`s16 degrees_to_sm64(f32 degreesAngle);`
[:arrow_up_small:](#)
<br />
## [hypotf](#hypotf)
### Description
Computes the hypotenuse of a right triangle given sides `a` and `b` using the Pythagorean theorem
### Lua Example
`local numberValue = hypotf(a, b)`
### Parameters
| Field | Type |
| ----- | ---- |
| a | `number` |
| b | `number` |
### Returns
- `number`
### C Prototype
`f32 hypotf(f32 a, f32 b);`
[:arrow_up_small:](#)
<br />
## [max](#max)
### Description
Finds the maximum of two signed 32-bit integers
### Lua Example
`local integerValue = max(a, b)`
### Parameters
| Field | Type |
| ----- | ---- |
| a | `integer` |
| b | `integer` |
### Returns
- `integer`
### C Prototype
`s32 max(s32 a, s32 b);`
[:arrow_up_small:](#)
<br />
## [maxf](#maxf)
### Description
Finds the maximum of two floating-point numbers
### Lua Example
`local numberValue = maxf(a, b)`
### Parameters
| Field | Type |
| ----- | ---- |
| a | `number` |
| b | `number` |
### Returns
- `number`
### C Prototype
`f32 maxf(f32 a, f32 b);`
[:arrow_up_small:](#)
<br />
## [min](#min)
### Description
Finds the minimum of two signed 32-bit integers
### Lua Example
`local integerValue = min(a, b)`
### Parameters
| Field | Type |
| ----- | ---- |
| a | `integer` |
| b | `integer` |
### Returns
- `integer`
### C Prototype
`s32 min(s32 a, s32 b);`
[:arrow_up_small:](#)
<br />
## [minf](#minf)
### Description
Finds the minimum of two floating-point numbers
### Lua Example
`local numberValue = minf(a, b)`
### Parameters
| Field | Type |
| ----- | ---- |
| a | `number` |
| b | `number` |
### Returns
- `number`
### C Prototype
`f32 minf(f32 a, f32 b);`
[:arrow_up_small:](#)
<br />
## [radians_to_sm64](#radians_to_sm64)
### Description
Converts an angle from radians to SM64 format
### Lua Example
`local integerValue = radians_to_sm64(radiansAngle)`
### Parameters
| Field | Type |
| ----- | ---- |
| radiansAngle | `number` |
### Returns
- `integer`
### C Prototype
`s16 radians_to_sm64(f32 radiansAngle);`
[:arrow_up_small:](#)
<br />
## [sm64_to_degrees](#sm64_to_degrees)
### Description
Converts an angle from SM64 format to degrees
### Lua Example
`local numberValue = sm64_to_degrees(sm64Angle)`
### Parameters
| Field | Type |
| ----- | ---- |
| sm64Angle | `integer` |
### Returns
- `number`
### C Prototype
`f32 sm64_to_degrees(s16 sm64Angle);`
[:arrow_up_small:](#)
<br />
## [sm64_to_radians](#sm64_to_radians)
### Description
Converts an angle from SM64 format to radians
### Lua Example
`local numberValue = sm64_to_radians(sm64Angle)`
### Parameters
| Field | Type |
| ----- | ---- |
| sm64Angle | `integer` |
### Returns
- `number`
### C Prototype
`f32 sm64_to_radians(s16 sm64Angle);`
[:arrow_up_small:](#)
<br />
## [sqr](#sqr)
### Description
Computes the square of a signed 32-bit integer
### Lua Example
`local integerValue = sqr(x)`
### Parameters
| Field | Type |
| ----- | ---- |
| x | `integer` |
### Returns
- `integer`
### C Prototype
`s32 sqr(s32 x);`
[:arrow_up_small:](#)
<br />
## [sqrf](#sqrf)
### Description
Computes the square of a floating-point number
### Lua Example
`local numberValue = sqrf(x)`
### Parameters
| Field | Type |
| ----- | ---- |
| x | `number` |
### Returns
- `number`
### C Prototype
`f32 sqrf(f32 x);`
[:arrow_up_small:](#)
<br />
---
# functions from smlua_misc_utils.h
@ -371,29 +57,6 @@ Checks if a course is a main course and not the castle or secret levels
<br />
## [deref_s32_pointer](#deref_s32_pointer)
### Description
Gets the signed 32-bit integer value from `pointer`
### Lua Example
`local integerValue = deref_s32_pointer(pointer)`
### Parameters
| Field | Type |
| ----- | ---- |
| pointer | `Pointer` <`integer`> |
### Returns
- `integer`
### C Prototype
`s32 deref_s32_pointer(s32* pointer);`
[:arrow_up_small:](#)
<br />
## [djui_attempting_to_open_playerlist](#djui_attempting_to_open_playerlist)
### Description
@ -1000,29 +663,6 @@ Checks if the save file has been modified without saving
<br />
## [get_temp_s32_pointer](#get_temp_s32_pointer)
### Description
Returns a temporary signed 32-bit integer pointer with its value set to `initialValue`
### Lua Example
`local PointerValue = get_temp_s32_pointer(initialValue)`
### Parameters
| Field | Type |
| ----- | ---- |
| initialValue | `integer` |
### Returns
- `Pointer` <`integer`>
### C Prototype
`s32* get_temp_s32_pointer(s32 initialValue);`
[:arrow_up_small:](#)
<br />
## [get_time](#get_time)
### Description

View file

@ -1482,7 +1482,6 @@
- [enable_time_stop_including_mario](functions-5.md#enable_time_stop_including_mario)
- [find_object_with_behavior](functions-5.md#find_object_with_behavior)
- [find_unimportant_object](functions-5.md#find_unimportant_object)
- [geo_offset_klepto_debug](functions-5.md#geo_offset_klepto_debug)
- [get_object_list_from_behavior](functions-5.md#get_object_list_from_behavior)
- [get_trajectory_length](functions-5.md#get_trajectory_length)
- [increment_velocity_toward_range](functions-5.md#increment_velocity_toward_range)
@ -1737,26 +1736,25 @@
<br />
- smlua_math_utils.h
- [clamp](functions-6.md#clamp)
- [clampf](functions-6.md#clampf)
- [degrees_to_sm64](functions-6.md#degrees_to_sm64)
- [hypotf](functions-6.md#hypotf)
- [max](functions-6.md#max)
- [maxf](functions-6.md#maxf)
- [min](functions-6.md#min)
- [minf](functions-6.md#minf)
- [radians_to_sm64](functions-6.md#radians_to_sm64)
- [sm64_to_degrees](functions-6.md#sm64_to_degrees)
- [sm64_to_radians](functions-6.md#sm64_to_radians)
- [sqr](functions-6.md#sqr)
- [sqrf](functions-6.md#sqrf)
- [clamp](functions-5.md#clamp)
- [clampf](functions-5.md#clampf)
- [degrees_to_sm64](functions-5.md#degrees_to_sm64)
- [hypotf](functions-5.md#hypotf)
- [max](functions-5.md#max)
- [maxf](functions-5.md#maxf)
- [min](functions-5.md#min)
- [minf](functions-5.md#minf)
- [radians_to_sm64](functions-5.md#radians_to_sm64)
- [sm64_to_degrees](functions-5.md#sm64_to_degrees)
- [sm64_to_radians](functions-5.md#sm64_to_radians)
- [sqr](functions-5.md#sqr)
- [sqrf](functions-5.md#sqrf)
<br />
- smlua_misc_utils.h
- [allocate_mario_action](functions-6.md#allocate_mario_action)
- [course_is_main_course](functions-6.md#course_is_main_course)
- [deref_s32_pointer](functions-6.md#deref_s32_pointer)
- [djui_attempting_to_open_playerlist](functions-6.md#djui_attempting_to_open_playerlist)
- [djui_is_playerlist_open](functions-6.md#djui_is_playerlist_open)
- [djui_is_popup_disabled](functions-6.md#djui_is_popup_disabled)
@ -1785,7 +1783,6 @@
- [get_network_area_timer](functions-6.md#get_network_area_timer)
- [get_os_name](functions-6.md#get_os_name)
- [get_save_file_modified](functions-6.md#get_save_file_modified)
- [get_temp_s32_pointer](functions-6.md#get_temp_s32_pointer)
- [get_time](functions-6.md#get_time)
- [get_ttc_speed_setting](functions-6.md#get_ttc_speed_setting)
- [get_volume_env](functions-6.md#get_volume_env)

View file

@ -9162,7 +9162,7 @@ int smlua_func_geo_bits_bowser_coloring(lua_State* L) {
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);
// 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; }
@ -9185,7 +9185,7 @@ int smlua_func_geo_move_mario_part_from_parent(lua_State* L) {
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);
// 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;
@ -9212,7 +9212,7 @@ int smlua_func_geo_scale_bowser_key(lua_State* L) {
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);
// 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; }
@ -9235,7 +9235,7 @@ int smlua_func_geo_snufit_move_mask(lua_State* L) {
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);
// 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; }
@ -9258,7 +9258,7 @@ int smlua_func_geo_snufit_scale_body(lua_State* L) {
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);
// 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; }
@ -9281,7 +9281,7 @@ int smlua_func_geo_switch_bowser_eyes(lua_State* L) {
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);
// 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; }
@ -9304,7 +9304,7 @@ int smlua_func_geo_switch_tuxie_mother_eyes(lua_State* L) {
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);
// 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; }
@ -9327,7 +9327,7 @@ int smlua_func_geo_update_body_rot_from_parent(lua_State* L) {
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);
// 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;
@ -9354,7 +9354,7 @@ int smlua_func_geo_update_held_mario_pos(lua_State* L) {
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);
// 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;
@ -10525,7 +10525,7 @@ int smlua_func_geo_camera_fov(lua_State* L) {
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);
// 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; }
@ -10548,7 +10548,7 @@ int smlua_func_geo_camera_main(lua_State* L) {
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);
// 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; }
@ -20317,7 +20317,7 @@ int smlua_func_geo_obj_transparency_something(lua_State* L) {
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);
// 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; }
@ -24535,7 +24535,7 @@ int smlua_func_geo_choose_area_ext(lua_State* L) {
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);
// 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;
@ -24551,6 +24551,7 @@ int smlua_func_geo_choose_area_ext(lua_State* L) {
}
*/
/*
int smlua_func_geo_offset_klepto_debug(lua_State* L) {
if (L == NULL) { return 0; }
@ -24562,7 +24563,7 @@ int smlua_func_geo_offset_klepto_debug(lua_State* L) {
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);
// 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; }
@ -24572,6 +24573,7 @@ int smlua_func_geo_offset_klepto_debug(lua_State* L) {
return 1;
}
*/
/*
int smlua_func_geo_offset_klepto_held_object(lua_State* L) {
@ -24585,7 +24587,7 @@ int smlua_func_geo_offset_klepto_held_object(lua_State* L) {
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);
// 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;
@ -24613,7 +24615,7 @@ int smlua_func_geo_switch_anim_state(lua_State* L) {
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);
// 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);
@ -24635,7 +24637,7 @@ int smlua_func_geo_switch_area(lua_State* L) {
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);
// 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);
@ -24657,7 +24659,7 @@ int smlua_func_geo_update_layer_transparency(lua_State* L) {
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);
// 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; }
@ -24681,7 +24683,7 @@ int smlua_func_geo_update_projectile_pos_from_parent(lua_State* L) {
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);
// 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;
@ -29057,23 +29059,6 @@ int smlua_func_course_is_main_course(lua_State* L) {
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_attempting_to_open_playerlist(UNUSED lua_State* L) {
if (L == NULL) { return 0; }
@ -29516,23 +29501,6 @@ int smlua_func_get_save_file_modified(UNUSED lua_State* L) {
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));
return 1;
}
int smlua_func_get_time(UNUSED lua_State* L) {
if (L == NULL) { return 0; }
@ -33429,7 +33397,7 @@ void smlua_bind_functions_autogen(void) {
smlua_bind_function(L, "find_object_with_behavior", smlua_func_find_object_with_behavior);
smlua_bind_function(L, "find_unimportant_object", smlua_func_find_unimportant_object);
//smlua_bind_function(L, "geo_choose_area_ext", smlua_func_geo_choose_area_ext); <--- UNIMPLEMENTED
smlua_bind_function(L, "geo_offset_klepto_debug", smlua_func_geo_offset_klepto_debug);
//smlua_bind_function(L, "geo_offset_klepto_debug", smlua_func_geo_offset_klepto_debug); <--- UNIMPLEMENTED
//smlua_bind_function(L, "geo_offset_klepto_held_object", smlua_func_geo_offset_klepto_held_object); <--- UNIMPLEMENTED
//smlua_bind_function(L, "geo_switch_anim_state", smlua_func_geo_switch_anim_state); <--- UNIMPLEMENTED
//smlua_bind_function(L, "geo_switch_area", smlua_func_geo_switch_area); <--- UNIMPLEMENTED
@ -33689,7 +33657,6 @@ void smlua_bind_functions_autogen(void) {
// smlua_misc_utils.h
smlua_bind_function(L, "allocate_mario_action", smlua_func_allocate_mario_action);
smlua_bind_function(L, "course_is_main_course", smlua_func_course_is_main_course);
smlua_bind_function(L, "deref_s32_pointer", smlua_func_deref_s32_pointer);
smlua_bind_function(L, "djui_attempting_to_open_playerlist", smlua_func_djui_attempting_to_open_playerlist);
smlua_bind_function(L, "djui_is_playerlist_open", smlua_func_djui_is_playerlist_open);
smlua_bind_function(L, "djui_is_popup_disabled", smlua_func_djui_is_popup_disabled);
@ -33718,7 +33685,6 @@ void smlua_bind_functions_autogen(void) {
smlua_bind_function(L, "get_network_area_timer", smlua_func_get_network_area_timer);
smlua_bind_function(L, "get_os_name", smlua_func_get_os_name);
smlua_bind_function(L, "get_save_file_modified", smlua_func_get_save_file_modified);
smlua_bind_function(L, "get_temp_s32_pointer", smlua_func_get_temp_s32_pointer);
smlua_bind_function(L, "get_time", smlua_func_get_time);
smlua_bind_function(L, "get_ttc_speed_setting", smlua_func_get_ttc_speed_setting);
smlua_bind_function(L, "get_volume_env", smlua_func_get_volume_env);

View file

@ -47,22 +47,6 @@ u32 get_network_area_timer(void) {
///
s32* get_temp_s32_pointer(s32 initialValue) {
static s32 value = 0;
value = initialValue;
return &value;
}
s32 deref_s32_pointer(s32* pointer) {
if (pointer == NULL) {
LOG_LUA_LINE("Tried to dereference null pointer!");
return 0;
}
return *pointer;
}
///
void djui_popup_create_global(const char* message, int lines) {
djui_popup_create(message, lines);
network_send_global_popup(message, lines);

View file

@ -42,11 +42,6 @@ struct DateTime {
/* |description|Gets the current area's networked timer|descriptionEnd| */
u32 get_network_area_timer(void);
/* |description|Returns a temporary signed 32-bit integer pointer with its value set to `initialValue`|descriptionEnd| */
s32* get_temp_s32_pointer(s32 initialValue);
/* |description|Gets the signed 32-bit integer value from `pointer`|descriptionEnd| */
s32 deref_s32_pointer(s32* pointer);
/* |description|Creates a DJUI popup that is broadcasted to every client|descriptionEnd| */
void djui_popup_create_global(const char* message, int lines);
/* |description|Returns if popups are disabled|descriptionEnd| */