1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-03 14:34:32 +00:00

Names for some view things (#1191)

* Names for some view things

* Review: ORTHOGRAPHIC → ORTHO

* Review: dirty → dirtyFlags

* Review: Doc comment style

* Review: Define constants in terms of each other

* Review: Rename the ApplyToOverlay functions

* Update include/z64.h

Co-authored-by: fig02 <fig02srl@gmail.com>

* Review: Better View_LookAtInternal doc

* arg1 → mask

* View_LookAtInternal → View_LookAtUnsafe

* Review: View_SanityCheckEyePosition → View_ErrorCheckEyePosition

* sViewNotInitialized → sLogOnNextViewInit

* Remove VIEW_FORCE_ALL

* near/far → zNear/zFar

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* lookAt → at

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* near/far → zNear/zFar

* View_ApplyPerspective/Ortho: Remove from header instead of commenting

* lookAt → at

* Add fwd decls

* Fix external view->at accesses

* Missed these somehow

* lookAt → at

* Omit "Apply" in comments

* dirtyFlags → flags

* View_ApplyScissor → View_ApplyShrinkWindow

* Update src/code/z_view.c

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>

Co-authored-by: fig02 <fig02srl@gmail.com>
Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>
Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
This commit is contained in:
Robin Allen 2022-04-08 23:50:28 +01:00 committed by GitHub
parent b9b40805f7
commit 9984c267d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 210 additions and 170 deletions

View file

@ -1347,14 +1347,14 @@ void func_800AA178(u32);
View* View_New(GraphicsContext* gfxCtx);
void View_Free(View* view);
void View_Init(View*, GraphicsContext*);
void func_800AA358(View* view, Vec3f* eye, Vec3f* lookAt, Vec3f* up);
void func_800AA3F0(View* view, Vec3f* eye, Vec3f* lookAt, Vec3f* up);
void View_LookAt(View* view, Vec3f* eye, Vec3f* lookAt, Vec3f* up);
void View_LookAtUnsafe(View* view, Vec3f* eye, Vec3f* lookAt, Vec3f* up);
void View_SetScale(View* view, f32 scale);
void View_GetScale(View* view, f32* scale);
void func_800AA460(View* view, f32 fovy, f32 near, f32 far);
void func_800AA48C(View* view, f32* fovy, f32* near, f32* far);
void func_800AA4A8(View* view, f32 fovy, f32 near, f32 far);
void func_800AA4E0(View* view, f32* fovy, f32* near, f32* far);
void View_SetPerspective(View* view, f32 fovy, f32 zNear, f32 zFar);
void View_GetPerspective(View* view, f32* fovy, f32* zNear, f32* zFar);
void View_SetOrtho(View* view, f32 fovy, f32 zNear, f32 zFar);
void View_GetOrtho(View* view, f32* fovy, f32* zNear, f32* zFar);
void View_SetViewport(View* view, Viewport* viewport);
void View_GetViewport(View* view, Viewport* viewport);
void View_SetDistortionOrientation(View* view, f32 rotX, f32 rotY, f32 rotZ);
@ -1364,14 +1364,12 @@ void View_InitDistortion(View* view);
void View_ClearDistortion(View* view);
void View_SetDistortion(View* view, Vec3f orientation, Vec3f scale, f32 speed);
s32 View_StepDistortion(View* view, Mtx* projectionMtx);
void func_800AAA50(View* view, s32 arg1);
s32 func_800AAA9C(View* view);
s32 func_800AB0A8(View* view);
s32 func_800AB2C4(View* view);
s32 func_800AB560(View* view);
s32 func_800AB944(View* view);
s32 func_800AB9EC(View* view, s32 arg1, Gfx** p);
s32 func_800ABE74(f32 eyeX, f32 eyeY, f32 eyeZ);
void View_Apply(View* view, s32 mask);
s32 View_ApplyOrthoToOverlay(View* view);
s32 View_ApplyPerspectiveToOverlay(View* view);
s32 View_UpdateViewingMatrix(View* view);
s32 View_ApplyTo(View* view, s32 mask, Gfx** p);
s32 View_ErrorCheckEyePosition(f32 eyeX, f32 eyeY, f32 eyeZ);
void ViMode_LogPrint(OSViMode* viMode);
void ViMode_Configure(ViMode* viMode, s32 mode, s32 type, s32 unk_70, s32 unk_74, s32 unk_78, s32 unk_7C, s32 width,
s32 height, s32 unk_left, s32 unk_right, s32 unk_top, s32 unk_bottom);

View file

@ -171,7 +171,7 @@ typedef struct {
/* 0x0020 */ f32 zFar; // distance to far clipping plane
/* 0x0024 */ f32 scale; // scale for matrix elements
/* 0x0028 */ Vec3f eye;
/* 0x0034 */ Vec3f lookAt;
/* 0x0034 */ Vec3f at;
/* 0x0040 */ Vec3f up;
/* 0x0050 */ Vp vp;
/* 0x0060 */ Mtx projection;
@ -188,6 +188,17 @@ typedef struct {
/* 0x0124 */ s32 unk_124;
} View; // size = 0x128
#define VIEW_VIEWING (1 << 0)
#define VIEW_VIEWPORT (1 << 1)
#define VIEW_PROJECTION_PERSPECTIVE (1 << 2)
#define VIEW_PROJECTION_ORTHO (1 << 3)
#define VIEW_ALL (VIEW_VIEWING | VIEW_VIEWPORT | VIEW_PROJECTION_PERSPECTIVE | VIEW_PROJECTION_ORTHO)
#define VIEW_FORCE_VIEWING (VIEW_VIEWING << 4)
#define VIEW_FORCE_VIEWPORT (VIEW_VIEWPORT << 4)
#define VIEW_FORCE_PROJECTION_PERSPECTIVE (VIEW_PROJECTION_PERSPECTIVE << 4)
#define VIEW_FORCE_PROJECTION_ORTHO (VIEW_PROJECTION_ORTHO << 4)
typedef struct {
/* 0x00 */ u8 seqId;
/* 0x01 */ u8 natureAmbienceId;