//CGfxPostProcess - [2020-04-13 11:57:46]
#ifndef _CGFXPOSTPROCESS_H_
#define _CGFXPOSTPROCESS_H_

#include "CFTTRenderHelper.h"
#include "CFTTVector32x4.h"
#include "CFTTRenderToTexture.h"
#include "CGfxPostProcessRenderer.h"
#include "CFTTPlane32.h"
#include "CFTTMaterial.h"

/*
00188010 CGfxPostProcess::CGfxPostProcess(CGfxPostProcessSetup const&)
00188694 CGfxPostProcess::~CGfxPostProcess()
00188598 CGfxPostProcess::CalcRenderTargetSize(float,float,int &,int &)
00188600 CGfxPostProcess::SetupFullScreenQuadVerts(CFTTRenderHelper *,uint)
0018872C CGfxPostProcess::SetDOFValues(bool,float,float,bool,float)
001887E4 CGfxPostProcess::SetDOFValues(bool,float,float,float,bool)
001888C8 CGfxPostProcess::SetFogValues(bool,float,float,float,uint)
001888E2 CGfxPostProcess::SetVHSEffect(bool,CFTTVector32x4 const*)
00188924 CGfxPostProcess::SetReflectionValues(bool,CFTTPlane32 const*)
00188944 CGfxPostProcess::SetGlareValues(bool,float,float,float)
0018896C CGfxPostProcess::SetSnapshot(bool,CFTTRenderToTexture *,bool,uint)
00188980 CGfxPostProcess::PreRender(CGfxPostProcessRenderer &)
00188A90 CGfxPostProcess::PreRender_LinearDepth(CGfxPostProcessRenderer &)
00188B18 CGfxPostProcess::PreRender_Reflection(CGfxPostProcessRenderer &)
00188B70 CGfxPostProcess::PreRender_MainScene(CGfxPostProcessRenderer &)
00188D1C CGfxPostProcess::PreRender_DOFBlur(CGfxPostProcessRenderer &)
00188F44 CGfxPostProcess::PreRender_GlareEffect(CGfxPostProcessRenderer &)
001892A8 CGfxPostProcess::PreRender_TakeSnapshot(CGfxPostProcessRenderer &)
001893B8 CGfxPostProcess::Render(CGfxPostProcessRenderer &)
001896EC CGfxPostProcess::BlitMainScene(int)
001897E8 CGfxPostProcess::RenderScene(CGfxPostProcessRenderer &,bool)
00189968 CGfxPostProcess::RenderFullScreenQuad(int,uint)
001899C4 CGfxPostProcess::ReflectCamera()
00189AD8 CGfxPostProcess::GetReflectionTexture()
00189AF4 CGfxPostProcess::DebugRender()
00189AF6 CGfxPostProcess::LinearDepthMatCB_Static(ushort,CFTTMaterial *,void *)
00189B8C CGfxPostProcess::LinearDepthMatCB(ushort,CFTTMaterial *)
0018A1EC CGfxPostProcess::PPGaussianBlur(CGfxPostProcess::CRTT &,CGfxPostProcess::CRTT &,CGfxPostProcess::CRTT &,float)

0x1CC
*/

class CGfxPostProcessSetup {
public:
//float f_0;
  //float f_4;
  //int m_ifield_8;
  //uint ui_C;
  //int m_ifield_10;
  //float f_14;
  //char m_cfield_18;
  //char m_cfield_19;
  //char m_cfield_1A;
  //char m_cfield_1B;
  //char *m_pcfield_1C;
  //bool m_bfield_20;
  //bool m_bfield_21;
  //bool m_bfield_22;
  //bool m_bfield_23;
  //float f_24;
  //bool m_bfield_28;
  //bool m_bfield_29;
  //bool m_bfield_2A;
  //bool m_bfield_2B;
  //float m_ffield_2C;
  //int m_ifield_30;
  float f_0;
  float f_4;
  int m_ifield_8;
  uint eEnableDOF_C;
  int m_ifield_10;
  float f_14;
  bool bEnableDepthFog_18;
  const char *pVHSShader_1C;
  bool bEnableReflection_20;
  float f_24;
  bool bEnableGodRays_28;  //0018A92A   STRH.W          R9, [SP,#0x58+vSetup_54.bEnableGodRays_28]
  bool b_29;
  short field_2A;
  float f_2C;
  int eAntiAliasing_30;
};

class CGfxPostProcess {
public:
  class CRTT {
  public:
    CFTTRenderToTexture *m_prenderToTexture_0;
    CFTTTexture *m_texture_4;

    int m_iwidth_8;
    int m_iheight_C;
    uchar m_ucfield_10;
  };  //sizeof 0x14

  CGfxPostProcess(CGfxPostProcessSetup const &);                //00188010
  ~CGfxPostProcess();                                           //00188694
  void CalcRenderTargetSize(float, float, int &, int &) const;  //00188598
  void SetupFullScreenQuadVerts(CFTTRenderHelper *, uint);      //00188600
  void SetDOFValues(bool, float, float, bool, float);           //0018872C
  void SetDOFValues(bool, float, float, float, bool);           //001887E4
  void SetFogValues(bool, float, float, float, uint);           //001888C8
  void SetVHSEffect(bool, CFTTVector32x4 const *);              //001888E2
  void SetReflectionValues(bool, CFTTPlane32 const *);          //00188924
  void SetGlareValues(bool, float, float, float);               //00188944
  void SetSnapshot(bool, CFTTRenderToTexture *, bool, uint);    //0018896C
  void PreRender(CGfxPostProcessRenderer &);                    //00188980
  void PreRender_LinearDepth(CGfxPostProcessRenderer &);        //00188A90
  void PreRender_Reflection(CGfxPostProcessRenderer &);         //00188B18
  void PreRender_MainScene(CGfxPostProcessRenderer &);          //00188B70
  void PreRender_DOFBlur(CGfxPostProcessRenderer &);            //00188D1C
  void PreRender_GlareEffect(CGfxPostProcessRenderer &);        //00188F44
  void PreRender_TakeSnapshot(CGfxPostProcessRenderer &);       //001892A8
  void Render(CGfxPostProcessRenderer &);                       //001893B8
  void BlitMainScene(int);                                      //001896EC
  void RenderScene(CGfxPostProcessRenderer &, bool);            //001897E8
  void RenderFullScreenQuad(int, uint);                         //00189968
  void ReflectCamera();                                         //001899C4
  CFTTTexture *GetReflectionTexture();                          //00189AD8
  void DebugRender(void);                                       //00189AF4
  static ushort LinearDepthMatCB_Static(ushort, CFTTMaterial *,
                                        void *);  //00189AF6
  ushort LinearDepthMatCB(ushort,
                          CFTTMaterial *);  //00189B8C

  void PPGaussianBlur(CGfxPostProcess::CRTT &,
                      CGfxPostProcess::CRTT &,
                      CGfxPostProcess::CRTT &,
                      float);  //0018A1EC
//class CGfxPostProcessSetup {
//public:
// float field_0;
// float field_4;
// int field_8;
// int eEnableDOF_C;
// int field_10;
// float field_14;
// bool bEnableDepthFog_18;
// const char *pVHSShader_1C;
// bool bEnableReflection_20;
// float field_24;
// bool bEnableGodRays_28;  //0018A92A   STRH.W          R9, [SP,#0x58+vSetup_54.bEnableGodRays_28]
// bool bUnuse_29;
// int field_29;
// float field_2C;
// int eAntiAliasing_30;
//};

  CGfxPostProcessSetup m_gfxPostProcessSetup;
  CRTT m_rttfield_34[10];  //sizeof  0x14
  CFTTRenderHelper *m_prenderHelper_FC[2];
  int m_ifield_104;
  int m_ifield_108;
  int m_ifield_10C;
  float m_fNearPlane_110;
  float m_fFarPlane_114;
  int m_ifield_118;
  int m_ifield_11C;
  int m_ifield_120;
  int m_ifield_124;
  int m_ifield_128;
  int m_ifield_12C;
  int m_ifield_130;
  int m_ifield_134;
  int m_ifield_138;
  int m_ifield_13C;
  bool m_bfield_140;
  bool m_bfield_141;
  //ushort m_usfiled_140;
  bool m_bfield_142;
  bool m_bfield_143;
  CFTTVector32 m_vector32_144;
  bool m_bfield_150;
  int8 m_i8field_151;
  bool m_bfield_152;
  bool m_bfield_153;
  float m_ffield_154;
  float m_ffield_158;
  float m_ffield_15C;
  float m_ffield_160;
  int8 m_i8field_164;
  bool m_bfield_165;
  bool m_bfield_166;
  bool m_bfield_167;
  float m_ffield_168;
  float m_ffield_16C;
  float m_ffield_170;
  uint m_ufield_174;
  bool m_bfield_178;
  bool m_bfield_179;
  bool m_bfield_17A;
  bool m_bfield_17B;
  uint m_uRGB_17C;
  CFTTRenderToTexture *pRenderToTexture_180;
  uchar m_ucfield_184;
  uchar m_ucfield_185;
  uchar m_ucfield_186;
  uchar m_ucfield_187;
  CFTTVector32x4 tVector32x4_188; //??? 会是数组吗?
  CFTTVector32x4 tVector32x4_198;
  CFTTVector32x4 tVector32x4_1A8;
  bool b_1B8;
  bool b_1B9;
  bool b_1BA;
  bool b_1BB;
  CFTTPlane32 tPlane32_1BC;
};

//extern CGfxPostProcess *GFXRENDER_pPostProcess;  //0045FD80

#endif  //_CGFXPOSTPROCESS_H_