diff options
| author | Garrett Cox <garrettjcox@gmail.com> | 2026-08-15 08:02:20 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-15 08:02:20 -0500 |
| commit | 525c1bc62309b17513d6ea22b3f9d0ffbfc0d2ee (patch) | |
| tree | a0914c3989d54997d2cece75bcd003fd5ab4fba0 /mm/src/code | |
| parent | 5d96fd84fe4c1f67318183e860d38255b1dfe55c (diff) | |
Toggle for screen distortion (#1880)
Diffstat (limited to 'mm/src/code')
| -rw-r--r-- | mm/src/code/z_quake.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/mm/src/code/z_quake.c b/mm/src/code/z_quake.c index 3b09d08e8..64d8773c7 100644 --- a/mm/src/code/z_quake.c +++ b/mm/src/code/z_quake.c @@ -3,6 +3,8 @@ #include "z64quake.h" #include "z64view.h" +#include "2s2h/GameInteractor/GameInteractor.h" + typedef struct { /* 0x00 */ s16 index; /* 0x02 */ s16 duration; @@ -878,15 +880,17 @@ void Distortion_Update(void) { depthPhase += CAM_DEG_TO_BINANG(depthPhaseStep); screenPlanePhase += CAM_DEG_TO_BINANG(screenPlanePhaseStep); - View_SetDistortionOrientation(&sDistortionRequest.play->view, - Math_CosS(depthPhase) * (DEG_TO_RAD(rotX) * xyScaleFactor), - Math_SinS(depthPhase) * (DEG_TO_RAD(rotY) * xyScaleFactor), - Math_SinS(screenPlanePhase) * (DEG_TO_RAD(rotZ) * zScaleFactor)); - View_SetDistortionScale(&sDistortionRequest.play->view, - (Math_SinS(screenPlanePhase) * (xScale * xyScaleFactor)) + 1.0f, - (Math_CosS(screenPlanePhase) * (yScale * xyScaleFactor)) + 1.0f, - (Math_CosS(depthPhase) * (zScale * zScaleFactor)) + 1.0f); - View_SetDistortionSpeed(&sDistortionRequest.play->view, speed * speedScaleFactor); + if (GameInteractor_Should(VB_APPLY_SCREEN_DISTORTION, true, sDistortionRequest.type)) { + View_SetDistortionOrientation(&sDistortionRequest.play->view, + Math_CosS(depthPhase) * (DEG_TO_RAD(rotX) * xyScaleFactor), + Math_SinS(depthPhase) * (DEG_TO_RAD(rotY) * xyScaleFactor), + Math_SinS(screenPlanePhase) * (DEG_TO_RAD(rotZ) * zScaleFactor)); + View_SetDistortionScale(&sDistortionRequest.play->view, + (Math_SinS(screenPlanePhase) * (xScale * xyScaleFactor)) + 1.0f, + (Math_CosS(screenPlanePhase) * (yScale * xyScaleFactor)) + 1.0f, + (Math_CosS(depthPhase) * (zScale * zScaleFactor)) + 1.0f); + View_SetDistortionSpeed(&sDistortionRequest.play->view, speed * speedScaleFactor); + } sDistortionRequest.state = DISTORTION_ACTIVE; |
