mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2026-04-26 03:51:46 +00:00
autogen
This commit is contained in:
parent
b93e5e17fd
commit
912556bb94
5 changed files with 108 additions and 7 deletions
|
|
@ -4876,6 +4876,19 @@ function lag_compensation_get_local_state_index()
|
|||
-- ...
|
||||
end
|
||||
|
||||
--- @param str64 Pointer_integer
|
||||
--- @param strAscii string
|
||||
--- @param menu boolean
|
||||
function convert_string_ascii_to_sm64(str64, strAscii, menu)
|
||||
-- ...
|
||||
end
|
||||
|
||||
--- @param strAscii Pointer_integer
|
||||
--- @param str64 Pointer_integer
|
||||
function convert_string_sm64_to_ascii(strAscii, str64)
|
||||
-- ...
|
||||
end
|
||||
|
||||
--- @param courseNum integer
|
||||
--- @param levelNum integer
|
||||
--- @param areaIndex integer
|
||||
|
|
|
|||
|
|
@ -6253,6 +6253,49 @@ Gets the local Mario's state index
|
|||
<br />
|
||||
|
||||
|
||||
## [convert_string_ascii_to_sm64](#convert_string_ascii_to_sm64)
|
||||
|
||||
### Lua Example
|
||||
`convert_string_ascii_to_sm64(str64, strAscii, menu)`
|
||||
|
||||
### Parameters
|
||||
| Field | Type |
|
||||
| ----- | ---- |
|
||||
| str64 | `Pointer` <`integer`> |
|
||||
| strAscii | `string` |
|
||||
| menu | `boolean` |
|
||||
|
||||
### Returns
|
||||
- None
|
||||
|
||||
### C Prototype
|
||||
`void convert_string_ascii_to_sm64(u8 *str64, const char *strAscii, bool menu);`
|
||||
|
||||
[:arrow_up_small:](#)
|
||||
|
||||
<br />
|
||||
|
||||
## [convert_string_sm64_to_ascii](#convert_string_sm64_to_ascii)
|
||||
|
||||
### Lua Example
|
||||
`convert_string_sm64_to_ascii(strAscii, str64)`
|
||||
|
||||
### Parameters
|
||||
| Field | Type |
|
||||
| ----- | ---- |
|
||||
| strAscii | `Pointer` <`integer`> |
|
||||
| str64 | `Pointer` <`integer`> |
|
||||
|
||||
### Returns
|
||||
- None
|
||||
|
||||
### C Prototype
|
||||
`void convert_string_sm64_to_ascii(char *strAscii, const u8 *str64);`
|
||||
|
||||
[:arrow_up_small:](#)
|
||||
|
||||
<br />
|
||||
|
||||
## [get_level_name_ascii](#get_level_name_ascii)
|
||||
|
||||
### Description
|
||||
|
|
|
|||
|
|
@ -935,6 +935,8 @@
|
|||
<br />
|
||||
|
||||
- level_info.h
|
||||
- [convert_string_ascii_to_sm64](functions-3.md#convert_string_ascii_to_sm64)
|
||||
- [convert_string_sm64_to_ascii](functions-3.md#convert_string_sm64_to_ascii)
|
||||
- [get_level_name_ascii](functions-3.md#get_level_name_ascii)
|
||||
- [get_level_name_sm64](functions-3.md#get_level_name_sm64)
|
||||
- [get_level_name](functions-3.md#get_level_name)
|
||||
|
|
|
|||
|
|
@ -3499,13 +3499,14 @@ char gSmluaConstants[] = ""
|
|||
"HUD_DISPLAY_FLAGS_CAMERA=0x0080\n"
|
||||
"HUD_DISPLAY_FLAGS_POWER=0x0100\n"
|
||||
"HUD_DISPLAY_FLAGS_EMPHASIZE_POWER=0x8000\n"
|
||||
"ACT_SELECT_HUD_ALL=1 << 0\n"
|
||||
"ACT_SELECT_HUD_SCORE=1 << 1\n"
|
||||
"ACT_SELECT_HUD_LEVEL_NAME=1 << 2\n"
|
||||
"ACT_SELECT_HUD_COURSE_NUM=1 << 3\n"
|
||||
"ACT_SELECT_HUD_ACT_NAME=1 << 4\n"
|
||||
"ACT_SELECT_HUD_STAR_NUM=1 << 5\n"
|
||||
"ACT_SELECT_HUD_PLAYERS_IN_LEVEL=1 << 6\n"
|
||||
"ACT_SELECT_HUD_SCORE=1 << 0\n"
|
||||
"ACT_SELECT_HUD_LEVEL_NAME=1 << 1\n"
|
||||
"ACT_SELECT_HUD_COURSE_NUM=1 << 2\n"
|
||||
"ACT_SELECT_HUD_ACT_NAME=1 << 3\n"
|
||||
"ACT_SELECT_HUD_STAR_NUM=1 << 4\n"
|
||||
"ACT_SELECT_HUD_PLAYERS_IN_LEVEL=1 << 5\n"
|
||||
"ACT_SELECT_HUD_NONE=0\n"
|
||||
"ACT_SELECT_HUD_ALL=ACT_SELECT_HUD_SCORE | ACT_SELECT_HUD_LEVEL_NAME | ACT_SELECT_HUD_COURSE_NUM | ACT_SELECT_HUD_ACT_NAME |ACT_SELECT_HUD_STAR_NUM | ACT_SELECT_HUD_PLAYERS_IN_LEVEL\n"
|
||||
"E_MODEL_NONE=0\n"
|
||||
"E_MODEL_MARIO=1\n"
|
||||
"E_MODEL_SMOKE=2\n"
|
||||
|
|
|
|||
|
|
@ -15155,6 +15155,46 @@ int smlua_func_lag_compensation_get_local_state_index(UNUSED lua_State* L) {
|
|||
// level_info.h //
|
||||
//////////////////
|
||||
|
||||
int smlua_func_convert_string_ascii_to_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", "convert_string_ascii_to_sm64", 3, top);
|
||||
return 0;
|
||||
}
|
||||
|
||||
u8 * str64 = (u8 *)smlua_to_cpointer(L, 1, LVT_U8_P);
|
||||
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "convert_string_ascii_to_sm64"); return 0; }
|
||||
const char* strAscii = smlua_to_string(L, 2);
|
||||
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "convert_string_ascii_to_sm64"); return 0; }
|
||||
bool menu = smlua_to_boolean(L, 3);
|
||||
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 3, "convert_string_ascii_to_sm64"); return 0; }
|
||||
|
||||
convert_string_ascii_to_sm64(str64, strAscii, menu);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int smlua_func_convert_string_sm64_to_ascii(lua_State* L) {
|
||||
if (L == NULL) { return 0; }
|
||||
|
||||
int top = lua_gettop(L);
|
||||
if (top != 2) {
|
||||
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "convert_string_sm64_to_ascii", 2, top);
|
||||
return 0;
|
||||
}
|
||||
|
||||
char * strAscii = (char *)smlua_to_cpointer(L, 1, LVT_STRING_P);
|
||||
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "convert_string_sm64_to_ascii"); return 0; }
|
||||
u8 * str64 = (u8 *)smlua_to_cpointer(L, 2, LVT_U8_P);
|
||||
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 2, "convert_string_sm64_to_ascii"); return 0; }
|
||||
|
||||
convert_string_sm64_to_ascii(strAscii, str64);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int smlua_func_get_level_name_ascii(lua_State* L) {
|
||||
if (L == NULL) { return 0; }
|
||||
|
||||
|
|
@ -37264,6 +37304,8 @@ void smlua_bind_functions_autogen(void) {
|
|||
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, "convert_string_ascii_to_sm64", smlua_func_convert_string_ascii_to_sm64);
|
||||
smlua_bind_function(L, "convert_string_sm64_to_ascii", smlua_func_convert_string_sm64_to_ascii);
|
||||
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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue