diff options
| author | Dragorn421 <Dragorn421@users.noreply.github.com> | 2026-09-24 05:56:15 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-24 05:56:15 +0200 |
| commit | 39070bb9dd5bba8b60363b81ef0b36f4590e68f4 (patch) | |
| tree | dec35cfe12833c27ca6ac6302b0a60b9e6e12949 /src/code/z_camera.c | |
| parent | 5d80451f3109232d05432f67d8425ff5e7bef68a (diff) | |
Fix misc 24 (#2760)
* rm PROJECT_DIR var from makefile
* fix tlutoffset missing 0x prefix
* fix FTOFIX32 redef warning
* `@bug:` -> `@bug`
* playerFloorPoly -> sPlayerFloorPoly
* fix settingChangeSuccessful use as bool
* fix broken english
* osEPiStartDma: use OS_MESG_PRI_HIGH
* EffectSsHahen_SpawnBurst: pass OBJECT_ for objId
* remove extra parens
* fix trailing comma warnings in enums
* EnRu1: decimal alpha
* fix parens
* fix ATELEM_SFX_NORMAL comment (collider "type" was renamed to material)
* fix comment in Math3D_TriChkPointParaYImpl
* use ANIMMODE_ more
* Remove leading 0s from enum comments (as they indicate octal in C)
Diffstat (limited to 'src/code/z_camera.c')
| -rw-r--r-- | src/code/z_camera.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/code/z_camera.c b/src/code/z_camera.c index bce305788..f5d88d806 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -479,15 +479,15 @@ s32 func_80043F94(Camera* camera, Vec3f* from, CamColChk* to) { to->pos.x = to->norm.x + toNewPos.x; to->pos.y = to->norm.y + toNewPos.y; to->pos.z = to->norm.z + toNewPos.z; - } else if (playerFloorPoly != NULL) { - playerFloorNormF.x = COLPOLY_GET_NORMAL(playerFloorPoly->normal.x); - playerFloorNormF.y = COLPOLY_GET_NORMAL(playerFloorPoly->normal.y); - playerFloorNormF.z = COLPOLY_GET_NORMAL(playerFloorPoly->normal.z); - if (Math3D_LineSegVsPlane(playerFloorNormF.x, playerFloorNormF.y, playerFloorNormF.z, playerFloorPoly->dist, + } else if (sPlayerFloorPoly != NULL) { + playerFloorNormF.x = COLPOLY_GET_NORMAL(sPlayerFloorPoly->normal.x); + playerFloorNormF.y = COLPOLY_GET_NORMAL(sPlayerFloorPoly->normal.y); + playerFloorNormF.z = COLPOLY_GET_NORMAL(sPlayerFloorPoly->normal.z); + if (Math3D_LineSegVsPlane(playerFloorNormF.x, playerFloorNormF.y, playerFloorNormF.z, sPlayerFloorPoly->dist, from, &toPos, &toNewPos, 1)) { // line is from->to is touching the poly the player is on. to->norm = playerFloorNormF; - to->poly = playerFloorPoly; + to->poly = sPlayerFloorPoly; to->bgId = camera->bgId; to->pos.x = to->norm.x + toNewPos.x; to->pos.y = to->norm.y + toNewPos.y; @@ -8080,13 +8080,13 @@ Vec3s Camera_Update(Camera* camera) { pos = curPlayerPosRot.pos; pos.y += Player_GetHeight(camera->player); - playerGroundY = BgCheck_EntityRaycastDown5(camera->play, &camera->play->colCtx, &playerFloorPoly, &bgId, + playerGroundY = BgCheck_EntityRaycastDown5(camera->play, &camera->play->colCtx, &sPlayerFloorPoly, &bgId, &camera->player->actor, &pos); if (playerGroundY != BGCHECK_Y_MIN) { // player is above ground. - camera->floorNorm.x = COLPOLY_GET_NORMAL(playerFloorPoly->normal.x); - camera->floorNorm.y = COLPOLY_GET_NORMAL(playerFloorPoly->normal.y); - camera->floorNorm.z = COLPOLY_GET_NORMAL(playerFloorPoly->normal.z); + camera->floorNorm.x = COLPOLY_GET_NORMAL(sPlayerFloorPoly->normal.x); + camera->floorNorm.y = COLPOLY_GET_NORMAL(sPlayerFloorPoly->normal.y); + camera->floorNorm.z = COLPOLY_GET_NORMAL(sPlayerFloorPoly->normal.z); camera->bgId = bgId; camera->playerGroundY = playerGroundY; sOOBTimer = 0; @@ -8114,7 +8114,7 @@ Vec3s Camera_Update(Camera* camera) { !(camera->stateFlags & CAM_STATE_BLOCK_BG) && (!(camera->stateFlags & CAM_STATE_PLAYER_IN_WATER) || (player->currentBoots == PLAYER_BOOTS_IRON)) && !(camera->stateFlags & CAM_STATE_PLAYER_DIVING) && (playerGroundY != BGCHECK_Y_MIN)) { - bgCamIndex = Camera_GetBgCamIndex(camera, &bgId, playerFloorPoly); + bgCamIndex = Camera_GetBgCamIndex(camera, &bgId, sPlayerFloorPoly); if (bgCamIndex != -1) { camera->nextBgId = bgId; if (bgId == BGCHECK_SCENE) { @@ -8619,12 +8619,12 @@ s32 Camera_RequestBgCam(Camera* camera, s32 requestedBgCamIndex) { settingChangeSuccessful = Camera_RequestSettingImpl(camera, requestedCamSetting, CAM_REQUEST_SETTING_PRESERVE_BG_CAM_INDEX | CAM_REQUEST_SETTING_FORCE_CHANGE) >= 0; - if ((settingChangeSuccessful != CAM_SET_NONE) || (sCameraSettings[camera->setting].unk_00 & 0x80000000)) { + if (settingChangeSuccessful || (sCameraSettings[camera->setting].unk_00 & 0x80000000)) { camera->bgCamIndex = requestedBgCamIndex; camera->behaviorFlags |= CAM_BEHAVIOR_BG_SUCCESS; Camera_CopyDataToRegs(camera, camera->mode); } else if (settingChangeSuccessful < -1) { - //! @bug: `settingChangeSuccessful` is a bool and is likely checking the wrong value. This can never pass. + //! @bug `settingChangeSuccessful` is a bool and is likely checking the wrong value. This can never pass. //! The actual return of Camera_RequestSettingImpl or bgCamIndex would make more sense. PRINTF(VT_COL(RED, WHITE) "camera: error: illegal camera ID (%d) !! (%d|%d|%d)\n" VT_RST, requestedBgCamIndex, camera->camId, BGCHECK_SCENE, requestedCamSetting); |
