summaryrefslogtreecommitdiff
path: root/src/code/z_camera.c
diff options
context:
space:
mode:
authorDragorn421 <Dragorn421@users.noreply.github.com>2023-01-10 19:03:31 +0100
committerGitHub <noreply@github.com>2023-01-10 13:03:31 -0500
commit542012efa68d110d6b631f9d149f6e5f4e68cc8e (patch)
tree6da8592b14b6be82219c09189ad8aeef537362a3 /src/code/z_camera.c
parentb4c97ce17eb35329b4a7e3d98d7f06d558683f6d (diff)
Fix misc 19 (#1488)
* "bgs sword" -> "biggoron sword" * Animation_ChangeImpl: last arg is `ANIMTAPER_` enum * TransitionTileStatus -> state * Tiny gbi.h formatting fixups * some cleanup on floormaster * misc float ops cleanup * sunsSongState = SUNSSONG_INACTIVE * continueFlag == CS_CMD_STOP * fix few camera names inconsistency * textual 0 padding? not on my lawn * libultra: construct address from end of dmem rather than oob from imem * more free1 -> 2 fixup
Diffstat (limited to 'src/code/z_camera.c')
-rw-r--r--src/code/z_camera.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/code/z_camera.c b/src/code/z_camera.c
index f7641f471..e83a0e918 100644
--- a/src/code/z_camera.c
+++ b/src/code/z_camera.c
@@ -487,12 +487,12 @@ Vec3s* Camera_GetBgCamFuncDataUnderPlayer(Camera* camera, u16* bgCamCount) {
CollisionPoly* floorPoly;
s32 pad;
s32 bgId;
- PosRot playerPosShape;
+ PosRot playerPosRot;
- Actor_GetWorldPosShapeRot(&playerPosShape, &camera->player->actor);
- playerPosShape.pos.y += Player_GetHeight(camera->player);
+ Actor_GetWorldPosShapeRot(&playerPosRot, &camera->player->actor);
+ playerPosRot.pos.y += Player_GetHeight(camera->player);
- if (BgCheck_EntityRaycastDown3(&camera->play->colCtx, &floorPoly, &bgId, &playerPosShape.pos) == BGCHECK_Y_MIN) {
+ if (BgCheck_EntityRaycastDown3(&camera->play->colCtx, &floorPoly, &bgId, &playerPosRot.pos) == BGCHECK_Y_MIN) {
// no floor
return NULL;
}
@@ -508,14 +508,14 @@ Vec3s* Camera_GetBgCamFuncDataUnderPlayer(Camera* camera, u16* bgCamCount) {
* Returns the camera data index otherwise.
*/
s32 Camera_GetWaterBoxBgCamIndex(Camera* camera, f32* waterY) {
- PosRot playerPosShape;
+ PosRot playerPosRot;
WaterBox* waterBox;
s32 bgCamIndex;
- Actor_GetWorldPosShapeRot(&playerPosShape, &camera->player->actor);
- *waterY = playerPosShape.pos.y;
+ Actor_GetWorldPosShapeRot(&playerPosRot, &camera->player->actor);
+ *waterY = playerPosRot.pos.y;
- if (!WaterBox_GetSurface1(camera->play, &camera->play->colCtx, playerPosShape.pos.x, playerPosShape.pos.z, waterY,
+ if (!WaterBox_GetSurface1(camera->play, &camera->play->colCtx, playerPosRot.pos.x, playerPosRot.pos.z, waterY,
&waterBox)) {
// player's position is not in a water box.
*waterY = BGCHECK_Y_MIN;
@@ -7144,29 +7144,29 @@ void Camera_Stub80058140(Camera* camera) {
}
void Camera_InitDataUsingPlayer(Camera* camera, Player* player) {
- PosRot playerPosShape;
+ PosRot playerPosRot;
VecGeo eyeNextAtOffset;
s32 bgId;
- Vec3f floorPos;
+ Vec3f floorNorm;
s32 upXZ;
f32 playerToAtOffsetY;
Vec3f* eye = &camera->eye;
Vec3f* at = &camera->at;
Vec3f* eyeNext = &camera->eyeNext;
- Actor_GetWorldPosShapeRot(&playerPosShape, &player->actor);
+ Actor_GetWorldPosShapeRot(&playerPosRot, &player->actor);
playerToAtOffsetY = Player_GetHeight(player);
camera->player = player;
- camera->playerPosRot = playerPosShape;
+ camera->playerPosRot = playerPosRot;
camera->dist = eyeNextAtOffset.r = 180.0f;
- camera->inputDir.y = playerPosShape.rot.y;
+ camera->inputDir.y = playerPosRot.rot.y;
eyeNextAtOffset.yaw = camera->inputDir.y - 0x7FFF;
camera->inputDir.x = eyeNextAtOffset.pitch = 0x71C;
camera->inputDir.z = 0;
camera->camDir = camera->inputDir;
camera->xzSpeed = 0.0f;
camera->playerPosDelta.y = 0.0f;
- camera->at = playerPosShape.pos;
+ camera->at = playerPosRot.pos;
camera->at.y += playerToAtOffsetY;
camera->playerToAtOffset.x = 0;
@@ -7182,7 +7182,7 @@ void Camera_InitDataUsingPlayer(Camera* camera, Player* player) {
camera->up.y = 1.0f;
camera->up.x = upXZ;
- if (Camera_GetFloorYNorm(camera, &floorPos, at, &bgId) != BGCHECK_Y_MIN) {
+ if (Camera_GetFloorYNorm(camera, &floorNorm, at, &bgId) != BGCHECK_Y_MIN) {
camera->bgId = bgId;
}