Revert "Some more cleanup"

This reverts commit ea0fd25a73.
This commit is contained in:
thecozies
2021-10-03 10:30:30 -05:00
parent 6dde1e9026
commit 1e1aa3754f
56 changed files with 193 additions and 155 deletions

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++;
+ gDelayForErrorMessage += 1;
+ }
+ }
+

View File

@@ -394,14 +394,14 @@ index 6cbfd8e1..01dd4de8 100644
+
+ if (gPlayer1Controller->buttonPressed & R_JPAD) {
+ if (gCameraSpeed < 4) {
+ gCameraSpeed++;
+ gCameraSpeed += 1;
+ } else {
+ gCameraSpeed = 0;
+ }
+ save_file_set_camera_speed(gCameraSpeed);
+ } else if (gPlayer1Controller->buttonPressed & L_JPAD) {
+ if (gCameraSpeed > 0) {
+ gCameraSpeed--;
+ gCameraSpeed -= 1;
+ } else {
+ gCameraSpeed = 4;
+ }

View File

@@ -511,7 +511,7 @@ s32 adsr_update(struct AdsrState *adsr) {
}
case ADSR_STATE_SUSTAIN:
adsr->delay--;
adsr->delay -= 1;
if (adsr->delay == 0) {
adsr->state = ADSR_STATE_RELEASE;
}

View File

@@ -1274,6 +1274,9 @@ 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.
@@ -1285,6 +1288,7 @@ void audio_signal_game_loop_tick(void) {
#if defined(VERSION_EU) || defined(VERSION_SH)
maybe_tick_game_sound();
#endif
noop_8031EEC8();
}
/**

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++;
temp += 1;
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++;
unk += 1;
added = ((sampleAddr + size) + sample->medium);
if (added != D_SH_8034EC88[D_SH_8034F68C - 1].endAndMediumIdentification) {
D_SH_8034EC88[D_SH_8034F68C - 1].isFree = TRUE;

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--;
index -= 1;
}
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++;
index += 1;
}
if (index > (NUM_CELLS - 1)) {
@@ -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)++;
*data += 1;
for (i = 0; i < numSurfaces; i++) {
if (*surfaceRooms != NULL) {
room = *(*surfaceRooms);
(*surfaceRooms)++;
*surfaceRooms += 1;
}
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)++;
*data += 1;
}
#endif
}

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--;
o->oActivatedBackAndForthPlatformCountdown -= 1;
} else {
// After the wait period is over, we start moving, by adding the velocity
// to the positional offset.

View File

@@ -63,7 +63,7 @@ void bhv_animates_on_floor_switch_press_loop(void) {
}
if (o->oFloorSwitchPressAnimationDoubleFrame < 9) {
o->oFloorSwitchPressAnimationDoubleFrame++;
o->oFloorSwitchPressAnimationDoubleFrame += 1;
}
} else if ((o->oFloorSwitchPressAnimationDoubleFrame -= 2) < 0) {
o->oFloorSwitchPressAnimationDoubleFrame = 0;

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--;
o->oBubbaRandomTimer -= 1;
} else {
o->oBubbaTargetYaw = obj_random_fixed_turn(0x2000);
o->oBubbaRandomTimer = random_linear_offset(100, 100);

View File

@@ -150,7 +150,7 @@ static void chain_chomp_sub_act_turn(void) {
o->oChainChompTargetPitch = obj_get_pitch_from_vel();
}
} else {
o->oTimer--;
o->oTimer -= 1;
}
} else {
o->oForwardVel = 0.0f;
@@ -235,7 +235,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++;
o->oChainChompNumLunges += 1;
// enable wall collision
o->oWallHitboxRadius = 200.0f;
}

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--;
o->oClamShakeTimer -= 1;
cur_obj_shake_y(3.0f);
}
}

View File

@@ -49,7 +49,7 @@ void bhv_coffin_spawner_loop(void) {
}
}
o->oAction++;
o->oAction += 1;
}
} else if (o->activeFlags & ACTIVE_FLAG_IN_DIFFERENT_ROOM) {
o->oAction = COFFIN_SPAWNER_ACT_COFFINS_UNLOADED;

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,

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);

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--;
o->oEnemyLakituFaceForwardCountdown -= 1;
} 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--;
o->oEnemyLakituSpinyCooldown -= 1;
} 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++;
o->oEnemyLakituNumSpinies += 1;
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--;
o->oEnemyLakituSpinyCooldown -= 1;
}
// TODO: Check if anything interesting happens if we bypass this with speed
else if (o->oDistanceToMario > o->oDrawingDistance - 100.0f

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++;
o->oSubAction += 1;
}
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--;
o->oEyerokBossAttackCountdown -= 1;
}
if (o->oEyerokBossAttackCountdown != 0 && o->oEyerokBossAttackCountdown != 1) {
o->oEyerokBossAttackPhase++;
o->oEyerokBossAttackPhase += 1;
if ((o->oEyerokBossActiveHand = o->oEyerokBossAttackPhase & 0x1) == 0) {
o->oEyerokBossActiveHand = -1;
}
}
}
} else {
o->oEyerokBossAttackPhase++;
o->oEyerokBossAttackPhase += 1;
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--;
o->oTimer -= 1;
}
} 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--;
o->parentObj->oEyerokBossNumHands -= 1;
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++;
o->parentObj->oEyerokBossNumHands += 1;
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++;
o->oAnimState += 1;
} 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--;
o->oEyerokHandAnimStateIndex -= 1;
}
o->oAnimState = sEyerokAnimStatesList[o->oEyerokHandAnimStateIndex];
} else {

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--;
sNumActiveFirePiranhaPlants -= 1;
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++;
sNumActiveFirePiranhaPlants += 1;
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--;
sNumActiveFirePiranhaPlants -= 1;
}
} else {
cur_obj_init_animation_with_sound(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++;
o->oFlyGuyIdleTimer += 1;
}
}
}
@@ -190,7 +190,7 @@ void bhv_fly_guy_update(void) {
}
// Oscillate up and down
o->oFlyGuyOscTimer++;
o->oFlyGuyOscTimer += 1;
o->oPosY += coss(0x400 * o->oFlyGuyOscTimer) * 1.5f;
switch (o->oAction) {

View File

@@ -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++;
o->parentObj->oBookSwitchManagerNumCorrectChoices += 1;
} else {
rand01 = random_u16() & 0x1;
z = gMarioObject->oPosZ + 1.5f * gMarioStates[0].vel[2];

View File

@@ -95,7 +95,7 @@ void bhv_goomba_triplet_spawner_update(void) {
}
}
o->oAction++;
o->oAction += 1;
}
} 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--;
o->oGoombaWalkTimer -= 1;
} else {
if (random_u16() & 3) {
o->oGoombaTargetYaw = obj_random_fixed_turn(0x2000);

Some files were not shown because too many files have changed in this diff Show More