mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
View & Shrink_Window Docs (#1049)
* view and shrink_window docs * cleanup * move func declaration to header * move struct to local * PR Suggestions * g to s
This commit is contained in:
@@ -2261,35 +2261,6 @@ void SkinMatrix_SetYRotation(MtxF* mf, s16 a);
|
||||
void SkinMatrix_MulYRotation(MtxF* mf, s16 a);
|
||||
void SkinMatrix_SetZRotation(MtxF* mf, s16 a);
|
||||
|
||||
void View_ViewportToVp(Vp* dest, Viewport* src);
|
||||
void View_Init(View* view, GraphicsContext* gfxCtx);
|
||||
void View_SetViewOrientation(View* view, Vec3f* eye, Vec3f* at, Vec3f* up);
|
||||
void func_8013F050(View* view, Vec3f* eye, Vec3f* at, Vec3f* up);
|
||||
void View_SetScale(View* view, f32 scale);
|
||||
void View_GetScale(View* view, f32* scale);
|
||||
void func_8013F0D0(View* view, f32 fovy, f32 zNear, f32 zFar);
|
||||
void func_8013F100(View* view, f32* fovy, f32* zNear, f32* zFar);
|
||||
void func_8013F120(View* view, f32 fovy, f32 zNear, f32 zFar);
|
||||
void func_8013F15C(View* view, f32* fovy, f32* zNear, f32* zFar);
|
||||
void View_SetViewport(View* view, Viewport* viewport);
|
||||
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_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);
|
||||
s32 func_8013FBC8(View* view);
|
||||
s32 func_8013FD74(View* view);
|
||||
s32 func_80140024(View* view);
|
||||
s32 func_801400CC(View* view, Gfx** gfxp);
|
||||
void func_80140260(OSViMode* vimode);
|
||||
// void func_8014026C(OSViMode* param_1, UNK_TYPE1 param_2, s32 param_3, s32 param_4, s32 param_5, s32 param_6, s32 param_7, s32 param_8, UNK_TYPE4 param_9, s32 param_10, s16 param_11, u32 param_12, UNK_TYPE4 param_13);
|
||||
// void func_80140730(void);
|
||||
@@ -2399,18 +2370,6 @@ void Message_FindCreditsMessage(PlayState* play, u16 textId);
|
||||
void func_8015E7EC(PlayState* play, UNK_PTR puParm2);
|
||||
// void func_8015F8A8(UNK_TYPE4 ctxt);
|
||||
|
||||
void ShrinkWindow_SetLetterboxTarget(s32 target);
|
||||
s32 ShrinkWindow_GetLetterboxTarget(void);
|
||||
void ShrinkWindow_SetLetterboxMagnitude(s32 magnitude);
|
||||
s32 ShrinkWindow_GetLetterboxMagnitude(void);
|
||||
void ShrinkWindow_SetPillarboxTarget(s32 target);
|
||||
s32 ShrinkWindow_GetPillarboxTarget(void);
|
||||
void ShrinkWindow_SetPillarboxMagnitude(s32 magnitude);
|
||||
s32 ShrinkWindow_GetPillarboxMagnitude(void);
|
||||
void ShrinkWindow_Init(void);
|
||||
void ShrinkWindow_Destroy(void);
|
||||
void ShrinkWindow_Update(s32 framerateDivisor);
|
||||
void ShrinkWindow_Draw(GraphicsContext* gfxCtx);
|
||||
// void func_80161180(void);
|
||||
s32 func_8016119C(Camera* camera, DbCameraUnkStruct* arg1);
|
||||
// void func_8016122C(void);
|
||||
|
||||
@@ -3181,8 +3181,6 @@ extern s16 D_801F4E7A;
|
||||
// extern UNK_TYPE1 D_801F6B1E;
|
||||
// extern UNK_TYPE1 D_801F6B20;
|
||||
// extern UNK_TYPE1 D_801F6B22;
|
||||
extern ShrinkWindowContext gShrinkWindowContext;
|
||||
extern ShrinkWindowContext* gShrinkWindowContextPtr;
|
||||
// extern UNK_TYPE4 D_801F6B50;
|
||||
// extern UNK_TYPE1 D_801F6B58;
|
||||
extern void (*sKaleidoScopeUpdateFunc)(PlayState* play);
|
||||
|
||||
@@ -286,13 +286,6 @@ typedef struct {
|
||||
/* 0x10 */ OSTime resetTime;
|
||||
} NmiBuff; // size >= 0x18
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ s8 letterboxTarget;
|
||||
/* 0x1 */ s8 letterboxMagnitude;
|
||||
/* 0x2 */ s8 pillarboxTarget;
|
||||
/* 0x3 */ s8 pillarboxMagnitude;
|
||||
} ShrinkWindowContext; // size = 0x4
|
||||
|
||||
typedef void(*osCreateThread_func)(void*);
|
||||
|
||||
typedef enum {
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
#ifndef Z64SHRINK_WINDOW_H
|
||||
#define Z64SHRINK_WINDOW_H
|
||||
|
||||
#include "PR/ultratypes.h"
|
||||
|
||||
struct GraphicsContext;
|
||||
|
||||
void ShrinkWindow_Letterbox_SetSizeTarget(s32 target);
|
||||
s32 ShrinkWindow_Letterbox_GetSizeTarget(void);
|
||||
void ShrinkWindow_Letterbox_SetSize(s32 size);
|
||||
s32 ShrinkWindow_Letterbox_GetSize(void);
|
||||
|
||||
void ShrinkWindow_Pillarbox_SetSizeTarget(s32 target);
|
||||
s32 ShrinkWindow_Pillarbox_GetSizeTarget(void);
|
||||
void ShrinkWindow_Pillarbox_SetSize(s32 size);
|
||||
s32 ShrinkWindow_Pillarbox_GetSize(void);
|
||||
|
||||
void ShrinkWindow_Init(void);
|
||||
void ShrinkWindow_Destroy(void);
|
||||
void ShrinkWindow_Update(s32 framerateDivisor);
|
||||
void ShrinkWindow_Draw(GraphicsContext* gfxCtx);
|
||||
|
||||
#endif
|
||||
+38
-3
@@ -33,16 +33,27 @@ typedef struct View {
|
||||
/* 0x0E0 */ Mtx unkE0;
|
||||
/* 0x120 */ Mtx* projectionPtr;
|
||||
/* 0x124 */ Mtx* viewingPtr;
|
||||
/* 0x128 */ Vec3f distortionDirRot;
|
||||
/* 0x128 */ Vec3f distortionOrientation;
|
||||
/* 0x134 */ Vec3f distortionScale;
|
||||
/* 0x140 */ f32 distortionSpeed;
|
||||
/* 0x144 */ Vec3f curDistortionDirRot;
|
||||
/* 0x144 */ Vec3f curDistortionOrientation;
|
||||
/* 0x150 */ Vec3f curDistortionScale;
|
||||
/* 0x15C */ u16 normal; // used to normalize the projection matrix
|
||||
/* 0x15C */ u16 perspNorm; // used to normalize the projection matrix
|
||||
/* 0x160 */ u32 flags; // bit 3: Render to an orthographic perspective
|
||||
/* 0x164 */ s32 unk164;
|
||||
} View; // size = 0x168
|
||||
|
||||
#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)
|
||||
|
||||
#define SET_FULLSCREEN_VIEWPORT(view) \
|
||||
{ \
|
||||
Viewport viewport; \
|
||||
@@ -54,4 +65,28 @@ typedef struct View {
|
||||
} \
|
||||
(void)0
|
||||
|
||||
void View_Init(View* view, struct GraphicsContext* gfxCtx);
|
||||
void View_LookAt(View* view, Vec3f* eye, Vec3f* at, Vec3f* up);
|
||||
void View_SetScale(View* view, f32 scale);
|
||||
void View_GetScale(View* view, f32* scale);
|
||||
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);
|
||||
|
||||
s32 View_SetDistortionOrientation(View* view, f32 rotX, f32 rotY, f32 rotZ);
|
||||
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 orientation, Vec3f scale, f32 speed);
|
||||
|
||||
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, Gfx** gfxp);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "global.h"
|
||||
#include "z64view.h"
|
||||
#include "system_malloc.h"
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/speed_meter/func_80177390.s")
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "global.h"
|
||||
#include "z64quake.h"
|
||||
#include "z64shrink_window.h"
|
||||
#include "z64view.h"
|
||||
|
||||
/**
|
||||
* Returns the absolute value for floats
|
||||
|
||||
+5
-4
@@ -1,6 +1,7 @@
|
||||
#include "global.h"
|
||||
#include "z64quake.h"
|
||||
#include "z64rumble.h"
|
||||
#include "z64shrink_window.h"
|
||||
#include "overlays/gamestates/ovl_daytelop/z_daytelop.h"
|
||||
|
||||
void Cutscene_DoNothing(PlayState* play, CutsceneContext* csCtx);
|
||||
@@ -107,7 +108,7 @@ s32 func_800EA220(PlayState* play, CutsceneContext* csCtx, f32 target) {
|
||||
|
||||
void func_800EA258(PlayState* play, CutsceneContext* csCtx) {
|
||||
Interface_SetHudVisibility(HUD_VISIBILITY_NONE);
|
||||
ShrinkWindow_SetLetterboxTarget(32);
|
||||
ShrinkWindow_Letterbox_SetSizeTarget(32);
|
||||
if (func_800EA220(play, csCtx, 1.0f)) {
|
||||
Audio_SetCutsceneFlag(true);
|
||||
csCtx->state++;
|
||||
@@ -117,7 +118,7 @@ void func_800EA258(PlayState* play, CutsceneContext* csCtx) {
|
||||
void func_800EA2B8(PlayState* play, CutsceneContext* csCtx) {
|
||||
func_800ED980(play, csCtx);
|
||||
Interface_SetHudVisibility(HUD_VISIBILITY_NONE);
|
||||
ShrinkWindow_SetLetterboxTarget(32);
|
||||
ShrinkWindow_Letterbox_SetSizeTarget(32);
|
||||
if (func_800EA220(play, csCtx, 1.0f)) {
|
||||
Audio_SetCutsceneFlag(true);
|
||||
csCtx->state++;
|
||||
@@ -1449,8 +1450,8 @@ void func_800EDA84(PlayState* play, CutsceneContext* csCtx) {
|
||||
|
||||
if (gSaveContext.cutsceneTrigger == 0) {
|
||||
Interface_SetHudVisibility(HUD_VISIBILITY_NONE);
|
||||
ShrinkWindow_SetLetterboxTarget(32);
|
||||
ShrinkWindow_SetLetterboxMagnitude(0x20);
|
||||
ShrinkWindow_Letterbox_SetSizeTarget(32);
|
||||
ShrinkWindow_Letterbox_SetSize(32);
|
||||
csCtx->state++;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "global.h"
|
||||
#include "z64shrink_window.h"
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/func_800F1460.s")
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "global.h"
|
||||
#include "z64rumble.h"
|
||||
#include "z64shrink_window.h"
|
||||
|
||||
void GameOver_Init(PlayState* play) {
|
||||
play->gameOverCtx.state = GAMEOVER_INACTIVE;
|
||||
@@ -86,7 +87,7 @@ void GameOver_Update(PlayState* play) {
|
||||
gameOverCtx->state++;
|
||||
sGameOverTimer = 0;
|
||||
Kankyo_InitGameOverLights(play);
|
||||
ShrinkWindow_SetLetterboxTarget(32);
|
||||
ShrinkWindow_Letterbox_SetSizeTarget(32);
|
||||
break;
|
||||
case GAMEOVER_REVIVE_RUMBLE:
|
||||
sGameOverTimer = 50;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "global.h"
|
||||
#include "z64shrink_window.h"
|
||||
#include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h"
|
||||
|
||||
void (*sKaleidoScopeUpdateFunc)(PlayState* play);
|
||||
@@ -36,7 +37,7 @@ void KaleidoScopeCall_Update(PlayState* play) {
|
||||
|
||||
if ((play->pauseCtx.state != 0) || (play->pauseCtx.debugEditor != DEBUG_EDITOR_NONE)) {
|
||||
if (pauseCtx->state == 1 || pauseCtx->state == 19) {
|
||||
if (ShrinkWindow_GetLetterboxMagnitude() == 0) {
|
||||
if (ShrinkWindow_Letterbox_GetSize() == 0) {
|
||||
R_PAUSE_MENU_MODE = 1;
|
||||
pauseCtx->unk_200 = 0;
|
||||
pauseCtx->unk_208 = 0;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "global.h"
|
||||
#include "z64rumble.h"
|
||||
#include "z64shrink_window.h"
|
||||
#include "z64view.h"
|
||||
#include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h"
|
||||
|
||||
s16 D_801BDB00[] = { PAUSE_MAP, PAUSE_QUEST, PAUSE_MASK, PAUSE_ITEM };
|
||||
@@ -91,8 +93,8 @@ void KaleidoSetup_Update(PlayState* play) {
|
||||
|
||||
if (pauseCtx->state == 1) {
|
||||
Game_SetFramerateDivisor(&play->state, 2);
|
||||
if (ShrinkWindow_GetLetterboxTarget() != 0) {
|
||||
ShrinkWindow_SetLetterboxTarget(0);
|
||||
if (ShrinkWindow_Letterbox_GetSizeTarget() != 0) {
|
||||
ShrinkWindow_Letterbox_SetSizeTarget(0);
|
||||
}
|
||||
func_801A3AEC(1);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
#include "global.h"
|
||||
#include "z64shrink_window.h"
|
||||
#include "z64view.h"
|
||||
#include "message_data_static.h"
|
||||
#include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h"
|
||||
|
||||
@@ -489,7 +491,7 @@ u8 Message_GetState(MessageContext* msgCtx) {
|
||||
|
||||
void func_80152C64(View* view) {
|
||||
SET_FULLSCREEN_VIEWPORT(view);
|
||||
func_8013FBC8(view);
|
||||
View_ApplyOrthoToOverlay(view);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_message/func_80152CAC.s")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "global.h"
|
||||
|
||||
#include "z64view.h"
|
||||
#include "interface/parameter_static/parameter_static.h"
|
||||
#include "interface/do_action_static/do_action_static.h"
|
||||
#include "misc/story_static/story_static.h"
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "global.h"
|
||||
#include "z64quake.h"
|
||||
#include "z64shrink_window.h"
|
||||
#include "z64view.h"
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_80165460.s")
|
||||
|
||||
|
||||
+5
-4
@@ -1,5 +1,6 @@
|
||||
#include "global.h"
|
||||
#include "z64quake.h"
|
||||
#include "z64view.h"
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s16 randIndex;
|
||||
@@ -823,10 +824,10 @@ void Distortion_Update(void) {
|
||||
depthPhase += CAM_DEG_TO_BINANG(depthPhaseStep);
|
||||
screenPlanePhase += CAM_DEG_TO_BINANG(screenPlanePhaseStep);
|
||||
|
||||
View_SetDistortionDirRot(&sDistortionRequest.play->view,
|
||||
Math_CosS(depthPhase) * (DEGF_TO_RADF(rotX) * xyScaleFactor),
|
||||
Math_SinS(depthPhase) * (DEGF_TO_RADF(rotY) * xyScaleFactor),
|
||||
Math_SinS(screenPlanePhase) * (DEGF_TO_RADF(rotZ) * zScaleFactor));
|
||||
View_SetDistortionOrientation(&sDistortionRequest.play->view,
|
||||
Math_CosS(depthPhase) * (DEGF_TO_RADF(rotX) * xyScaleFactor),
|
||||
Math_SinS(depthPhase) * (DEGF_TO_RADF(rotY) * xyScaleFactor),
|
||||
Math_SinS(screenPlanePhase) * (DEGF_TO_RADF(rotZ) * zScaleFactor));
|
||||
View_SetDistortionScale(&sDistortionRequest.play->view,
|
||||
(Math_SinS(screenPlanePhase) * (xScale * xyScaleFactor)) + 1.0f,
|
||||
(Math_CosS(screenPlanePhase) * (yScale * xyScaleFactor)) + 1.0f,
|
||||
|
||||
+50
-43
@@ -4,70 +4,78 @@
|
||||
*/
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "global.h"
|
||||
#include "z64shrink_window.h"
|
||||
|
||||
ShrinkWindowContext gShrinkWindowContext;
|
||||
ShrinkWindowContext* gShrinkWindowContextPtr;
|
||||
typedef struct {
|
||||
/* 0x0 */ s8 letterboxTarget;
|
||||
/* 0x1 */ s8 letterboxSize;
|
||||
/* 0x2 */ s8 pillarboxTarget;
|
||||
/* 0x3 */ s8 pillarboxSize;
|
||||
} ShrinkWindow; // size = 0x4
|
||||
|
||||
void ShrinkWindow_SetLetterboxTarget(s32 target) {
|
||||
gShrinkWindowContextPtr->letterboxTarget = target;
|
||||
ShrinkWindow sShrinkWindow;
|
||||
ShrinkWindow* sShrinkWindowPtr;
|
||||
|
||||
void ShrinkWindow_Letterbox_SetSizeTarget(s32 target) {
|
||||
sShrinkWindowPtr->letterboxTarget = target;
|
||||
}
|
||||
|
||||
s32 ShrinkWindow_GetLetterboxTarget(void) {
|
||||
return gShrinkWindowContextPtr->letterboxTarget;
|
||||
s32 ShrinkWindow_Letterbox_GetSizeTarget(void) {
|
||||
return sShrinkWindowPtr->letterboxTarget;
|
||||
}
|
||||
|
||||
void ShrinkWindow_SetLetterboxMagnitude(s32 magnitude) {
|
||||
gShrinkWindowContextPtr->letterboxMagnitude = magnitude;
|
||||
void ShrinkWindow_Letterbox_SetSize(s32 size) {
|
||||
sShrinkWindowPtr->letterboxSize = size;
|
||||
}
|
||||
|
||||
s32 ShrinkWindow_GetLetterboxMagnitude(void) {
|
||||
return gShrinkWindowContextPtr->letterboxMagnitude;
|
||||
s32 ShrinkWindow_Letterbox_GetSize(void) {
|
||||
return sShrinkWindowPtr->letterboxSize;
|
||||
}
|
||||
|
||||
void ShrinkWindow_SetPillarboxTarget(s32 target) {
|
||||
gShrinkWindowContextPtr->pillarboxTarget = target;
|
||||
void ShrinkWindow_Pillarbox_SetSizeTarget(s32 target) {
|
||||
sShrinkWindowPtr->pillarboxTarget = target;
|
||||
}
|
||||
|
||||
s32 ShrinkWindow_GetPillarboxTarget(void) {
|
||||
return gShrinkWindowContextPtr->pillarboxTarget;
|
||||
s32 ShrinkWindow_Pillarbox_GetSizeTarget(void) {
|
||||
return sShrinkWindowPtr->pillarboxTarget;
|
||||
}
|
||||
|
||||
void ShrinkWindow_SetPillarboxMagnitude(s32 magnitude) {
|
||||
gShrinkWindowContextPtr->pillarboxMagnitude = magnitude;
|
||||
void ShrinkWindow_Pillarbox_SetSize(s32 size) {
|
||||
sShrinkWindowPtr->pillarboxSize = size;
|
||||
}
|
||||
|
||||
s32 ShrinkWindow_GetPillarboxMagnitude(void) {
|
||||
return gShrinkWindowContextPtr->pillarboxMagnitude;
|
||||
s32 ShrinkWindow_Pillarbox_GetSize(void) {
|
||||
return sShrinkWindowPtr->pillarboxSize;
|
||||
}
|
||||
|
||||
void ShrinkWindow_Init(void) {
|
||||
gShrinkWindowContextPtr = &gShrinkWindowContext;
|
||||
bzero(gShrinkWindowContextPtr, sizeof(gShrinkWindowContext));
|
||||
sShrinkWindowPtr = &sShrinkWindow;
|
||||
bzero(sShrinkWindowPtr, sizeof(sShrinkWindow));
|
||||
}
|
||||
|
||||
void ShrinkWindow_Destroy(void) {
|
||||
gShrinkWindowContextPtr = NULL;
|
||||
sShrinkWindowPtr = NULL;
|
||||
}
|
||||
|
||||
void ShrinkWindow_Update(s32 framerateDivisor) {
|
||||
s32 step = ((framerateDivisor == 3) ? 10 : 30 / framerateDivisor);
|
||||
s32 nextMagnitude;
|
||||
s32 step = (framerateDivisor == 3) ? 10 : (30 / framerateDivisor);
|
||||
s32 nextSize;
|
||||
|
||||
nextMagnitude = gShrinkWindowContextPtr->letterboxMagnitude;
|
||||
Math_StepToIGet(&nextMagnitude, gShrinkWindowContextPtr->letterboxTarget, step);
|
||||
gShrinkWindowContextPtr->letterboxMagnitude = nextMagnitude;
|
||||
nextSize = sShrinkWindowPtr->letterboxSize;
|
||||
Math_StepToIGet(&nextSize, sShrinkWindowPtr->letterboxTarget, step);
|
||||
sShrinkWindowPtr->letterboxSize = nextSize;
|
||||
|
||||
nextMagnitude = gShrinkWindowContextPtr->pillarboxMagnitude;
|
||||
Math_StepToIGet(&nextMagnitude, gShrinkWindowContextPtr->pillarboxTarget, step);
|
||||
gShrinkWindowContextPtr->pillarboxMagnitude = nextMagnitude;
|
||||
nextSize = sShrinkWindowPtr->pillarboxSize;
|
||||
Math_StepToIGet(&nextSize, sShrinkWindowPtr->pillarboxTarget, step);
|
||||
sShrinkWindowPtr->pillarboxSize = nextSize;
|
||||
}
|
||||
|
||||
void ShrinkWindow_Draw(GraphicsContext* gfxCtx) {
|
||||
Gfx* gfx;
|
||||
s8 letterboxMagnitude = gShrinkWindowContextPtr->letterboxMagnitude;
|
||||
s8 pillarboxMagnitude = gShrinkWindowContextPtr->pillarboxMagnitude;
|
||||
s8 letterboxSize = sShrinkWindowPtr->letterboxSize;
|
||||
s8 pillarboxSize = sShrinkWindowPtr->pillarboxSize;
|
||||
|
||||
if (letterboxMagnitude > 0) {
|
||||
if (letterboxSize > 0) {
|
||||
OPEN_DISPS(gfxCtx);
|
||||
|
||||
gfx = OVERLAY_DISP;
|
||||
@@ -76,23 +84,23 @@ void ShrinkWindow_Draw(GraphicsContext* gfxCtx) {
|
||||
gDPSetCycleType(gfx++, G_CYC_FILL);
|
||||
gDPSetRenderMode(gfx++, G_RM_NOOP, G_RM_NOOP2);
|
||||
gDPSetFillColor(gfx++, (GPACK_RGBA5551(0, 0, 0, 1) << 16) | GPACK_RGBA5551(0, 0, 0, 1));
|
||||
gDPFillRectangle(gfx++, 0, 0, gScreenWidth - 1, letterboxMagnitude - 1);
|
||||
gDPFillRectangle(gfx++, 0, gScreenHeight - letterboxMagnitude, gScreenWidth - 1, gScreenHeight - 1);
|
||||
gDPFillRectangle(gfx++, 0, 0, gScreenWidth - 1, letterboxSize - 1);
|
||||
gDPFillRectangle(gfx++, 0, gScreenHeight - letterboxSize, gScreenWidth - 1, gScreenHeight - 1);
|
||||
|
||||
gDPPipeSync(gfx++);
|
||||
gDPSetCycleType(gfx++, G_CYC_1CYCLE);
|
||||
gDPSetRenderMode(gfx++, G_RM_XLU_SURF, G_RM_XLU_SURF2);
|
||||
gDPSetPrimColor(gfx++, 0, 0, 0, 0, 0, 0);
|
||||
gDPFillRectangle(gfx++, 0, letterboxMagnitude, gScreenWidth, letterboxMagnitude + 1);
|
||||
gDPFillRectangle(gfx++, 0, gScreenHeight - letterboxMagnitude - 1, gScreenWidth,
|
||||
gScreenHeight - letterboxMagnitude);
|
||||
gDPFillRectangle(gfx++, 0, letterboxSize, gScreenWidth, letterboxSize + 1);
|
||||
gDPFillRectangle(gfx++, 0, gScreenHeight - letterboxSize - 1, gScreenWidth, gScreenHeight - letterboxSize);
|
||||
|
||||
gDPPipeSync(gfx++);
|
||||
OVERLAY_DISP = gfx++;
|
||||
|
||||
CLOSE_DISPS(gfxCtx);
|
||||
}
|
||||
if (pillarboxMagnitude > 0) {
|
||||
|
||||
if (pillarboxSize > 0) {
|
||||
OPEN_DISPS(gfxCtx);
|
||||
|
||||
gfx = OVERLAY_DISP;
|
||||
@@ -102,17 +110,16 @@ void ShrinkWindow_Draw(GraphicsContext* gfxCtx) {
|
||||
gDPSetRenderMode(gfx++, G_RM_NOOP, G_RM_NOOP2);
|
||||
gDPSetFillColor(gfx++, (GPACK_RGBA5551(0, 0, 0, 1) << 16) | GPACK_RGBA5551(0, 0, 0, 1));
|
||||
|
||||
gDPFillRectangle(gfx++, 0, 0, pillarboxMagnitude - 1, gScreenHeight - 1);
|
||||
gDPFillRectangle(gfx++, gScreenWidth - pillarboxMagnitude, 0, gScreenWidth - 1, gScreenHeight - 1);
|
||||
gDPFillRectangle(gfx++, 0, 0, pillarboxSize - 1, gScreenHeight - 1);
|
||||
gDPFillRectangle(gfx++, gScreenWidth - pillarboxSize, 0, gScreenWidth - 1, gScreenHeight - 1);
|
||||
|
||||
gDPPipeSync(gfx++);
|
||||
gDPSetCycleType(gfx++, G_CYC_1CYCLE);
|
||||
gDPSetRenderMode(gfx++, G_RM_XLU_SURF, G_RM_XLU_SURF2);
|
||||
gDPSetPrimColor(gfx++, 0, 0, 0, 0, 0, 0);
|
||||
|
||||
gDPFillRectangle(gfx++, pillarboxMagnitude, 0, pillarboxMagnitude + 2, gScreenHeight);
|
||||
gDPFillRectangle(gfx++, gScreenWidth - pillarboxMagnitude - 2, 0, gScreenWidth - pillarboxMagnitude,
|
||||
gScreenHeight);
|
||||
gDPFillRectangle(gfx++, pillarboxSize, 0, pillarboxSize + 2, gScreenHeight);
|
||||
gDPFillRectangle(gfx++, gScreenWidth - pillarboxSize - 2, 0, gScreenWidth - pillarboxSize, gScreenHeight);
|
||||
|
||||
gDPPipeSync(gfx++);
|
||||
OVERLAY_DISP = gfx++;
|
||||
|
||||
+142
-105
File diff suppressed because it is too large
Load Diff
@@ -6,6 +6,7 @@
|
||||
|
||||
#include "z_boss_01.h"
|
||||
#include "z64rumble.h"
|
||||
#include "z64shrink_window.h"
|
||||
|
||||
#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_20)
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include "z_boss_02.h"
|
||||
#include "z64rumble.h"
|
||||
#include "z64shrink_window.h"
|
||||
#include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h"
|
||||
#include "overlays/actors/ovl_Item_B_Heart/z_item_b_heart.h"
|
||||
#include "objects/gameplay_keep/gameplay_keep.h"
|
||||
@@ -2033,7 +2034,7 @@ void func_809DD934(Boss02* this, PlayState* play) {
|
||||
Matrix_RotateZF(this->unk_1D54, MTXMODE_APPLY);
|
||||
Matrix_MultVecY(1.0f, &this->subCamUp);
|
||||
Play_SetCameraAtEyeUp(play, this->subCamId, &this->subCamAt, &this->subCamEye, &this->subCamUp);
|
||||
ShrinkWindow_SetLetterboxTarget(27);
|
||||
ShrinkWindow_Letterbox_SetSizeTarget(27);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2241,6 +2242,6 @@ void func_809DEAC4(Boss02* this, PlayState* play) {
|
||||
Play_SetCameraAtEyeUp(play, this->subCamId, &this->subCamAt, &subCamEye, &this->subCamUp);
|
||||
this->subCamUp.z = this->subCamUp.x = 0.0f;
|
||||
this->subCamUp.y = 1.0f;
|
||||
ShrinkWindow_SetLetterboxTarget(27);
|
||||
ShrinkWindow_Letterbox_SetSizeTarget(27);
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user