summaryrefslogtreecommitdiffstats
path: root/src/extras/postfx.h
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-08-13 16:29:07 +0200
committerGitHub <noreply@github.com>2020-08-13 16:29:07 +0200
commit18647717df2153bdce6805cf9270f8b33019dd0b (patch)
treef23a40ccb7bfb37a53b8814aca20bd5758f72627 /src/extras/postfx.h
parentMerge pull request #683 from majesticCoding/miami (diff)
parentsun reflection fix (diff)
downloadre3-18647717df2153bdce6805cf9270f8b33019dd0b.tar
re3-18647717df2153bdce6805cf9270f8b33019dd0b.tar.gz
re3-18647717df2153bdce6805cf9270f8b33019dd0b.tar.bz2
re3-18647717df2153bdce6805cf9270f8b33019dd0b.tar.lz
re3-18647717df2153bdce6805cf9270f8b33019dd0b.tar.xz
re3-18647717df2153bdce6805cf9270f8b33019dd0b.tar.zst
re3-18647717df2153bdce6805cf9270f8b33019dd0b.zip
Diffstat (limited to 'src/extras/postfx.h')
-rw-r--r--src/extras/postfx.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/extras/postfx.h b/src/extras/postfx.h
new file mode 100644
index 00000000..ace2e4a8
--- /dev/null
+++ b/src/extras/postfx.h
@@ -0,0 +1,45 @@
+#pragma once
+
+#ifdef EXTENDED_COLOURFILTER
+
+class CPostFX
+{
+public:
+ enum {
+ POSTFX_OFF,
+ POSTFX_SIMPLE,
+ POSTFX_NORMAL,
+ POSTFX_MOBILE
+ };
+ static RwRaster *pFrontBuffer;
+ static RwRaster *pBackBuffer;
+ static bool bJustInitialised;
+ static int EffectSwitch;
+ static bool BlurOn; // or use CMblur for that?
+ static bool MotionBlurOn; // or use CMblur for that?
+ static float Intensity;
+
+ // smooth blur color
+ enum { NUMAVERAGE = 20 };
+ static int PrevRed[NUMAVERAGE], AvgRed;
+ static int PrevGreen[NUMAVERAGE], AvgGreen;
+ static int PrevBlue[NUMAVERAGE], AvgBlue;
+ static int PrevAlpha[NUMAVERAGE], AvgAlpha;
+ static int Next;
+ static int NumValues;
+
+ static void InitOnce(void);
+ static void Open(RwCamera *cam);
+ static void Close(void);
+ static void RenderOverlayBlur(RwCamera *cam, int32 r, int32 g, int32 b, int32 a);
+ static void RenderOverlaySniper(RwCamera *cam, int32 r, int32 g, int32 b, int32 a);
+ static void RenderOverlayShader(RwCamera *cam, int32 r, int32 g, int32 b, int32 a);
+ static void RenderMotionBlur(RwCamera *cam, uint32 blur);
+ static void Render(RwCamera *cam, uint32 red, uint32 green, uint32 blue, uint32 blur, int32 type, uint32 bluralpha);
+ static void SmoothColor(uint32 red, uint32 green, uint32 blue, uint32 alpha);
+ static bool NeedBackBuffer(void);
+ static bool NeedFrontBuffer(int32 type);
+ static bool UseBlurColours(void) { return EffectSwitch != POSTFX_SIMPLE; }
+};
+
+#endif