diff options
| author | MegaMech <7255464+MegaMech@users.noreply.github.com> | 2024-12-17 17:12:12 -0700 |
|---|---|---|
| committer | MegaMech <7255464+MegaMech@users.noreply.github.com> | 2024-12-17 17:12:12 -0700 |
| commit | 135b51ea719c6107663d9f54cc3e8cb7404dbda3 (patch) | |
| tree | 0fbcf721e8fafba631949fe1d3ef554cee1ef52f /src/update_objects.c | |
| parent | 60014ec46695fb964a685d6a17d5fc63e02ab7b8 (diff) | |
Impl snowmen and trashbin
Diffstat (limited to 'src/update_objects.c')
| -rw-r--r-- | src/update_objects.c | 299 |
1 files changed, 49 insertions, 250 deletions
diff --git a/src/update_objects.c b/src/update_objects.c index fe25980cd..c3a9b5129 100644 --- a/src/update_objects.c +++ b/src/update_objects.c @@ -1004,10 +1004,6 @@ bool func_80073CB0(s32 objectIndex, s16* arg1, s32 arg2, s32 arg3, s32 arg4, s32 return func_80073B78(1, objectIndex, arg1, arg2, arg3, arg4, arg5, arg6); } -bool func_80073D0C(s32 objectIndex, s16* arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) { - return func_80073B78(0, objectIndex, arg1, arg2, arg3, arg4, arg5, arg6); -} - UNUSED void func_80073D68(s32 objectIndex, s16* arg1, s16 arg2, s32 arg3) { *arg1 = *arg1 + arg3; if (*arg1 >= arg2) { @@ -1803,7 +1799,7 @@ void func_8007601C(s32 objectIndex) { } } - if (func_8008A8B0(9, 0xB) == 0) { + if (are_players_in_course_section(9, 0xB) == 0) { gObjectList[objectIndex].type = 2; } } @@ -1965,7 +1961,7 @@ void func_8007661C(void) { gObjectList[objectIndex].unk_048 = 0x0000003C; } } - if (func_8008A8B0(4, 5) == 0) { + if (are_players_in_course_section(4, 5) == 0) { gObjectList[objectIndex].type = 2; } } @@ -5173,89 +5169,58 @@ void func_8007DDC0(s32 objectIndex) { object->unk_048 = 0x0000012C; } } - if (func_8008A8B0(0x000F, 0x0012) == 0) { + if (are_players_in_course_section(0x000F, 0x0012) == 0) { object->type = 2; } } -void init_bb_trash_bin(s32 objectIndex) { - gObjectList[objectIndex].sizeScaling = 1.0f; - gObjectList[objectIndex].model = d_course_banshee_boardwalk_dl_trash_bin; - gObjectList[objectIndex].unk_04C = 0; - gObjectList[objectIndex].unk_084[7] = 0; - set_obj_orientation(objectIndex, 0U, 0U, 0U); - if (gIsMirrorMode != 0) { - gObjectList[objectIndex].pos[0] = 1765.0f; - gObjectList[objectIndex].pos[2] = 195.0f; - gObjectList[objectIndex].orientation[1] = 0x8000; - } else { - gObjectList[objectIndex].pos[0] = -1765.0f; - gObjectList[objectIndex].pos[2] = 70.0f; - } - gObjectList[objectIndex].pos[1] = 45.0f; - set_obj_velocity(objectIndex, 0.0f, 0.0f, 0.0f); - gObjectList[objectIndex].type = 0; - object_next_state(objectIndex); -} -void func_8007E00C(s32 objectIndex) { - switch (gObjectList[objectIndex].state) { - case 1: - init_bb_trash_bin(objectIndex); - break; - case 3: - D_8018CFB0 = 1; - object_next_state(objectIndex); - break; - case 4: - set_and_run_timer_object(objectIndex, 0x000000D2); - if (D_80165594 == 0) { - if (gCCSelection < CC_150) { - func_8007D714(1); - func_8007D714(1); - } else { - func_8007D714(1); - func_8007D714(1); - func_8007D714(1); - func_8007D714(1); - } - } - func_80073CB0(objectIndex, &gObjectList[objectIndex].primAlpha, -0x00002000, 0, 0x00000400, 0, -1); - gObjectList[objectIndex].orientation[2] = gObjectList[objectIndex].primAlpha; - if (gObjectList[objectIndex].unk_084[7] == 0) { - func_800C98B8(gObjectList[objectIndex].pos, gObjectList[objectIndex].velocity, - SOUND_ARG_LOAD(0x19, 0x01, 0x90, 0x4E)); - gObjectList[objectIndex].unk_084[7] = 0x0014; - } else { - gObjectList[objectIndex].unk_084[7]--; - } - break; - case 5: - gObjectList[objectIndex].orientation[2] = func_800417B4(gObjectList[objectIndex].orientation[2], 0U); - if (gObjectList[objectIndex].orientation[2] == 0) { - object_next_state(objectIndex); - } - break; - case 6: - gObjectList[objectIndex].orientation[2] = 0; - gObjectList[objectIndex].unk_084[7] = 0; - object_next_state(objectIndex); - D_8018CFB0 = 0; - break; - case 0: - case 2: - default: - break; - } -} -void update_trash_bin(void) { - s32 objectIndex = indexObjectList1[1]; - func_8007E00C(objectIndex); - if (gModeSelection != TIME_TRIALS) { - func_8007DDC0(objectIndex); - } -} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + void func_8007E1F4(s32 objectIndex) { f32 sp2C; @@ -5293,7 +5258,7 @@ void func_8007E1F4(s32 objectIndex) { object->unk_048 = 0x0000012C; } } - if (func_8008A8B0(0x000F, 0x0013) == 0) { + if (are_players_in_course_section(0x000F, 0x0013) == 0) { object->type = 2; } } @@ -5582,19 +5547,6 @@ void func_80083538(s32 objectIndex, Vec3f arg1, s32 arg2, s32 arg3) { object->primAlpha = random_int(0x4000U) + 0x1000; } -void func_800836F0(Vec3f arg0) { - s32 objectIndex; - s32 i; - - for (i = 0; i < D_8018D3BC; i++) { - objectIndex = add_unused_obj_index(&gObjectParticle2[0], &gNextFreeObjectParticle2, gObjectParticle2_SIZE); - if (objectIndex == NULL_OBJECT_ID) { - break; - } - func_80083538(objectIndex, arg0, i, D_8018D3BC); - } -} - void func_8008379C(s32 objectIndex) { switch (gObjectList[objectIndex].state) { case 0: @@ -5636,159 +5588,6 @@ void func_80083868(s32 objectIndex) { set_object_flag(objectIndex, 0x00000200); } -void func_80083948(s32 objectIndex) { - switch (gObjectList[objectIndex].unk_0AE) { - case 1: - func_80086FD4(objectIndex); - break; - case 2: - func_800871AC(objectIndex, 0x00000014); - break; - case 3: - func_8008701C(objectIndex, 1); - break; - case 10: - func_80087C48(objectIndex, 10.0f, 0.5f, 0x0000000A); - break; - case 11: - func_80087D24(objectIndex, 0.0f, 0.2f, -7.0f); - break; - case 20: - if (f32_step_up_towards(&gObjectList[objectIndex].offset[1], 0.0f, 0.2f) != 0) { - func_80073800(objectIndex, 0); - func_8008701C(objectIndex, 1); - } - break; - case 0: - default: - break; - } - object_calculate_new_pos_offset(objectIndex); - func_80073D0C(objectIndex, &gObjectList[objectIndex].primAlpha, -0x00001000, 0x00001000, 0x00000400, 1, -1); - gObjectList[objectIndex].orientation[2] = gObjectList[objectIndex].primAlpha + 0x8000; -} - -void func_80083A94(s32 objectIndex) { - switch (gObjectList[objectIndex].state) { - case 0: - break; - case 1: - func_80083868(objectIndex); - break; - } - if (gObjectList[objectIndex].state >= 2) { - func_80073514(objectIndex); - } - func_80083948(objectIndex); -} - -static const char* sSnowmanBodyList[] = { d_course_frappe_snowland_snowman_body }; - -void func_80083B0C(s32 objectIndex) { - Vtx* vtx = (Vtx*) LOAD_ASSET(common_vtx_hedgehog); - init_texture_object(objectIndex, d_course_frappe_snowland_snowman_tlut, sSnowmanBodyList, 0x40U, (u16) 0x00000040); - gObjectList[objectIndex].vertex = vtx; - gObjectList[objectIndex].sizeScaling = 0.1f; - gObjectList[objectIndex].textureListIndex = 0; - object_next_state(objectIndex); - set_obj_origin_offset(objectIndex, 0.0f, 0.0f, 0.0f); - gObjectList[objectIndex].orientation[0] = 0; - gObjectList[objectIndex].orientation[1] = 0; - gObjectList[objectIndex].orientation[2] = 0x8000; - gObjectList[objectIndex].boundingBoxSize = 2; - gObjectList[objectIndex].unk_034 = 1.5f; - set_object_flag(objectIndex, 0x04000210); -} - -void func_80083BE4(s32 objectIndex) { - object_calculate_new_pos_offset(objectIndex); -} - -void func_80083C04(s32 objectIndex) { - Object* object; - - object = &gObjectList[objectIndex]; - switch (object->state) { - case 0: - break; - case 1: - func_80083B0C(objectIndex); - break; - case 2: - set_and_run_timer_object(objectIndex, 0x00000096); - break; - case 10: - if (set_and_run_timer_object(objectIndex, 0x0000012C) != 0) { - func_800722A4(objectIndex, 2); - } - break; - case 11: - if (set_and_run_timer_object(objectIndex, 0x0000000A) != 0) { - set_object_flag(objectIndex, 0x00000010); - object->sizeScaling = 0.001f; - } - break; - case 12: - if (func_80074118(objectIndex, &object->sizeScaling, 0.001f, 0.1f, 0.0025f, 0, 0) != 0) { - object_next_state(objectIndex); - } - break; - case 13: - func_800726CC(objectIndex, 2); - clear_object_flag(objectIndex, 0x00001000); - break; - } - if (object->state >= 2) { - func_80073514(objectIndex); - } - func_80083BE4(objectIndex); -} - -void update_snowmen(void) { - s32 var_s0; - s32 var_s3; - s32 var_s4; - s32 objectIndex; - Object* object; - - for (var_s0 = 0; var_s0 < gObjectParticle2_SIZE; var_s0++) { - objectIndex = gObjectParticle2[var_s0]; - - if (objectIndex == DELETED_OBJECT_ID) { - continue; - } - - if (gObjectList[objectIndex].state == 0) { - continue; - } - func_8008379C(objectIndex); - if (gObjectList[objectIndex].state != 0) { - continue; - } - delete_object_wrapper(&gObjectParticle2[var_s0]); - if (var_s0) {} // ?? - } - - for (var_s0 = 0; var_s0 < NUM_SNOWMEN; var_s0++) { - var_s4 = indexObjectList1[var_s0]; - var_s3 = indexObjectList2[var_s0]; - func_80083A94(var_s3); // snowman head - func_80083C04(var_s4); // snowman body - if (is_obj_index_flag_status_inactive(var_s4, 0x00001000) != 0) { - object = &gObjectList[var_s4]; - if ((func_8008A8B0(object->unk_0D5 - 1, object->unk_0D5 + 1) != 0) && (func_80089B50(var_s4) != 0)) { - set_object_flag(var_s4, 0x00001000); - clear_object_flag(var_s4, 0x00000010); - func_800726CC(var_s4, 0x0000000A); - func_8008701C(var_s3, 0x0000000A); - func_800836F0(object->pos); - } - } else if (func_80072320(var_s4, 2) != 0) { - func_800722CC(var_s4, 2); - func_8008701C(var_s3, 0x00000014); - } - } -} void func_80083F18(s32 objectIndex) { switch (gObjectList[objectIndex].state) { |
