Further improvements and document smlua_misc_utils.h

This commit is contained in:
Agent X 2024-12-07 12:53:34 -05:00
parent 1aa7524380
commit a8a8d50a0c
5 changed files with 361 additions and 8 deletions

View file

@ -1,5 +1,6 @@
import os
import re
import math
from extract_functions import *
from common import *
@ -812,6 +813,7 @@ N/A
############################################################################
total_functions = 0
total_doc_functions = 0
header_h = ""
def reject_line(line):
@ -978,6 +980,9 @@ def build_function(function, do_extern):
else:
global total_functions
total_functions += 1
if function['description'] != "":
global total_doc_functions
total_doc_functions += 1
return s + "\n"
@ -1427,13 +1432,16 @@ def main():
with open(filename, 'w', newline='\n') as out:
out.write(gen)
print('REJECTS:\n%s' % rejects)
if rejects != "":
print(f"REJECTS:\n{rejects}")
doc_files(processed_files)
def_files(processed_files)
global total_functions
print('Total functions: ' + str(total_functions))
print(f"Total functions: {total_functions}")
global total_doc_functions
print(f"Total documented functions: {total_doc_functions} ({round((total_doc_functions / total_functions) * 100, 2)}%)")
if len(sys.argv) >= 2 and sys.argv[1] == 'fuzz':
output_fuzz_file()

View file

@ -8351,110 +8351,131 @@ end
--- @param actFlags integer
--- @return integer
--- Allocates an action ID with bitwise flags
function allocate_mario_action(actFlags)
-- ...
end
--- @param courseNum integer
--- @return boolean
--- Checks if a course is a main course and not the castle or secret levels
function course_is_main_course(courseNum)
-- ...
end
--- @param pointer Pointer_integer
--- @return integer
--- Gets the 32-bit integer value from the 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()
-- ...
end
--- @return boolean
--- Checks if the DJUI playerlist is open
function djui_is_playerlist_open()
-- ...
end
--- @return boolean
--- Returns if popups are disabled
function djui_is_popup_disabled()
-- ...
end
--- @return DjuiFontType
--- Gets the DJUI menu font
function djui_menu_get_font()
-- ...
end
--- @return DjuiTheme
--- Gets the DJUI menu theme
function djui_menu_get_theme()
-- ...
end
--- @param message string
--- @param lines integer
--- Creates a DJUI popup that is broadcasted to every client
function djui_popup_create_global(message, lines)
-- ...
end
--- Resets if popups are disabled
function djui_reset_popup_disabled_override()
-- ...
end
--- @param value boolean
--- Sets if popups are disabled
function djui_set_popup_disabled_override(value)
-- ...
end
--- @param localIndex integer
--- @return string
--- Gets the CoopNet ID of a player if CoopNet is being used and the player is connected, otherwise "-1" is returned
function get_coopnet_id(localIndex)
-- ...
end
--- @return integer
--- Gets the current save file number (1-indexed)
function get_current_save_file_num()
-- ...
end
--- @return DateTime
--- Gets the system clock's date and time
function get_date_and_time()
-- ...
end
--- @return integer
--- Gets the current state of the dialog box
function get_dialog_box_state()
-- ...
end
--- @return integer
--- Gets the current dialog box ID
function get_dialog_id()
-- ...
end
--- @return integer
--- Gets the choice selected inside of a dialog box (0-1)
function get_dialog_response()
-- ...
end
--- @return integer
--- Gets the non overridden environment effect (e.g. snow)
function get_envfx()
-- ...
end
--- @param index integer
--- @return number
--- Gets an environment region (gas/water boxes) height value
function get_environment_region(index)
-- ...
end
--- @return integer
--- Gets the global timer that has been ticking at 30 frames per second since game boot
function get_global_timer()
-- ...
end
--- @return boolean
--- Checks if the save file's coin "HI SCORE" was obtained with the last star or key collection
function get_got_file_coin_hi_score()
-- ...
end
@ -8462,6 +8483,7 @@ end
--- @param m MarioState
--- @param index integer
--- @return number
--- Gets the X coordinate of Mario's hand (0-1) or foot (2-3) but it is important to note that the positions are not updated off-screen
function get_hand_foot_pos_x(m, index)
-- ...
end
@ -8469,6 +8491,7 @@ end
--- @param m MarioState
--- @param index integer
--- @return number
--- Gets the Y coordinate of Mario's hand (0-1) or foot (2-3) but it is important to note that the positions are not updated off-screen
function get_hand_foot_pos_y(m, index)
-- ...
end
@ -8476,88 +8499,105 @@ end
--- @param m MarioState
--- @param index integer
--- @return number
--- Gets the Z coordinate of Mario's hand (0-1) or foot (2-3) but it is important to note that the positions are not updated off-screen
function get_hand_foot_pos_z(m, index)
-- ...
end
--- @return integer
--- Gets the last course a star or key was collected in
function get_last_completed_course_num()
-- ...
end
--- @return integer
--- Gets the last collected star's number (1-7)
function get_last_completed_star_num()
-- ...
end
--- @return integer
--- Gets if the last objective collected was a star (0) or a key (1)
function get_last_star_or_key()
-- ...
end
--- @return string
--- Gets the local discord ID if it isn't disabled, otherwise "0" is returned
function get_local_discord_id()
-- ...
end
--- @return integer
--- Gets the current area's networked timer
function get_network_area_timer()
-- ...
end
--- @return string
--- Gets the name of the operating system the game is running on
function get_os_name()
-- ...
end
--- @return boolean
--- Checks if the save file has been modified without saving
function get_save_file_modified()
-- ...
end
--- @param initialValue integer
--- @return Pointer_integer
--- Returns a temporary 32-bit integer pointer
function get_temp_s32_pointer(initialValue)
-- ...
end
--- @return integer
--- Gets the Unix Timestamp
function get_time()
-- ...
end
--- @return integer
--- Gets TTC's speed setting
function get_ttc_speed_setting()
-- ...
end
--- @return number
--- Gets the volume level of environment sounds effects
function get_volume_env()
-- ...
end
--- @return number
--- Gets the volume level of music
function get_volume_level()
-- ...
end
--- @return number
--- Gets the master volume level
function get_volume_master()
-- ...
end
--- @return number
--- Gets the volume level of sound effects
function get_volume_sfx()
-- ...
end
--- @param index integer
--- @return integer
--- Gets the water level in an area
function get_water_level(index)
-- ...
end
--- @return integer
--- Gets if the star counter on the HUD should flash
function hud_get_flash()
-- ...
end
@ -8568,11 +8608,13 @@ function hud_get_value(type)
-- ...
end
--- Hides the HUD
function hud_hide()
-- ...
end
--- @return boolean
--- Checks if the HUD is hidden
function hud_is_hidden()
-- ...
end
@ -8582,6 +8624,7 @@ end
--- @param y number
--- @param width number
--- @param height number
--- Renders a power meter on the HUD
function hud_render_power_meter(health, x, y, width, height)
-- ...
end
@ -8595,37 +8638,44 @@ end
--- @param y number
--- @param width number
--- @param height number
--- Renders an interpolated power meter on the HUD
function hud_render_power_meter_interpolated(health, prevX, prevY, prevWidth, prevHeight, x, y, width, height)
-- ...
end
--- @param value integer
--- Sets if the star counter on the HUD should flash
function hud_set_flash(value)
-- ...
end
--- @param type HudDisplayValue
--- @param value integer
--- Sets a HUD display value
function hud_set_value(type, value)
-- ...
end
--- Shows the HUD
function hud_show()
-- ...
end
--- @return boolean
--- Checks if the game is paused
function is_game_paused()
-- ...
end
--- @return boolean
--- Checks if a screen transition is playing
function is_transition_playing()
-- ...
end
--- @param filename string
--- @return boolean
--- Checks if a file exists inside of a mod
function mod_file_exists(filename)
-- ...
end
@ -8634,6 +8684,7 @@ end
--- @param level integer
--- @param area integer
--- @param type integer
--- Registers a custom moving texture entry (used for vanilla water boxes)
function movtexqc_register(name, level, area, type)
-- ...
end
@ -8643,81 +8694,97 @@ end
--- @param red integer
--- @param green integer
--- @param blue integer
--- Plays a screen transition
function play_transition(transType, time, red, green, blue)
-- ...
end
--- Resets the window title
function reset_window_title()
-- ...
end
--- @return boolean
--- Checks if the save file is using its backup slot
function save_file_get_using_backup_slot()
-- ...
end
--- @param usingBackupSlot boolean
--- Sets if the save file should use its backup slot
function save_file_set_using_backup_slot(usingBackupSlot)
-- ...
end
--- @param index integer
--- @param value integer
--- Sets an environment region (gas/water boxes) height value
function set_environment_region(index, value)
-- ...
end
--- @param value boolean
--- Sets if the save file's coin "HI SCORE" was obtained with the last star or key collection
function set_got_file_coin_hi_score(value)
-- ...
end
--- @param courseNum integer
--- Sets the last course a star or key was collected in
function set_last_completed_course_num(courseNum)
-- ...
end
--- @param starNum integer
--- Sets the last collected star's number (1-7)
function set_last_completed_star_num(starNum)
-- ...
end
--- @param value integer
--- Sets if the last objective collected was a star (0) or a key (1)
function set_last_star_or_key(value)
-- ...
end
--- @param envfx integer
--- Sets the override environment effect (e.g. snow)
function set_override_envfx(envfx)
-- ...
end
--- @param value boolean
--- Sets if the save file has been modified without saving
function set_save_file_modified(value)
-- ...
end
--- @param speed integer
--- Sets TTC's speed setting (TTC_SPEED_*)
function set_ttc_speed_setting(speed)
-- ...
end
--- @param volume number
--- Sets the volume level of environment sounds effects
function set_volume_env(volume)
-- ...
end
--- @param volume number
--- Sets the volume level of music
function set_volume_level(volume)
-- ...
end
--- @param volume number
--- Sets the master volume level
function set_volume_master(volume)
-- ...
end
--- @param volume number
--- Sets the volume level of sound effects
function set_volume_sfx(volume)
-- ...
end
@ -8725,11 +8792,13 @@ end
--- @param index integer
--- @param height integer
--- @param sync boolean
--- Sets the water level in an area
function set_water_level(index, height, sync)
-- ...
end
--- @param title string
--- Sets the window title to a custom title
function set_window_title(title)
-- ...
end

View file

@ -2736,6 +2736,9 @@ Computes the square of a floating-point number
### C Prototype
`u32 allocate_mario_action(u32 actFlags);`
### Description
Allocates an action ID with bitwise flags
[:arrow_up_small:](#)
<br />
@ -2756,6 +2759,9 @@ Computes the square of a floating-point number
### C Prototype
`bool course_is_main_course(u16 courseNum);`
### Description
Checks if a course is a main course and not the castle or secret levels
[:arrow_up_small:](#)
<br />
@ -2776,6 +2782,9 @@ Computes the square of a floating-point number
### C Prototype
`s32 deref_s32_pointer(s32* pointer);`
### Description
Gets the 32-bit integer value from the pointer
[:arrow_up_small:](#)
<br />
@ -2794,6 +2803,9 @@ Computes the square of a floating-point number
### C Prototype
`bool djui_attempting_to_open_playerlist(void);`
### Description
Checks if the DJUI playerlist is attempting to be opened
[:arrow_up_small:](#)
<br />
@ -2812,6 +2824,9 @@ Computes the square of a floating-point number
### C Prototype
`bool djui_is_playerlist_open(void);`
### Description
Checks if the DJUI playerlist is open
[:arrow_up_small:](#)
<br />
@ -2830,6 +2845,9 @@ Computes the square of a floating-point number
### C Prototype
`bool djui_is_popup_disabled(void);`
### Description
Returns if popups are disabled
[:arrow_up_small:](#)
<br />
@ -2848,6 +2866,9 @@ Computes the square of a floating-point number
### C Prototype
`enum DjuiFontType djui_menu_get_font(void);`
### Description
Gets the DJUI menu font
[:arrow_up_small:](#)
<br />
@ -2866,6 +2887,9 @@ Computes the square of a floating-point number
### C Prototype
`struct DjuiTheme* djui_menu_get_theme(void);`
### Description
Gets the DJUI menu theme
[:arrow_up_small:](#)
<br />
@ -2887,6 +2911,9 @@ Computes the square of a floating-point number
### C Prototype
`void djui_popup_create_global(const char* message, int lines);`
### Description
Creates a DJUI popup that is broadcasted to every client
[:arrow_up_small:](#)
<br />
@ -2905,6 +2932,9 @@ Computes the square of a floating-point number
### C Prototype
`void djui_reset_popup_disabled_override(void);`
### Description
Resets if popups are disabled
[:arrow_up_small:](#)
<br />
@ -2925,6 +2955,9 @@ Computes the square of a floating-point number
### C Prototype
`void djui_set_popup_disabled_override(bool value);`
### Description
Sets if popups are disabled
[:arrow_up_small:](#)
<br />
@ -2945,6 +2978,9 @@ Computes the square of a floating-point number
### C Prototype
`const char* get_coopnet_id(s8 localIndex);`
### Description
Gets the CoopNet ID of a player if CoopNet is being used and the player is connected, otherwise "-1" is returned
[:arrow_up_small:](#)
<br />
@ -2963,6 +2999,9 @@ Computes the square of a floating-point number
### C Prototype
`s16 get_current_save_file_num(void);`
### Description
Gets the current save file number (1-indexed)
[:arrow_up_small:](#)
<br />
@ -2981,6 +3020,9 @@ Computes the square of a floating-point number
### C Prototype
`struct DateTime* get_date_and_time(void);`
### Description
Gets the system clock's date and time
[:arrow_up_small:](#)
<br />
@ -2999,6 +3041,9 @@ Computes the square of a floating-point number
### C Prototype
`s8 get_dialog_box_state(void);`
### Description
Gets the current state of the dialog box
[:arrow_up_small:](#)
<br />
@ -3017,6 +3062,9 @@ Computes the square of a floating-point number
### C Prototype
`s16 get_dialog_id(void);`
### Description
Gets the current dialog box ID
[:arrow_up_small:](#)
<br />
@ -3035,6 +3083,9 @@ Computes the square of a floating-point number
### C Prototype
`s32 get_dialog_response(void);`
### Description
Gets the choice selected inside of a dialog box (0-1)
[:arrow_up_small:](#)
<br />
@ -3053,6 +3104,9 @@ Computes the square of a floating-point number
### C Prototype
`u16 get_envfx(void);`
### Description
Gets the non overridden environment effect (e.g. snow)
[:arrow_up_small:](#)
<br />
@ -3073,6 +3127,9 @@ Computes the square of a floating-point number
### C Prototype
`f32 get_environment_region(u8 index);`
### Description
Gets an environment region (gas/water boxes) height value
[:arrow_up_small:](#)
<br />
@ -3091,6 +3148,9 @@ Computes the square of a floating-point number
### C Prototype
`u32 get_global_timer(void);`
### Description
Gets the global timer that has been ticking at 30 frames per second since game boot
[:arrow_up_small:](#)
<br />
@ -3109,6 +3169,9 @@ Computes the square of a floating-point number
### C Prototype
`bool get_got_file_coin_hi_score(void);`
### Description
Checks if the save file's coin "HI SCORE" was obtained with the last star or key collection
[:arrow_up_small:](#)
<br />
@ -3130,6 +3193,9 @@ Computes the square of a floating-point number
### C Prototype
`f32 get_hand_foot_pos_x(struct MarioState* m, u8 index);`
### Description
Gets the X coordinate of Mario's hand (0-1) or foot (2-3) but it is important to note that the positions are not updated off-screen
[:arrow_up_small:](#)
<br />
@ -3151,6 +3217,9 @@ Computes the square of a floating-point number
### C Prototype
`f32 get_hand_foot_pos_y(struct MarioState* m, u8 index);`
### Description
Gets the Y coordinate of Mario's hand (0-1) or foot (2-3) but it is important to note that the positions are not updated off-screen
[:arrow_up_small:](#)
<br />
@ -3172,6 +3241,9 @@ Computes the square of a floating-point number
### C Prototype
`f32 get_hand_foot_pos_z(struct MarioState* m, u8 index);`
### Description
Gets the Z coordinate of Mario's hand (0-1) or foot (2-3) but it is important to note that the positions are not updated off-screen
[:arrow_up_small:](#)
<br />
@ -3190,6 +3262,9 @@ Computes the square of a floating-point number
### C Prototype
`u8 get_last_completed_course_num(void);`
### Description
Gets the last course a star or key was collected in
[:arrow_up_small:](#)
<br />
@ -3208,6 +3283,9 @@ Computes the square of a floating-point number
### C Prototype
`u8 get_last_completed_star_num(void);`
### Description
Gets the last collected star's number (1-7)
[:arrow_up_small:](#)
<br />
@ -3224,7 +3302,10 @@ Computes the square of a floating-point number
- `integer`
### C Prototype
`s32 get_last_star_or_key(void);`
`u8 get_last_star_or_key(void);`
### Description
Gets if the last objective collected was a star (0) or a key (1)
[:arrow_up_small:](#)
@ -3244,6 +3325,9 @@ Computes the square of a floating-point number
### C Prototype
`const char* get_local_discord_id(void);`
### Description
Gets the local discord ID if it isn't disabled, otherwise "0" is returned
[:arrow_up_small:](#)
<br />
@ -3262,6 +3346,9 @@ Computes the square of a floating-point number
### C Prototype
`u32 get_network_area_timer(void);`
### Description
Gets the current area's networked timer
[:arrow_up_small:](#)
<br />
@ -3280,6 +3367,9 @@ Computes the square of a floating-point number
### C Prototype
`const char* get_os_name(void);`
### Description
Gets the name of the operating system the game is running on
[:arrow_up_small:](#)
<br />
@ -3298,6 +3388,9 @@ Computes the square of a floating-point number
### C Prototype
`bool get_save_file_modified(void);`
### Description
Checks if the save file has been modified without saving
[:arrow_up_small:](#)
<br />
@ -3318,6 +3411,9 @@ Computes the square of a floating-point number
### C Prototype
`s32* get_temp_s32_pointer(s32 initialValue);`
### Description
Returns a temporary 32-bit integer pointer
[:arrow_up_small:](#)
<br />
@ -3336,6 +3432,9 @@ Computes the square of a floating-point number
### C Prototype
`s64 get_time(void);`
### Description
Gets the Unix Timestamp
[:arrow_up_small:](#)
<br />
@ -3354,6 +3453,9 @@ Computes the square of a floating-point number
### C Prototype
`s16 get_ttc_speed_setting(void);`
### Description
Gets TTC's speed setting
[:arrow_up_small:](#)
<br />
@ -3372,6 +3474,9 @@ Computes the square of a floating-point number
### C Prototype
`f32 get_volume_env(void);`
### Description
Gets the volume level of environment sounds effects
[:arrow_up_small:](#)
<br />
@ -3390,6 +3495,9 @@ Computes the square of a floating-point number
### C Prototype
`f32 get_volume_level(void);`
### Description
Gets the volume level of music
[:arrow_up_small:](#)
<br />
@ -3408,6 +3516,9 @@ Computes the square of a floating-point number
### C Prototype
`f32 get_volume_master(void);`
### Description
Gets the master volume level
[:arrow_up_small:](#)
<br />
@ -3426,6 +3537,9 @@ Computes the square of a floating-point number
### C Prototype
`f32 get_volume_sfx(void);`
### Description
Gets the volume level of sound effects
[:arrow_up_small:](#)
<br />
@ -3446,6 +3560,9 @@ Computes the square of a floating-point number
### C Prototype
`s16 get_water_level(u8 index);`
### Description
Gets the water level in an area
[:arrow_up_small:](#)
<br />
@ -3464,6 +3581,9 @@ Computes the square of a floating-point number
### C Prototype
`s8 hud_get_flash(void);`
### Description
Gets if the star counter on the HUD should flash
[:arrow_up_small:](#)
<br />
@ -3502,6 +3622,9 @@ Computes the square of a floating-point number
### C Prototype
`void hud_hide(void);`
### Description
Hides the HUD
[:arrow_up_small:](#)
<br />
@ -3520,6 +3643,9 @@ Computes the square of a floating-point number
### C Prototype
`bool hud_is_hidden(void);`
### Description
Checks if the HUD is hidden
[:arrow_up_small:](#)
<br />
@ -3544,6 +3670,9 @@ Computes the square of a floating-point number
### C Prototype
`void hud_render_power_meter(s32 health, f32 x, f32 y, f32 width, f32 height);`
### Description
Renders a power meter on the HUD
[:arrow_up_small:](#)
<br />
@ -3572,6 +3701,9 @@ Computes the square of a floating-point number
### C Prototype
`void hud_render_power_meter_interpolated(s32 health, f32 prevX, f32 prevY, f32 prevWidth, f32 prevHeight, f32 x, f32 y, f32 width, f32 height);`
### Description
Renders an interpolated power meter on the HUD
[:arrow_up_small:](#)
<br />
@ -3592,6 +3724,9 @@ Computes the square of a floating-point number
### C Prototype
`void hud_set_flash(s8 value);`
### Description
Sets if the star counter on the HUD should flash
[:arrow_up_small:](#)
<br />
@ -3613,6 +3748,9 @@ Computes the square of a floating-point number
### C Prototype
`void hud_set_value(enum HudDisplayValue type, s32 value);`
### Description
Sets a HUD display value
[:arrow_up_small:](#)
<br />
@ -3631,6 +3769,9 @@ Computes the square of a floating-point number
### C Prototype
`void hud_show(void);`
### Description
Shows the HUD
[:arrow_up_small:](#)
<br />
@ -3649,6 +3790,9 @@ Computes the square of a floating-point number
### C Prototype
`bool is_game_paused(void);`
### Description
Checks if the game is paused
[:arrow_up_small:](#)
<br />
@ -3667,6 +3811,9 @@ Computes the square of a floating-point number
### C Prototype
`bool is_transition_playing(void);`
### Description
Checks if a screen transition is playing
[:arrow_up_small:](#)
<br />
@ -3687,6 +3834,9 @@ Computes the square of a floating-point number
### C Prototype
`bool mod_file_exists(const char* filename);`
### Description
Checks if a file exists inside of a mod
[:arrow_up_small:](#)
<br />
@ -3710,6 +3860,9 @@ Computes the square of a floating-point number
### C Prototype
`void movtexqc_register(const char* name, s16 level, s16 area, s16 type);`
### Description
Registers a custom moving texture entry (used for vanilla water boxes)
[:arrow_up_small:](#)
<br />
@ -3734,6 +3887,9 @@ Computes the square of a floating-point number
### C Prototype
`void play_transition(s16 transType, s16 time, u8 red, u8 green, u8 blue);`
### Description
Plays a screen transition
[:arrow_up_small:](#)
<br />
@ -3752,6 +3908,9 @@ Computes the square of a floating-point number
### C Prototype
`void reset_window_title(void);`
### Description
Resets the window title
[:arrow_up_small:](#)
<br />
@ -3770,6 +3929,9 @@ Computes the square of a floating-point number
### C Prototype
`bool save_file_get_using_backup_slot(void);`
### Description
Checks if the save file is using its backup slot
[:arrow_up_small:](#)
<br />
@ -3790,6 +3952,9 @@ Computes the square of a floating-point number
### C Prototype
`void save_file_set_using_backup_slot(bool usingBackupSlot);`
### Description
Sets if the save file should use its backup slot
[:arrow_up_small:](#)
<br />
@ -3811,6 +3976,9 @@ Computes the square of a floating-point number
### C Prototype
`void set_environment_region(u8 index, s32 value);`
### Description
Sets an environment region (gas/water boxes) height value
[:arrow_up_small:](#)
<br />
@ -3831,6 +3999,9 @@ Computes the square of a floating-point number
### C Prototype
`void set_got_file_coin_hi_score(bool value);`
### Description
Sets if the save file's coin "HI SCORE" was obtained with the last star or key collection
[:arrow_up_small:](#)
<br />
@ -3851,6 +4022,9 @@ Computes the square of a floating-point number
### C Prototype
`void set_last_completed_course_num(u8 courseNum);`
### Description
Sets the last course a star or key was collected in
[:arrow_up_small:](#)
<br />
@ -3871,6 +4045,9 @@ Computes the square of a floating-point number
### C Prototype
`void set_last_completed_star_num(u8 starNum);`
### Description
Sets the last collected star's number (1-7)
[:arrow_up_small:](#)
<br />
@ -3891,6 +4068,9 @@ Computes the square of a floating-point number
### C Prototype
`void set_last_star_or_key(u8 value);`
### Description
Sets if the last objective collected was a star (0) or a key (1)
[:arrow_up_small:](#)
<br />
@ -3911,6 +4091,9 @@ Computes the square of a floating-point number
### C Prototype
`void set_override_envfx(s32 envfx);`
### Description
Sets the override environment effect (e.g. snow)
[:arrow_up_small:](#)
<br />
@ -3931,6 +4114,9 @@ Computes the square of a floating-point number
### C Prototype
`void set_save_file_modified(bool value);`
### Description
Sets if the save file has been modified without saving
[:arrow_up_small:](#)
<br />
@ -3951,6 +4137,9 @@ Computes the square of a floating-point number
### C Prototype
`void set_ttc_speed_setting(s16 speed);`
### Description
Sets TTC's speed setting (TTC_SPEED_*)
[:arrow_up_small:](#)
<br />
@ -3971,6 +4160,9 @@ Computes the square of a floating-point number
### C Prototype
`void set_volume_env(f32 volume);`
### Description
Sets the volume level of environment sounds effects
[:arrow_up_small:](#)
<br />
@ -3991,6 +4183,9 @@ Computes the square of a floating-point number
### C Prototype
`void set_volume_level(f32 volume);`
### Description
Sets the volume level of music
[:arrow_up_small:](#)
<br />
@ -4011,6 +4206,9 @@ Computes the square of a floating-point number
### C Prototype
`void set_volume_master(f32 volume);`
### Description
Sets the master volume level
[:arrow_up_small:](#)
<br />
@ -4031,6 +4229,9 @@ Computes the square of a floating-point number
### C Prototype
`void set_volume_sfx(f32 volume);`
### Description
Sets the volume level of sound effects
[:arrow_up_small:](#)
<br />
@ -4053,6 +4254,9 @@ Computes the square of a floating-point number
### C Prototype
`void set_water_level(u8 index, s16 height, bool sync);`
### Description
Sets the water level in an area
[:arrow_up_small:](#)
<br />
@ -4073,6 +4277,9 @@ Computes the square of a floating-point number
### C Prototype
`void set_window_title(const char* title);`
### Description
Sets the window title to a custom title
[:arrow_up_small:](#)
<br />

View file

@ -118,7 +118,7 @@ s8 get_dialog_box_state(void) {
///
extern u8 gLastCollectedStarOrKey;
s32 get_last_star_or_key(void) {
u8 get_last_star_or_key(void) {
return gLastCollectedStarOrKey;
}
@ -150,7 +150,7 @@ bool get_got_file_coin_hi_score(void) {
}
void set_got_file_coin_hi_score(bool value) {
gGotFileCoinHiScore = value ? TRUE : FALSE;
gGotFileCoinHiScore = value;
}
extern s8 gSaveFileModified;
@ -159,7 +159,7 @@ bool get_save_file_modified(void) {
}
void set_save_file_modified(bool value) {
gSaveFileModified = value ? TRUE : FALSE;
gSaveFileModified = value;
}
///

View file

@ -39,99 +39,168 @@ struct DateTime {
};
/* |description|Gets the current area's networked timer|descriptionEnd| */
u32 get_network_area_timer(void);
/* |description|Returns a temporary 32-bit integer pointer|descriptionEnd| */
s32* get_temp_s32_pointer(s32 initialValue);
/* |description|Gets the 32-bit integer value from the 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| */
bool djui_is_popup_disabled(void);
/* |description|Sets if popups are disabled|descriptionEnd| */
void djui_set_popup_disabled_override(bool value);
/* |description|Resets if popups are disabled|descriptionEnd| */
void djui_reset_popup_disabled_override(void);
/* |description|Checks if the DJUI playerlist is open|descriptionEnd| */
bool djui_is_playerlist_open(void);
/* |description|Checks if the DJUI playerlist is attempting to be opened|descriptionEnd| */
bool djui_attempting_to_open_playerlist(void);
/* |description|Gets the DJUI menu font|descriptionEnd| */
enum DjuiFontType djui_menu_get_font(void);
/* |description|Gets the DJUI menu theme|descriptionEnd| */
struct DjuiTheme* djui_menu_get_theme(void);
/* |description|Gets the current state of the dialog box|descriptionEnd| */
s8 get_dialog_box_state(void);
/* |description|Gets the current dialog box ID|descriptionEnd| */
s16 get_dialog_id(void);
s32 get_last_star_or_key(void);
/* |description|Gets if the last objective collected was a star (0) or a key (1)|descriptionEnd| */
u8 get_last_star_or_key(void);
/* |description|Sets if the last objective collected was a star (0) or a key (1)|descriptionEnd| */
void set_last_star_or_key(u8 value);
/* |description|Gets the last course a star or key was collected in|descriptionEnd| */
u8 get_last_completed_course_num(void);
/* |description|Sets the last course a star or key was collected in|descriptionEnd| */
void set_last_completed_course_num(u8 courseNum);
/* |description|Gets the last collected star's number (1-7) |descriptionEnd| */
u8 get_last_completed_star_num(void);
/* |description|Sets the last collected star's number (1-7) |descriptionEnd| */
void set_last_completed_star_num(u8 starNum);
/* |description|Checks if the save file's coin "HI SCORE" was obtained with the last star or key collection|descriptionEnd| */
bool get_got_file_coin_hi_score(void);
/* |description|Sets if the save file's coin "HI SCORE" was obtained with the last star or key collection|descriptionEnd| */
void set_got_file_coin_hi_score(bool value);
/* |description|Checks if the save file has been modified without saving|descriptionEnd| */
bool get_save_file_modified(void);
/* |description|Sets if the save file has been modified without saving|descriptionEnd| */
void set_save_file_modified(bool value);
/* |description|Hides the HUD|descriptionEnd| */
void hud_hide(void);
/* |description|Shows the HUD|descriptionEnd| */
void hud_show(void);
/* |description|Checks if the HUD is hidden|descriptionEnd| */
bool hud_is_hidden(void);
/* |description|Gets a HUD display value|descriptionEnd| */
s32 hud_get_value(enum HudDisplayValue type);
/* |description|Sets a HUD display value|descriptionEnd| */
void hud_set_value(enum HudDisplayValue type, s32 value);
/* |description|Renders a power meter on the HUD|descriptionEnd| */
void hud_render_power_meter(s32 health, f32 x, f32 y, f32 width, f32 height);
/* |description|Renders an interpolated power meter on the HUD|descriptionEnd| */
void hud_render_power_meter_interpolated(s32 health, f32 prevX, f32 prevY, f32 prevWidth, f32 prevHeight, f32 x, f32 y, f32 width, f32 height);
/* |description|Gets if the star counter on the HUD should flash|descriptionEnd| */
s8 hud_get_flash(void);
/* |description|Sets if the star counter on the HUD should flash|descriptionEnd| */
void hud_set_flash(s8 value);
/* |description|Checks if the game is paused|descriptionEnd| */
bool is_game_paused(void);
/* |description|Checks if a screen transition is playing|descriptionEnd| */
bool is_transition_playing(void);
/* |description|Allocates an action ID with bitwise flags|descriptionEnd| */
u32 allocate_mario_action(u32 actFlags);
/* |description|Gets the X coordinate of Mario's hand (0-1) or foot (2-3) but it is important to note that the positions are not updated off-screen|descriptionEnd| */
f32 get_hand_foot_pos_x(struct MarioState* m, u8 index);
/* |description|Gets the Y coordinate of Mario's hand (0-1) or foot (2-3) but it is important to note that the positions are not updated off-screen|descriptionEnd| */
f32 get_hand_foot_pos_y(struct MarioState* m, u8 index);
/* |description|Gets the Z coordinate of Mario's hand (0-1) or foot (2-3) but it is important to note that the positions are not updated off-screen|descriptionEnd| */
f32 get_hand_foot_pos_z(struct MarioState* m, u8 index);
/* |description|Gets the current save file number (1-indexed)|descriptionEnd| */
s16 get_current_save_file_num(void);
/* |description|Checks if the save file is using its backup slot|descriptionEnd| */
bool save_file_get_using_backup_slot(void);
/* |description|Sets if the save file should use its backup slot|descriptionEnd| */
void save_file_set_using_backup_slot(bool usingBackupSlot);
/* |description|Registers a custom moving texture entry (used for vanilla water boxes)|descriptionEnd| */
void movtexqc_register(const char* name, s16 level, s16 area, s16 type);
/* |description|Gets the water level in an area|descriptionEnd| */
s16 get_water_level(u8 index);
/* |description|Sets the water level in an area|descriptionEnd| */
void set_water_level(u8 index, s16 height, bool sync);
/* |description|Plays a screen transition|descriptionEnd| */
void play_transition(s16 transType, s16 time, u8 red, u8 green, u8 blue);
/* |description|Checks if a course is a main course and not the castle or secret levels|descriptionEnd| */
bool course_is_main_course(u16 courseNum);
/* |description|Gets TTC's speed setting|descriptionEnd| */
s16 get_ttc_speed_setting(void);
/* |description|Sets TTC's speed setting (TTC_SPEED_*)|descriptionEnd| */
void set_ttc_speed_setting(s16 speed);
/* |description|Gets the Unix Timestamp|descriptionEnd| */
s64 get_time(void);
/* |description|Gets the system clock's date and time|descriptionEnd| */
struct DateTime* get_date_and_time(void);
/* |description|Gets the non overridden environment effect (e.g. snow)|descriptionEnd| */
u16 get_envfx(void);
/* |description|Sets the override environment effect (e.g. snow)|descriptionEnd| */
void set_override_envfx(s32 envfx);
/* |description|Gets the global timer that has been ticking at 30 frames per second since game boot|descriptionEnd| */
u32 get_global_timer(void);
/* |description|Gets the choice selected inside of a dialog box (0-1)|descriptionEnd| */
s32 get_dialog_response(void);
/* |description|Gets the local discord ID if it isn't disabled, otherwise "0" is returned|descriptionEnd| */
const char* get_local_discord_id(void);
/* |description|Gets the CoopNet ID of a player if CoopNet is being used and the player is connected, otherwise "-1" is returned|descriptionEnd| */
const char* get_coopnet_id(s8 localIndex);
/* |description|Gets the master volume level|descriptionEnd| */
f32 get_volume_master(void);
/* |description|Gets the volume level of music|descriptionEnd| */
f32 get_volume_level(void);
/* |description|Gets the volume level of sound effects|descriptionEnd| */
f32 get_volume_sfx(void);
/* |description|Gets the volume level of environment sounds effects|descriptionEnd| */
f32 get_volume_env(void);
/* |description|Sets the master volume level|descriptionEnd| */
void set_volume_master(f32 volume);
/* |description|Sets the volume level of music|descriptionEnd| */
void set_volume_level(f32 volume);
/* |description|Sets the volume level of sound effects|descriptionEnd| */
void set_volume_sfx(f32 volume);
/* |description|Sets the volume level of environment sounds effects|descriptionEnd| */
void set_volume_env(f32 volume);
/* |description|Gets an environment region (gas/water boxes) height value|descriptionEnd| */
f32 get_environment_region(u8 index);
/* |description|Sets an environment region (gas/water boxes) height value|descriptionEnd| */
void set_environment_region(u8 index, s32 value);
/* |description|Checks if a file exists inside of a mod|descriptionEnd| */
bool mod_file_exists(const char* filename);
/* |description|Sets the window title to a custom title|descriptionEnd| */
void set_window_title(const char* title);
/* |description|Resets the window title|descriptionEnd| */
void reset_window_title(void);
/* |description|Gets the name of the operating system the game is running on|descriptionEnd| */
const char* get_os_name(void);
#endif