mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-25 05:25:14 +00:00
Fixed over 100 code warnings
This commit is contained in:
parent
04d01667c3
commit
7294e127f5
52 changed files with 83 additions and 112 deletions
4
Makefile
4
Makefile
|
@ -612,8 +612,8 @@ CFLAGS += -DCOOP
|
||||||
|
|
||||||
# Enforce -Werror in strict mode
|
# Enforce -Werror in strict mode
|
||||||
ifeq ($(STRICT),1)
|
ifeq ($(STRICT),1)
|
||||||
CC_CHECK += -Werror -Wno-error=unused-variable -Wno-error=unused-parameter
|
CC_CHECK += -Werror
|
||||||
CFLAGS += -Werror -Wno-error=unused-variable -Wno-error=unused-parameter
|
CFLAGS += -Werror
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Check for debug option
|
# Check for debug option
|
||||||
|
|
|
@ -81,7 +81,6 @@ void bhv_activated_back_and_forth_platform_update(void) {
|
||||||
|
|
||||||
struct Object* player = nearest_player_to_object(o);
|
struct Object* player = nearest_player_to_object(o);
|
||||||
int distanceToPlayer = dist_between_objects(o, player);
|
int distanceToPlayer = dist_between_objects(o, player);
|
||||||
int angleToPlayer = obj_angle_to_object(o, player);
|
|
||||||
|
|
||||||
// oVelY is used for vertical platforms' movement and also for
|
// oVelY is used for vertical platforms' movement and also for
|
||||||
// horizontal platforms' dipping up/down when Mario gets on/off them
|
// horizontal platforms' dipping up/down when Mario gets on/off them
|
||||||
|
|
|
@ -21,7 +21,7 @@ static struct ObjectHitbox sBooCageHitbox = {
|
||||||
/* hurtboxHeight: */ 0,
|
/* hurtboxHeight: */ 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
static void bhv_boo_cage_on_received_post(u8 localIndex) {
|
static void bhv_boo_cage_on_received_post(UNUSED u8 localIndex) {
|
||||||
if (o->oAction > BOO_CAGE_ACT_ON_GROUND) {
|
if (o->oAction > BOO_CAGE_ACT_ON_GROUND) {
|
||||||
o->oAction = BOO_CAGE_ACT_ON_GROUND;
|
o->oAction = BOO_CAGE_ACT_ON_GROUND;
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ void bhv_big_boulder_loop(void) {
|
||||||
|
|
||||||
void bhv_big_boulder_generator_loop(void) {
|
void bhv_big_boulder_generator_loop(void) {
|
||||||
if (!network_sync_object_initialized(o)) {
|
if (!network_sync_object_initialized(o)) {
|
||||||
struct SyncObject* so = network_init_object(o, SYNC_DISTANCE_ONLY_EVENTS);
|
network_init_object(o, SYNC_DISTANCE_ONLY_EVENTS);
|
||||||
network_init_object_field(o, &o->oTimer);
|
network_init_object_field(o, &o->oTimer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -181,7 +181,7 @@ void bhv_generic_bowling_ball_spawner_init(void) {
|
||||||
|
|
||||||
void bhv_generic_bowling_ball_spawner_loop(void) {
|
void bhv_generic_bowling_ball_spawner_loop(void) {
|
||||||
if (!network_sync_object_initialized(o)) {
|
if (!network_sync_object_initialized(o)) {
|
||||||
struct SyncObject* so = network_init_object(o, SYNC_DISTANCE_ONLY_EVENTS);
|
network_init_object(o, SYNC_DISTANCE_ONLY_EVENTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Object *bowlingBall;
|
struct Object *bowlingBall;
|
||||||
|
@ -217,7 +217,7 @@ void bhv_generic_bowling_ball_spawner_loop(void) {
|
||||||
|
|
||||||
void bhv_thi_bowling_ball_spawner_loop(void) {
|
void bhv_thi_bowling_ball_spawner_loop(void) {
|
||||||
if (!network_sync_object_initialized(o)) {
|
if (!network_sync_object_initialized(o)) {
|
||||||
struct SyncObject* so = network_init_object(o, SYNC_DISTANCE_ONLY_EVENTS);
|
network_init_object(o, SYNC_DISTANCE_ONLY_EVENTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Object *bowlingBall;
|
struct Object *bowlingBall;
|
||||||
|
@ -281,7 +281,6 @@ void bhv_free_bowling_ball_init(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void bhv_free_bowling_ball_roll_loop(void) {
|
void bhv_free_bowling_ball_roll_loop(void) {
|
||||||
s16 collisionFlags = object_step();
|
|
||||||
bowling_ball_set_hitbox();
|
bowling_ball_set_hitbox();
|
||||||
|
|
||||||
if (o->oForwardVel > 10.0f) {
|
if (o->oForwardVel > 10.0f) {
|
||||||
|
@ -289,8 +288,9 @@ void bhv_free_bowling_ball_roll_loop(void) {
|
||||||
cur_obj_play_sound_1(SOUND_ENV_UNKNOWN2);
|
cur_obj_play_sound_1(SOUND_ENV_UNKNOWN2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((collisionFlags & OBJ_COL_FLAG_GROUNDED) && !(collisionFlags & OBJ_COL_FLAGS_LANDED))
|
// warning: 'and' of mutually exclusive equal-tests is always 0
|
||||||
cur_obj_play_sound_2(SOUND_GENERAL_QUIET_POUND1_LOWPRIO);
|
/*if ((collisionFlags & OBJ_COL_FLAG_GROUNDED) && !(collisionFlags & OBJ_COL_FLAGS_LANDED))
|
||||||
|
cur_obj_play_sound_2(SOUND_GENERAL_QUIET_POUND1_LOWPRIO);*/
|
||||||
|
|
||||||
if (!is_point_within_radius_of_mario(o->oPosX, o->oPosY, o->oPosZ, 6000)) {
|
if (!is_point_within_radius_of_mario(o->oPosX, o->oPosY, o->oPosZ, 6000)) {
|
||||||
o->header.gfx.node.flags |= GRAPH_RENDER_INVISIBLE;
|
o->header.gfx.node.flags |= GRAPH_RENDER_INVISIBLE;
|
||||||
|
|
|
@ -1036,7 +1036,7 @@ void bowser_act_dead(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void bhv_tilting_bowser_lava_platform_init(void) {
|
void bhv_tilting_bowser_lava_platform_init(void) {
|
||||||
struct SyncObject* so = network_init_object(o, SYNC_DISTANCE_ONLY_EVENTS);
|
network_init_object(o, SYNC_DISTANCE_ONLY_EVENTS);
|
||||||
network_init_object_field(o, &o->oAngleVelPitch);
|
network_init_object_field(o, &o->oAngleVelPitch);
|
||||||
network_init_object_field(o, &o->oAngleVelRoll);
|
network_init_object_field(o, &o->oAngleVelRoll);
|
||||||
network_init_object_field(o, &o->oFaceAnglePitch);
|
network_init_object_field(o, &o->oFaceAnglePitch);
|
||||||
|
|
|
@ -53,7 +53,6 @@ void bhv_controllable_platform_sub_loop(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void bhv_controllable_platform_init(void) {
|
void bhv_controllable_platform_init(void) {
|
||||||
struct Object *sp34;
|
|
||||||
controllablePlatformSubs[0] = spawn_object_rel_with_rot(o, MODEL_HMC_METAL_ARROW_PLATFORM, bhvControllablePlatformSub, 0,
|
controllablePlatformSubs[0] = spawn_object_rel_with_rot(o, MODEL_HMC_METAL_ARROW_PLATFORM, bhvControllablePlatformSub, 0,
|
||||||
51, 204, 0, 0, 0);
|
51, 204, 0, 0, 0);
|
||||||
controllablePlatformSubs[0]->oBehParams2ndByte = 1;
|
controllablePlatformSubs[0]->oBehParams2ndByte = 1;
|
||||||
|
|
|
@ -128,8 +128,6 @@ static u8 dorrie_act_raise_head_continue_dialog(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void dorrie_act_raise_head(void) {
|
void dorrie_act_raise_head(void) {
|
||||||
struct MarioState* marioState = nearest_mario_state_to_object(o);
|
|
||||||
|
|
||||||
o->collisionData = segmented_to_virtual(dorrie_seg6_collision_0600F644);
|
o->collisionData = segmented_to_virtual(dorrie_seg6_collision_0600F644);
|
||||||
if (cur_obj_check_if_near_animation_end()) {
|
if (cur_obj_check_if_near_animation_end()) {
|
||||||
o->oAction = DORRIE_ACT_MOVE;
|
o->oAction = DORRIE_ACT_MOVE;
|
||||||
|
|
|
@ -39,7 +39,7 @@ static void fire_spitter_act_spit_fire(void) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void bhv_fire_spitter_on_received_post(u8 localIndex) {
|
static void bhv_fire_spitter_on_received_post(UNUSED u8 localIndex) {
|
||||||
cur_obj_play_sound_2(SOUND_OBJ_FLAME_BLOWN);
|
cur_obj_play_sound_2(SOUND_OBJ_FLAME_BLOWN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -78,11 +78,11 @@ static void klepto_anim_dive(void) {
|
||||||
|
|
||||||
static s32 kleptoCachedAnimState = 0;
|
static s32 kleptoCachedAnimState = 0;
|
||||||
|
|
||||||
static void bhv_klepto_on_received_pre(u8 localIndex) {
|
static void bhv_klepto_on_received_pre(UNUSED u8 localIndex) {
|
||||||
kleptoCachedAnimState = o->oAnimState;
|
kleptoCachedAnimState = o->oAnimState;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void bhv_klepto_on_received_post(u8 localIndex) {
|
static void bhv_klepto_on_received_post(UNUSED u8 localIndex) {
|
||||||
if (kleptoCachedAnimState == KLEPTO_ANIM_STATE_HOLDING_NOTHING && o->oAnimState == KLEPTO_ANIM_STATE_HOLDING_STAR) {
|
if (kleptoCachedAnimState == KLEPTO_ANIM_STATE_HOLDING_NOTHING && o->oAnimState == KLEPTO_ANIM_STATE_HOLDING_STAR) {
|
||||||
o->oAnimState = KLEPTO_ANIM_STATE_HOLDING_NOTHING;
|
o->oAnimState = KLEPTO_ANIM_STATE_HOLDING_NOTHING;
|
||||||
}
|
}
|
||||||
|
@ -373,7 +373,6 @@ void obj_set_speed_to_zero(void) {
|
||||||
void bhv_klepto_update(void) {
|
void bhv_klepto_update(void) {
|
||||||
struct MarioState* marioState = nearest_mario_state_to_object(o);
|
struct MarioState* marioState = nearest_mario_state_to_object(o);
|
||||||
struct Object* player = marioState->marioObj;
|
struct Object* player = marioState->marioObj;
|
||||||
int distanceToPlayer = dist_between_objects(o, player);
|
|
||||||
int angleToPlayer = obj_angle_to_object(o, player);
|
int angleToPlayer = obj_angle_to_object(o, player);
|
||||||
|
|
||||||
UNUSED s32 unused;
|
UNUSED s32 unused;
|
||||||
|
|
|
@ -69,7 +69,7 @@ static u32 koopaPathedStartWaypoint = 0;
|
||||||
static u32 koopaPathedPrevWaypoint = 0;
|
static u32 koopaPathedPrevWaypoint = 0;
|
||||||
static u32 koopaShotFromCannon = 0;
|
static u32 koopaShotFromCannon = 0;
|
||||||
|
|
||||||
static void bhv_koopa_the_quick_on_received_post(u8 fromLocalIndex) {
|
static void bhv_koopa_the_quick_on_received_post(UNUSED u8 fromLocalIndex) {
|
||||||
void* path = segmented_to_virtual(sKoopaTheQuickProperties[o->oKoopaTheQuickRaceIndex].path);
|
void* path = segmented_to_virtual(sKoopaTheQuickProperties[o->oKoopaTheQuickRaceIndex].path);
|
||||||
o->oPathedStartWaypoint = (struct Waypoint*)path + koopaPathedStartWaypoint;
|
o->oPathedStartWaypoint = (struct Waypoint*)path + koopaPathedStartWaypoint;
|
||||||
o->oPathedPrevWaypoint = (struct Waypoint*)path + koopaPathedPrevWaypoint;
|
o->oPathedPrevWaypoint = (struct Waypoint*)path + koopaPathedPrevWaypoint;
|
||||||
|
|
|
@ -16,7 +16,7 @@ void hexagonal_ring_spawn_flames(void) {
|
||||||
|
|
||||||
void bhv_lll_rotating_hexagonal_ring_loop(void) {
|
void bhv_lll_rotating_hexagonal_ring_loop(void) {
|
||||||
if (!network_sync_object_initialized(o)) {
|
if (!network_sync_object_initialized(o)) {
|
||||||
struct SyncObject* so = network_init_object(o, 4000.0f);
|
network_init_object(o, 4000.0f);
|
||||||
network_init_object_field(o, &o->oAngleVelYaw);
|
network_init_object_field(o, &o->oAngleVelYaw);
|
||||||
}
|
}
|
||||||
UNUSED s32 unused;
|
UNUSED s32 unused;
|
||||||
|
|
|
@ -17,7 +17,7 @@ void sinking_rectangular_plat_actions(f32 a0, s32 a1) {
|
||||||
|
|
||||||
void bhv_lll_sinking_rectangular_platform_loop(void) {
|
void bhv_lll_sinking_rectangular_platform_loop(void) {
|
||||||
if (!network_sync_object_initialized(o)) {
|
if (!network_sync_object_initialized(o)) {
|
||||||
struct SyncObject* so = network_init_object(o, 1000.0f);
|
network_init_object(o, 1000.0f);
|
||||||
network_init_object_field(o, &o->oLllWoodPieceOscillationTimer);
|
network_init_object_field(o, &o->oLllWoodPieceOscillationTimer);
|
||||||
network_init_object_field(o, &o->oFaceAnglePitch);
|
network_init_object_field(o, &o->oFaceAnglePitch);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,11 +4,11 @@
|
||||||
|
|
||||||
static u32 mipsPrevHeldState = 0;
|
static u32 mipsPrevHeldState = 0;
|
||||||
|
|
||||||
static void bhv_mips_on_received_pre(u8 fromLocalIndex) {
|
static void bhv_mips_on_received_pre(UNUSED u8 fromLocalIndex) {
|
||||||
mipsPrevHeldState = o->oHeldState;
|
mipsPrevHeldState = o->oHeldState;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void bhv_mips_on_received_post(u8 fromLocalIndex) {
|
static void bhv_mips_on_received_post(UNUSED u8 fromLocalIndex) {
|
||||||
if (mipsPrevHeldState == HELD_HELD && o->oHeldState == HELD_FREE) {
|
if (mipsPrevHeldState == HELD_HELD && o->oHeldState == HELD_FREE) {
|
||||||
cur_obj_init_animation(0);
|
cur_obj_init_animation(0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -139,7 +139,7 @@ void monty_mole_spawn_dirt_particles(s8 offsetY, s8 velYBase) {
|
||||||
cur_obj_spawn_particles(&sMontyMoleRiseFromGroundParticles);
|
cur_obj_spawn_particles(&sMontyMoleRiseFromGroundParticles);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void bhv_monty_mole_on_received_post(u8 fromLocalIndex) {
|
static void bhv_monty_mole_on_received_post(UNUSED u8 fromLocalIndex) {
|
||||||
if (o->oMontyMoleHoleX == 0 && o->oMontyMoleHoleY == 0 && o->oMontyMoleHoleZ == 0) { return; }
|
if (o->oMontyMoleHoleX == 0 && o->oMontyMoleHoleY == 0 && o->oMontyMoleHoleZ == 0) { return; }
|
||||||
|
|
||||||
o->oMontyMoleCurrentHole = NULL;
|
o->oMontyMoleCurrentHole = NULL;
|
||||||
|
|
|
@ -150,12 +150,12 @@ void bhv_pokey_body_part_update(void) {
|
||||||
static u32 pokeyCacheAliveBodyPartFlags = 0;
|
static u32 pokeyCacheAliveBodyPartFlags = 0;
|
||||||
static s32 pokeyCacheNumAliveBodyParts = 0;
|
static s32 pokeyCacheNumAliveBodyParts = 0;
|
||||||
|
|
||||||
static void pokey_on_received_pre(u8 localIndex) {
|
static void pokey_on_received_pre(UNUSED u8 localIndex) {
|
||||||
pokeyCacheAliveBodyPartFlags = o->oPokeyAliveBodyPartFlags;
|
pokeyCacheAliveBodyPartFlags = o->oPokeyAliveBodyPartFlags;
|
||||||
pokeyCacheNumAliveBodyParts = o->oPokeyNumAliveBodyParts;
|
pokeyCacheNumAliveBodyParts = o->oPokeyNumAliveBodyParts;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void pokey_on_received_post(u8 localIndex) {
|
static void pokey_on_received_post(UNUSED u8 localIndex) {
|
||||||
if (o->oPokeyNumAliveBodyParts > pokeyCacheNumAliveBodyParts) {
|
if (o->oPokeyNumAliveBodyParts > pokeyCacheNumAliveBodyParts) {
|
||||||
o->oPokeyAliveBodyPartFlags = pokeyCacheAliveBodyPartFlags;
|
o->oPokeyAliveBodyPartFlags = pokeyCacheAliveBodyPartFlags;
|
||||||
o->oPokeyNumAliveBodyParts = pokeyCacheNumAliveBodyParts;
|
o->oPokeyNumAliveBodyParts = pokeyCacheNumAliveBodyParts;
|
||||||
|
|
|
@ -12,7 +12,7 @@ static struct RacingPenguinData sRacingPenguinData[] = {
|
||||||
static u32 penguinPathedStartWaypoint = 0;
|
static u32 penguinPathedStartWaypoint = 0;
|
||||||
static u32 penguinPathedPrevWaypoint = 0;
|
static u32 penguinPathedPrevWaypoint = 0;
|
||||||
|
|
||||||
static void bhv_racing_penguin_the_quick_on_received_post(u8 fromLocalIndex) {
|
static void bhv_racing_penguin_the_quick_on_received_post(UNUSED u8 fromLocalIndex) {
|
||||||
void* path = segmented_to_virtual(ccm_seg7_trajectory_penguin_race);
|
void* path = segmented_to_virtual(ccm_seg7_trajectory_penguin_race);
|
||||||
o->oPathedStartWaypoint = (struct Waypoint*)path + penguinPathedStartWaypoint;
|
o->oPathedStartWaypoint = (struct Waypoint*)path + penguinPathedStartWaypoint;
|
||||||
o->oPathedPrevWaypoint = (struct Waypoint*)path + penguinPathedPrevWaypoint;
|
o->oPathedPrevWaypoint = (struct Waypoint*)path + penguinPathedPrevWaypoint;
|
||||||
|
|
|
@ -25,8 +25,6 @@ void bhv_sliding_snow_mound_loop(void) {
|
||||||
|
|
||||||
void bhv_snow_mound_spawn_loop(void) {
|
void bhv_snow_mound_spawn_loop(void) {
|
||||||
struct Object* player = nearest_player_to_object(o);
|
struct Object* player = nearest_player_to_object(o);
|
||||||
int distanceToPlayer = dist_between_objects(o, player);
|
|
||||||
int angleToPlayer = obj_angle_to_object(o, player);
|
|
||||||
|
|
||||||
struct Object *sp1C = NULL;
|
struct Object *sp1C = NULL;
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,6 @@ static void swoop_act_idle(void) {
|
||||||
*/
|
*/
|
||||||
static void swoop_act_move(void) {
|
static void swoop_act_move(void) {
|
||||||
struct Object* player = nearest_player_to_object(o);
|
struct Object* player = nearest_player_to_object(o);
|
||||||
int distanceToPlayer = dist_between_objects(o, player);
|
|
||||||
int angleToPlayer = obj_angle_to_object(o, player);
|
int angleToPlayer = obj_angle_to_object(o, player);
|
||||||
|
|
||||||
cur_obj_init_animation_with_accel_and_sound(0, 2.0f);
|
cur_obj_init_animation_with_accel_and_sound(0, 2.0f);
|
||||||
|
|
|
@ -419,14 +419,14 @@ u8 bhv_wiggler_ignore_if_true(void) {
|
||||||
static Vec3f wigglerPrePos = { 0 };
|
static Vec3f wigglerPrePos = { 0 };
|
||||||
static u8 wigglerCompletedDialog = FALSE;
|
static u8 wigglerCompletedDialog = FALSE;
|
||||||
|
|
||||||
void bhv_wiggler_on_received_pre(u8 localIndex) {
|
void bhv_wiggler_on_received_pre(UNUSED u8 localIndex) {
|
||||||
wigglerPrePos[0] = o->oPosX;
|
wigglerPrePos[0] = o->oPosX;
|
||||||
wigglerPrePos[1] = o->oPosY;
|
wigglerPrePos[1] = o->oPosY;
|
||||||
wigglerPrePos[2] = o->oPosZ;
|
wigglerPrePos[2] = o->oPosZ;
|
||||||
wigglerCompletedDialog = (o->oWigglerTextStatus == WIGGLER_TEXT_STATUS_COMPLETED_DIALOG);
|
wigglerCompletedDialog = (o->oWigglerTextStatus == WIGGLER_TEXT_STATUS_COMPLETED_DIALOG);
|
||||||
}
|
}
|
||||||
|
|
||||||
void bhv_wiggler_on_received_post(u8 localIndex) {
|
void bhv_wiggler_on_received_post(UNUSED u8 localIndex) {
|
||||||
Vec3f posDiff = { 0 };
|
Vec3f posDiff = { 0 };
|
||||||
posDiff[0] = o->oPosX - wigglerPrePos[0];
|
posDiff[0] = o->oPosX - wigglerPrePos[0];
|
||||||
posDiff[1] = o->oPosY - wigglerPrePos[1];
|
posDiff[1] = o->oPosY - wigglerPrePos[1];
|
||||||
|
|
|
@ -253,11 +253,11 @@ void play_character_sound(struct MarioState* m, enum CharacterSound characterSou
|
||||||
play_sound_with_freq_scale(sound, m->marioObj->header.gfx.cameraToObject, character->soundFreqScale);
|
play_sound_with_freq_scale(sound, m->marioObj->header.gfx.cameraToObject, character->soundFreqScale);
|
||||||
}
|
}
|
||||||
|
|
||||||
void play_character_sound_offset(struct MarioState* m, enum CharacterSound characterSound, u8 offset) {
|
void play_character_sound_offset(struct MarioState* m, enum CharacterSound characterSound, u32 offset) {
|
||||||
s32 sound = get_character_sound(m, characterSound);
|
s32 sound = get_character_sound(m, characterSound);
|
||||||
if (sound == 0) { return; }
|
if (sound == 0) { return; }
|
||||||
struct Character* character = get_character(m);
|
struct Character* character = get_character(m);
|
||||||
play_sound_with_freq_scale(sound, m->marioObj->header.gfx.cameraToObject, character->soundFreqScale);
|
play_sound_with_freq_scale(sound + offset, m->marioObj->header.gfx.cameraToObject, character->soundFreqScale);
|
||||||
}
|
}
|
||||||
|
|
||||||
void play_character_sound_if_no_flag(struct MarioState* m, enum CharacterSound characterSound, u32 flags) {
|
void play_character_sound_if_no_flag(struct MarioState* m, enum CharacterSound characterSound, u32 flags) {
|
||||||
|
|
|
@ -120,7 +120,7 @@ struct MarioState;
|
||||||
extern struct Character gCharacters[];
|
extern struct Character gCharacters[];
|
||||||
struct Character* get_character(struct MarioState* m);
|
struct Character* get_character(struct MarioState* m);
|
||||||
void play_character_sound(struct MarioState* m, enum CharacterSound characterSound);
|
void play_character_sound(struct MarioState* m, enum CharacterSound characterSound);
|
||||||
void play_character_sound_offset(struct MarioState* m, enum CharacterSound characterSound, u8 offset);
|
void play_character_sound_offset(struct MarioState* m, enum CharacterSound characterSound, u32 offset);
|
||||||
void play_character_sound_if_no_flag(struct MarioState* m, enum CharacterSound characterSound, u32 flags);
|
void play_character_sound_if_no_flag(struct MarioState* m, enum CharacterSound characterSound, u32 flags);
|
||||||
|
|
||||||
#endif // CHARACTERS_H
|
#endif // CHARACTERS_H
|
||||||
|
|
|
@ -2073,8 +2073,6 @@ s32 force_idle_state(struct MarioState* m) {
|
||||||
**************************************************/
|
**************************************************/
|
||||||
|
|
||||||
static void init_single_mario(struct MarioState* m) {
|
static void init_single_mario(struct MarioState* m) {
|
||||||
Vec3s capPos;
|
|
||||||
struct Object* capObject;
|
|
||||||
|
|
||||||
u16 playerIndex = m->playerIndex;
|
u16 playerIndex = m->playerIndex;
|
||||||
struct SpawnInfo* spawnInfo = &gPlayerSpawnInfos[playerIndex];
|
struct SpawnInfo* spawnInfo = &gPlayerSpawnInfos[playerIndex];
|
||||||
|
@ -2156,7 +2154,9 @@ static void init_single_mario(struct MarioState* m) {
|
||||||
vec3s_set(m->marioObj->header.gfx.angle, 0, m->faceAngle[1], 0);
|
vec3s_set(m->marioObj->header.gfx.angle, 0, m->faceAngle[1], 0);
|
||||||
|
|
||||||
// cap will never be lying on the ground in coop
|
// cap will never be lying on the ground in coop
|
||||||
/*if (save_file_get_cap_pos(capPos)) {
|
/* struct Object* capObject;
|
||||||
|
Vec3s capPos;
|
||||||
|
if (save_file_get_cap_pos(capPos)) {
|
||||||
capObject = spawn_object(m->marioObj, MODEL_MARIOS_CAP, bhvNormalCap);
|
capObject = spawn_object(m->marioObj, MODEL_MARIOS_CAP, bhvNormalCap);
|
||||||
|
|
||||||
capObject->oPosX = capPos[0];
|
capObject->oPosX = capPos[0];
|
||||||
|
|
|
@ -477,7 +477,6 @@ Gfx* geo_switch_mario_eyes(s32 callContext, struct GraphNode* node, UNUSED Mat4*
|
||||||
*/
|
*/
|
||||||
Gfx* geo_mario_tilt_torso(s32 callContext, struct GraphNode* node, Mat4* mtx) {
|
Gfx* geo_mario_tilt_torso(s32 callContext, struct GraphNode* node, Mat4* mtx) {
|
||||||
Mat4 * curTransform = mtx;
|
Mat4 * curTransform = mtx;
|
||||||
struct GraphNodeGenerated* asGenerated = (struct GraphNodeGenerated*) node;
|
|
||||||
u8 plrIdx = geo_get_processing_object_index();
|
u8 plrIdx = geo_get_processing_object_index();
|
||||||
struct MarioBodyState* bodyState = &gBodyStates[plrIdx];
|
struct MarioBodyState* bodyState = &gBodyStates[plrIdx];
|
||||||
s32 action = bodyState->action;
|
s32 action = bodyState->action;
|
||||||
|
@ -507,7 +506,6 @@ Gfx* geo_mario_tilt_torso(s32 callContext, struct GraphNode* node, Mat4* mtx) {
|
||||||
* Makes Mario's head rotate with the camera angle when in C-up mode
|
* Makes Mario's head rotate with the camera angle when in C-up mode
|
||||||
*/
|
*/
|
||||||
Gfx* geo_mario_head_rotation(s32 callContext, struct GraphNode* node, UNUSED Mat4* c) {
|
Gfx* geo_mario_head_rotation(s32 callContext, struct GraphNode* node, UNUSED Mat4* c) {
|
||||||
struct GraphNodeGenerated* asGenerated = (struct GraphNodeGenerated*) node;
|
|
||||||
u8 plrIdx = geo_get_processing_object_index();
|
u8 plrIdx = geo_get_processing_object_index();
|
||||||
struct MarioBodyState* bodyState = &gBodyStates[plrIdx];
|
struct MarioBodyState* bodyState = &gBodyStates[plrIdx];
|
||||||
s32 action = bodyState->action;
|
s32 action = bodyState->action;
|
||||||
|
|
|
@ -222,8 +222,6 @@ u32 main_pool_pop_state(void) {
|
||||||
* function blocks until completion.
|
* function blocks until completion.
|
||||||
*/
|
*/
|
||||||
static void dma_read(u8 *dest, u8 *srcStart, u8 *srcEnd) {
|
static void dma_read(u8 *dest, u8 *srcStart, u8 *srcEnd) {
|
||||||
u32 size = ALIGN16(srcEnd - srcStart);
|
|
||||||
|
|
||||||
memcpy(dest, srcStart, srcEnd - srcStart);
|
memcpy(dest, srcStart, srcEnd - srcStart);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -416,7 +416,7 @@ static void save_file_load_textsaves(void) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void save_file_load_all(u8 reload) {
|
void save_file_load_all(UNUSED u8 reload) {
|
||||||
s32 file;
|
s32 file;
|
||||||
|
|
||||||
gMainMenuDataModified = FALSE;
|
gMainMenuDataModified = FALSE;
|
||||||
|
@ -424,13 +424,6 @@ void save_file_load_all(u8 reload) {
|
||||||
|
|
||||||
bzero(&gSaveBuffer, sizeof(gSaveBuffer));
|
bzero(&gSaveBuffer, sizeof(gSaveBuffer));
|
||||||
|
|
||||||
#ifdef TEXTSAVES
|
|
||||||
if (!reload) {
|
|
||||||
save_file_load_textsaves();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
read_eeprom_data(&gSaveBuffer, sizeof(gSaveBuffer));
|
read_eeprom_data(&gSaveBuffer, sizeof(gSaveBuffer));
|
||||||
|
|
||||||
if (save_file_need_bswap(&gSaveBuffer))
|
if (save_file_need_bswap(&gSaveBuffer))
|
||||||
|
|
|
@ -408,7 +408,6 @@ void print_act_selector_strings(void) {
|
||||||
|
|
||||||
gSPDisplayList(gDisplayListHead++, dl_ia_text_begin);
|
gSPDisplayList(gDisplayListHead++, dl_ia_text_begin);
|
||||||
f32 textWidth = get_generic_ascii_string_width(message);
|
f32 textWidth = get_generic_ascii_string_width(message);
|
||||||
f32 textHeight = get_generic_ascii_string_height(message);
|
|
||||||
|
|
||||||
f32 xPos = (sSelectedActIndex + 1) * 34 - sVisibleStars * 17 + 139 - (textWidth / 2.0f) + 4;
|
f32 xPos = (sSelectedActIndex + 1) * 34 - sVisibleStars * 17 + 139 - (textWidth / 2.0f) + 4;
|
||||||
f32 yPos = 224;
|
f32 yPos = 224;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#include "audio_api.h"
|
#include "audio_api.h"
|
||||||
|
#include "macros.h"
|
||||||
|
|
||||||
static bool audio_null_init(void) {
|
static bool audio_null_init(void) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -12,7 +13,7 @@ static int audio_null_get_desired_buffered(void) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void audio_null_play(const uint8_t *buf, size_t len) {
|
static void audio_null_play(UNUSED const uint8_t *buf, UNUSED size_t len) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void audio_null_shutdown(void) {
|
static void audio_null_shutdown(void) {
|
||||||
|
|
|
@ -30,8 +30,7 @@ static inline int arg_string(const char *name, const char *value, char *target,
|
||||||
fprintf(stderr, "Supplied value for `%s` is too long.\n", name);
|
fprintf(stderr, "Supplied value for `%s` is too long.\n", name);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
strncpy(target, value, arglen);
|
snprintf(target, maxLength, "%s", value);
|
||||||
target[arglen] = '\0';
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ static void djui_button_on_hover_end(struct DjuiBase* base) {
|
||||||
djui_button_set_default_style(base);
|
djui_button_set_default_style(base);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void djui_button_on_cursor_down_begin(struct DjuiBase* base, bool inputCursor) {
|
static void djui_button_on_cursor_down_begin(struct DjuiBase* base, UNUSED bool inputCursor) {
|
||||||
struct DjuiButton* button = (struct DjuiButton*)base;
|
struct DjuiButton* button = (struct DjuiButton*)base;
|
||||||
djui_base_set_border_color(base, 0, 84, 153, 255);
|
djui_base_set_border_color(base, 0, 84, 153, 255);
|
||||||
djui_base_set_color(&button->rect->base, 204, 228, 247, 255);
|
djui_base_set_color(&button->rect->base, 204, 228, 247, 255);
|
||||||
|
|
|
@ -26,7 +26,7 @@ static void djui_checkbox_on_hover_end(struct DjuiBase* base) {
|
||||||
djui_checkbox_set_default_style(base);
|
djui_checkbox_set_default_style(base);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void djui_checkbox_on_cursor_down_begin(struct DjuiBase* base, bool inputCursor) {
|
static void djui_checkbox_on_cursor_down_begin(struct DjuiBase* base, UNUSED bool inputCursor) {
|
||||||
struct DjuiCheckbox* checkbox = (struct DjuiCheckbox*)base;
|
struct DjuiCheckbox* checkbox = (struct DjuiCheckbox*)base;
|
||||||
djui_base_set_border_color(&checkbox->rect->base, 20, 170, 255, 255);
|
djui_base_set_border_color(&checkbox->rect->base, 20, 170, 255, 255);
|
||||||
djui_base_set_color(&checkbox->rect->base, 255, 255, 255, 32);
|
djui_base_set_color(&checkbox->rect->base, 255, 255, 255, 32);
|
||||||
|
@ -40,7 +40,6 @@ static void djui_checkbox_on_cursor_down_begin(struct DjuiBase* base, bool input
|
||||||
}
|
}
|
||||||
|
|
||||||
static void djui_checkbox_on_cursor_down_end(struct DjuiBase* base) {
|
static void djui_checkbox_on_cursor_down_end(struct DjuiBase* base) {
|
||||||
struct DjuiCheckbox* checkbox = (struct DjuiCheckbox*)base;
|
|
||||||
djui_checkbox_set_default_style(base);
|
djui_checkbox_set_default_style(base);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,6 @@ void djui_image_set_image(struct DjuiImage* image, const u8* texture, u16 textur
|
||||||
static bool djui_image_render(struct DjuiBase* base) {
|
static bool djui_image_render(struct DjuiBase* base) {
|
||||||
struct DjuiImage* image = (struct DjuiImage*)base;
|
struct DjuiImage* image = (struct DjuiImage*)base;
|
||||||
struct DjuiBaseRect* comp = &base->comp;
|
struct DjuiBaseRect* comp = &base->comp;
|
||||||
struct DjuiBaseRect* clip = &base->clip;
|
|
||||||
|
|
||||||
// translate position
|
// translate position
|
||||||
f32 translatedX = comp->x;
|
f32 translatedX = comp->x;
|
||||||
|
|
|
@ -96,7 +96,7 @@ static void djui_inputbox_on_cursor_down_end(struct DjuiBase* base) {
|
||||||
djui_inputbox_set_default_style(base);
|
djui_inputbox_set_default_style(base);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void djui_inputbox_on_cursor_down_begin(struct DjuiBase* base, bool inputCursor) {
|
static void djui_inputbox_on_cursor_down_begin(struct DjuiBase* base, UNUSED bool inputCursor) {
|
||||||
struct DjuiInputbox* inputbox = (struct DjuiInputbox*)base;
|
struct DjuiInputbox* inputbox = (struct DjuiInputbox*)base;
|
||||||
u16 index = djui_inputbox_get_cursor_index(inputbox);
|
u16 index = djui_inputbox_get_cursor_index(inputbox);
|
||||||
u16 selLength = abs(inputbox->selection[0] - inputbox->selection[1]);
|
u16 selLength = abs(inputbox->selection[0] - inputbox->selection[1]);
|
||||||
|
@ -111,7 +111,7 @@ static void djui_inputbox_on_cursor_down_begin(struct DjuiBase* base, bool input
|
||||||
djui_interactable_set_input_focus(base);
|
djui_interactable_set_input_focus(base);
|
||||||
}
|
}
|
||||||
|
|
||||||
static u16 djui_inputbox_jump_word_left(char* msg, u16 len, u16 i) {
|
static u16 djui_inputbox_jump_word_left(char* msg, UNUSED u16 len, u16 i) {
|
||||||
if (i == 0) { return i; }
|
if (i == 0) { return i; }
|
||||||
|
|
||||||
s32 lastI = i;
|
s32 lastI = i;
|
||||||
|
@ -282,7 +282,7 @@ bool djui_inputbox_on_key_down(struct DjuiBase *base, int scancode) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void djui_inputbox_on_key_up(struct DjuiBase *base, int scancode) {
|
void djui_inputbox_on_key_up(UNUSED struct DjuiBase *base, int scancode) {
|
||||||
switch (scancode) {
|
switch (scancode) {
|
||||||
case SCANCODE_CONTROL_LEFT: sHeldControl &= ~(1 << 0); break;
|
case SCANCODE_CONTROL_LEFT: sHeldControl &= ~(1 << 0); break;
|
||||||
case SCANCODE_CONTROL_RIGHT: sHeldControl &= ~(1 << 1); break;
|
case SCANCODE_CONTROL_RIGHT: sHeldControl &= ~(1 << 1); break;
|
||||||
|
@ -291,13 +291,13 @@ void djui_inputbox_on_key_up(struct DjuiBase *base, int scancode) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void djui_inputbox_on_focus_begin(struct DjuiBase* base) {
|
static void djui_inputbox_on_focus_begin(UNUSED struct DjuiBase* base) {
|
||||||
sHeldControl = 0;
|
sHeldControl = 0;
|
||||||
sHeldShift = 0;
|
sHeldShift = 0;
|
||||||
wm_api->start_text_input();
|
wm_api->start_text_input();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void djui_inputbox_on_focus_end(struct DjuiBase* base) {
|
static void djui_inputbox_on_focus_end(UNUSED struct DjuiBase* base) {
|
||||||
wm_api->stop_text_input();
|
wm_api->stop_text_input();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#include "src/pc/configfile.h"
|
#include "src/pc/configfile.h"
|
||||||
#include "src/game/bettercamera.h"
|
#include "src/game/bettercamera.h"
|
||||||
|
|
||||||
void djui_panel_camera_value_changed(struct DjuiBase* caller) {
|
void djui_panel_camera_value_changed(UNUSED struct DjuiBase* caller) {
|
||||||
newcam_init_settings();
|
newcam_init_settings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#include "src/pc/configfile.h"
|
#include "src/pc/configfile.h"
|
||||||
#include "src/pc/controller/controller_api.h"
|
#include "src/pc/controller/controller_api.h"
|
||||||
|
|
||||||
void djui_panel_controls_value_change(struct DjuiBase* caller) {
|
void djui_panel_controls_value_change(UNUSED struct DjuiBase* caller) {
|
||||||
controller_reconfigure();
|
controller_reconfigure();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ static struct DjuiText* sDjuiText = NULL;
|
||||||
static struct DjuiRect* sDjuiRect2 = NULL;
|
static struct DjuiRect* sDjuiRect2 = NULL;
|
||||||
static struct DjuiText* sDjuiText2 = NULL;
|
static struct DjuiText* sDjuiText2 = NULL;
|
||||||
|
|
||||||
static void djui_panel_debug_render_pre(struct DjuiBase* base, bool* skipRender) {
|
static void djui_panel_debug_render_pre(UNUSED struct DjuiBase* base, UNUSED bool* skipRender) {
|
||||||
static u32 sTimer = 0;
|
static u32 sTimer = 0;
|
||||||
sTimer++;
|
sTimer++;
|
||||||
if (sDjuiText != NULL) {
|
if (sDjuiText != NULL) {
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#include "src/pc/utils/misc.h"
|
#include "src/pc/utils/misc.h"
|
||||||
#include "src/pc/configfile.h"
|
#include "src/pc/configfile.h"
|
||||||
|
|
||||||
static void djui_panel_display_apply(struct DjuiBase* caller) {
|
static void djui_panel_display_apply(UNUSED struct DjuiBase* caller) {
|
||||||
configWindow.settings_changed = true;
|
configWindow.settings_changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,8 +15,7 @@
|
||||||
struct DjuiInputbox* sInputboxPort = NULL;
|
struct DjuiInputbox* sInputboxPort = NULL;
|
||||||
static unsigned int sKnockbackIndex = 0;
|
static unsigned int sKnockbackIndex = 0;
|
||||||
|
|
||||||
static void djui_panel_host_network_system_change(struct DjuiBase* base) {
|
static void djui_panel_host_network_system_change(UNUSED struct DjuiBase* base) {
|
||||||
struct DjuiSelectionbox* selectionbox = (struct DjuiSelectionbox*)base;
|
|
||||||
djui_base_set_enabled(&sInputboxPort->base, DJUI_HOST_NS_IS_SOCKET);
|
djui_base_set_enabled(&sInputboxPort->base, DJUI_HOST_NS_IS_SOCKET);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +40,7 @@ static void djui_panel_host_port_text_change(struct DjuiBase* caller) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void djui_panel_host_knockback_change(struct DjuiBase* caller) {
|
static void djui_panel_host_knockback_change(UNUSED struct DjuiBase* caller) {
|
||||||
switch (sKnockbackIndex) {
|
switch (sKnockbackIndex) {
|
||||||
case 0: configPlayerKnockbackStrength = 10; break;
|
case 0: configPlayerKnockbackStrength = 10; break;
|
||||||
case 1: configPlayerKnockbackStrength = 25; break;
|
case 1: configPlayerKnockbackStrength = 25; break;
|
||||||
|
|
|
@ -25,7 +25,7 @@ Direct connections \\#ffa0a0\\require you\\#c8c8c8\\ to configure port forwardin
|
||||||
Forward port '\\#d0d0ff\\%d\\#c8c8c8\\' for UDP.\
|
Forward port '\\#d0d0ff\\%d\\#c8c8c8\\' for UDP.\
|
||||||
";
|
";
|
||||||
|
|
||||||
void djui_panel_host_message_do_host(struct DjuiBase* caller) {
|
void djui_panel_host_message_do_host(UNUSED struct DjuiBase* caller) {
|
||||||
djui_panel_shutdown();
|
djui_panel_shutdown();
|
||||||
extern s16 gCurrSaveFileNum;
|
extern s16 gCurrSaveFileNum;
|
||||||
gCurrSaveFileNum = configHostSaveSlot;
|
gCurrSaveFileNum = configHostSaveSlot;
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
bool gDjuiPanelMainCreated = false;
|
bool gDjuiPanelMainCreated = false;
|
||||||
|
|
||||||
static void djui_panel_main_quit_yes(struct DjuiBase* caller) {
|
static void djui_panel_main_quit_yes(UNUSED struct DjuiBase* caller) {
|
||||||
game_exit();
|
game_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#include "src/pc/utils/misc.h"
|
#include "src/pc/utils/misc.h"
|
||||||
#include "src/pc/configfile.h"
|
#include "src/pc/configfile.h"
|
||||||
|
|
||||||
void djui_panel_menu_back(struct DjuiBase* base) {
|
void djui_panel_menu_back(UNUSED struct DjuiBase* base) {
|
||||||
djui_panel_back();
|
djui_panel_back();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,11 +4,11 @@
|
||||||
|
|
||||||
bool gDjuiPanelPauseCreated = false;
|
bool gDjuiPanelPauseCreated = false;
|
||||||
|
|
||||||
static void djui_panel_pause_resume(struct DjuiBase* caller) {
|
static void djui_panel_pause_resume(UNUSED struct DjuiBase* caller) {
|
||||||
djui_panel_shutdown();
|
djui_panel_shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void djui_panel_pause_quit_yes(struct DjuiBase* caller) {
|
static void djui_panel_pause_quit_yes(UNUSED struct DjuiBase* caller) {
|
||||||
game_exit();
|
game_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,8 +35,7 @@ static void djui_panel_player_name_on_focus_end(struct DjuiBase* caller) {
|
||||||
djui_inputbox_set_text_color(inputbox1, 0, 0, 0, 255);
|
djui_inputbox_set_text_color(inputbox1, 0, 0, 0, 255);
|
||||||
}
|
}
|
||||||
|
|
||||||
void djui_panel_player_value_changed(struct DjuiBase* caller) {
|
void djui_panel_player_value_changed(UNUSED struct DjuiBase* caller) {
|
||||||
struct MarioState* m = &gMarioStates[0];
|
|
||||||
if (configPlayerModel >= CT_MAX) { configPlayerModel = 0; }
|
if (configPlayerModel >= CT_MAX) { configPlayerModel = 0; }
|
||||||
gNetworkPlayers[0].modelIndex = configPlayerModel;
|
gNetworkPlayers[0].modelIndex = configPlayerModel;
|
||||||
gNetworkPlayers[0].paletteIndex = configPlayerPalette;
|
gNetworkPlayers[0].paletteIndex = configPlayerPalette;
|
||||||
|
|
|
@ -38,7 +38,7 @@ static void djui_selectionbox_on_hover_end(struct DjuiBase* base) {
|
||||||
djui_selectionbox_set_default_style(base);
|
djui_selectionbox_set_default_style(base);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void djui_selectionbox_on_cursor_down_begin(struct DjuiBase* base, bool inputCursor) {
|
static void djui_selectionbox_on_cursor_down_begin(struct DjuiBase* base, UNUSED bool inputCursor) {
|
||||||
struct DjuiSelectionbox* selectionbox = (struct DjuiSelectionbox*)base;
|
struct DjuiSelectionbox* selectionbox = (struct DjuiSelectionbox*)base;
|
||||||
f32 x = selectionbox->rect->base.elem.x;
|
f32 x = selectionbox->rect->base.elem.x;
|
||||||
if (gCursorX >= x) {
|
if (gCursorX >= x) {
|
||||||
|
@ -59,7 +59,6 @@ static void djui_selectionbox_on_cursor_down_begin(struct DjuiBase* base, bool i
|
||||||
}
|
}
|
||||||
|
|
||||||
static void djui_selectionbox_on_cursor_down_end(struct DjuiBase* base) {
|
static void djui_selectionbox_on_cursor_down_end(struct DjuiBase* base) {
|
||||||
struct DjuiSelectionbox* selectionbox = (struct DjuiSelectionbox*)base;
|
|
||||||
djui_selectionbox_set_default_style(base);
|
djui_selectionbox_set_default_style(base);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,6 @@ static void djui_text_render_single_char(struct DjuiText* text, char c) {
|
||||||
static void djui_text_render_char(struct DjuiText* text, char c) {
|
static void djui_text_render_char(struct DjuiText* text, char c) {
|
||||||
if (text->dropShadow.a > 0) {
|
if (text->dropShadow.a > 0) {
|
||||||
// render drop shadow
|
// render drop shadow
|
||||||
struct DjuiBase* base = &text->base;
|
|
||||||
sTextRenderX += 1.0f / text->fontScale;
|
sTextRenderX += 1.0f / text->fontScale;
|
||||||
sTextRenderY += 1.0f / text->fontScale;
|
sTextRenderY += 1.0f / text->fontScale;
|
||||||
gDPSetEnvColor(gDisplayListHead++, text->dropShadow.r, text->dropShadow.g, text->dropShadow.b, text->dropShadow.a);
|
gDPSetEnvColor(gDisplayListHead++, text->dropShadow.r, text->dropShadow.g, text->dropShadow.b, text->dropShadow.a);
|
||||||
|
@ -108,7 +107,7 @@ static f32 djui_text_measure_word_width(struct DjuiText* text, char* message) {
|
||||||
return width;
|
return width;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void djui_text_read_line(struct DjuiText* text, u16* index, f32* lineWidth, f32 maxLineWidth, bool onLastLine, bool* ellipses) {
|
static void djui_text_read_line(struct DjuiText* text, u16* index, f32* lineWidth, f32 maxLineWidth, bool onLastLine, UNUSED bool* ellipses) {
|
||||||
char* message = text->message;
|
char* message = text->message;
|
||||||
*lineWidth = 0;
|
*lineWidth = 0;
|
||||||
char lastC = '\0';
|
char lastC = '\0';
|
||||||
|
@ -264,7 +263,6 @@ static void djui_text_render_line(struct DjuiText* text, u16 startIndex, u16 end
|
||||||
}
|
}
|
||||||
|
|
||||||
// render the line
|
// render the line
|
||||||
bool escapeCode = false;
|
|
||||||
for (int i = startIndex; i < endIndex; i++) {
|
for (int i = startIndex; i < endIndex; i++) {
|
||||||
char c = text->message[i];
|
char c = text->message[i];
|
||||||
if (c == '\\') {
|
if (c == '\\') {
|
||||||
|
|
|
@ -28,6 +28,8 @@
|
||||||
#include "../configfile.h"
|
#include "../configfile.h"
|
||||||
#include "../fs/fs.h"
|
#include "../fs/fs.h"
|
||||||
|
|
||||||
|
#include "macros.h"
|
||||||
|
|
||||||
#define SUPPORT_CHECK(x) assert(x)
|
#define SUPPORT_CHECK(x) assert(x)
|
||||||
|
|
||||||
// SCALE_M_N: upscale/downscale M-bit integer to N-bit
|
// SCALE_M_N: upscale/downscale M-bit integer to N-bit
|
||||||
|
@ -207,13 +209,13 @@ static unsigned long get_time(void) {
|
||||||
|
|
||||||
static void gfx_flush(void) {
|
static void gfx_flush(void) {
|
||||||
if (buf_vbo_len > 0) {
|
if (buf_vbo_len > 0) {
|
||||||
int num = buf_vbo_num_tris;
|
/*int num = buf_vbo_num_tris;
|
||||||
unsigned long t0 = get_time();
|
unsigned long t0 = get_time();*/
|
||||||
gfx_rapi->draw_triangles(buf_vbo, buf_vbo_len, buf_vbo_num_tris);
|
gfx_rapi->draw_triangles(buf_vbo, buf_vbo_len, buf_vbo_num_tris);
|
||||||
buf_vbo_len = 0;
|
buf_vbo_len = 0;
|
||||||
buf_vbo_num_tris = 0;
|
buf_vbo_num_tris = 0;
|
||||||
unsigned long t1 = get_time();
|
/*unsigned long t1 = get_time();
|
||||||
/*if (t1 - t0 > 1000) {
|
if (t1 - t0 > 1000) {
|
||||||
printf("f: %d %d\n", num, (int)(t1 - t0));
|
printf("f: %d %d\n", num, (int)(t1 - t0));
|
||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
|
@ -625,7 +627,7 @@ static void import_texture(int tile) {
|
||||||
load_texture(texname);
|
load_texture(texname);
|
||||||
#else
|
#else
|
||||||
// the texture data is actual texture data
|
// the texture data is actual texture data
|
||||||
int t0 = get_time();
|
//int t0 = get_time();
|
||||||
if (fmt == G_IM_FMT_RGBA) {
|
if (fmt == G_IM_FMT_RGBA) {
|
||||||
if (siz == G_IM_SIZ_32b) {
|
if (siz == G_IM_SIZ_32b) {
|
||||||
import_texture_rgba32(tile);
|
import_texture_rgba32(tile);
|
||||||
|
@ -664,7 +666,7 @@ static void import_texture(int tile) {
|
||||||
} else {
|
} else {
|
||||||
sys_fatal("unsupported texture format: %u", fmt);
|
sys_fatal("unsupported texture format: %u", fmt);
|
||||||
}
|
}
|
||||||
int t1 = get_time();
|
//int t1 = get_time();
|
||||||
//printf("Time diff: %d\n", t1 - t0);
|
//printf("Time diff: %d\n", t1 - t0);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -1141,7 +1143,7 @@ static void gfx_sp_movemem(uint8_t index, uint8_t offset, const void* data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef F3DEX_GBI_2E
|
#ifdef F3DEX_GBI_2E
|
||||||
static void gfx_sp_copymem(uint8_t idx, uint8_t dstofs, uint8_t srcofs, uint8_t words) {
|
static void gfx_sp_copymem(uint8_t idx, uint8_t dstofs, uint8_t srcofs, UNUSED uint8_t words) {
|
||||||
if (idx == G_MV_LIGHT) {
|
if (idx == G_MV_LIGHT) {
|
||||||
const int srcidx = srcofs / 24 - 2;
|
const int srcidx = srcofs / 24 - 2;
|
||||||
const int dstidx = dstofs / 24 - 2;
|
const int dstidx = dstofs / 24 - 2;
|
||||||
|
@ -1152,7 +1154,7 @@ static void gfx_sp_copymem(uint8_t idx, uint8_t dstofs, uint8_t srcofs, uint8_t
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void gfx_sp_moveword(uint8_t index, uint16_t offset, uint32_t data) {
|
static void gfx_sp_moveword(uint8_t index, UNUSED uint16_t offset, uint32_t data) {
|
||||||
switch (index) {
|
switch (index) {
|
||||||
case G_MW_NUMLIGHT:
|
case G_MW_NUMLIGHT:
|
||||||
#ifdef F3DEX_GBI_2
|
#ifdef F3DEX_GBI_2
|
||||||
|
@ -1171,12 +1173,12 @@ static void gfx_sp_moveword(uint8_t index, uint16_t offset, uint32_t data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_sp_texture(uint16_t sc, uint16_t tc, uint8_t level, uint8_t tile, uint8_t on) {
|
static void gfx_sp_texture(uint16_t sc, uint16_t tc, UNUSED uint8_t level, UNUSED uint8_t tile, UNUSED uint8_t on) {
|
||||||
rsp.texture_scaling_factor.s = sc;
|
rsp.texture_scaling_factor.s = sc;
|
||||||
rsp.texture_scaling_factor.t = tc;
|
rsp.texture_scaling_factor.t = tc;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_dp_set_scissor(uint32_t mode, uint32_t ulx, uint32_t uly, uint32_t lrx, uint32_t lry) {
|
static void gfx_dp_set_scissor(UNUSED uint32_t mode, uint32_t ulx, uint32_t uly, uint32_t lrx, uint32_t lry) {
|
||||||
float x = ulx / 4.0f * RATIO_X;
|
float x = ulx / 4.0f * RATIO_X;
|
||||||
float y = (SCREEN_HEIGHT - lry / 4.0f) * RATIO_Y;
|
float y = (SCREEN_HEIGHT - lry / 4.0f) * RATIO_Y;
|
||||||
float width = (lrx - ulx) / 4.0f * RATIO_X;
|
float width = (lrx - ulx) / 4.0f * RATIO_X;
|
||||||
|
@ -1190,12 +1192,12 @@ static void gfx_dp_set_scissor(uint32_t mode, uint32_t ulx, uint32_t uly, uint32
|
||||||
rdp.viewport_or_scissor_changed = true;
|
rdp.viewport_or_scissor_changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_dp_set_texture_image(uint32_t format, uint32_t size, uint32_t width, const void* addr) {
|
static void gfx_dp_set_texture_image(UNUSED uint32_t format, uint32_t size, UNUSED uint32_t width, const void* addr) {
|
||||||
rdp.texture_to_load.addr = addr;
|
rdp.texture_to_load.addr = addr;
|
||||||
rdp.texture_to_load.siz = size;
|
rdp.texture_to_load.siz = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_dp_set_tile(uint8_t fmt, uint32_t siz, uint32_t line, uint32_t tmem, uint8_t tile, uint32_t palette, uint32_t cmt, uint32_t maskt, uint32_t shiftt, uint32_t cms, uint32_t masks, uint32_t shifts) {
|
static void gfx_dp_set_tile(uint8_t fmt, uint32_t siz, uint32_t line, uint32_t tmem, uint8_t tile, uint32_t palette, uint32_t cmt, UNUSED uint32_t maskt, UNUSED uint32_t shiftt, uint32_t cms, UNUSED uint32_t masks, UNUSED uint32_t shifts) {
|
||||||
|
|
||||||
if (tile == G_TX_RENDERTILE) {
|
if (tile == G_TX_RENDERTILE) {
|
||||||
SUPPORT_CHECK(palette == 0); // palette should set upper 4 bits of color index in 4b mode
|
SUPPORT_CHECK(palette == 0); // palette should set upper 4 bits of color index in 4b mode
|
||||||
|
@ -1224,13 +1226,13 @@ static void gfx_dp_set_tile_size(uint8_t tile, uint16_t uls, uint16_t ult, uint1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_dp_load_tlut(uint8_t tile, uint32_t high_index) {
|
static void gfx_dp_load_tlut(uint8_t tile, UNUSED uint32_t high_index) {
|
||||||
SUPPORT_CHECK(tile == G_TX_LOADTILE);
|
SUPPORT_CHECK(tile == G_TX_LOADTILE);
|
||||||
SUPPORT_CHECK(rdp.texture_to_load.siz == G_IM_SIZ_16b);
|
SUPPORT_CHECK(rdp.texture_to_load.siz == G_IM_SIZ_16b);
|
||||||
rdp.palette = rdp.texture_to_load.addr;
|
rdp.palette = rdp.texture_to_load.addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_dp_load_block(uint8_t tile, uint32_t uls, uint32_t ult, uint32_t lrs, uint32_t dxt) {
|
static void gfx_dp_load_block(uint8_t tile, uint32_t uls, uint32_t ult, uint32_t lrs, UNUSED uint32_t dxt) {
|
||||||
if (tile == 1) return;
|
if (tile == 1) return;
|
||||||
SUPPORT_CHECK(tile == G_TX_LOADTILE);
|
SUPPORT_CHECK(tile == G_TX_LOADTILE);
|
||||||
SUPPORT_CHECK(uls == 0);
|
SUPPORT_CHECK(uls == 0);
|
||||||
|
@ -1426,7 +1428,7 @@ static void gfx_draw_rectangle(int32_t ulx, int32_t uly, int32_t lrx, int32_t lr
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_dp_texture_rectangle(int32_t ulx, int32_t uly, int32_t lrx, int32_t lry, uint8_t tile, int16_t uls, int16_t ult, int16_t dsdx, int16_t dtdy, bool flip) {
|
static void gfx_dp_texture_rectangle(int32_t ulx, int32_t uly, int32_t lrx, int32_t lry, UNUSED uint8_t tile, int16_t uls, int16_t ult, int16_t dsdx, int16_t dtdy, bool flip) {
|
||||||
uint32_t saved_combine_mode = rdp.combine_mode;
|
uint32_t saved_combine_mode = rdp.combine_mode;
|
||||||
if ((rdp.other_mode_h & (3U << G_MDSFT_CYCLETYPE)) == G_CYC_COPY) {
|
if ((rdp.other_mode_h & (3U << G_MDSFT_CYCLETYPE)) == G_CYC_COPY) {
|
||||||
// Per RDP Command Summary Set Tile's shift s and this dsdx should be set to 4 texels
|
// Per RDP Command Summary Set Tile's shift s and this dsdx should be set to 4 texels
|
||||||
|
@ -1506,7 +1508,7 @@ static void gfx_dp_set_z_image(void *z_buf_address) {
|
||||||
rdp.z_buf_address = z_buf_address;
|
rdp.z_buf_address = z_buf_address;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_dp_set_color_image(uint32_t format, uint32_t size, uint32_t width, void* address) {
|
static void gfx_dp_set_color_image(UNUSED uint32_t format, UNUSED uint32_t size, UNUSED uint32_t width, void* address) {
|
||||||
rdp.color_image_address = address;
|
rdp.color_image_address = address;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1526,7 +1528,6 @@ static inline void *seg_addr(uintptr_t w1) {
|
||||||
#define C1(pos, width) ((cmd->words.w1 >> (pos)) & ((1U << width) - 1))
|
#define C1(pos, width) ((cmd->words.w1 >> (pos)) & ((1U << width) - 1))
|
||||||
|
|
||||||
static void gfx_run_dl(Gfx* cmd) {
|
static void gfx_run_dl(Gfx* cmd) {
|
||||||
int dummy = 0;
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
uint32_t opcode = cmd->words.w0 >> 24;
|
uint32_t opcode = cmd->words.w0 >> 24;
|
||||||
|
|
||||||
|
@ -1821,11 +1822,11 @@ void gfx_run(Gfx *commands) {
|
||||||
}
|
}
|
||||||
dropped_frame = false;
|
dropped_frame = false;
|
||||||
|
|
||||||
double t0 = gfx_wapi->get_time();
|
//double t0 = gfx_wapi->get_time();
|
||||||
gfx_rapi->start_frame();
|
gfx_rapi->start_frame();
|
||||||
gfx_run_dl(commands);
|
gfx_run_dl(commands);
|
||||||
gfx_flush();
|
gfx_flush();
|
||||||
double t1 = gfx_wapi->get_time();
|
//double t1 = gfx_wapi->get_time();
|
||||||
//printf("Process %f %f\n", t1, t1 - t0);
|
//printf("Process %f %f\n", t1, t1 - t0);
|
||||||
gfx_rapi->end_frame();
|
gfx_rapi->end_frame();
|
||||||
gfx_wapi->swap_buffers_begin();
|
gfx_wapi->swap_buffers_begin();
|
||||||
|
|
|
@ -22,7 +22,7 @@ struct DiscordApplication app = { 0 };
|
||||||
bool gDiscordInitialized = false;
|
bool gDiscordInitialized = false;
|
||||||
bool gDiscordFailed = false;
|
bool gDiscordFailed = false;
|
||||||
|
|
||||||
static void discord_sdk_log_callback(void* hook_data, enum EDiscordLogLevel level, const char* message) {
|
static void discord_sdk_log_callback(UNUSED void* hook_data, enum EDiscordLogLevel level, const char* message) {
|
||||||
LOGFILE_INFO(LFT_DISCORD, "callback (%d): %s", level, message);
|
LOGFILE_INFO(LFT_DISCORD, "callback (%d): %s", level, message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ void discord_fatal(int rc) {
|
||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
LOGFILE_ERROR(LFT_DISCORD, "discord fatal %d", rc);
|
LOGFILE_ERROR(LFT_DISCORD, "discord fatal %d", rc);
|
||||||
logfile_close(LFT_DISCORD);
|
logfile_close(LFT_DISCORD);
|
||||||
int msgboxID = MessageBox(NULL,
|
MessageBox(NULL,
|
||||||
errorMessage,
|
errorMessage,
|
||||||
"Fatal Discord Error",
|
"Fatal Discord Error",
|
||||||
MB_ICONERROR | MB_OK | MB_DEFBUTTON1
|
MB_ICONERROR | MB_OK | MB_DEFBUTTON1
|
||||||
|
|
|
@ -20,7 +20,7 @@ int ns_discord_network_send(u8 localIndex, u8* data, u16 dataLength) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void discord_network_on_message(UNUSED void* eventData, int64_t lobbyId, int64_t userId, uint8_t channelId, uint8_t* data, uint32_t dataLength) {
|
void discord_network_on_message(UNUSED void* eventData, UNUSED int64_t lobbyId, int64_t userId, UNUSED uint8_t channelId, uint8_t* data, uint32_t dataLength) {
|
||||||
gNetworkUserIds[0] = userId;
|
gNetworkUserIds[0] = userId;
|
||||||
|
|
||||||
u8 localIndex = UNKNOWN_LOCAL_INDEX;
|
u8 localIndex = UNKNOWN_LOCAL_INDEX;
|
||||||
|
|
|
@ -9,6 +9,6 @@ void network_send_keep_alive(u8 localIndex) {
|
||||||
LOG_INFO("sending keep alive");
|
LOG_INFO("sending keep alive");
|
||||||
}
|
}
|
||||||
|
|
||||||
void network_receive_keep_alive(struct Packet* p) {
|
void network_receive_keep_alive(UNUSED struct Packet* p) {
|
||||||
LOG_INFO("received keep alive");
|
LOG_INFO("received keep alive");
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,9 +74,6 @@ void network_override_object(u8 syncId, struct Object* o) {
|
||||||
}
|
}
|
||||||
|
|
||||||
struct SyncObject* network_init_object(struct Object *o, float maxSyncDistance) {
|
struct SyncObject* network_init_object(struct Object *o, float maxSyncDistance) {
|
||||||
// HACK: an odd way to detect if this entity was spawned from a staticLevel respawner
|
|
||||||
bool wasStaticRespawner = (o->oSyncID != 0 && gSyncObjects[o->oSyncID].o == o && o->oSyncID < RESERVED_IDS_SYNC_OBJECT_OFFSET);
|
|
||||||
|
|
||||||
// generate new sync ID
|
// generate new sync ID
|
||||||
network_set_sync_id(o);
|
network_set_sync_id(o);
|
||||||
|
|
||||||
|
|
|
@ -101,11 +101,11 @@ static bool ns_socket_initialize(enum NetworkType networkType) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static s64 ns_socket_get_id(u8 localId) {
|
static s64 ns_socket_get_id(UNUSED u8 localId) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ns_socket_save_id(u8 localId, s64 networkId) {
|
static void ns_socket_save_id(u8 localId, UNUSED s64 networkId) {
|
||||||
assert(localId > 0);
|
assert(localId > 0);
|
||||||
assert(localId < MAX_PLAYERS);
|
assert(localId < MAX_PLAYERS);
|
||||||
addr[localId] = addr[0];
|
addr[localId] = addr[0];
|
||||||
|
|
|
@ -67,10 +67,10 @@ extern void thread5_game_loop(void *arg);
|
||||||
extern void create_next_audio_buffer(s16 *samples, u32 num_samples);
|
extern void create_next_audio_buffer(s16 *samples, u32 num_samples);
|
||||||
void game_loop_one_iteration(void);
|
void game_loop_one_iteration(void);
|
||||||
|
|
||||||
void dispatch_audio_sptask(struct SPTask *spTask) {
|
void dispatch_audio_sptask(UNUSED struct SPTask *spTask) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void set_vblank_handler(s32 index, struct VblankHandler *handler, OSMesgQueue *queue, OSMesg *msg) {
|
void set_vblank_handler(UNUSED s32 index, UNUSED struct VblankHandler *handler, UNUSED OSMesgQueue *queue, UNUSED OSMesg *msg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool inited = false;
|
static bool inited = false;
|
||||||
|
|
Loading…
Reference in a new issue