summaryrefslogtreecommitdiff
path: root/src/code
diff options
context:
space:
mode:
authorDragorn421 <Dragorn421@users.noreply.github.com>2026-09-24 05:56:15 +0200
committerGitHub <noreply@github.com>2026-09-24 05:56:15 +0200
commit39070bb9dd5bba8b60363b81ef0b36f4590e68f4 (patch)
treedec35cfe12833c27ca6ac6302b0a60b9e6e12949 /src/code
parent5d80451f3109232d05432f67d8425ff5e7bef68a (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')
-rw-r--r--src/code/sys_math3d.c4
-rw-r--r--src/code/z_bgcheck.c2
-rw-r--r--src/code/z_camera.c26
-rw-r--r--src/code/z_camera_data.inc.c2
-rw-r--r--src/code/z_room.c2
5 files changed, 18 insertions, 18 deletions
diff --git a/src/code/sys_math3d.c b/src/code/sys_math3d.c
index 5f41973ff..0287a64e2 100644
--- a/src/code/sys_math3d.c
+++ b/src/code/sys_math3d.c
@@ -636,7 +636,7 @@ s32 Math3D_PointRelativeToCubeVertices(Vec3f* point, Vec3f* min, Vec3f* max) {
ret |= 0x10;
}
- //! @bug: The next 2 conditions are the same check.
+ //! @bug The next 2 conditions are the same check.
if ((-min->x - min->y + max->z) < (-point->x - point->y + point->z)) {
ret |= 0x20;
}
@@ -996,7 +996,7 @@ s32 Math3D_TriChkPointParaYImpl(Vec3f* v0, Vec3f* v1, Vec3f* v2, f32 z, f32 x, f
}
if (fabsf(ny) > 0.5f) {
- // Do a check on each face of the triangle, if the point is within `chkDist` units return true.
+ // Do a check on each edge of the triangle, if the point is within `chkDist` units return true.
if (Math3D_PointDistSqToLine2D(z, x, v0->z, v0->x, v1->z, v1->x, &distToEdgeSq) && (distToEdgeSq < chkDistSq)) {
return true;
}
diff --git a/src/code/z_bgcheck.c b/src/code/z_bgcheck.c
index 0cd8ab9e2..22dbe31ff 100644
--- a/src/code/z_bgcheck.c
+++ b/src/code/z_bgcheck.c
@@ -326,7 +326,7 @@ void CollisionPoly_GetVerticesByBgId(CollisionPoly* poly, s32 bgId, CollisionCon
PRINTF_RST();
if (dest != NULL) {
- //! @bug: dest[2] x and y are not set to 0
+ //! @bug dest[2] x and y are not set to 0
dest[0].x = dest[0].y = dest[0].z = dest[1].x = dest[1].y = dest[1].z = dest[2].z = 0.0f;
}
} else {
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);
diff --git a/src/code/z_camera_data.inc.c b/src/code/z_camera_data.inc.c
index 82d1dd619..c2364b76e 100644
--- a/src/code/z_camera_data.inc.c
+++ b/src/code/z_camera_data.inc.c
@@ -2687,4 +2687,4 @@ PlayState* D_8015BD7C;
DebugCam D_8015BD80;
#endif
-CollisionPoly* playerFloorPoly;
+CollisionPoly* sPlayerFloorPoly;
diff --git a/src/code/z_room.c b/src/code/z_room.c
index 729eec25f..164ccd8d6 100644
--- a/src/code/z_room.c
+++ b/src/code/z_room.c
@@ -636,7 +636,7 @@ u32 Room_SetupFirstRoom(PlayState* play, RoomContext* roomCtx) {
}
}
- // If there any rooms are connected, find their combined size and update roomBufferSize if larger
+ // If there are any connected rooms, find their combined size and update roomBufferSize if larger
if ((u32)play->transitionActors.count != 0) {
RomFile* roomList = play->roomList.romFiles;
TransitionActorEntry* transitionActor = &play->transitionActors.list[0];