mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-22 14:23:44 -07:00
Camera resets to Auto when going through doors or changing maps
This commit is contained in:
parent
15d69c598e
commit
b45f7cc3d4
3 changed files with 14 additions and 10 deletions
|
@ -5,6 +5,10 @@
|
||||||
|
|
||||||
struct Player;
|
struct Player;
|
||||||
|
|
||||||
|
bool manualCamera;
|
||||||
|
f32 camX;
|
||||||
|
f32 camY;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
/* 0 */ PLAYER_SWORD_NONE,
|
/* 0 */ PLAYER_SWORD_NONE,
|
||||||
/* 1 */ PLAYER_SWORD_KOKIRI,
|
/* 1 */ PLAYER_SWORD_KOKIRI,
|
||||||
|
|
|
@ -1410,10 +1410,6 @@ s32 Camera_Noop(Camera* camera) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool manualCamera;
|
|
||||||
f32 camX;
|
|
||||||
f32 camY;
|
|
||||||
|
|
||||||
s32 SetCameraManual(Camera* camera) {
|
s32 SetCameraManual(Camera* camera) {
|
||||||
f32 newCamX = -D_8015BD7C->state.input[0].cur.cam_x;
|
f32 newCamX = -D_8015BD7C->state.input[0].cur.cam_x;
|
||||||
f32 newCamY = D_8015BD7C->state.input[0].cur.cam_y;
|
f32 newCamY = D_8015BD7C->state.input[0].cur.cam_y;
|
||||||
|
@ -1441,6 +1437,7 @@ s32 Camera_Free(Camera* camera) {
|
||||||
f32 playerHeight = Player_GetHeight(camera->player);
|
f32 playerHeight = Player_GetHeight(camera->player);
|
||||||
f32 sp94;
|
f32 sp94;
|
||||||
CamColChk camBgChk;
|
CamColChk camBgChk;
|
||||||
|
PosRot* playerPosRot = &camera->playerPosRot;
|
||||||
Vec3f at;
|
Vec3f at;
|
||||||
|
|
||||||
sCameraInterfaceFlags = norm1->interfaceFlags;
|
sCameraInterfaceFlags = norm1->interfaceFlags;
|
||||||
|
@ -1475,14 +1472,14 @@ s32 Camera_Free(Camera* camera) {
|
||||||
VecSph eyeAdjustment;
|
VecSph eyeAdjustment;
|
||||||
const f32 camSpeed = 0.5f;
|
const f32 camSpeed = 0.5f;
|
||||||
|
|
||||||
camera->animState = 1;
|
camera->animState = 0;
|
||||||
|
|
||||||
at.x = Camera_LERPCeilF(camera->player->actor.world.pos.x, camera->at.x, camSpeed, 1.0f);
|
at.x = Camera_LERPCeilF(camera->player->actor.world.pos.x, camera->at.x, camSpeed, 1.0f);
|
||||||
at.y = Camera_LERPCeilF(camera->player->actor.world.pos.y + (camera->player->rideActor != NULL
|
at.y = Camera_LERPCeilF(camera->player->actor.world.pos.y + (camera->player->rideActor != NULL
|
||||||
? Player_GetHeight(camera->player) / 2
|
? Player_GetHeight(camera->player) / 2
|
||||||
: Player_GetHeight(camera->player)) / 1.2f,
|
: Player_GetHeight(camera->player)) /
|
||||||
camera->at.y,
|
1.2f,
|
||||||
camSpeed, 1.0f);
|
camera->at.y, camSpeed, 1.0f);
|
||||||
at.z = Camera_LERPCeilF(camera->player->actor.world.pos.z, camera->at.z, camSpeed, 1.0f);
|
at.z = Camera_LERPCeilF(camera->player->actor.world.pos.z, camera->at.z, camSpeed, 1.0f);
|
||||||
|
|
||||||
OLib_Vec3fDiffToVecSphGeo(&eyeAdjustment, &at, &camera->eye);
|
OLib_Vec3fDiffToVecSphGeo(&eyeAdjustment, &at, &camera->eye);
|
||||||
|
@ -1496,8 +1493,7 @@ s32 Camera_Free(Camera* camera) {
|
||||||
|
|
||||||
if (rad > 150) {
|
if (rad > 150) {
|
||||||
camera->dist = eyeAdjustment.r = Camera_LERPCeilF(150.0f, camera->dist, camSpeed / 4, 1.0f);
|
camera->dist = eyeAdjustment.r = Camera_LERPCeilF(150.0f, camera->dist, camSpeed / 4, 1.0f);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
camera->dist = eyeAdjustment.r = rad;
|
camera->dist = eyeAdjustment.r = rad;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -446,6 +446,10 @@ void Gameplay_Update(GlobalContext* globalCtx) {
|
||||||
ActorOverlayTable_LogPrint();
|
ActorOverlayTable_LogPrint();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CVar_GetS32("gFreeCamera", 0) && Player_InCsMode(globalCtx)) {
|
||||||
|
manualCamera = false;
|
||||||
|
}
|
||||||
|
|
||||||
gSegments[4] = VIRTUAL_TO_PHYSICAL(globalCtx->objectCtx.status[globalCtx->objectCtx.mainKeepIndex].segment);
|
gSegments[4] = VIRTUAL_TO_PHYSICAL(globalCtx->objectCtx.status[globalCtx->objectCtx.mainKeepIndex].segment);
|
||||||
gSegments[5] = VIRTUAL_TO_PHYSICAL(globalCtx->objectCtx.status[globalCtx->objectCtx.subKeepIndex].segment);
|
gSegments[5] = VIRTUAL_TO_PHYSICAL(globalCtx->objectCtx.status[globalCtx->objectCtx.subKeepIndex].segment);
|
||||||
gSegments[2] = VIRTUAL_TO_PHYSICAL(globalCtx->sceneSegment);
|
gSegments[2] = VIRTUAL_TO_PHYSICAL(globalCtx->sceneSegment);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue