Compare commits

..

No commits in common. "5fd55ffac1db3ebdd63a76014755491101444e64" and "fcef8699f27d636ca4d2f0f1c5857617b1ac3546" have entirely different histories.

12 changed files with 35 additions and 111 deletions

View file

@ -3914,14 +3914,8 @@ function djui_hud_get_raw_mouse_y()
-- ...
end
--- @return boolean
--- Checks if the cursor is locked to the window
function djui_hud_is_mouse_locked()
-- ...
end
--- @param locked boolean
--- Locks (or unlocks) the cursor to the window
--- Sets if the cursor is hidden and constrainted to the window
function djui_hud_set_mouse_locked(locked)
-- ...
end
@ -3960,12 +3954,12 @@ end
--- @param y number
--- @param width number
--- @param height number
--- Sets the viewport to the specified position and size, this will resize any subsequent DJUI graphics
--- Sets the viewport to the specified position and size, this will resize
function djui_hud_set_viewport(x, y, width, height)
-- ...
end
--- Resets the viewport to a fullscreen state
--- put the description here
function djui_hud_reset_viewport()
-- ...
end
@ -3974,12 +3968,12 @@ end
--- @param y number
--- @param width number
--- @param height number
--- Sets the scissor rectangle to the specified position and size, this will cut off any subsequent DJUI graphics not within the rectangle
--- put the description here
function djui_hud_set_scissor(x, y, width, height)
-- ...
end
--- Resets the scissor rectangle to a fullscreen state
--- put the description here
function djui_hud_reset_scissor()
-- ...
end
@ -6449,14 +6443,14 @@ end
--- @param m MarioState
--- @return integer
--- Performs a full Mario stationary physics step (4 substeps) and returns a `GROUND_STEP_*` result
--- Performs a full Mario stationary physics step (4 substeps) and returns an `GROUND_STEP_*` result
function stationary_ground_step(m)
-- ...
end
--- @param m MarioState
--- @return integer
--- Performs a full Mario ground physics step (4 substeps) and returns a `GROUND_STEP_*` result
--- Performs a full Mario ground physics step (4 substeps) and returns an `GROUND_STEP_*` result
function perform_ground_step(m)
-- ...
end
@ -10035,7 +10029,7 @@ end
--- @param player integer
--- @return integer
--- Gets the `tempo` of `player`
--- Gets the tempo of `player`
function sequence_player_get_tempo(player)
-- ...
end
@ -10049,7 +10043,7 @@ end
--- @param player integer
--- @return integer
--- Gets the `tempoAcc` (tempo accumulation) of `player`
--- Gets the tempoAcc (tempo accumulation) of `player`
function sequence_player_get_tempo_acc(player)
-- ...
end
@ -10063,7 +10057,7 @@ end
--- @param player integer
--- @return integer
--- Gets the `transposition` (pitch) of `player`
--- Gets the transposition (pitch) of `player`
function sequence_player_get_transposition(player)
-- ...
end

View file

@ -3140,31 +3140,10 @@ Returns the y coordinate of the mouse relative to the screen
<br />
## [djui_hud_is_mouse_locked](#djui_hud_is_mouse_locked)
### Description
Checks if the cursor is locked to the window
### Lua Example
`local booleanValue = djui_hud_is_mouse_locked()`
### Parameters
- None
### Returns
- `boolean`
### C Prototype
`bool djui_hud_is_mouse_locked(void);`
[:arrow_up_small:](#)
<br />
## [djui_hud_set_mouse_locked](#djui_hud_set_mouse_locked)
### Description
Locks (or unlocks) the cursor to the window
Sets if the cursor is hidden and constrainted to the window
### Lua Example
`djui_hud_set_mouse_locked(locked)`
@ -3292,7 +3271,7 @@ Returns the amount scrolled vertically (-down/up+)
## [djui_hud_set_viewport](#djui_hud_set_viewport)
### Description
Sets the viewport to the specified position and size, this will resize any subsequent DJUI graphics
Sets the viewport to the specified position and size, this will resize
### Lua Example
`djui_hud_set_viewport(x, y, width, height)`
@ -3318,7 +3297,7 @@ Sets the viewport to the specified position and size, this will resize any subse
## [djui_hud_reset_viewport](#djui_hud_reset_viewport)
### Description
Resets the viewport to a fullscreen state
put the description here
### Lua Example
`djui_hud_reset_viewport()`
@ -3339,7 +3318,7 @@ Resets the viewport to a fullscreen state
## [djui_hud_set_scissor](#djui_hud_set_scissor)
### Description
Sets the scissor rectangle to the specified position and size, this will cut off any subsequent DJUI graphics not within the rectangle
put the description here
### Lua Example
`djui_hud_set_scissor(x, y, width, height)`
@ -3365,7 +3344,7 @@ Sets the scissor rectangle to the specified position and size, this will cut off
## [djui_hud_reset_scissor](#djui_hud_reset_scissor)
### Description
Resets the scissor rectangle to a fullscreen state
put the description here
### Lua Example
`djui_hud_reset_scissor()`

View file

@ -4070,7 +4070,7 @@ Sets all of Mario's velocity variables to 0 and sets his Y position to the floor
## [stationary_ground_step](#stationary_ground_step)
### Description
Performs a full Mario stationary physics step (4 substeps) and returns a `GROUND_STEP_*` result
Performs a full Mario stationary physics step (4 substeps) and returns an `GROUND_STEP_*` result
### Lua Example
`local integerValue = stationary_ground_step(m)`
@ -4093,7 +4093,7 @@ Performs a full Mario stationary physics step (4 substeps) and returns a `GROUND
## [perform_ground_step](#perform_ground_step)
### Description
Performs a full Mario ground physics step (4 substeps) and returns a `GROUND_STEP_*` result
Performs a full Mario ground physics step (4 substeps) and returns an `GROUND_STEP_*` result
### Lua Example
`local integerValue = perform_ground_step(m)`

View file

@ -5276,7 +5276,7 @@ Returns the current sound mode (e.g., stereo, mono) stored in the save file. Use
## [sequence_player_get_tempo](#sequence_player_get_tempo)
### Description
Gets the `tempo` of `player`
Gets the tempo of `player`
### Lua Example
`local integerValue = sequence_player_get_tempo(player)`
@ -5323,7 +5323,7 @@ Sets the `tempo` of `player`. Resets when another sequence is played
## [sequence_player_get_tempo_acc](#sequence_player_get_tempo_acc)
### Description
Gets the `tempoAcc` (tempo accumulation) of `player`
Gets the tempoAcc (tempo accumulation) of `player`
### Lua Example
`local integerValue = sequence_player_get_tempo_acc(player)`
@ -5370,7 +5370,7 @@ Sets the `tempoAcc` (tempo accumulation) of `player`. Resets when another sequen
## [sequence_player_get_transposition](#sequence_player_get_transposition)
### Description
Gets the `transposition` (pitch) of `player`
Gets the transposition (pitch) of `player`
### Lua Example
`local integerValue = sequence_player_get_transposition(player)`

View file

@ -770,7 +770,6 @@
- [djui_hud_get_mouse_y](functions-3.md#djui_hud_get_mouse_y)
- [djui_hud_get_raw_mouse_x](functions-3.md#djui_hud_get_raw_mouse_x)
- [djui_hud_get_raw_mouse_y](functions-3.md#djui_hud_get_raw_mouse_y)
- [djui_hud_is_mouse_locked](functions-3.md#djui_hud_is_mouse_locked)
- [djui_hud_set_mouse_locked](functions-3.md#djui_hud_set_mouse_locked)
- [djui_hud_get_mouse_buttons_down](functions-3.md#djui_hud_get_mouse_buttons_down)
- [djui_hud_get_mouse_buttons_pressed](functions-3.md#djui_hud_get_mouse_buttons_pressed)

View file

@ -15,15 +15,15 @@ void sequence_channel_set_volume(struct SequenceChannel *seqChannel, u8 volume);
void process_sequences(s32 iterationsRemaining);
void init_sequence_player(u32 player);
void init_sequence_players(void);
/* |description|Gets the `tempo` of `player`|descriptionEnd| */
/* |description|Gets the tempo of `player`|descriptionEnd| */
u16 sequence_player_get_tempo(u8 player);
/* |description|Sets the `tempo` of `player`. Resets when another sequence is played|descriptionEnd| */
void sequence_player_set_tempo(u8 player, u16 tempo);
/* |description|Gets the `tempoAcc` (tempo accumulation) of `player`|descriptionEnd| */
/* |description|Gets the tempoAcc (tempo accumulation) of `player`|descriptionEnd| */
u16 sequence_player_get_tempo_acc(u8 player);
/* |description|Sets the `tempoAcc` (tempo accumulation) of `player`. Resets when another sequence is played|descriptionEnd| */
void sequence_player_set_tempo_acc(u8 player, u16 tempoAcc);
/* |description|Gets the `transposition` (pitch) of `player`|descriptionEnd| */
/* |description|Gets the transposition (pitch) of `player`|descriptionEnd| */
u16 sequence_player_get_transposition(u8 player);
/* |description|Sets the `transposition` (pitch) of `player`. Resets when another sequence is played|descriptionEnd| */
void sequence_player_set_transposition(u8 player, u16 transposition);

View file

@ -3,7 +3,6 @@ static u32 networkBowserAnimationIndex = 0;
static u8 bowserIsDying = FALSE;
static u8 bowserCutscenePlayed = FALSE;
static u8 bowserIsCutscenePlayer = FALSE;
static u8 bowserCutsceneGlobalIndex = UNKNOWN_GLOBAL_INDEX;
void bowser_tail_anchor_act_0(void) {
struct Object* bowser = o->parentObj;
@ -778,10 +777,6 @@ void bowser_act_thrown_dropped(void)
o->oAction = 4;
else
o->oAction = 12;
if (is_nearest_mario_state_to_object(gMarioState, o)) {
network_send_object(o);
}
}
}
@ -1130,17 +1125,8 @@ void bowser_act_ride_tilting_platform(void) {
cur_obj_extend_animation_if_at_end();
}
void bowser_act_nothing(void) { // start moving if cutscene player is inactive
if (bowserCutsceneGlobalIndex == UNKNOWN_GLOBAL_INDEX) {
return;
}
struct NetworkPlayer* np = network_player_from_global_index(bowserCutsceneGlobalIndex);
if (np == NULL || !is_player_active(&gMarioStates[np->localIndex])) {
bowserCutscenePlayed = TRUE;
bowser_initialize_action();
return;
}
void bowser_act_nothing(void) {
}
s32 bowser_check_fallen_off_stage(void) // bowser off stage?
@ -1246,7 +1232,6 @@ void bowser_held_update(void) {
return;
}
o->parentObj = player;
o->oBowserUnkF4 &= ~0x20000;
cur_obj_become_intangible();
@ -1400,13 +1385,6 @@ static u8 bhv_bowser_ignore_if_true(void) {
return FALSE;
}
static void bhv_bowser_on_received_post(UNUSED u8 localIndex) {
// prevent sync from putting bowser in text action instead of nothing action
if (!(bowserIsCutscenePlayer || bowserCutscenePlayed) && (o->oAction == 5 || o->oAction == 6)) {
o->oAction = 20;
}
}
void bhv_bowser_init(void) {
bowserIsDying = FALSE;
s32 level; // 0 is dw, 1 is fs, 2 is sky
@ -1430,11 +1408,9 @@ void bhv_bowser_init(void) {
// Make sure we're the first to trigger Bowser.
if (!is_other_player_active()) {
bowserIsCutscenePlayer = TRUE;
bowserCutsceneGlobalIndex = gNetworkPlayerLocal->globalIndex;
o->oAction = 5; // bowser_act_text_wait
} else { // If we aren't do nothing till we get our sync.
bowserIsCutscenePlayer = FALSE;
bowserCutsceneGlobalIndex = UNKNOWN_GLOBAL_INDEX;
o->oAction = 20; // bowser_act_nothing
}
@ -1443,11 +1419,9 @@ void bhv_bowser_init(void) {
if (so) {
so->override_ownership = bhv_bowser_override_ownership;
so->ignore_if_true = bhv_bowser_ignore_if_true;
so->on_received_post = bhv_bowser_on_received_post;
so->fullObjectSync = TRUE;
sync_object_init_field_with_size(o, &o->header.gfx.node.flags, 16);
sync_object_init_field_with_size(o, &o->header.gfx.animInfo.animFrame, 16);
sync_object_init_field_with_size(o, &bowserCutsceneGlobalIndex, 8);
sync_object_init_field(o, &networkBowserAnimationIndex);
sync_object_init_field(o, &o->header.gfx.scale[0]);
sync_object_init_field(o, &o->header.gfx.scale[1]);

View file

@ -23,7 +23,7 @@ void bhv_heave_ho_throw_mario_loop(void) {
if (player) {
player->oInteractStatus |= INT_STATUS_MARIO_UNK2;
}
if (marioState && marioState->action == ACT_GRABBED) {
if (marioState) {
marioState->forwardVel = -45.0f;
marioState->vel[1] = 95.0f;
}

View file

@ -36,9 +36,9 @@ u32 mario_update_moving_sand(struct MarioState *m);
u32 mario_update_windy_ground(struct MarioState *m);
/* |description|Sets all of Mario's velocity variables to 0 and sets his Y position to the floor height|descriptionEnd| */
void stop_and_set_height_to_floor(struct MarioState *m);
/* |description|Performs a full Mario stationary physics step (4 substeps) and returns a `GROUND_STEP_*` result|descriptionEnd| */
/* |description|Performs a full Mario stationary physics step (4 substeps) and returns an `GROUND_STEP_*` result|descriptionEnd| */
s32 stationary_ground_step(struct MarioState *m);
/* |description|Performs a full Mario ground physics step (4 substeps) and returns a `GROUND_STEP_*` result|descriptionEnd| */
/* |description|Performs a full Mario ground physics step (4 substeps) and returns an `GROUND_STEP_*` result|descriptionEnd| */
s32 perform_ground_step(struct MarioState *m);
/* |description|Performs a full Mario air physics step (4 substeps) and returns an `AIR_STEP_*` result|descriptionEnd| */
s32 perform_air_step(struct MarioState *m, u32 stepArg);

View file

@ -33,7 +33,7 @@ static struct DjuiColor sRefColor = { 255, 255, 255, 255 };
static bool sLegacy = false;
f32 gDjuiHudUtilsZ = 0;
bool gDjuiHudLockMouse = false;
u8 gDjuiHudLockMouse = false;
extern ALIGNED8 const u8 texture_hud_char_camera[];
extern ALIGNED8 const u8 texture_hud_char_lakitu[];
@ -297,10 +297,6 @@ f32 djui_hud_get_raw_mouse_y(void) {
return mouse_y;
}
bool djui_hud_is_mouse_locked(void) {
return gDjuiHudLockMouse;
}
void djui_hud_set_mouse_locked(bool locked) {
gDjuiHudLockMouse = locked;
}

View file

@ -52,7 +52,7 @@ struct GlobalTextures {
extern struct GlobalTextures gGlobalTextures;
extern f32 gDjuiHudUtilsZ;
extern bool gDjuiHudLockMouse;
extern u8 gDjuiHudLockMouse;
/* |description|Gets the current DJUI HUD resolution|descriptionEnd| */
u8 djui_hud_get_resolution(void);
@ -92,9 +92,7 @@ f32 djui_hud_get_mouse_y(void);
f32 djui_hud_get_raw_mouse_x(void);
/* |description|Returns the y coordinate of the mouse relative to the screen|descriptionEnd| */
f32 djui_hud_get_raw_mouse_y(void);
/* |description|Checks if the cursor is locked to the window|descriptionEnd| */
bool djui_hud_is_mouse_locked(void);
/* |description|Locks (or unlocks) the cursor to the window|descriptionEnd| */
/* |description|Sets if the cursor is hidden and constrainted to the window|descriptionEnd| */
void djui_hud_set_mouse_locked(bool locked);
/* |description|Returns the flags of the mouse buttons held down|descriptionEnd| */
u8 djui_hud_get_mouse_buttons_down(void);
@ -106,13 +104,13 @@ u8 djui_hud_get_mouse_buttons_released(void);
f32 djui_hud_get_mouse_scroll_x(void);
/* |description|Returns the amount scrolled vertically (-down/up+)|descriptionEnd| */
f32 djui_hud_get_mouse_scroll_y(void);
/* |description|Sets the viewport to the specified position and size, this will resize any subsequent DJUI graphics|descriptionEnd| */
/* |description|Sets the viewport to the specified position and size, this will resize |descriptionEnd| */
void djui_hud_set_viewport(f32 x, f32 y, f32 width, f32 height);
/* |description|Resets the viewport to a fullscreen state|descriptionEnd| */
/* |description|put the description here|descriptionEnd| */
void djui_hud_reset_viewport(void);
/* |description|Sets the scissor rectangle to the specified position and size, this will cut off any subsequent DJUI graphics not within the rectangle|descriptionEnd| */
/* |description|put the description here|descriptionEnd| */
void djui_hud_set_scissor(f32 x, f32 y, f32 width, f32 height);
/* |description|Resets the scissor rectangle to a fullscreen state|descriptionEnd| */
/* |description|put the description here|descriptionEnd| */
void djui_hud_reset_scissor(void);
/* |description|Measures the length of `message` in the current font|descriptionEnd| */

View file

@ -12698,21 +12698,6 @@ int smlua_func_djui_hud_get_raw_mouse_y(UNUSED lua_State* L) {
return 1;
}
int smlua_func_djui_hud_is_mouse_locked(UNUSED lua_State* L) {
if (L == NULL) { return 0; }
int top = lua_gettop(L);
if (top != 0) {
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "djui_hud_is_mouse_locked", 0, top);
return 0;
}
lua_pushboolean(L, djui_hud_is_mouse_locked());
return 1;
}
int smlua_func_djui_hud_set_mouse_locked(lua_State* L) {
if (L == NULL) { return 0; }
@ -37446,7 +37431,6 @@ void smlua_bind_functions_autogen(void) {
smlua_bind_function(L, "djui_hud_get_mouse_y", smlua_func_djui_hud_get_mouse_y);
smlua_bind_function(L, "djui_hud_get_raw_mouse_x", smlua_func_djui_hud_get_raw_mouse_x);
smlua_bind_function(L, "djui_hud_get_raw_mouse_y", smlua_func_djui_hud_get_raw_mouse_y);
smlua_bind_function(L, "djui_hud_is_mouse_locked", smlua_func_djui_hud_is_mouse_locked);
smlua_bind_function(L, "djui_hud_set_mouse_locked", smlua_func_djui_hud_set_mouse_locked);
smlua_bind_function(L, "djui_hud_get_mouse_buttons_down", smlua_func_djui_hud_get_mouse_buttons_down);
smlua_bind_function(L, "djui_hud_get_mouse_buttons_pressed", smlua_func_djui_hud_get_mouse_buttons_pressed);