Some more cleanup

This commit is contained in:
Arceveti committed 2021-09-27 13:35:55 -07:00
1 parent 6155b6416a
commit ea0fd25a73
60 files changed
+731 -1011

No files matched your search

-1
View File
@@ -182,7 +182,6 @@ index 7d9b5b4a..c7bb81b9 100755
BUILD_DIR/asm/decompress.o(.text);
+ BUILD_DIR/asm/crash.o(.text);
BUILD_DIR/src/game/camera.o(.text);
BUILD_DIR/src/game/debug_course.o(.text);
BUILD_DIR/src/game/object_list_processor.o(.text);
diff --git a/src/game/crash.c b/src/game/crash.c
new file mode 100644
+1 -1
View File
@@ -258,7 +258,7 @@ index 00000000..f432927c
+ dl_ia_text_end); // Reset back to default render settings.
+ gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
+ } else {
+ gDelayForErrorMessage += 1;
+ gDelayForErrorMessage++;
+ }
+ }
+
+2 -2
View File
@@ -394,14 +394,14 @@ index 6cbfd8e1..01dd4de8 100644
+
+ if (gPlayer1Controller->buttonPressed & R_JPAD) {
+ if (gCameraSpeed < 4) {
+ gCameraSpeed += 1;
+ gCameraSpeed++;
+ } else {
+ gCameraSpeed = 0;
+ }
+ save_file_set_camera_speed(gCameraSpeed);
+ } else if (gPlayer1Controller->buttonPressed & L_JPAD) {
+ if (gCameraSpeed > 0) {
+ gCameraSpeed -= 1;
+ gCameraSpeed--;
+ } else {
+ gCameraSpeed = 4;
+ }
+1 -1
View File
@@ -511,7 +511,7 @@ s32 adsr_update(struct AdsrState *adsr) {
}
case ADSR_STATE_SUSTAIN:
adsr->delay -= 1;
adsr->delay--;
if (adsr->delay == 0) {
adsr->state = ADSR_STATE_RELEASE;
}
-4
View File
@@ -1281,9 +1281,6 @@ static u8 get_sound_reverb(UNUSED u8 bank, UNUSED u8 soundIndex, u8 channelIndex
return reverb;
}
static void noop_8031EEC8(void) {
}
/**
* Called from the game loop thread to inform the audio thread that a new game
* frame has started.
@@ -1295,7 +1292,6 @@ void audio_signal_game_loop_tick(void) {
#if defined(VERSION_EU) || defined(VERSION_SH)
maybe_tick_game_sound();
#endif
noop_8031EEC8();
}
/**
+2 -2
View File
@@ -1488,7 +1488,7 @@ void func_sh_802f5310(s32 bankId, struct AudioBank *mem, struct PatchStruct *pat
if (D_SH_8034F68C != 0 && sp4C == 0) {
temp_s0 = D_SH_8034EC88[D_SH_8034F68C - 1].sample;
temp = (temp_s0->size >> 12);
temp += 1;
temp++;
count = (uintptr_t) temp_s0->sampleAddr;
func_sh_802f4cb4(
count,
@@ -1540,7 +1540,7 @@ next:
sampleAddr = sample->sampleAddr;
size = sample->size;
unk = size >> 0xC;
unk += 1;
unk++;
added = ((sampleAddr + size) + sample->medium);
if (added != D_SH_8034EC88[D_SH_8034F68C - 1].endAndMediumIdentification) {
D_SH_8034EC88[D_SH_8034F68C - 1].isFree = TRUE;
+5 -5
View File
@@ -173,7 +173,7 @@ static s32 lower_cell_index(s32 coord) {
//! Some wall checks are larger than the buffer, meaning wall checks can
// miss walls that are near a cell border.
if (coord % CELL_SIZE < 50) {
index -= 1;
index--;
}
if (index < 0) {
@@ -205,7 +205,7 @@ static s32 upper_cell_index(s32 coord) {
//! Some wall checks are larger than the buffer, meaning wall checks can
// miss walls that are near a cell border.
if (coord % CELL_SIZE > CELL_SIZE - 50) {
index += 1;
index++;
}
if (index > NUM_CELLS_INDEX) {
@@ -372,12 +372,12 @@ static void load_static_surfaces(TerrainData **data, TerrainData *vertexData, s3
s32 flags = surf_has_no_cam_collision(surfaceType);
numSurfaces = *(*data);
*data += 1;
(*data)++;
for (i = 0; i < numSurfaces; i++) {
if (*surfaceRooms != NULL) {
room = *(*surfaceRooms);
*surfaceRooms += 1;
(*surfaceRooms)++;
}
surface = read_surface_data(vertexData, data);
@@ -404,7 +404,7 @@ static void load_static_surfaces(TerrainData **data, TerrainData *vertexData, s3
#else
*data += 3;
if (hasForce) {
*data += 1;
(*data)++;
}
#endif
}
+1 -1
View File
@@ -76,7 +76,7 @@ void bhv_activated_back_and_forth_platform_update(void) {
// and one more frame of "lag" after it finally reaches 0 here,
// Mario actually has to wait 22 frames before the platform starts moving.
if (o->oActivatedBackAndForthPlatformCountdown != 0) {
o->oActivatedBackAndForthPlatformCountdown -= 1;
o->oActivatedBackAndForthPlatformCountdown--;
} else {
// After the wait period is over, we start moving, by adding the velocity
// to the positional offset.
@@ -63,7 +63,7 @@ void bhv_animates_on_floor_switch_press_loop(void) {
}
if (o->oFloorSwitchPressAnimationDoubleFrame < 9) {
o->oFloorSwitchPressAnimationDoubleFrame += 1;
o->oFloorSwitchPressAnimationDoubleFrame++;
}
} else if ((o->oFloorSwitchPressAnimationDoubleFrame -= 2) < 0) {
o->oFloorSwitchPressAnimationDoubleFrame = 0;
+1 -1
View File
@@ -36,7 +36,7 @@ void bubba_act_0(void) {
} else if (o->oTimer > 30 && o->oDistanceToMario < 2000.0f) {
o->oAction = 1;
} else if (o->oBubbaRandomTimer != 0) {
o->oBubbaRandomTimer -= 1;
o->oBubbaRandomTimer--;
} else {
o->oBubbaTargetYaw = obj_random_fixed_turn(0x2000);
o->oBubbaRandomTimer = random_linear_offset(100, 100);
+2 -2
View File
@@ -190,7 +190,7 @@ static void chain_chomp_sub_act_turn(void) {
o->oChainChompTargetPitch = obj_get_pitch_from_vel();
}
} else {
o->oTimer -= 1;
o->oTimer--;
}
} else {
o->oForwardVel = 0.0f;
@@ -276,7 +276,7 @@ static void chain_chomp_released_lunge_around(void) {
if (o->oChainChompNumLunges == 0) {
if (cur_obj_rotate_yaw_toward(o->oAngleToMario, 0x320)) {
if (o->oTimer > 60) {
o->oChainChompNumLunges += 1;
o->oChainChompNumLunges++;
// enable wall collision
o->oWallHitboxRadius = 200.0f;
}
+1 -1
View File
@@ -24,7 +24,7 @@ void clam_act_0(void) {
cur_obj_play_sound_2(SOUND_GENERAL_CLAM_SHELL2);
o->oAction = 1;
} else if (o->oClamShakeTimer != 0) {
o->oClamShakeTimer -= 1;
o->oClamShakeTimer--;
cur_obj_shake_y(3.0f);
}
}
+1 -1
View File
@@ -49,7 +49,7 @@ void bhv_coffin_spawner_loop(void) {
}
}
o->oAction += 1;
o->oAction++;
}
} else if (o->activeFlags & ACTIVE_FLAG_IN_DIFFERENT_ROOM) {
o->oAction = COFFIN_SPAWNER_ACT_COFFINS_UNLOADED;
+1 -1
View File
@@ -9,7 +9,7 @@ void bhv_end_birds_1_loop(void) {
gCurrentObject->oIntroLakituEndBirds1DestX = -554.f;
gCurrentObject->oIntroLakituEndBirds1DestY = 3044.f;
gCurrentObject->oIntroLakituEndBirds1DestZ = -1314.f;
gCurrentObject->oAction += 1;
gCurrentObject->oAction = 1;
break;
case 1:
vec3f_set(pos, gCurrentObject->oIntroLakituEndBirds1DestX, gCurrentObject->oIntroLakituEndBirds1DestY,
+1 -1
View File
@@ -10,7 +10,7 @@ void bhv_end_birds_2_loop(void) {
switch (gCurrentObject->oAction) {
case 0:
cur_obj_scale(0.7f);
gCurrentObject->oAction += 1;
gCurrentObject->oAction = 1;
break;
case 1:
vec3f_get_dist_and_angle(gCamera->pos, gCamera->focus, &dist, &pitch, &yaw);
+4 -4
View File
@@ -77,7 +77,7 @@ static void enemy_lakitu_update_speed_and_angle(void) {
// Turn toward mario except right after throwing a spiny
if (o->oEnemyLakituFaceForwardCountdown != 0) {
o->oEnemyLakituFaceForwardCountdown -= 1;
o->oEnemyLakituFaceForwardCountdown--;
} else {
obj_face_yaw_approach(o->oAngleToMario, 0x600);
}
@@ -96,7 +96,7 @@ static void enemy_lakitu_sub_act_no_spiny(void) {
cur_obj_init_animation_with_sound(1);
if (o->oEnemyLakituSpinyCooldown != 0) {
o->oEnemyLakituSpinyCooldown -= 1;
o->oEnemyLakituSpinyCooldown--;
} else if (o->oEnemyLakituNumSpinies < 3 && o->oDistanceToMario < 800.0f
&& abs_angle_diff(o->oAngleToMario, o->oFaceAngleYaw) < 0x4000) {
struct Object *spiny = spawn_object(o, MODEL_SPINY_BALL, bhvSpiny);
@@ -105,7 +105,7 @@ static void enemy_lakitu_sub_act_no_spiny(void) {
spiny->oAction = SPINY_ACT_HELD_BY_LAKITU;
obj_init_animation_with_sound(spiny, spiny_egg_seg5_anims_050157E4, 0);
o->oEnemyLakituNumSpinies += 1;
o->oEnemyLakituNumSpinies++;
o->oSubAction = ENEMY_LAKITU_SUB_ACT_HOLD_SPINY;
o->oEnemyLakituSpinyCooldown = 30;
}
@@ -120,7 +120,7 @@ static void enemy_lakitu_sub_act_hold_spiny(void) {
cur_obj_init_anim_extend(3);
if (o->oEnemyLakituSpinyCooldown != 0) {
o->oEnemyLakituSpinyCooldown -= 1;
o->oEnemyLakituSpinyCooldown--;
}
// TODO: Check if anything interesting happens if we bypass this with speed
else if (o->oDistanceToMario > o->oDrawingDistance - 100.0f
+9 -9
View File
@@ -44,7 +44,7 @@ static void eyerok_boss_act_wake_up(void) {
if (o->oTimer > 5) {
if (o->oSubAction == 0) {
seq_player_lower_volume(SEQ_PLAYER_LEVEL, 60, 40);
o->oSubAction += 1;
o->oSubAction++;
}
if (o->oEyerokBossOffsetFromHome == 0.0f && mario_ready_to_speak() != 0) {
@@ -79,18 +79,18 @@ static void eyerok_boss_act_fight(void) {
o->oEyerokBossAttackCountdown = 1;
}
} else {
o->oEyerokBossAttackCountdown -= 1;
o->oEyerokBossAttackCountdown--;
}
if (o->oEyerokBossAttackCountdown != 0 && o->oEyerokBossAttackCountdown != 1) {
o->oEyerokBossAttackPhase += 1;
o->oEyerokBossAttackPhase++;
if ((o->oEyerokBossActiveHand = o->oEyerokBossAttackPhase & 0x1) == 0) {
o->oEyerokBossActiveHand = -1;
}
}
}
} else {
o->oEyerokBossAttackPhase += 1;
o->oEyerokBossAttackPhase++;
if (eyerok_check_mario_relative_z(400)) {
o->oEyerokBossAttackCountdown = -8;
@@ -120,7 +120,7 @@ static void eyerok_boss_act_die(void) {
if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP, DIALOG_FLAG_NONE, CUTSCENE_DIALOG, DIALOG_118)) {
spawn_default_star(0.0f, -900.0f, -3700.0f);
} else {
o->oTimer -= 1;
o->oTimer--;
}
} else if (o->oTimer > 120) {
stop_background_music(SEQUENCE_ARGS(4, SEQ_EVENT_BOSS));
@@ -156,7 +156,7 @@ static s32 eyerok_hand_check_attacked(void) {
o->oAction = EYEROK_HAND_ACT_ATTACKED;
o->oVelY = 30.0f;
} else {
o->parentObj->oEyerokBossNumHands -= 1;
o->parentObj->oEyerokBossNumHands--;
o->oAction = EYEROK_HAND_ACT_DIE;
o->oVelY = 50.0f;
}
@@ -183,7 +183,7 @@ static void eyerok_hand_act_sleep(void) {
if (o->parentObj->oAction != EYEROK_BOSS_ACT_SLEEP
&& ++o->oEyerokHandWakeUpTimer > -3 * o->oBehParams2ndByte) {
if (cur_obj_check_if_near_animation_end()) {
o->parentObj->oEyerokBossNumHands += 1;
o->parentObj->oEyerokBossNumHands++;
o->oAction = EYEROK_HAND_ACT_IDLE;
o->collisionData = segmented_to_virtual(&ssl_seg7_collision_07028274);
} else {
@@ -268,14 +268,14 @@ static void eyerok_hand_act_show_eye(void) {
if (!eyerok_hand_check_attacked()) {
if (o->parentObj->oEyerokBossActiveHand == 0) {
if (o->oAnimState < 3) {
o->oAnimState += 1;
o->oAnimState++;
} else if (cur_obj_check_if_near_animation_end()) {
o->oAction = EYEROK_HAND_ACT_CLOSE;
}
} else {
if (o->oEyerokHandEyeShownTimer--) {
if (o->oEyerokHandAnimStateIndex != 0) {
o->oEyerokHandAnimStateIndex -= 1;
o->oEyerokHandAnimStateIndex--;
}
o->oAnimState = sEyerokAnimStatesList[o->oEyerokHandAnimStateIndex];
} else {
+3 -3
View File
@@ -56,7 +56,7 @@ static void fire_piranha_plant_act_hide(void) {
0.04f * o->oFirePiranhaPlantNeutralScale)) {
cur_obj_become_intangible();
if (o->oFirePiranhaPlantActive) {
sNumActiveFirePiranhaPlants -= 1;
sNumActiveFirePiranhaPlants--;
o->oFirePiranhaPlantActive = FALSE;
if ((u16)(o->oBehParams >> 16) != 0 && o->oHealth == 0) {
@@ -72,7 +72,7 @@ static void fire_piranha_plant_act_hide(void) {
cur_obj_play_sound_2(SOUND_OBJ_PIRANHA_PLANT_APPEAR);
o->oFirePiranhaPlantActive = TRUE;
sNumActiveFirePiranhaPlants += 1;
sNumActiveFirePiranhaPlants++;
cur_obj_unhide();
o->oAction = FIRE_PIRANHA_PLANT_ACT_GROW;
@@ -127,7 +127,7 @@ void bhv_fire_piranha_plant_update(void) {
if (obj_check_attacks(&sFirePiranhaPlantHitbox, o->oAction)) {
if (--o->oHealth < 0) {
if (o->oFirePiranhaPlantActive) {
sNumActiveFirePiranhaPlants -= 1;
sNumActiveFirePiranhaPlants--;
}
} else {
cur_obj_init_animation_with_sound(2);
+2 -2
View File
@@ -45,7 +45,7 @@ static void fly_guy_act_idle(void) {
o->oAction = FLY_GUY_ACT_APPROACH_MARIO;
} else {
o->oFlyGuyUnusedJitter = o->oMoveAngleYaw + sFlyGuyJitterAmounts[o->oFlyGuyIdleTimer];
o->oFlyGuyIdleTimer += 1;
o->oFlyGuyIdleTimer++;
}
}
}
@@ -190,7 +190,7 @@ void bhv_fly_guy_update(void) {
}
// Oscillate up and down
o->oFlyGuyOscTimer += 1;
o->oFlyGuyOscTimer++;
o->oPosY += coss(0x400 * o->oFlyGuyOscTimer) * 1.5f;
switch (o->oAction) {
@@ -270,7 +270,7 @@ void bhv_book_switch_loop(void) {
if (o->oAction != 0) {
if (o->parentObj->oBookSwitchManagerNumCorrectChoices == o->oBehParams2ndByte) {
play_sound(SOUND_GENERAL2_RIGHT_ANSWER, gGlobalSoundSource);
o->parentObj->oBookSwitchManagerNumCorrectChoices += 1;
o->parentObj->oBookSwitchManagerNumCorrectChoices++;
} else {
rand01 = random_u16() & 0x1;
z = gMarioObject->oPosZ + 1.5f * gMarioStates[0].vel[2];
+2 -2
View File
@@ -95,7 +95,7 @@ void bhv_goomba_triplet_spawner_update(void) {
}
}
o->oAction += 1;
o->oAction++;
}
} else if (o->oDistanceToMario > 4000.0f) {
// If mario is too far away, enter the unloaded action. The goombas
@@ -194,7 +194,7 @@ static void goomba_act_walk(void) {
o->oGoombaRelativeSpeed = 4.0f / 3.0f;
if (o->oGoombaWalkTimer != 0) {
o->oGoombaWalkTimer -= 1;
o->oGoombaWalkTimer--;
} else {
if (random_u16() & 3) {
o->oGoombaTargetYaw = obj_random_fixed_turn(0x2000);
+1 -1
View File
@@ -59,7 +59,7 @@ void haunted_chair_act_0(void) {
}
} else if (o->oHauntedChairSpinTimer != 0) {
if (o->oDistanceToMario < 500.0f) {
o->oHauntedChairSpinTimer -= 1;
o->oHauntedChairSpinTimer--;
}
o->oTimer = 0.0f;
} else {
+9 -8
View File
@@ -45,7 +45,7 @@ s32 intro_lakitu_set_pos_and_focus(struct Object *o, struct CutsceneSplinePoint
if ((move_point_along_spline(newFocus, offset, &splineSegment, &(o->oIntroLakituSplineSegmentProgress)) == 1)
|| (move_point_along_spline(newOffset, focus, &splineSegment, &(o->oIntroLakituSplineSegmentProgress)) == 1))
splineFinished += 1;
splineFinished++;
o->oIntroLakituSplineSegment = splineSegment;
intro_lakitu_set_offset_from_camera(o, newOffset);
@@ -64,10 +64,11 @@ void bhv_intro_lakitu_loop(void) {
gCurrentObject->oIntroLakituSplineSegmentProgress = 0.f;
gCurrentObject->oIntroLakituCloud =
spawn_object_relative_with_scale(1, 0, 0, 0, 2.f, gCurrentObject, MODEL_MIST, bhvCloud);
if (gCamera->cutscene == CUTSCENE_END_WAVING)
if (gCamera->cutscene == CUTSCENE_END_WAVING) {
gCurrentObject->oAction = 100;
else
gCurrentObject->oAction += 1;
} else {
gCurrentObject->oAction = 1;
}
break;
case 1:
@@ -82,7 +83,7 @@ void bhv_intro_lakitu_loop(void) {
if (intro_lakitu_set_pos_and_focus(gCurrentObject, gIntroLakituStartToPipeOffsetFromCamera,
gIntroLakituStartToPipeFocus) == 1)
gCurrentObject->oAction += 1;
gCurrentObject->oAction = 2;
switch (gCurrentObject->oTimer) {
#if defined(VERSION_US) || defined(VERSION_SH)
@@ -111,7 +112,7 @@ void bhv_intro_lakitu_loop(void) {
#else
if (gCutsceneTimer > 720) {
#endif
gCurrentObject->oAction += 1;
gCurrentObject->oAction = 3;
gCurrentObject->oIntroLakituDistToBirdsX = 1400.f;
gCurrentObject->oIntroLakituDistToBirdsZ = -4096.f;
gCurrentObject->oIntroLakituEndBirds1DestZ = 2048.f;
@@ -173,7 +174,7 @@ void bhv_intro_lakitu_loop(void) {
gCurrentObject->oMoveAngleYaw = 0x9000;
gCurrentObject->oFaceAnglePitch = gCurrentObject->oMoveAnglePitch / 2;
gCurrentObject->oFaceAngleYaw = gCurrentObject->oMoveAngleYaw;
gCurrentObject->oAction += 1;
gCurrentObject->oAction++;
break;
case 101:
@@ -186,7 +187,7 @@ void bhv_intro_lakitu_loop(void) {
gCurrentObject->oFaceAngleYaw = camera_approach_s16_symmetric(gCurrentObject->oFaceAngleYaw, yawToCam, 0x200);
}
if (gCurrentObject->oTimer > 105) {
gCurrentObject->oAction += 1;
gCurrentObject->oAction++;
gCurrentObject->oMoveAnglePitch = 0xE00;
}
gCurrentObject->oFaceAnglePitch = 0;
+3 -3
View File
@@ -21,7 +21,7 @@ void intro_peach_set_pos_and_opacity(struct Object *o, f32 targetOpacity, f32 in
void bhv_intro_peach_loop(void) {
switch (gCurrentObject->oAction) {
case 0:
gCurrentObject->oAction += 1;
gCurrentObject->oAction = 1;
gCurrentObject->oFaceAnglePitch = 0x400;
gCurrentObject->oFaceAngleYaw = 0x7500;
gCurrentObject->oFaceAngleRoll = -0x3700;
@@ -35,13 +35,13 @@ void bhv_intro_peach_loop(void) {
intro_peach_set_pos_and_opacity(gCurrentObject, 0.f, 0.f);
if (gCurrentObject->oTimer > 20)
gCurrentObject->oAction += 1;
gCurrentObject->oAction = 2;
break;
case 2:
intro_peach_set_pos_and_opacity(gCurrentObject, 255.f, 3.f);
if ((gCurrentObject->oTimer > 100) && (get_dialog_id() == DIALOG_NONE))
gCurrentObject->oAction += 1;
gCurrentObject->oAction = 3;
break;
case 3:
intro_peach_set_pos_and_opacity(gCurrentObject, 0.f, 8.f);
+2 -2
View File
@@ -63,7 +63,7 @@ static void klepto_anim_dive(void) {
obj_move_pitch_approach(o->oKleptoPitchToTarget, 600);
if (klepto_set_and_check_if_anim_at_end() != 0) {
if (o->oKleptoDiveTimer != 0) {
o->oKleptoDiveTimer += 1;
o->oKleptoDiveTimer++;
} else if (o->oKleptoPitchToTarget > -100) {
o->oKleptoDiveTimer = random_linear_offset(60, 60);
}
@@ -234,7 +234,7 @@ static void klepto_act_dive_at_mario(void) {
o->oKleptoYawToTarget = o->oAngleToMario;
if (dy < 160.0f) {
o->oSubAction += 1;
o->oSubAction++;
}
}
+9 -10
View File
@@ -133,7 +133,7 @@ static void koopa_walk_start(void) {
obj_forward_vel_approach(3.0f * o->oKoopaAgility, 0.3f * o->oKoopaAgility);
if (cur_obj_init_anim_and_check_if_end(11)) {
o->oSubAction += 1;
o->oSubAction++;
o->oKoopaCountdown = random_linear_offset(30, 100);
}
}
@@ -146,9 +146,9 @@ static void koopa_walk(void) {
koopa_play_footstep_sound(2, 17);
if (o->oKoopaCountdown != 0) {
o->oKoopaCountdown -= 1;
o->oKoopaCountdown--;
} else if (cur_obj_check_if_near_animation_end()) {
o->oSubAction += 1;
o->oSubAction++;
}
}
@@ -244,7 +244,7 @@ static void koopa_shelled_act_lying(void) {
cur_obj_init_anim_extend(5);
koopa_dive_update_speed(0.3f);
} else if (o->oKoopaCountdown != 0) {
o->oKoopaCountdown -= 1;
o->oKoopaCountdown--;
cur_obj_extend_animation_if_at_end();
} else if (cur_obj_init_anim_and_check_if_end(6)) {
o->oAction = KOOPA_SHELLED_ACT_STOPPED;
@@ -350,7 +350,7 @@ static void koopa_unshelled_act_run(void) {
obj_bounce_off_walls_edges_objects(&o->oKoopaTargetYaw))) {
// Otherwise run around randomly
if (o->oKoopaUnshelledTimeUntilTurn != 0) {
o->oKoopaUnshelledTimeUntilTurn -= 1;
o->oKoopaUnshelledTimeUntilTurn--;
} else {
o->oKoopaTargetYaw = obj_random_fixed_turn(0x2000);
}
@@ -424,7 +424,7 @@ static void koopa_unshelled_act_dive(void) {
}
koopa_dive_update_speed(0.5f);
} else if (o->oKoopaCountdown != 0) {
o->oKoopaCountdown -= 1;
o->oKoopaCountdown--;
cur_obj_extend_animation_if_at_end();
} else if (cur_obj_init_anim_and_check_if_end(6)) {
o->oAction = KOOPA_UNSHELLED_ACT_RUN;
@@ -498,7 +498,7 @@ static void koopa_the_quick_act_wait_before_race(void) {
koopa_shelled_act_stopped();
if (o->oKoopaTheQuickInitTextboxCooldown != 0) {
o->oKoopaTheQuickInitTextboxCooldown -= 1;
o->oKoopaTheQuickInitTextboxCooldown--;
} else if (cur_obj_can_mario_activate_textbox_2(400.0f, 400.0f)) {
//! The next action doesn't execute until next frame, giving mario one
// frame where he can jump, and thus no longer be ready to speak.
@@ -657,11 +657,10 @@ static void koopa_the_quick_act_race(void) {
break;
case KOOPA_THE_QUICK_SUB_ACT_JUMP:
// We could perform a goomba double jump if we could deactivate
// ktq
// We could perform a goomba double jump if we could deactivate ktq
if (o->oMoveFlags & OBJ_MOVE_MASK_ON_GROUND) {
if (cur_obj_init_anim_and_check_if_end(13)) {
o->oSubAction -= 1;
o->oSubAction--;
}
koopa_the_quick_detect_bowling_ball();
+1 -1
View File
@@ -104,7 +104,7 @@ void bhv_monty_mole_hole_update(void) {
sMontyMoleHoleList = link_objects_with_behavior(bhvMontyMoleHole);
sMontyMoleKillStreak = 0;
} else if (o->oMontyMoleHoleCooldown > 0) {
o->oMontyMoleHoleCooldown -= 1;
o->oMontyMoleHoleCooldown--;
}
}
+1 -1
View File
@@ -116,7 +116,7 @@ static void mr_blizzard_act_rise_from_ground(void) {
// If the timer is not 0, decrement by 1 until it reaches 0.
if (o->oMrBlizzardTimer != 0) {
o->oMrBlizzardTimer -= 1;
o->oMrBlizzardTimer--;
} else if ((o->oMrBlizzardGraphYOffset += o->oMrBlizzardGraphYVel) > 24.0f) {
// Increments GraphYOffset by GraphYVel until it is greater than 24,
// moving Mr. Blizzard's graphical position upward each frame.
+1 -1
View File
@@ -156,7 +156,7 @@ void mr_i_act_2(void) {
o->oMrISpinAngle = 120;
if (o->oMrISpinAmount > 1 << 16)
o->oAction = 3;
o->oMrISpinAngle -= 1;
o->oMrISpinAngle--;
if (!o->oMrISpinAngle) {
o->oMrISpinAngle = 120;
o->oMrISpinAmount = 0;
+9 -13
View File
@@ -58,15 +58,12 @@ void bhv_pokey_body_part_update(void) {
// index by killing two body parts on the frame before a new part
// spawns, but one of the body parts shifts upward immediately,
// so not very interesting
if (o->oBehParams2ndByte > 1
&& !(o->parentObj->oPokeyAliveBodyPartFlags & (1 << (o->oBehParams2ndByte - 1)))) {
o->parentObj->oPokeyAliveBodyPartFlags =
o->parentObj->oPokeyAliveBodyPartFlags | 1 << (o->oBehParams2ndByte - 1);
if (o->oBehParams2ndByte > 1 && !(o->parentObj->oPokeyAliveBodyPartFlags & (1 << (o->oBehParams2ndByte - 1)))) {
o->parentObj->oPokeyAliveBodyPartFlags |= (1 << (o->oBehParams2ndByte - 1));
o->parentObj->oPokeyAliveBodyPartFlags =
o->parentObj->oPokeyAliveBodyPartFlags & ((1 << o->oBehParams2ndByte) ^ ~0);
o->parentObj->oPokeyAliveBodyPartFlags &= ((1 << o->oBehParams2ndByte) ^ ~0);
o->oBehParams2ndByte -= 1;
o->oBehParams2ndByte--;
}
// Set the bottom body part size, and gradually increase it.
@@ -109,7 +106,7 @@ void bhv_pokey_body_part_update(void) {
// then die after a delay.
if (obj_handle_attacks(&sPokeyBodyPartHitbox, o->oAction, sPokeyBodyPartAttackHandlers)) {
o->parentObj->oPokeyNumAliveBodyParts -= 1;
o->parentObj->oPokeyNumAliveBodyParts--;
if (o->oBehParams2ndByte == 0) {
o->parentObj->oPokeyHeadWasKilled = TRUE;
// Last minute change to blue coins - not sure why they didn't
@@ -123,7 +120,7 @@ void bhv_pokey_body_part_update(void) {
cur_obj_become_intangible();
if (--o->oPokeyBodyPartDeathDelayAfterHeadKilled < 0) {
o->parentObj->oPokeyNumAliveBodyParts -= 1;
o->parentObj->oPokeyNumAliveBodyParts--;
obj_die_if_health_non_positive();
}
} else {
@@ -208,9 +205,8 @@ static void pokey_act_wander(void) {
MODEL_POKEY_BODY_PART, bhvPokeyBodyPart);
if (bodyPart != NULL) {
o->oPokeyAliveBodyPartFlags =
o->oPokeyAliveBodyPartFlags | (1 << o->oPokeyNumAliveBodyParts);
o->oPokeyNumAliveBodyParts += 1;
o->oPokeyAliveBodyPartFlags |= (1 << o->oPokeyNumAliveBodyParts);
o->oPokeyNumAliveBodyParts++;
o->oPokeyBottomBodyPartSize = 0.0f;
obj_scale(bodyPart, 0.0f);
@@ -234,7 +230,7 @@ static void pokey_act_wander(void) {
if (!(o->oPokeyTurningAwayFromWall =
obj_bounce_off_walls_edges_objects(&o->oPokeyTargetYaw))) {
if (o->oPokeyChangeTargetTimer != 0) {
o->oPokeyChangeTargetTimer -= 1;
o->oPokeyChangeTargetTimer--;
} else if (o->oDistanceToMario > 2000.0f) {
o->oPokeyTargetYaw = obj_random_fixed_turn(0x2000);
o->oPokeyChangeTargetTimer = random_linear_offset(30, 50);
+1 -1
View File
@@ -16,7 +16,7 @@ void bhv_recovery_heart_loop(void) {
if (obj_check_if_collided_with_object(o, gMarioObject)) {
if (o->oSpinningHeartPlayedSound == 0) {
cur_obj_play_sound_2(SOUND_GENERAL_HEART_SPIN);
o->oSpinningHeartPlayedSound += 1;
o->oSpinningHeartPlayedSound++;
}
o->oAngleVelYaw = (s32)(200.0f * gMarioStates[0].forwardVel) + 1000;
+1 -1
View File
@@ -16,7 +16,7 @@ void bhv_bowser_shock_wave_loop(void) {
cur_obj_scale(o->oBowserShockWaveScale);
// Slightly reduce opacity each 3 frames
if (gGlobalTimer % 3)
o->oOpacity -= 1;
o->oOpacity--;
// Reduce opacity faster after 70 frames have passed
if (o->oTimer > fadeFrames)
o->oOpacity -= 5;
+2 -2
View File
@@ -48,7 +48,7 @@ static void skeeter_act_idle(void) {
&& obj_smooth_turn(&o->oSkeeterAngleVel, &o->oMoveAngleYaw, o->oSkeeterTargetAngle, 0.02f,
5, 50, 200)) {
if (o->oSkeeterWaitTime != 0) {
o->oSkeeterWaitTime -= 1;
o->oSkeeterWaitTime--;
} else if (cur_obj_check_if_near_animation_end()) {
cur_obj_play_sound_2(SOUND_OBJ_WALKING_WATER);
o->oAction = SKEETER_ACT_LUNGE;
@@ -116,7 +116,7 @@ static void skeeter_act_walk(void) {
} else {
o->oSkeeterTargetForwardVel = 10.0f;
if (o->oSkeeterWaitTime != 0) {
o->oSkeeterWaitTime -= 1;
o->oSkeeterWaitTime--;
} else if (cur_obj_check_if_near_animation_end() != 0) {
if (random_u16() & 0x0003) {
o->oSkeeterTargetAngle = obj_random_fixed_turn(0x2000);
+1 -1
View File
@@ -105,7 +105,7 @@ void snufit_act_shoot(void) {
if ((u16) o->oSnufitBodyScalePeriod == 0x8000 && o->oSnufitBodyBaseScale == 167) {
o->oAction = SNUFIT_ACT_IDLE;
} else if (o->oSnufitBullets < 3 && o->oTimer >= 3) {
o->oSnufitBullets += 1;
o->oSnufitBullets++;
cur_obj_play_sound_2(SOUND_OBJ_SNUFIT_SHOOT);
spawn_object_relative(0, 0, -20, 40, o, MODEL_BOWLING_BALL, bhvSnufitBalls);
o->oSnufitRecoil = -30;
+3 -3
View File
@@ -46,7 +46,7 @@ static s32 spiny_check_active(void) {
// behave similar to a regular goomba.
// It can also be used on a bob-omb respawner to change its model
// to a butterfly or fish.
o->parentObj->oEnemyLakituNumSpinies -= 1;
o->parentObj->oEnemyLakituNumSpinies--;
obj_mark_for_deletion(o);
return FALSE;
}
@@ -85,7 +85,7 @@ static void spiny_act_walk(void) {
obj_bounce_off_walls_edges_objects(&o->oSpinyTargetYaw))) {
// Walk and occasionally randomly change direction
if (o->oSpinyTimeUntilTurn != 0) {
o->oSpinyTimeUntilTurn -= 1;
o->oSpinyTimeUntilTurn--;
} else {
o->oSpinyTargetYaw = o->oMoveAngleYaw + (s16) random_sign() * 0x2000;
o->oSpinyTimeUntilTurn = random_linear_offset(100, 100);
@@ -171,7 +171,7 @@ static void spiny_act_thrown_by_lakitu(void) {
if (obj_check_attacks(&sSpinyHitbox, o->oAction)) {
if (o->parentObj != o) {
o->parentObj->oEnemyLakituNumSpinies -= 1;
o->parentObj->oEnemyLakituNumSpinies--;
}
}
}
+1 -1
View File
@@ -61,7 +61,7 @@ static void swoop_act_move(void) {
o->oFaceAngleRoll = 0;
} else {
if (o->oSwoopBonkCountdown != 0) {
o->oSwoopBonkCountdown -= 1;
o->oSwoopBonkCountdown--;
} else if (o->oVelY != 0.0f) {
// If we're not done swooping, turn toward mario. When between
// 0 and 200 units above mario, increase speed and stop swooping
+1 -1
View File
@@ -31,7 +31,7 @@ void bhv_thi_tiny_island_top_loop(void) {
} else {
gTHIWaterDrained |= 1;
play_puzzle_jingle();
o->oAction += 1;
o->oAction++;
}
}
} else {
+1 -1
View File
@@ -51,7 +51,7 @@ void bhv_ttc_2d_rotator_update(void) {
s32 startYaw = o->oFaceAngleYaw;
if (o->oTTC2DRotatorRandomDirTimer != 0) {
o->oTTC2DRotatorRandomDirTimer -= 1;
o->oTTC2DRotatorRandomDirTimer--;
}
// Wait until rotated to target yaw
+2 -2
View File
@@ -43,7 +43,7 @@ static void ttc_moving_bar_act_wait(void) {
// This is zero except on the first cycle, and is used to desync the
// bars from each other at the very beginning
if (o->oTTCMovingBarStoppedTimer != 0) {
o->oTTCMovingBarStoppedTimer -= 1;
o->oTTCMovingBarStoppedTimer--;
} else {
if (gTTCSpeedSetting == TTC_SPEED_RANDOM) {
// Set the delay for the next cycle
@@ -70,7 +70,7 @@ static void ttc_moving_bar_act_pull_back(void) {
if ((o->oTTCMovingBarSpeed += 0.73f) > 0.0f) {
// Possibly pause after pulling back
if (o->oTTCMovingBarStoppedTimer != 0) {
o->oTTCMovingBarStoppedTimer -= 1;
o->oTTCMovingBarStoppedTimer--;
o->oTTCMovingBarSpeed = 0.0f;
} else {
// Begin extending
+1 -1
View File
@@ -42,7 +42,7 @@ void bhv_ttc_pendulum_update(void) {
// Stay still for a while
if (o->oTTCPendulumDelay != 0) {
o->oTTCPendulumDelay -= 1;
o->oTTCPendulumDelay--;
} else {
// Accelerate in the direction that moves angle to zero
if (o->oTTCPendulumAngle * o->oTTCPendulumAccelDir > 0.0f) {
+3 -5
View File
@@ -39,7 +39,7 @@ void bhv_water_bomb_spawner_update(void) {
if (!o->oWaterBombSpawnerBombActive && latDistToMario < spawnerRadius
&& gMarioObject->oPosY - o->oPosY < 1000.0f) {
if (o->oWaterBombSpawnerTimeToSpawn != 0) {
o->oWaterBombSpawnerTimeToSpawn -= 1;
o->oWaterBombSpawnerTimeToSpawn--;
} else {
struct Object *waterBomb =
spawn_object_relative(0, 0, 2000, 0, o, MODEL_WATER_BOMB, bhvWaterBomb);
@@ -50,10 +50,8 @@ void bhv_water_bomb_spawner_update(void) {
waterBomb->oAction = WATER_BOMB_ACT_INIT;
waterBomb->oPosX =
gMarioObject->oPosX + waterBombDistToMario * sins(gMarioObject->oMoveAngleYaw);
waterBomb->oPosZ =
gMarioObject->oPosZ + waterBombDistToMario * coss(gMarioObject->oMoveAngleYaw);
waterBomb->oPosX = gMarioObject->oPosX + waterBombDistToMario * sins(gMarioObject->oMoveAngleYaw);
waterBomb->oPosZ = gMarioObject->oPosZ + waterBombDistToMario * coss(gMarioObject->oMoveAngleYaw);
spawn_object(waterBomb, MODEL_WATER_BOMB_SHADOW, bhvWaterBombShadow);
+2 -2
View File
@@ -52,14 +52,14 @@ void water_bomb_cannon_act_1(void) {
o->oAction = 2;
} else if (o->oBehParams2ndByte == 0) {
if (o->oWaterCannonIdleTimer != 0) {
o->oWaterCannonIdleTimer -= 1;
o->oWaterCannonIdleTimer--;
} else {
obj_move_pitch_approach(o->oWaterCannonTargetMovePitch, 0x80);
obj_face_yaw_approach(o->oWaterCannonTargetFaceYaw, 0x100);
if ((s16) o->oFaceAngleYaw == (s16) o->oWaterCannonTargetFaceYaw) {
if (o->oWaterCannonRotationTimer != 0) {
o->oWaterCannonRotationTimer -= 1;
o->oWaterCannonRotationTimer--;
} else {
cur_obj_play_sound_2(SOUND_OBJ_CANNON4);
o->oWaterCannonIdleTimer = 70;
+2 -2
View File
@@ -234,7 +234,7 @@ static void wiggler_act_walk(void) {
obj_forward_vel_approach(sWigglerSpeeds[o->oHealth - 1], 1.0f);
if (o->oWigglerWalkAwayFromWallTimer != 0) {
o->oWigglerWalkAwayFromWallTimer -= 1;
o->oWigglerWalkAwayFromWallTimer--;
} else {
if (o->oDistanceToMario >= 25000.0f) {
// If >1200 away from home, turn to home
@@ -250,7 +250,7 @@ static void wiggler_act_walk(void) {
if (o->oHealth < 4) {
o->oWigglerTargetYaw = o->oAngleToMario;
} else if (o->oWigglerTimeUntilRandomTurn != 0) {
o->oWigglerTimeUntilRandomTurn -= 1;
o->oWigglerTimeUntilRandomTurn--;
} else {
o->oWigglerTargetYaw = o->oMoveAngleYaw + 0x4000 * (s16) random_sign();
o->oWigglerTimeUntilRandomTurn = random_linear_offset(30, 50);
+10 -16
View File
@@ -3396,7 +3396,7 @@ s32 move_point_along_spline(Vec3f p, struct CutsceneSplinePoint spline[], s16 *s
*splineSegment = 0;
finished = 1;
}
*progress -= 1;
(*progress)--;
}
return finished;
}
@@ -5397,17 +5397,17 @@ u32 surface_type_modes(struct Camera *c) {
switch (sMarioGeometry.currFloorType) {
case SURFACE_CLOSE_CAMERA:
transition_to_camera_mode(c, CAMERA_MODE_CLOSE, 90);
modeChanged += 1;
modeChanged++;
break;
case SURFACE_CAMERA_FREE_ROAM:
transition_to_camera_mode(c, CAMERA_MODE_FREE_ROAM, 90);
modeChanged += 1;
modeChanged++;
break;
case SURFACE_NO_CAM_COL_SLIPPERY:
transition_to_camera_mode(c, CAMERA_MODE_CLOSE, 90);
modeChanged += 1;
modeChanged++;
break;
}
return modeChanged;
@@ -6255,12 +6255,12 @@ void copy_spline_segment(struct CutsceneSplinePoint dst[], struct CutsceneSpline
s32 i = 0;
init_spline_point(&dst[i], src[j].index, src[j].speed, src[j].point);
i += 1;
i++;
do {
do {
init_spline_point(&dst[i], src[j].index, src[j].speed, src[j].point);
i += 1;
j += 1;
i++;
j++;
} while (src[j].index != -1);
} while (j > 16);
@@ -6940,12 +6940,6 @@ void cutscene_dance_rotate_move_towards_mario(struct Camera *c) {
rotate_and_move_vec3f(c->pos, sMarioCamState->pos, 20.f, 0, 0);
}
/**
* Speculated to be dance-related due to its proximity to the other dance functions
*/
UNUSED static void cutscene_dance_unused(UNUSED struct Camera *c) {
}
/**
* Slowly turn to the point 100 units in front of Mario
*/
@@ -8270,7 +8264,7 @@ void cutscene_read_message(struct Camera *c) {
// Do nothing until message is gone.
case 0:
if (get_dialog_id() != DIALOG_NONE) {
sCutsceneVars[0].angle[0] += 1;
sCutsceneVars[0].angle[0]++;
set_time_stop_flags(TIME_STOP_ENABLED | TIME_STOP_DIALOG);
}
break;
@@ -10305,12 +10299,12 @@ void play_cutscene(struct Camera *c) {
if ((cutsceneDuration != 0) && !(gCutsceneTimer & CUTSCENE_STOP)) {
if (gCutsceneTimer < CUTSCENE_LOOP) {
gCutsceneTimer += 1;
gCutsceneTimer++;
}
//! Because gCutsceneTimer is often set to 0x7FFF (CUTSCENE_LOOP), this conditional can only
//! check for == due to overflow
if (gCutsceneTimer == cutsceneDuration) {
sCutsceneShot += 1;
sCutsceneShot++;
gCutsceneTimer = 0;
}
} else {
+9 -9
View File
@@ -96,7 +96,7 @@ void print_text_array_info(s16 *printState, const char *str, s32 number) {
|| (printState[DEBUG_PSTATE_MAX_X_CURSOR] < printState[DEBUG_PSTATE_Y_CURSOR])) {
print_text(printState[DEBUG_PSTATE_X_CURSOR], printState[DEBUG_PSTATE_Y_CURSOR],
"DPRINT OVER");
printState[DEBUG_PSTATE_DISABLED] += 1; // why not just = TRUE...
printState[DEBUG_PSTATE_DISABLED] = TRUE;
} else {
print_text_fmt_int(printState[DEBUG_PSTATE_X_CURSOR], printState[DEBUG_PSTATE_Y_CURSOR],
str, number);
@@ -201,7 +201,7 @@ void print_string_array_info(const char **strArr) {
s32 i;
if (!sDebugStringArrPrinted) {
sDebugStringArrPrinted += 1; // again, why not = TRUE...
sDebugStringArrPrinted = TRUE;
for (i = 0; i < 8; i++) {
// sDebugPage is assumed to be 4 or 5 here.
print_debug_top_down_mapinfo(strArr[i], gDebugInfo[sDebugPage][i]);
@@ -240,7 +240,7 @@ void update_debug_dpadmask(void) {
} else {
sDebugInfoDPadMask = 0;
}
sDebugInfoDPadUpdID += 1;
sDebugInfoDPadUpdID++;
if (sDebugInfoDPadUpdID >= 8) {
sDebugInfoDPadUpdID = 6; // rapidly set to 6 from 8 as long as dPadMask is being set.
}
@@ -249,7 +249,7 @@ void update_debug_dpadmask(void) {
void debug_unknown_level_select_check(void) {
if (!sDebugLvSelectCheckFlag) {
sDebugLvSelectCheckFlag += 1; // again, just do = TRUE...
sDebugLvSelectCheckFlag = TRUE;
if (!gDebugLevelSelect) {
gDebugInfoFlags = DEBUG_INFO_NOFLAGS;
@@ -291,7 +291,7 @@ UNUSED static void check_debug_button_seq(void) {
} else {
if ((s16)(cButtonMask = (gPlayer1Controller->buttonPressed & C_BUTTONS))) {
if (buttonArr[sDebugInfoButtonSeqID] == cButtonMask) {
sDebugInfoButtonSeqID += 1;
sDebugInfoButtonSeqID++;
if (buttonArr[sDebugInfoButtonSeqID] == -1) {
if (gDebugInfoFlags == DEBUG_INFO_FLAG_ALL) {
gDebugInfoFlags = DEBUG_INFO_FLAG_LSELECT;
@@ -314,11 +314,11 @@ UNUSED static void try_change_debug_page(void) {
if (gDebugInfoFlags & DEBUG_INFO_FLAG_DPRINT) {
if ((gPlayer1Controller->buttonPressed & L_JPAD)
&& (gPlayer1Controller->buttonDown & (L_TRIG | R_TRIG))) {
sDebugPage += 1;
sDebugPage++;
}
if ((gPlayer1Controller->buttonPressed & R_JPAD)
&& (gPlayer1Controller->buttonDown & (L_TRIG | R_TRIG))) {
sDebugPage -= 1;
sDebugPage--;
}
if (sDebugPage >= (DEBUG_PAGE_MAX + 1)) {
sDebugPage = DEBUG_PAGE_MIN;
@@ -351,14 +351,14 @@ void try_modify_debug_controls(void) {
}
if (sDebugInfoDPadMask & U_JPAD) {
sDebugSysCursor -= 1;
sDebugSysCursor--;
if (sDebugSysCursor < 0) {
sDebugSysCursor = 0;
}
}
if (sDebugInfoDPadMask & D_JPAD) {
sDebugSysCursor += 1;
sDebugSysCursor++;
if (sDebugSysCursor >= 8) {
sDebugSysCursor = 7;
}
-7
View File
@@ -1,7 +0,0 @@
#include "debug_course.h"
// This is a seperate file according to Europe/Shindou
// versions. It is unknown what this file was for.
void nop_change_course(void) {
}
-6
View File
@@ -1,6 +0,0 @@
#ifndef DEBUG_COURSE_H
#define DEBUG_COURSE_H
void nop_change_course(void);
#endif // DEBUG_COURSE_H
+2 -2
View File
@@ -83,7 +83,7 @@ void envfx_update_flower(Vec3s centerPos) {
(gEnvFxBuffer + i)->isAlive = 1;
(gEnvFxBuffer + i)->animFrame = random_float() * 5.0f;
} else if ((timer & 0x03) == 0) {
(gEnvFxBuffer + i)->animFrame += 1;
(gEnvFxBuffer + i)->animFrame++;
if ((gEnvFxBuffer + i)->animFrame > 5) {
(gEnvFxBuffer + i)->animFrame = 0;
}
@@ -154,7 +154,7 @@ void envfx_update_lava(Vec3s centerPos) {
envfx_set_lava_bubble_position(i, centerPos);
(gEnvFxBuffer + i)->isAlive = 1;
} else if ((timer & 0x01) == 0) {
(gEnvFxBuffer + i)->animFrame += 1;
(gEnvFxBuffer + i)->animFrame++;
if ((gEnvFxBuffer + i)->animFrame > 8) {
(gEnvFxBuffer + i)->isAlive = 0;
(gEnvFxBuffer + i)->animFrame = 0;
+11 -27
View File
@@ -1440,8 +1440,8 @@ u32 interact_koopa_shell(struct MarioState *m, UNUSED u32 interactType, struct O
if (interaction == INT_HIT_FROM_ABOVE || m->action == ACT_WALKING
|| m->action == ACT_HOLD_WALKING) {
m->interactObj = obj;
m->usedObj = obj;
m->riddenObj = obj;
m->usedObj = obj;
m->riddenObj = obj;
attack_object(obj, interaction);
update_mario_sound_and_camera(m);
@@ -1503,9 +1503,9 @@ u32 interact_pole(struct MarioState *m, UNUSED u32 interactType, struct Object *
#endif
m->interactObj = obj;
m->usedObj = obj;
m->vel[1] = 0.0f;
m->forwardVel = 0.0f;
m->usedObj = obj;
m->vel[1] = 0.0f;
m->forwardVel = 0.0f;
marioObj->oMarioPoleUnk108 = 0;
marioObj->oMarioPoleYawVel = 0;
@@ -1651,22 +1651,10 @@ u32 mario_can_talk(struct MarioState *m, u32 arg) {
return FALSE;
}
#ifdef VERSION_JP
#define READ_MASK (INPUT_B_PRESSED)
#else
#define READ_MASK (INPUT_B_PRESSED | INPUT_A_PRESSED)
#endif
#ifdef VERSION_JP
#define SIGN_RANGE 0x38E3
#else
#define SIGN_RANGE 0x4000
#endif
u32 check_read_sign(struct MarioState *m, struct Object *obj) {
if ((m->input & READ_MASK) && mario_can_talk(m, 0) && object_facing_mario(m, obj, SIGN_RANGE)) {
if ((m->input & (INPUT_B_PRESSED | INPUT_A_PRESSED)) && mario_can_talk(m, 0) && object_facing_mario(m, obj, 0x4000)) {
s16 facingDYaw = (s16)(obj->oMoveAngleYaw + 0x8000) - m->faceAngle[1];
if (facingDYaw >= -SIGN_RANGE && facingDYaw <= SIGN_RANGE) {
if (facingDYaw >= -0x4000 && facingDYaw <= 0x4000) {
f32 targetX = obj->oPosX + 105.0f * sins(obj->oMoveAngleYaw);
f32 targetZ = obj->oPosZ + 105.0f * coss(obj->oMoveAngleYaw);
@@ -1684,7 +1672,7 @@ u32 check_read_sign(struct MarioState *m, struct Object *obj) {
}
u32 check_npc_talk(struct MarioState *m, struct Object *obj) {
if ((m->input & READ_MASK) && mario_can_talk(m, 1)) {
if ((m->input & (INPUT_B_PRESSED | INPUT_A_PRESSED)) && mario_can_talk(m, 1)) {
s16 facingDYaw = mario_obj_angle_to_object(m, obj) - m->faceAngle[1];
if (facingDYaw >= -0x4000 && facingDYaw <= 0x4000) {
obj->oInteractStatus = INT_STATUS_INTERACTED;
@@ -1765,7 +1753,7 @@ void mario_process_interactions(struct MarioState *m) {
}
if (m->invincTimer > 0 && !sDelayInvincTimer) {
m->invincTimer -= 1;
m->invincTimer--;
}
//! If the kick/punch flags are set and an object collision changes Mario's
@@ -1847,12 +1835,8 @@ void mario_handle_special_floors(struct MarioState *m) {
break;
}
if (!(m->action & ACT_FLAG_AIR) && !(m->action & ACT_FLAG_SWIMMING)) {
switch (floorType) {
case SURFACE_BURNING:
check_lava_boost(m);
break;
}
if (!(m->action & ACT_FLAG_AIR) && !(m->action & ACT_FLAG_SWIMMING) && (floorType == SURFACE_BURNING)) {
check_lava_boost(m);
}
}
}
+5 -7
View File
@@ -19,7 +19,6 @@
#include "ingame_menu.h"
#include "obj_behaviors.h"
#include "save_file.h"
#include "debug_course.h"
#if MULTILANG
#include "memory.h"
#include "eu_translation.h"
@@ -874,7 +873,7 @@ void initiate_delayed_warp(void) {
case WARP_OP_CREDITS_NEXT:
sound_banks_disable(SEQ_PLAYER_SFX, SOUND_BANKS_ALL);
gCurrCreditsEntry += 1;
gCurrCreditsEntry++;
gCurrActNum = gCurrCreditsEntry->actNum & 0x07;
if ((gCurrCreditsEntry + 1)->levelNum == LEVEL_NONE) {
destWarpNode = WARP_NODE_CREDITS_END;
@@ -915,7 +914,7 @@ void update_hud_values(void) {
}
if (gHudDisplay.coins < gMarioState->numCoins) {
if (gGlobalTimer & 0x00000001) {
if (gGlobalTimer & 0x1) {
u32 coinSound;
if (gMarioState->action & (ACT_FLAG_SWIMMING | ACT_FLAG_METAL_WATER)) {
coinSound = SOUND_GENERAL_COIN_WATER;
@@ -923,7 +922,7 @@ void update_hud_values(void) {
coinSound = SOUND_GENERAL_COIN;
}
gHudDisplay.coins += 1;
gHudDisplay.coins++;
play_sound(coinSound, gMarioState->marioObj->header.gfx.cameraToObject);
}
}
@@ -998,7 +997,7 @@ s32 play_mode_normal(void) {
check_instant_warp();
if (sTimerRunning && gHudDisplay.timer < 17999) {
gHudDisplay.timer += 1;
gHudDisplay.timer++;
}
area_update_objects();
@@ -1098,7 +1097,7 @@ s32 play_mode_change_area(void) {
}
if (sTransitionTimer > 0) {
sTransitionTimer -= 1;
sTransitionTimer--;
}
if (sTransitionTimer == 0) {
@@ -1341,7 +1340,6 @@ s32 lvl_set_current_level(UNUSED s16 arg0, s32 levelNum) {
if (gSavedCourseNum != gCurrCourseNum) {
gSavedCourseNum = gCurrCourseNum;
nop_change_course();
disable_warp_checkpoint();
}
+7 -8
View File
@@ -1167,11 +1167,10 @@ void squish_mario_model(struct MarioState *m) {
if (m->squishTimer != 0xFF) {
// If no longer squished, scale back to default.
if (m->squishTimer == 0) {
vec3f_set(m->marioObj->header.gfx.scale, 1.0f, 1.0f, 1.0f);
}
vec3_same(m->marioObj->header.gfx.scale, 1.0f);
// If timer is less than 16, rubber-band Mario's size scale up and down.
else if (m->squishTimer <= 16) {
m->squishTimer -= 1;
} else if (m->squishTimer <= 16) {
m->squishTimer--;
m->marioObj->header.gfx.scale[1] =
1.0f - ((sSquishScaleOverTime[15 - m->squishTimer] * 0.6f) / 100.0f);
@@ -1180,7 +1179,7 @@ void squish_mario_model(struct MarioState *m) {
m->marioObj->header.gfx.scale[2] = m->marioObj->header.gfx.scale[0];
} else {
m->squishTimer -= 1;
m->squishTimer--;
vec3f_set(m->marioObj->header.gfx.scale, 1.4f, 0.4f, 1.4f);
}
@@ -1243,13 +1242,13 @@ void update_mario_button_inputs(struct MarioState *m) {
if (m->input & INPUT_A_PRESSED) {
m->framesSinceA = 0;
} else if (m->framesSinceA < 0xFF) {
m->framesSinceA += 1;
m->framesSinceA++;
}
if (m->input & INPUT_B_PRESSED) {
m->framesSinceB = 0;
} else if (m->framesSinceB < 0xFF) {
m->framesSinceB += 1;
m->framesSinceB++;
}
}
@@ -1585,7 +1584,7 @@ u32 update_and_return_cap_flags(struct MarioState *m) {
if ((m->capTimer <= 60)
|| ((action != ACT_READING_AUTOMATIC_DIALOG) && (action != ACT_READING_NPC_DIALOG)
&& (action != ACT_READING_SIGN) && (action != ACT_IN_CANNON))) {
m->capTimer -= 1;
m->capTimer--;
}
if (m->capTimer == 0) {
+1 -1
View File
@@ -1545,7 +1545,7 @@ s32 act_lava_boost(struct MarioState *m) {
if (m->actionState < 2 && m->vel[1] < 0.0f) {
m->vel[1] = -m->vel[1] * 0.4f;
mario_set_forward_vel(m, m->forwardVel * 0.5f);
m->actionState += 1;
m->actionState++;
} else {
set_mario_action(m, ACT_LAVA_BOOST_LAND, 0);
}
+2 -4
View File
@@ -477,12 +477,10 @@ Gfx *geo_mario_hand_foot_scaler(s32 callContext, struct GraphNode *node, UNUSED
scaleNode->scale = 1.0f;
if (asGenerated->parameter == bodyState->punchState >> 6) {
if (sMarioAttackAnimCounter != gAreaUpdateCounter && (bodyState->punchState & 0x3F) > 0) {
bodyState->punchState -= 1;
bodyState->punchState--;
sMarioAttackAnimCounter = gAreaUpdateCounter;
}
scaleNode->scale =
gMarioAttackScaleAnimation[asGenerated->parameter * 6 + (bodyState->punchState & 0x3F)]
/ 10.0f;
scaleNode->scale = gMarioAttackScaleAnimation[asGenerated->parameter * 6 + (bodyState->punchState & 0x3F)] / 10.0f;
}
}
return NULL;
+3 -4
View File
@@ -146,7 +146,7 @@ static void platform_on_track_update_pos_or_spawn_ball(s32 ballIndex, f32 x, f32
do {
prevWaypoint = nextWaypoint;
nextWaypoint += 1;
nextWaypoint++;
if (nextWaypoint->flags == WAYPOINT_FLAGS_END) {
if (ballIndex == 0) {
o->oPlatformOnTrackPrevWaypointFlags = WAYPOINT_FLAGS_END;
@@ -470,10 +470,9 @@ static s32 oscillate_toward(s32 *value, f32 *vel, s32 target, f32 velCloseToZero
return FALSE;
}
static void obj_update_blinking(s32 *blinkTimer, s16 baseCycleLength, s16 cycleLengthRange,
s16 blinkLength) {
static void obj_update_blinking(s32 *blinkTimer, s16 baseCycleLength, s16 cycleLengthRange, s16 blinkLength) {
if (*blinkTimer != 0) {
*blinkTimer -= 1;
(*blinkTimer)--;
} else {
*blinkTimer = random_linear_offset(baseCycleLength, cycleLengthRange);
}
+3 -3
View File
@@ -285,7 +285,7 @@ s32 update_objects_starting_at(struct ObjectNode *objList, struct ObjectNode *fi
cur_obj_update();
firstObj = firstObj->next;
count += 1;
count++;
}
return count;
@@ -543,7 +543,7 @@ void update_non_terrain_objects(void) {
s32 i = 2;
while ((listIndex = sObjectListUpdateOrder[i]) != -1) {
gObjectCounter += update_objects_in_list(&gObjectLists[listIndex]);
i += 1;
i++;
}
}
@@ -556,7 +556,7 @@ void unload_deactivated_objects(void) {
s32 i = 0;
while ((listIndex = sObjectListUpdateOrder[i]) != -1) {
unload_deactivated_objects_in_list(&gObjectLists[listIndex]);
i += 1;
i++;
}
// TIME_STOP_UNKNOWN_0 was most likely intended to be used to track whether
+576 -803
View File
File diff suppressed because it is too large. Load diff
+1 -2
View File
@@ -220,8 +220,7 @@ struct Object *allocate_object(struct ObjectNode *objList) {
// If no unimportant object exists, then the object pool is exhausted.
if (unimportantObj == NULL) {
// We've met with a terrible fate.
while (TRUE) {
}
while (TRUE) {}
} else {
// If an unimportant object does exist, unload it and take its slot.
unload_object(unimportantObj);
+1 -1
View File
@@ -3018,7 +3018,7 @@ void Unknown801A5D90(struct ObjGroup *arg0) {
sp23C = FALSE;
for (;;) {
trackerNum += 1;
trackerNum++;
mt = get_memtracker_by_index(trackerNum);
if (mt->name != NULL) {
+1 -1
View File
@@ -1181,7 +1181,7 @@ void animate_mario_head_normal(struct ObjAnimator *self) {
if (self->frame == 810.0f) {
self->frame = 750.0f;
self->nods -= 1;
self->nods--;
if (self->nods == 0) {
state = 3;
}
+1 -1
View File
@@ -2319,7 +2319,7 @@ void print_file_select_strings(void) {
sTextBaseAlpha += 10;
}
if (sMainMenuTimer < 1000) {
sMainMenuTimer += 1;
sMainMenuTimer++;
}
}