Rename "Quake2" -> "Distortion" (#588)

* rename `quake2` -> `distortion`

* Small touch-up

* cleanup and better spacing

* PR Feedback from OoT

* missed a small thing

* Name `billboardMtx` using better knowledge of sys_matrix functions thanks to `z_view`

* Add documentation to `SurfaceType_GetConveyorType`

* Cleanup Conveyor Type docs

* update cycle to phase
This commit is contained in:
engineer124
2022-01-30 17:55:42 -03:00
committed by GitHub
parent 50a9df7804
commit bc7249960d
10 changed files with 319 additions and 261 deletions
+16 -16
View File
@@ -944,7 +944,7 @@ u32 SurfaceType_GetEcho(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId)
u32 SurfaceType_IsHookshotSurface(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId);
s32 SurfaceType_IsIgnoredByEntities(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId);
s32 SurfaceType_IsIgnoredByProjectiles(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId);
s32 SurfaceType_IsConveyor(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId);
s32 SurfaceType_GetConveyorType(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId);
s32 func_800C9DDC(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId);
u32 SurfaceType_GetConveyorSpeed(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId);
u32 SurfaceType_GetConveyorDirection(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId);
@@ -2150,14 +2150,14 @@ void Quake_Init(void);
s16 Quake_Add(Camera* camera, u32 callbackIdx);
u32 Quake_RemoveFromIdx(s16 idx);
s16 Quake_Calc(Camera* camera, QuakeCamCalc* camData);
void Quake2_Init(GlobalContext* globalCtx);
void Quake2_SetCountdown(s16 countdown);
s16 Quake2_GetCountdown(void);
s16 Quake2_GetType(void);
void Quake2_SetType(s32 type);
void Quake2_ClearType(s32 type);
s32 Quake2_GetFloorQuake(Player* player);
void Quake2_Update(void);
void Distortion_Init(GlobalContext* globalCtx);
void Distortion_SetCountdown(s16 countdown);
s16 Distortion_GetCountdown(void);
s16 Distortion_GetType(void);
void Distortion_SetType(s32 type);
void Distortion_ClearType(s32 type);
s32 Distortion_GetUnderwaterCurrentSpeed(Player* player);
void Distortion_Update(void);
s32 Quake_NumActiveQuakes(void);
Gfx* Gfx_SetFog(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 n, s32 f);
Gfx* Gfx_SetFogWithSync(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 n, s32 f);
@@ -2581,13 +2581,13 @@ void View_GetViewport(View* view, Viewport* viewport);
void View_WriteScissor(Gfx** gfx, s32 ulx, s32 uly, s32 lrx, s32 lry);
void View_SyncAndWriteScissor(View* view, Gfx** gfx);
void View_SetScissorForLetterbox(View* view);
s32 View_SetQuakeRotation(View* view, f32 x, f32 y, f32 z);
s32 View_SetQuakeScale(View* view, f32 x, f32 y, f32 z);
s32 View_SetQuakeSpeed(View* view, f32 speed);
s32 View_InitCameraQuake(View* view);
s32 View_ClearQuake(View* view);
s32 View_SetQuake(View* view, Vec3f rot, Vec3f scale, f32 speed);
s32 View_StepQuake(View* view, Mtx* matrix);
s32 View_SetDistortionDirRot(View* view, f32 dirRotX, f32 dirRotY, f32 dirRotZ);
s32 View_SetDistortionScale(View* view, f32 scaleX, f32 scaleY, f32 scaleZ);
s32 View_SetDistortionSpeed(View* view, f32 speed);
s32 View_InitDistortion(View* view);
s32 View_ClearDistortion(View* view);
s32 View_SetDistortion(View* view, Vec3f dirRot, Vec3f scale, f32 speed);
s32 View_StepDistortion(View* view, Mtx* projectionMtx);
void View_RenderView(View* view, s32 uParm2);
s32 View_RenderToPerspectiveMatrix(View* view);
s32 View_RenderToOrthographicMatrix(View* view);
+11 -12
View File
@@ -494,13 +494,12 @@ typedef struct {
/* 0x0E0 */ Mtx unkE0;
/* 0x120 */ Mtx* projectionPtr;
/* 0x124 */ Mtx* viewingPtr;
/* 0x128 */ Vec3f quakeRot;
/* 0x134 */ Vec3f quakeScale;
/* 0x140 */ f32 quakeSpeed;
/* 0x144 */ Vec3f currQuakeRot;
/* 0x150 */ Vec3f currQuakeScale;
/* 0x128 */ Vec3f distortionDirRot;
/* 0x134 */ Vec3f distortionScale;
/* 0x140 */ f32 distortionSpeed;
/* 0x144 */ Vec3f curDistortionDirRot;
/* 0x150 */ Vec3f curDistortionScale;
/* 0x15C */ u16 normal;
/* 0x15E */ UNK_TYPE1 pad15E[0x2];
/* 0x160 */ u32 flags; // bit 3: Render to an orthographic perspective
/* 0x164 */ UNK_TYPE4 unk164;
} View; // size = 0x168
@@ -1124,13 +1123,13 @@ typedef struct {
/* 0x4 */ s32 type; // bitfield, highest set bit determines type
/* 0x8 */ s16 countdown;
/* 0xA */ s16 state;
} Quake2Context; // size = 0xC
} DistortionContext; // size = 0xC
typedef enum {
QUAKE2_INACTIVE,
QUAKE2_ACTIVE,
QUAKE2_SETUP,
} Quake2State;
/* 0 */ DISTORTION_INACTIVE,
/* 1 */ DISTORTION_ACTIVE,
/* 2 */ DISTORTION_SETUP,
} DistortionState;
typedef struct {
/* 0x000 */ u8 controllers; // bit 0 is set if controller 1 is plugged in, etc.
@@ -1310,7 +1309,7 @@ struct GlobalContext {
/* 0x187B0 */ MtxF viewProjectionMtxF;
/* 0x187F0 */ Vec3f unk_187F0;
/* 0x187FC */ MtxF billboardMtxF;
/* 0x1883C */ Mtx* unk_1883C;
/* 0x1883C */ Mtx* billboardMtx;
/* 0x18840 */ u32 gameplayFrames;
/* 0x18844 */ u8 unk_18844;
/* 0x18845 */ u8 unk_18845;
+5
View File
@@ -56,6 +56,11 @@ struct DynaPolyActor;
// CollisionContext flags
#define BGCHECK_FLAG_REVERSE_CONVEYOR_FLOW 1
typedef enum {
/* 0 */ CONVEYOR_WATER,
/* 1 */ CONVEYOR_FLOOR
} ConveyorType;
typedef struct {
/* 0x0 */ Vec3s pos;
} BgVertex; // size = 0x6