diff options
| author | Tyler McGavran <tyler.taggerung@gmail.com> | 2024-03-04 21:28:31 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-04 19:28:31 -0700 |
| commit | 6f4decf6b346d65da28f07dd541aef2844baacb5 (patch) | |
| tree | 4f867789e9e468f3676167f4e527d7ec76457b88 /src/update_objects.c | |
| parent | 0ac8284fb26ddafcff799fa1011d8b3a7bdeb558 (diff) | |
Update StarSpawn to StarCloudData (#578)
* Update StarSpawn to StarCloudData
Add and better specify the struct used to control how stars and
clouds are handled in various courses.
Diffstat (limited to 'src/update_objects.c')
| -rw-r--r-- | src/update_objects.c | 81 |
1 files changed, 29 insertions, 52 deletions
diff --git a/src/update_objects.c b/src/update_objects.c index 8f0dea1b4..37037b091 100644 --- a/src/update_objects.c +++ b/src/update_objects.c @@ -2741,52 +2741,28 @@ void func_800788F8(s32 objectIndex, u16 rot, Camera *camera) { set_object_flag_status_false(objectIndex, 0x00000010); } -#ifdef MIPS_TO_C -//generated by m2c commit beb457dabfc7a01ec6540a5404a6a05097a13602 on Nov-13-2023 -void func_800789AC(s32 arg0, Camera *arg1, s16 (*arg2)[4]) { - s32 *var_s1; - s32 var_s0; - - var_s0 = 0; - if (D_8018D1F0 > 0) { - var_s1 = &D_8018CC80[arg0]; - do { - func_800788F8(*var_s1, (u16) *arg2[var_s0], arg1); - var_s0 += 1; - var_s1 += 4; - } while (var_s0 < D_8018D1F0); - } - /* - s32 var_s0; +void update_clouds(s32 arg0, Camera *arg1, CloudData *cloudList) { + s32 cloudIndex; + s32 objectIndex; + CloudData *cloud; - for (var_s0 = 0; var_s0 < D_8018D1F0; var_s0++) { - func_800788F8(D_8018CC80[arg0 + var_s0], arg2[0][var_s0], arg1); + for (cloudIndex = 0; cloudIndex < D_8018D1F0; cloudIndex++) { + cloud = &cloudList[cloudIndex]; + objectIndex = D_8018CC80[arg0 + cloudIndex]; + func_800788F8(objectIndex, cloud->rotY, arg1); } - */ } -#else -GLOBAL_ASM("asm/non_matchings/update_objects/func_800789AC.s") -#endif - -typedef struct { - Vec3su unk0; - u16 pad; - Vec3su unkA; - u16 pad2; -} test; -typedef u16 testA[44][4]; - -void func_80078A44(s32 arg0, Camera *camera, u16 rot[][4]) { - s32 objectIndex; - s32 i; - - for (i = 0; i < D_8018D1F0; i++, arg0++) { - objectIndex = D_8018CC80[arg0]; +void update_stars(s32 arg0, Camera *camera, StarData *starList) { + s32 starIndex; + s32 objectIndex; + StarData *star; - // rot[i][0] - func_800788F8(objectIndex, *(u16 *)(rot + i), camera); - switch (i % 5U) { + for (starIndex = 0; starIndex < D_8018D1F0; starIndex++) { + star = &starList[starIndex]; + objectIndex = D_8018CC80[arg0 + starIndex]; + func_800788F8(objectIndex, star->rotY, camera); + switch (starIndex % 5U) { case 0: func_80073CB0(objectIndex, &gObjectList[objectIndex].primAlpha, 0x00000028, 0x000000B4, 0x000000FF, 0, -1); break; @@ -2849,40 +2825,41 @@ void func_80078C70(s32 arg0) { D_8018D218 = 0xA0; switch (gCurrentCourseId) { /* switch 2 */ case COURSE_MARIO_RACEWAY: /* switch 2 */ - func_800789AC(sp1C, camera, D_800E6A38); + // Uses Luigi Raceway's clouds for display purposes? + update_clouds(sp1C, camera, gLuigiRacewayClouds); break; case COURSE_YOSHI_VALLEY: /* switch 2 */ - func_800789AC(sp1C, camera, D_800E6AA8); + update_clouds(sp1C, camera, gYoshiValleyMooMooFarmClouds); break; case COURSE_FRAPPE_SNOWLAND: /* switch 2 */ func_80078170(sp1C, camera); break; case COURSE_KOOPA_BEACH: /* switch 2 */ - func_800789AC(sp1C, camera, D_800E6B00); + update_clouds(sp1C, camera, gKoopaTroopaBeachClouds); break; case COURSE_ROYAL_RACEWAY: /* switch 2 */ - func_800789AC(sp1C, camera, D_800E6B38); + update_clouds(sp1C, camera, gRoyalRacewayClouds); break; case COURSE_LUIGI_RACEWAY: /* switch 2 */ - func_800789AC(sp1C, camera, D_800E6A38); + update_clouds(sp1C, camera, gLuigiRacewayClouds); break; case COURSE_MOO_MOO_FARM: /* switch 2 */ - func_800789AC(sp1C, camera, D_800E6AA8); + update_clouds(sp1C, camera, gYoshiValleyMooMooFarmClouds); break; case COURSE_TOADS_TURNPIKE: /* switch 2 */ - func_80078A44(sp1C, camera, D_800E6C80); + update_stars(sp1C, camera, gToadsTurnpikeRainbowRoadStars); break; case COURSE_KALAMARI_DESERT: /* switch 2 */ - func_800789AC(sp1C, camera, D_800E6C10); + update_clouds(sp1C, camera, gKalimariDesertClouds); break; case COURSE_SHERBET_LAND: /* switch 2 */ - func_800789AC(sp1C, camera, D_800E6BA8); + update_clouds(sp1C, camera, gSherbetLandClouds); break; case COURSE_RAINBOW_ROAD: /* switch 2 */ - func_80078A44(sp1C, camera, D_800E6C80); + update_stars(sp1C, camera, gToadsTurnpikeRainbowRoadStars); break; case COURSE_WARIO_STADIUM: /* switch 2 */ - func_80078A44(sp1C, camera, D_800E6DE0); + update_stars(sp1C, camera, gWarioStadiumStars); break; } } |
