1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-12 10:54:44 +00:00

Camera Flags (#1225)

* Generic Camera Flags

* New flag names

* Add flags to functions

* Finish flag docs

* More docs

* More cleanup

* More clarity

* Better shrinkwindow flag docs

* Improve name

* CAM_INTERFACE_FLAGS

* Better approach to edge cases

* Change ordering for consistency

* Oops

* Add masks to macro

* PR/Discord discussions

* cleanup comment

* Oops

* PR Suggestions

* More PR Feedback

* More PR Suggestions

* PR Suggestions

* More flag style change

* Small cleanup

* sync names with other PRs

* more fixes

* fix comments

* update with hud visibility mode docs

* missed one

* fix comments

* Roman PR Suggestions

* interfaceField

* small fix

* letterbox cleanup

* fix macro arg

* fix func declaration
This commit is contained in:
engineer124 2022-12-04 23:02:24 -05:00 committed by GitHub
parent da2e8a8f2c
commit 8ff58118b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 1091 additions and 673 deletions

View file

@ -255,7 +255,8 @@ void Play_Init(GameState* thisx) {
this->cameraPtrs[CAM_ID_MAIN] = &this->mainCamera;
this->cameraPtrs[CAM_ID_MAIN]->uid = 0;
this->activeCamId = CAM_ID_MAIN;
func_8005AC48(&this->mainCamera, 0xFF);
Camera_OverwriteStateFlags(&this->mainCamera, CAM_STATE_0 | CAM_STATE_1 | CAM_STATE_2 | CAM_STATE_3 | CAM_STATE_4 |
CAM_STATE_5 | CAM_STATE_6 | CAM_STATE_7);
Sram_Init(this, &this->sramCtx);
Regs_InitData(this);
Message_Init(this);
@ -1539,9 +1540,9 @@ s32 Play_CameraSetAtEye(PlayState* this, s16 camId, Vec3f* at, Vec3f* eye) {
Camera* camera = this->cameraPtrs[camIdx];
Player* player;
ret |= Camera_SetParam(camera, 1, at);
ret |= Camera_SetViewParam(camera, CAM_VIEW_AT, at);
ret <<= 1;
ret |= Camera_SetParam(camera, 2, eye);
ret |= Camera_SetViewParam(camera, CAM_VIEW_EYE, eye);
camera->dist = Math3D_Vec3f_DistXYZ(at, eye);
@ -1565,11 +1566,11 @@ s32 Play_CameraSetAtEyeUp(PlayState* this, s16 camId, Vec3f* at, Vec3f* eye, Vec
Camera* camera = this->cameraPtrs[camIdx];
Player* player;
ret |= Camera_SetParam(camera, 1, at);
ret |= Camera_SetViewParam(camera, CAM_VIEW_AT, at);
ret <<= 1;
ret |= Camera_SetParam(camera, 2, eye);
ret |= Camera_SetViewParam(camera, CAM_VIEW_EYE, eye);
ret <<= 1;
ret |= Camera_SetParam(camera, 4, up);
ret |= Camera_SetViewParam(camera, CAM_VIEW_UP, up);
camera->dist = Math3D_Vec3f_DistXYZ(at, eye);
@ -1588,7 +1589,7 @@ s32 Play_CameraSetAtEyeUp(PlayState* this, s16 camId, Vec3f* at, Vec3f* eye, Vec
}
s32 Play_CameraSetFov(PlayState* this, s16 camId, f32 fov) {
s32 ret = Camera_SetParam(this->cameraPtrs[camId], 0x20, &fov) & 1;
s32 ret = Camera_SetViewParam(this->cameraPtrs[camId], CAM_VIEW_FOV, &fov) & 1;
if (1) {}
return ret;