mirror of
https://github.com/HarbourMasters/Shipwright
synced 2026-08-31 10:10:45 -04:00
Apply clang-format to files (#5273)
This commit is contained in:
+35
-32
@@ -493,8 +493,7 @@ Vec3s* Camera_GetCamBgDataUnderPlayer(Camera* camera, u16* dataCnt) {
|
||||
|
||||
Actor_GetWorldPosShapeRot(&playerPosShape, &camera->player->actor);
|
||||
playerPosShape.pos.y += Player_GetHeight(camera->player);
|
||||
if (BgCheck_EntityRaycastFloor3(&camera->play->colCtx, &floorPoly, &bgId, &playerPosShape.pos) ==
|
||||
BGCHECK_Y_MIN) {
|
||||
if (BgCheck_EntityRaycastFloor3(&camera->play->colCtx, &floorPoly, &bgId, &playerPosShape.pos) == BGCHECK_Y_MIN) {
|
||||
// no floor
|
||||
return NULL;
|
||||
}
|
||||
@@ -516,8 +515,8 @@ s32 Camera_GetWaterBoxDataIdx(Camera* camera, f32* waterY) {
|
||||
Actor_GetWorldPosShapeRot(&playerPosShape, &camera->player->actor);
|
||||
*waterY = playerPosShape.pos.y;
|
||||
|
||||
if (!WaterBox_GetSurface1(camera->play, &camera->play->colCtx, playerPosShape.pos.x, playerPosShape.pos.z,
|
||||
waterY, &waterBox)) {
|
||||
if (!WaterBox_GetSurface1(camera->play, &camera->play->colCtx, playerPosShape.pos.x, playerPosShape.pos.z, waterY,
|
||||
&waterBox)) {
|
||||
// player's position is not in a water box.
|
||||
*waterY = BGCHECK_Y_MIN;
|
||||
return -1;
|
||||
@@ -551,8 +550,7 @@ f32 Camera_GetWaterSurface(Camera* camera, Vec3f* chkPos, s32* envProp) {
|
||||
Actor_GetWorldPosShapeRot(&playerPosRot, &camera->player->actor);
|
||||
waterY = playerPosRot.pos.y;
|
||||
|
||||
if (!WaterBox_GetSurface1(camera->play, &camera->play->colCtx, chkPos->x, chkPos->z, &waterY,
|
||||
&waterBox)) {
|
||||
if (!WaterBox_GetSurface1(camera->play, &camera->play->colCtx, chkPos->x, chkPos->z, &waterY, &waterBox)) {
|
||||
// chkPos is not within the x/z boundaries of a water box.
|
||||
return BGCHECK_Y_MIN;
|
||||
}
|
||||
@@ -574,9 +572,9 @@ s16 Camera_XZAngle(Vec3f* to, Vec3f* from) {
|
||||
return DEGF_TO_BINANG(RADF_TO_DEGF(Math_FAtan2F(from->x - to->x, from->z - to->z)));
|
||||
}
|
||||
|
||||
f32 D_8015CE50;
|
||||
f32 D_8015CE54;
|
||||
CamColChk D_8015CE58;
|
||||
f32 D_8015CE50;
|
||||
f32 D_8015CE54;
|
||||
CamColChk D_8015CE58;
|
||||
s16 func_80044ADC(Camera* camera, s16 yaw, s16 arg2) {
|
||||
Vec3f playerPos;
|
||||
Vec3f rotatedPos;
|
||||
@@ -1317,7 +1315,7 @@ s16 Camera_CalcDefaultYaw(Camera* camera, s16 cur, s16 target, f32 arg3, f32 acc
|
||||
return cur + (s16)(angDelta * velocity * velFactor * yawUpdRate);
|
||||
}
|
||||
|
||||
//Follow player with collision
|
||||
// Follow player with collision
|
||||
void func_80046E20(Camera* camera, VecSph* eyeAdjustment, f32 minDist, f32 arg3, f32* arg4, SwingAnimation* anim) {
|
||||
static CamColChk atEyeColChk;
|
||||
static CamColChk eyeAtColChk;
|
||||
@@ -1499,7 +1497,10 @@ s32 Camera_Free(Camera* camera) {
|
||||
newCamX *= (CVarGetFloat(CVAR_SETTING("FreeLook.CameraSensitivity.X"), 1.0f));
|
||||
newCamY *= (CVarGetFloat(CVAR_SETTING("FreeLook.CameraSensitivity.Y"), 1.0f));
|
||||
|
||||
bool invertXAxis = (CVarGetInteger(CVAR_SETTING("FreeLook.InvertXAxis"), 0) && !CVarGetInteger(CVAR_ENHANCEMENT("MirroredWorld"), 0)) || (!CVarGetInteger(CVAR_SETTING("FreeLook.InvertXAxis"), 0) && CVarGetInteger(CVAR_ENHANCEMENT("MirroredWorld"), 0));
|
||||
bool invertXAxis = (CVarGetInteger(CVAR_SETTING("FreeLook.InvertXAxis"), 0) &&
|
||||
!CVarGetInteger(CVAR_ENHANCEMENT("MirroredWorld"), 0)) ||
|
||||
(!CVarGetInteger(CVAR_SETTING("FreeLook.InvertXAxis"), 0) &&
|
||||
CVarGetInteger(CVAR_ENHANCEMENT("MirroredWorld"), 0));
|
||||
|
||||
camera->play->camX += newCamX * (invertXAxis ? -1 : 1);
|
||||
camera->play->camY += newCamY * (CVarGetInteger(CVAR_SETTING("FreeLook.InvertYAxis"), 1) ? 1 : -1);
|
||||
@@ -1761,7 +1762,7 @@ s32 Camera_Normal1(Camera* camera) {
|
||||
}
|
||||
|
||||
// crit wiggle
|
||||
if(!CVarGetInteger(CVAR_ENHANCEMENT("DisableCritWiggle"),0)) {
|
||||
if (!CVarGetInteger(CVAR_ENHANCEMENT("DisableCritWiggle"), 0)) {
|
||||
if (gSaveContext.health <= 16 && ((camera->play->state.frames % 256) == 0)) {
|
||||
wiggleAdj = Rand_ZeroOne() * 10000.0f;
|
||||
camera->inputDir.y = wiggleAdj + camera->inputDir.y;
|
||||
@@ -3095,7 +3096,7 @@ s32 Camera_Battle1(Camera* camera) {
|
||||
}
|
||||
anim->roll += (((OREG(36) * camera->speedRatio) * (1.0f - distRatio)) - anim->roll) * PCT(OREG(37));
|
||||
camera->roll = DEGF_TO_BINANG(anim->roll);
|
||||
camera->fov = Camera_LERPCeilF((player->meleeWeaponState != 0 ? 0.8f
|
||||
camera->fov = Camera_LERPCeilF((player->meleeWeaponState != 0 ? 0.8f
|
||||
: gSaveContext.health <= 0x10 ? 0.8f
|
||||
: 1.0f) *
|
||||
(fov - ((fov * 0.05f) * distRatio)),
|
||||
@@ -3565,8 +3566,8 @@ s32 Camera_KeepOn3(Camera* camera) {
|
||||
Camera_Vec3fVecSphGeoAdd(&lineChkPointB, &anim->atTarget, &atToEyeAdj);
|
||||
if (!(keep3->flags & 0x80)) {
|
||||
while (i < angleCnt) {
|
||||
if (!CollisionCheck_LineOCCheck(camera->play, &camera->play->colChkCtx, &anim->atTarget,
|
||||
&lineChkPointB, colChkActors, 2) &&
|
||||
if (!CollisionCheck_LineOCCheck(camera->play, &camera->play->colChkCtx, &anim->atTarget, &lineChkPointB,
|
||||
colChkActors, 2) &&
|
||||
!Camera_BGCheck(camera, &anim->atTarget, &lineChkPointB)) {
|
||||
break;
|
||||
}
|
||||
@@ -3590,7 +3591,7 @@ s32 Camera_KeepOn3(Camera* camera) {
|
||||
at->y += (anim->atTarget.y - at->y) / anim->animTimer;
|
||||
at->z += (anim->atTarget.z - at->z) / anim->animTimer;
|
||||
// needed to match
|
||||
//if (!prevTargetPlayerDist) {}
|
||||
// if (!prevTargetPlayerDist) {}
|
||||
atToEyeAdj.r = ((anim->eyeToAtTarget.x * anim->animTimer) + atToEyeNextDir.r) + 1.0f;
|
||||
atToEyeAdj.yaw = atToEyeNextDir.yaw + (s16)(anim->eyeToAtTarget.y * anim->animTimer);
|
||||
atToEyeAdj.pitch = atToEyeNextDir.pitch + (s16)(anim->eyeToAtTarget.z * anim->animTimer);
|
||||
@@ -3848,8 +3849,8 @@ s32 Camera_KeepOn4(Camera* camera) {
|
||||
if (!(keep4->unk_1C & 1)) {
|
||||
angleCnt = ARRAY_COUNT(D_8011D3B0);
|
||||
for (i = 0; i < angleCnt; i++) {
|
||||
if (!CollisionCheck_LineOCCheck(camera->play, &camera->play->colChkCtx, &D_8015BD50,
|
||||
&D_8015BD70, spCC, sp9C) &&
|
||||
if (!CollisionCheck_LineOCCheck(camera->play, &camera->play->colChkCtx, &D_8015BD50, &D_8015BD70,
|
||||
spCC, sp9C) &&
|
||||
!Camera_BGCheck(camera, &D_8015BD50, &D_8015BD70)) {
|
||||
break;
|
||||
}
|
||||
@@ -4541,9 +4542,9 @@ s32 Camera_Subj4(Camera* camera) {
|
||||
}
|
||||
|
||||
anim->unk_28 = temp_f16;
|
||||
//camera->player->actor.world.pos = *eyeNext;
|
||||
//camera->player->actor.world.pos.y = camera->playerGroundY;
|
||||
//camera->player->actor.shape.rot.y = sp64.yaw;
|
||||
// camera->player->actor.world.pos = *eyeNext;
|
||||
// camera->player->actor.world.pos.y = camera->playerGroundY;
|
||||
// camera->player->actor.shape.rot.y = sp64.yaw;
|
||||
temp_f16 = ((240.0f * temp_f16) * (anim->unk_24 * 0.416667f));
|
||||
temp_a0 = temp_f16 + anim->unk_30;
|
||||
at->x = eye->x + (Math_SinS(temp_a0) * 10.0f);
|
||||
@@ -4738,7 +4739,8 @@ s32 Camera_Unique1(Camera* camera) {
|
||||
anim->timer--;
|
||||
}
|
||||
|
||||
sp8C.yaw = Camera_LERPFloorS(anim->yawTarget, eyeNextAtOffset.yaw, 0.5f, CVarGetInteger(CVAR_ENHANCEMENT("FixHangingLedgeSwingRate"), 0) ? 0xA : 0x2710);
|
||||
sp8C.yaw = Camera_LERPFloorS(anim->yawTarget, eyeNextAtOffset.yaw, 0.5f,
|
||||
CVarGetInteger(CVAR_ENHANCEMENT("FixHangingLedgeSwingRate"), 0) ? 0xA : 0x2710);
|
||||
Camera_Vec3fVecSphGeoAdd(eyeNext, at, &sp8C);
|
||||
*eye = *eyeNext;
|
||||
Camera_BGCheck(camera, at, eye);
|
||||
@@ -5249,7 +5251,8 @@ s32 Camera_Unique9(Camera* camera) {
|
||||
D_8011D3AC = anim->curKeyFrame->unk_01 & 0xF;
|
||||
} else if ((anim->curKeyFrame->unk_01 & 0xF0) == 0xC0) {
|
||||
Camera_UpdateInterface(0xF000 | ((anim->curKeyFrame->unk_01 & 0xF) << 8));
|
||||
} else if (camera->player->stateFlags1 & PLAYER_STATE1_IN_WATER && player->currentBoots != PLAYER_BOOTS_IRON) {
|
||||
} else if (camera->player->stateFlags1 & PLAYER_STATE1_IN_WATER &&
|
||||
player->currentBoots != PLAYER_BOOTS_IRON) {
|
||||
func_8002DF38(camera->play, camera->target, 8);
|
||||
osSyncPrintf("camera: demo: player demo set WAIT\n");
|
||||
} else {
|
||||
@@ -5724,8 +5727,8 @@ s32 Camera_Demo1(Camera* camera) {
|
||||
anim->curFrame = 0.0f;
|
||||
camera->animState++;
|
||||
// "absolute" : "relative"
|
||||
osSyncPrintf(VT_SGR("1") "%06u:" VT_RST " camera: spline demo: start %s \n",
|
||||
camera->play->state.frames, *relativeToPlayer == 0 ? "絶対" : "相対");
|
||||
osSyncPrintf(VT_SGR("1") "%06u:" VT_RST " camera: spline demo: start %s \n", camera->play->state.frames,
|
||||
*relativeToPlayer == 0 ? "絶対" : "相対");
|
||||
|
||||
if (PREG(93)) {
|
||||
Camera_DebugPrintSplineArray("CENTER", 5, csAtPoints);
|
||||
@@ -7051,8 +7054,7 @@ void func_80057FC4(Camera* camera) {
|
||||
camera->prevSetting = camera->setting = CAM_SET_NORMAL0;
|
||||
break;
|
||||
default:
|
||||
osSyncPrintf("camera: room type: default set etc (%d)\n",
|
||||
camera->play->roomCtx.curRoom.behaviorType1);
|
||||
osSyncPrintf("camera: room type: default set etc (%d)\n", camera->play->roomCtx.curRoom.behaviorType1);
|
||||
Camera_ChangeDoorCam(camera, NULL, -99, 0, 0, 18, 10);
|
||||
camera->prevSetting = camera->setting = CAM_SET_NORMAL0;
|
||||
camera->unk_14C |= 4;
|
||||
@@ -7468,7 +7470,7 @@ void Camera_UpdateDistortion(Camera* camera) {
|
||||
screenPlanePhase += DEGF_TO_BINANG(screenPlanePhaseStep);
|
||||
|
||||
View_SetDistortionOrientation(&camera->play->view, Math_CosS(depthPhase) * 0.0f, Math_SinS(depthPhase) * 0.0f,
|
||||
Math_SinS(screenPlanePhase) * 0.0f);
|
||||
Math_SinS(screenPlanePhase) * 0.0f);
|
||||
View_SetDistortionScale(&camera->play->view, Math_SinS(screenPlanePhase) * (xScale * scaleFactor) + 1.0f,
|
||||
Math_CosS(screenPlanePhase) * (yScale * scaleFactor) + 1.0f,
|
||||
Math_CosS(depthPhase) * (zScale * scaleFactor) + 1.0f);
|
||||
@@ -7524,8 +7526,8 @@ Vec3s Camera_Update(Camera* camera) {
|
||||
spAC = curPlayerPosRot.pos;
|
||||
spAC.y += Player_GetHeight(camera->player);
|
||||
|
||||
playerGroundY = BgCheck_EntityRaycastFloor5(camera->play, &camera->play->colCtx, &playerFloorPoly,
|
||||
&bgId, &camera->player->actor, &spAC);
|
||||
playerGroundY = BgCheck_EntityRaycastFloor5(camera->play, &camera->play->colCtx, &playerFloorPoly, &bgId,
|
||||
&camera->player->actor, &spAC);
|
||||
if (playerGroundY != BGCHECK_Y_MIN) {
|
||||
// player is above ground.
|
||||
sOOBTimer = 0;
|
||||
@@ -7631,7 +7633,8 @@ Vec3s Camera_Update(Camera* camera) {
|
||||
}
|
||||
|
||||
// enable/disable debug cam
|
||||
if (CVarGetInteger(CVAR_DEVELOPER_TOOLS("DebugEnabled"), 0) && CHECK_BTN_ALL(D_8015BD7C->state.input[2].press.button, BTN_START)) {
|
||||
if (CVarGetInteger(CVAR_DEVELOPER_TOOLS("DebugEnabled"), 0) &&
|
||||
CHECK_BTN_ALL(D_8015BD7C->state.input[2].press.button, BTN_START)) {
|
||||
gDbgCamEnabled ^= 1;
|
||||
if (gDbgCamEnabled) {
|
||||
DbgCamera_Enable(&D_8015BD80, camera);
|
||||
@@ -7947,7 +7950,7 @@ s16 Camera_ChangeSettingFlags(Camera* camera, s16 setting, s16 flags) {
|
||||
return -5;
|
||||
}
|
||||
|
||||
//modified from "==" to "<=" to not crash when "setting" is a negative value
|
||||
// modified from "==" to "<=" to not crash when "setting" is a negative value
|
||||
if (setting <= CAM_SET_NONE || setting >= CAM_SET_MAX) {
|
||||
osSyncPrintf(VT_COL(RED, WHITE) "camera: error: illegal camera set (%d) !!!!\n" VT_RST, setting);
|
||||
return -99;
|
||||
|
||||
Reference in New Issue
Block a user