From 1eca2fc63f56b821c66acf762b98e20774efd697 Mon Sep 17 00:00:00 2001 From: Derek Hensley Date: Wed, 5 Oct 2022 20:42:19 -0700 Subject: [PATCH] Floor Surface --- include/functions.h | 4 ++-- src/code/z_actor.c | 2 +- src/code/z_play.c | 9 +++++---- src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c | 4 ++-- .../effects/ovl_Effect_Ss_Blast/z_eff_ss_blast.c | 2 +- tools/disasm/functions.txt | 4 ++-- tools/sizes/code_functions.csv | 4 ++-- 7 files changed, 15 insertions(+), 14 deletions(-) diff --git a/include/functions.h b/include/functions.h index adbbd6a267..4caa78525c 100644 --- a/include/functions.h +++ b/include/functions.h @@ -2468,8 +2468,8 @@ void Play_Draw(PlayState* this); void Play_SetupDraw(PlayState* this); void Play_Main(GameState* thisx); s32 Play_InCsMode(PlayState* this); -f32 func_80169100(PlayState* this, MtxF* mtx, CollisionPoly** poly, s32* bgId, Vec3f* feetPos); -void func_801691F0(PlayState* this, MtxF* mtx, Vec3f* feetPos); +f32 Play_GetFloorSurfaceImpl(PlayState* this, MtxF* mtx, CollisionPoly** poly, s32* bgId, Vec3f* pos); +void Play_GetFloorSurface(PlayState* this, MtxF* mtx, Vec3f* pos); void* Play_LoadFile(PlayState* this, RomFile* entry); void Play_InitEnvironment(PlayState* this, s16 skyboxId); // void func_801692C4(PlayState* play, UNK_TYPE1 uParm2); diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 5069b94a8d..5239c51a00 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -224,7 +224,7 @@ void ActorShadow_DrawFeet(Actor* actor, Lights* mapper, PlayState* play) { for (i = 0; i < ARRAY_COUNT(floorHeight); i++, spB8 >>= 1) { feetPosPtr->y += 50.0f; - *floorHeightPtr = func_80169100(play, &sp13C, &spF8, &bgId, feetPosPtr); + *floorHeightPtr = Play_GetFloorSurfaceImpl(play, &sp13C, &spF8, &bgId, feetPosPtr); feetPosPtr->y -= 50.0f; distToFloor = feetPosPtr->y - *floorHeightPtr; diff --git a/src/code/z_play.c b/src/code/z_play.c index 2131fb9a20..05eecf5454 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -108,7 +108,8 @@ void Play_DisableMotionBlur(void) { R_MOTION_BLUR_ENABLED = false; } -void Play_ConvertBufferToI(void* destI, u16* srcBuf, s32 bufWidth, s32 pixelLeft, s32 pixelTop, s32 pixelRight, s32 pixelBottom, s32 type) { +void Play_ConvertBufferToI(void* destI, u16* srcBuf, s32 bufWidth, s32 pixelLeft, s32 pixelTop, s32 pixelRight, + s32 pixelBottom, s32 type) { s32 i; s32 j; u32 pixel; @@ -1512,7 +1513,7 @@ s32 Play_InCsMode(PlayState* this) { return (this->csCtx.state != 0) || Player_InCsMode(this); } -f32 func_80169100(PlayState* this, MtxF* mtx, CollisionPoly** poly, s32* bgId, Vec3f* pos) { +f32 Play_GetFloorSurfaceImpl(PlayState* this, MtxF* mtx, CollisionPoly** poly, s32* bgId, Vec3f* pos) { f32 floorHeight = BgCheck_EntityRaycastFloor3(&this->colCtx, poly, bgId, pos); if (floorHeight > BGCHECK_Y_MIN) { @@ -1539,11 +1540,11 @@ f32 func_80169100(PlayState* this, MtxF* mtx, CollisionPoly** poly, s32* bgId, V return floorHeight; } -void func_801691F0(PlayState* this, MtxF* mtx, Vec3f* pos) { +void Play_GetFloorSurface(PlayState* this, MtxF* mtx, Vec3f* pos) { CollisionPoly* poly; s32 bgId; - func_80169100(this, mtx, &poly, &bgId, pos); + Play_GetFloorSurfaceImpl(this, mtx, &poly, &bgId, pos); } void* Play_LoadFile(PlayState* this, RomFile* entry) { diff --git a/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c b/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c index 64e15015eb..5c0752428e 100644 --- a/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c +++ b/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c @@ -209,8 +209,8 @@ void EnWarpTag_RespawnPlayer(EnWarptag* this, PlayState* play) { // why are we getting player home rotation from the room data? doesnt player have home.rot.y? // especially because we are converting from deg to binang, but isnt home.rot.y already in binang?? Play_SetRespawnData( - &play->state, 0, entrance, - play->setupEntranceList[playerSpawnIndex].room, playerParams, &newRespawnPos, + &play->state, 0, entrance, play->setupEntranceList[playerSpawnIndex].room, playerParams, + &newRespawnPos, ((((playerActorEntry->rot.y >> 7) & 0x1FF) / 180.0f) * 32768.0f)); // DEG_TO_BINANG ? Play_TriggerVoidOut(&play->state); diff --git a/src/overlays/effects/ovl_Effect_Ss_Blast/z_eff_ss_blast.c b/src/overlays/effects/ovl_Effect_Ss_Blast/z_eff_ss_blast.c index 93353f28cc..c903bac6d4 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Blast/z_eff_ss_blast.c +++ b/src/overlays/effects/ovl_Effect_Ss_Blast/z_eff_ss_blast.c @@ -70,7 +70,7 @@ void EffectSsBlast_Draw(PlayState* play, u32 index, EffectSs* this) { func_8012C2DC(play->state.gfxCtx); gDPSetEnvColor(POLY_XLU_DISP++, this->rEnvColorR, this->rEnvColorG, this->rEnvColorB, this->rEnvColorA); - func_801691F0(play, &mf, &this->pos); + Play_GetFloorSurface(play, &mf, &this->pos); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, this->rPrimColorR, this->rPrimColorG, this->rPrimColorB, this->rPrimColorA); Matrix_Put(&mf); Matrix_Scale(radius, radius, radius, MTXMODE_APPLY); diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index 8dd9802190..36e6740f9b 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -2999,8 +2999,8 @@ 0x80168DAC:("Play_SetupDraw",), 0x80168F64:("Play_Main",), 0x801690CC:("Play_InCsMode",), - 0x80169100:("func_80169100",), - 0x801691F0:("func_801691F0",), + 0x80169100:("Play_GetFloorSurfaceImpl",), + 0x801691F0:("Play_GetFloorSurface",), 0x80169220:("Play_LoadFile",), 0x8016927C:("Play_InitEnvironment",), 0x801692C4:("Play_InitScene",), diff --git a/tools/sizes/code_functions.csv b/tools/sizes/code_functions.csv index 310fbefd1a..b1c0915e58 100644 --- a/tools/sizes/code_functions.csv +++ b/tools/sizes/code_functions.csv @@ -2513,8 +2513,8 @@ asm/non_matchings/code/z_play/Play_Draw.s,Play_Draw,0x80168090,0x347 asm/non_matchings/code/z_play/Play_SetupDraw.s,Play_SetupDraw,0x80168DAC,0x6E asm/non_matchings/code/z_play/Play_Main.s,Play_Main,0x80168F64,0x5A asm/non_matchings/code/z_play/Play_InCsMode.s,Play_InCsMode,0x801690CC,0xD -asm/non_matchings/code/z_play/func_80169100.s,func_80169100,0x80169100,0x3C -asm/non_matchings/code/z_play/func_801691F0.s,func_801691F0,0x801691F0,0xC +asm/non_matchings/code/z_play/Play_GetFloorSurfaceImpl.s,Play_GetFloorSurfaceImpl,0x80169100,0x3C +asm/non_matchings/code/z_play/Play_GetFloorSurface.s,Play_GetFloorSurface,0x801691F0,0xC asm/non_matchings/code/z_play/Play_LoadFile.s,Play_LoadFile,0x80169220,0x17 asm/non_matchings/code/z_play/Play_InitEnvironment.s,Play_InitEnvironment,0x8016927C,0x12 asm/non_matchings/code/z_play/Play_InitScene.s,Play_InitScene,0x801692C4,0x44