From 84204471a51f4bd0a4f89619d2dbdb5b59e21be7 Mon Sep 17 00:00:00 2001 From: aap Date: Fri, 31 May 2019 11:44:43 +0200 Subject: more high level functions --- src/Camera.cpp | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'src/Camera.cpp') diff --git a/src/Camera.cpp b/src/Camera.cpp index ed3a474c..fe96f574 100644 --- a/src/Camera.cpp +++ b/src/Camera.cpp @@ -8,6 +8,7 @@ #include "General.h" #include "CullZones.h" #include "SurfaceTable.h" +#include "MBlur.h" #include "Camera.h" const float DefaultFOV = 80.0f; // actually 70.0f @@ -72,6 +73,16 @@ WRAPPER void CCamera::Fade(float timeout, int16 direction) { EAXJMP(0x46B3A0); } WRAPPER void CCamera::ProcessFade(void) { EAXJMP(0x46F080); } WRAPPER void CCamera::ProcessMusicFade(void) { EAXJMP(0x46F1E0); } +int +CCamera::GetScreenFadeStatus(void) +{ + if(m_fFLOATingFade == 0.0f) + return FADE_0; + if(m_fFLOATingFade == 255.0f) + return FADE_2; + return FADE_1; +} + void CCamera::SetFadeColour(uint8 r, uint8 g, uint8 b) { @@ -81,6 +92,34 @@ CCamera::SetFadeColour(uint8 r, uint8 g, uint8 b) CDraw::FadeBlue = b; } +void +CCamera::SetMotionBlur(int r, int g, int b, int a, int type) +{ + m_BlurRed = r; + m_BlurGreen = g; + m_BlurBlue = b; + m_motionBlur = a; + m_BlurType = type; +} + +void +CCamera::SetMotionBlurAlpha(int a) +{ + m_imotionBlurAddAlpha = a; +} + +void +CCamera::RenderMotionBlur(void) +{ + if(m_BlurType == 0) + return; + + CMBlur::MotionBlurRender(m_pRwCamera, + m_BlurRed, m_BlurGreen, m_BlurBlue, + m_motionBlur, m_BlurType, m_imotionBlurAddAlpha); +} + + /* * * CCam @@ -1202,6 +1241,10 @@ STARTPATCHES InjectHook(0x42C760, &CCamera::IsSphereVisible, PATCH_JUMP); InjectHook(0x46FD00, &CCamera::SetFadeColour, PATCH_JUMP); + InjectHook(0x46FD40, &CCamera::SetMotionBlur, PATCH_JUMP); + InjectHook(0x46FD80, &CCamera::SetMotionBlurAlpha, PATCH_JUMP); + InjectHook(0x46F940, &CCamera::RenderMotionBlur, PATCH_JUMP); + InjectHook(0x456F40, WellBufferMe, PATCH_JUMP); InjectHook(0x4582F0, &CCam::GetVectorsReadyForRW, PATCH_JUMP); InjectHook(0x457710, &CCam::DoAverageOnVector, PATCH_JUMP); -- cgit v1.2.3