From 05b2cbfc60d396a7cf3b539347fc693d5588cada Mon Sep 17 00:00:00 2001 From: Dragorn421 Date: Sat, 11 Dec 2021 02:21:19 +0100 Subject: Doc dodongo's cavern stuff (#1019) * Document `func_80033480` more * More doc in `BgDdanKd` * WIP Document BgDodoago The dodongo skull light-eyes-with-bomb puzzle Some TODOs, jank/legacy code which I'm unsure if it achieves something significant * Finish documenting BgDodoago * `BgDodoago_WaitExplosives_` -> `BgDodoago_WaitExplosives` * Run formatter * `dlistBuffer` -> `displayListHead` --- src/code/z_actor.c | 13 +++++++------ src/code/z_scene_table.c | 11 +++++++---- 2 files changed, 14 insertions(+), 10 deletions(-) (limited to 'src/code') diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 4f23e2c78..b1e5366cb 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -3159,7 +3159,8 @@ void Actor_SpawnFloorDustRing(GlobalContext* globalCtx, Actor* actor, Vec3f* pos } } -void func_80033480(GlobalContext* globalCtx, Vec3f* arg1, f32 arg2, s32 arg3, s16 arg4, s16 scaleStep, u8 arg6) { +void func_80033480(GlobalContext* globalCtx, Vec3f* posBase, f32 randRangeDiameter, s32 amountMinusOne, s16 scaleBase, + s16 scaleStep, u8 arg6) { Vec3f pos; Vec3f velocity = { 0.0f, 0.0f, 0.0f }; Vec3f accel = { 0.0f, 0.3f, 0.0f }; @@ -3167,12 +3168,12 @@ void func_80033480(GlobalContext* globalCtx, Vec3f* arg1, f32 arg2, s32 arg3, s1 u32 var2; s32 i; - for (i = arg3; i >= 0; i--) { - pos.x = arg1->x + ((Rand_ZeroOne() - 0.5f) * arg2); - pos.y = arg1->y + ((Rand_ZeroOne() - 0.5f) * arg2); - pos.z = arg1->z + ((Rand_ZeroOne() - 0.5f) * arg2); + for (i = amountMinusOne; i >= 0; i--) { + pos.x = posBase->x + ((Rand_ZeroOne() - 0.5f) * randRangeDiameter); + pos.y = posBase->y + ((Rand_ZeroOne() - 0.5f) * randRangeDiameter); + pos.z = posBase->z + ((Rand_ZeroOne() - 0.5f) * randRangeDiameter); - scale = (s16)((Rand_ZeroOne() * arg4) * 0.2f) + arg4; + scale = (s16)((Rand_ZeroOne() * scaleBase) * 0.2f) + scaleBase; var2 = arg6; if (var2 != 0) { diff --git a/src/code/z_scene_table.c b/src/code/z_scene_table.c index 15f9b032a..bdfe03651 100644 --- a/src/code/z_scene_table.c +++ b/src/code/z_scene_table.c @@ -21,6 +21,8 @@ #include "scenes/indoors/miharigoya/miharigoya_scene.h" #include "scenes/dungeons/ice_doukutu/ice_doukutu_scene.h" +#include "overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.h" + #define ENTRANCE(scene, spawn, continueBgm, displayTitleCard, fadeIn, fadeOut) \ { \ scene, spawn, \ @@ -1025,11 +1027,11 @@ void* sDCLavaFloorTextures[] = { gDCLavaFloor5Tex, gDCLavaFloor6Tex, gDCLavaFloor7Tex, gDCLavaFloor8Tex, }; -// Scene Draw Config 20 +// Scene Draw Config 20 - Dodongo's Cavern void func_80099878(GlobalContext* globalCtx) { u32 gameplayFrames; s32 pad; - Gfx* displayListHead = Graph_Alloc(globalCtx->state.gfxCtx, 6 * sizeof(Gfx)); + Gfx* displayListHead = Graph_Alloc(globalCtx->state.gfxCtx, 2 * sizeof(Gfx[3])); OPEN_DISPS(globalCtx->state.gfxCtx, "../z_scene_table.c", 4905); @@ -1053,11 +1055,12 @@ void func_80099878(GlobalContext* globalCtx) { gSPSegment(POLY_OPA_DISP++, 0x0B, displayListHead); gDPPipeSync(displayListHead++); - gDPSetEnvColor(displayListHead++, 255, 255, 255, globalCtx->roomCtx.unk_74[0]); + gDPSetEnvColor(displayListHead++, 255, 255, 255, globalCtx->roomCtx.unk_74[BGDODOAGO_EYE_LEFT]); gSPEndDisplayList(displayListHead++); + gSPSegment(POLY_OPA_DISP++, 0x0C, displayListHead); gDPPipeSync(displayListHead++); - gDPSetEnvColor(displayListHead++, 255, 255, 255, globalCtx->roomCtx.unk_74[1]); + gDPSetEnvColor(displayListHead++, 255, 255, 255, globalCtx->roomCtx.unk_74[BGDODOAGO_EYE_RIGHT]); gSPEndDisplayList(displayListHead); CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_scene_table.c", 4956); -- cgit v1.2.3