mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-21 19:45:10 +00:00
fix some issue with recent prs
This commit is contained in:
parent
3dd9226bc9
commit
f8a30e4fd8
7 changed files with 17 additions and 16 deletions
|
@ -8201,7 +8201,7 @@ end
|
||||||
--- @param a number
|
--- @param a number
|
||||||
--- @param b number
|
--- @param b number
|
||||||
--- @return number
|
--- @return number
|
||||||
function fast_hypot(a, b)
|
function hypotf(a, b)
|
||||||
-- ...
|
-- ...
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1398,7 +1398,6 @@ static const void* sDynosBuiltinFuncs[] = {
|
||||||
define_builtin(geo_movtex_draw_water_regions_ext),
|
define_builtin(geo_movtex_draw_water_regions_ext),
|
||||||
define_builtin(lvl_init_or_update),
|
define_builtin(lvl_init_or_update),
|
||||||
define_builtin(geo_choose_area_ext),
|
define_builtin(geo_choose_area_ext),
|
||||||
define_builtin(geo_mario_cap_display_list),
|
|
||||||
|
|
||||||
// Behaviors
|
// Behaviors
|
||||||
define_builtin(bhv_cap_switch_loop),
|
define_builtin(bhv_cap_switch_loop),
|
||||||
|
@ -1976,6 +1975,7 @@ static const void* sDynosBuiltinFuncs[] = {
|
||||||
define_builtin(bhv_star_number_loop),
|
define_builtin(bhv_star_number_loop),
|
||||||
define_builtin(spawn_star_number),
|
define_builtin(spawn_star_number),
|
||||||
define_builtin(bhv_ferris_wheel_platform_init),
|
define_builtin(bhv_ferris_wheel_platform_init),
|
||||||
|
define_builtin(geo_mario_cap_display_list),
|
||||||
};
|
};
|
||||||
|
|
||||||
const void* DynOS_Builtin_Func_GetFromName(const char* aDataName) {
|
const void* DynOS_Builtin_Func_GetFromName(const char* aDataName) {
|
||||||
|
|
|
@ -1821,10 +1821,10 @@
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
## [fast_hypot](#fast_hypot)
|
## [hypotf](#hypotf)
|
||||||
|
|
||||||
### Lua Example
|
### Lua Example
|
||||||
`local numberValue = fast_hypot(a, b)`
|
`local numberValue = hypotf(a, b)`
|
||||||
|
|
||||||
### Parameters
|
### Parameters
|
||||||
| Field | Type |
|
| Field | Type |
|
||||||
|
@ -1836,7 +1836,7 @@
|
||||||
- `number`
|
- `number`
|
||||||
|
|
||||||
### C Prototype
|
### C Prototype
|
||||||
`f32 fast_hypot(f32 a, f32 b);`
|
`f32 hypotf(f32 a, f32 b);`
|
||||||
|
|
||||||
[:arrow_up_small:](#)
|
[:arrow_up_small:](#)
|
||||||
|
|
||||||
|
|
|
@ -1718,7 +1718,7 @@
|
||||||
- [clamp](functions-5.md#clamp)
|
- [clamp](functions-5.md#clamp)
|
||||||
- [clampf](functions-5.md#clampf)
|
- [clampf](functions-5.md#clampf)
|
||||||
- [degrees_to_sm64](functions-5.md#degrees_to_sm64)
|
- [degrees_to_sm64](functions-5.md#degrees_to_sm64)
|
||||||
- [fast_hypot](functions-5.md#fast_hypot)
|
- [hypotf](functions-5.md#hypotf)
|
||||||
- [radians_to_sm64](functions-5.md#radians_to_sm64)
|
- [radians_to_sm64](functions-5.md#radians_to_sm64)
|
||||||
- [sm64_to_degrees](functions-5.md#sm64_to_degrees)
|
- [sm64_to_degrees](functions-5.md#sm64_to_degrees)
|
||||||
- [sm64_to_radians](functions-5.md#sm64_to_radians)
|
- [sm64_to_radians](functions-5.md#sm64_to_radians)
|
||||||
|
|
|
@ -52,9 +52,10 @@ f32 coss(s16 sm64Angle);
|
||||||
#if defined(__clang__) || defined(__GNUC__)
|
#if defined(__clang__) || defined(__GNUC__)
|
||||||
|
|
||||||
#define absx(x) _Generic((x), \
|
#define absx(x) _Generic((x), \
|
||||||
f32: __builtin_fabsf(x), \
|
f32: __builtin_fabsf, \
|
||||||
default: __builtin_abs(x) \
|
double: __builtin_fabs, \
|
||||||
)
|
default: __builtin_abs \
|
||||||
|
)(x)
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
|
|
@ -30199,21 +30199,21 @@ int smlua_func_degrees_to_sm64(lua_State* L) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int smlua_func_fast_hypot(lua_State* L) {
|
int smlua_func_hypotf(lua_State* L) {
|
||||||
if (L == NULL) { return 0; }
|
if (L == NULL) { return 0; }
|
||||||
|
|
||||||
int top = lua_gettop(L);
|
int top = lua_gettop(L);
|
||||||
if (top != 2) {
|
if (top != 2) {
|
||||||
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "fast_hypot", 2, top);
|
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "hypotf", 2, top);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
f32 a = smlua_to_number(L, 1);
|
f32 a = smlua_to_number(L, 1);
|
||||||
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "fast_hypot"); return 0; }
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "hypotf"); return 0; }
|
||||||
f32 b = smlua_to_number(L, 2);
|
f32 b = smlua_to_number(L, 2);
|
||||||
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "fast_hypot"); return 0; }
|
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "hypotf"); return 0; }
|
||||||
|
|
||||||
lua_pushnumber(L, fast_hypot(a, b));
|
lua_pushnumber(L, hypotf(a, b));
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -34873,7 +34873,7 @@ void smlua_bind_functions_autogen(void) {
|
||||||
smlua_bind_function(L, "clamp", smlua_func_clamp);
|
smlua_bind_function(L, "clamp", smlua_func_clamp);
|
||||||
smlua_bind_function(L, "clampf", smlua_func_clampf);
|
smlua_bind_function(L, "clampf", smlua_func_clampf);
|
||||||
smlua_bind_function(L, "degrees_to_sm64", smlua_func_degrees_to_sm64);
|
smlua_bind_function(L, "degrees_to_sm64", smlua_func_degrees_to_sm64);
|
||||||
smlua_bind_function(L, "fast_hypot", smlua_func_fast_hypot);
|
smlua_bind_function(L, "hypotf", smlua_func_hypotf);
|
||||||
smlua_bind_function(L, "radians_to_sm64", smlua_func_radians_to_sm64);
|
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, "sm64_to_degrees", smlua_func_sm64_to_degrees);
|
||||||
smlua_bind_function(L, "sm64_to_radians", smlua_func_sm64_to_radians);
|
smlua_bind_function(L, "sm64_to_radians", smlua_func_sm64_to_radians);
|
||||||
|
|
|
@ -5,7 +5,7 @@ f32 sm64_to_radians(s16 sm64Angle);
|
||||||
s16 radians_to_sm64(f32 radiansAngle);
|
s16 radians_to_sm64(f32 radiansAngle);
|
||||||
f32 sm64_to_degrees(s16 sm64Angle);
|
f32 sm64_to_degrees(s16 sm64Angle);
|
||||||
s16 degrees_to_sm64(f32 degreesAngle);
|
s16 degrees_to_sm64(f32 degreesAngle);
|
||||||
f32 fast_hypot(f32 a, f32 b);
|
f32 hypotf(f32 a, f32 b);
|
||||||
s32 clamp(s32 a, s32 b, s32 c);
|
s32 clamp(s32 a, s32 b, s32 c);
|
||||||
f32 clampf(f32 a, f32 b, f32 c);
|
f32 clampf(f32 a, f32 b, f32 c);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue