// CFTTRenderTarget - [2020-04-13 11:57:46]
#ifndef _CFTTRENDERTARGET_H_
#define _CFTTRENDERTARGET_H_

#include "CFTTRenderBuffer.h"
#include "XMATH.h"
#include "CFTTTexture.h"

/*
00221D90 CFTTRenderTarget::CFTTRenderTarget()
00221DE0 CFTTRenderTarget::Deactivate()
00202C98 CFTTRenderTarget::DeactivateCurrentTarget()
00221DE2 CFTTRenderTarget::ExtractColourBuffer()
00221DC8 CFTTRenderTarget::SetColourBuffer(int,CFTTRenderBuffer *)
00221DD0 CFTTRenderTarget::SetColourBufferMS(int,CFTTRenderBuffer *)
00221DD8 CFTTRenderTarget::SetDepthBuffer(CFTTRenderBuffer *)
00221DDC CFTTRenderTarget::SetDepthBufferMS(CFTTRenderBuffer *)
00119B64 CFTTRenderTarget::UpdateViewport(int,int,int,int,float,bool)
00221DC4 CFTTRenderTarget::~CFTTRenderTarget()
00221DC6 CFTTRenderTarget::~CFTTRenderTarget()

vptr_CFTTRenderTarget_3289CC:
  ~CFTTRenderTarget()
  ~CFTTRenderTarget()
  SetColourBuffer(int,CFTTRenderBuffer *)
  SetColourBufferMS(int,CFTTRenderBuffer *)
  SetDepthBuffer(CFTTRenderBuffer *)
  SetDepthBufferMS(CFTTRenderBuffer *)
  ApplyViewport() = 0
  Activate(bool) = 0
  Deactivate()
  ExtractColourBuffer()
*/

enum EFTTTextureTarget {
  EFTTTextureTarget_0,
  EFTTTextureTarget_1,
  EFTTTextureTarget_2,
  EFTTTextureTarget_3,
  EFTTTextureTarget_4,
  EFTTTextureTarget_5,
  EFTTTextureTarget_6
};

class CFTTRenderTarget {
public:
  CFTTRenderTarget();                                       // 00221D90
  virtual ~CFTTRenderTarget();                              // 00221DC4 00221DC6
  virtual void SetColourBuffer(int, CFTTRenderBuffer *);    // 00221DC8
  virtual void SetColourBufferMS(int, CFTTRenderBuffer *);  // 00221DD0
  virtual void SetDepthBuffer(CFTTRenderBuffer *);          // 00221DD8
  virtual void SetDepthBufferMS(CFTTRenderBuffer *);        // 00221DDC
  virtual void ApplyViewport() = 0;
  virtual void Activate(bool b) = 0;
  virtual void Deactivate();                             // 00221DE0
  virtual CFTTTexture *ExtractColourBuffer();            // 00221DE2
  void UpdateViewport(int, int, int, int, float, bool);  // 00119B64
  static void DeactivateCurrentTarget();                 // 00202C98

  // vptr_0
  CFTTRenderBuffer *list_renderbuffer_4[4];
  TRectI rectI_14;
  float float_24;
  EFTTTextureTarget eEFTTTextureTarget_28;  //这个变量很奇怪，在读取时是int，使用时它强转成uint8   00229138   UXTAB.W R2, R1, R0
  uint8 uyLevel_2C;
  uint8 byte_2D;  //.text:00223BA2   STRB.W R5, [R4,#0x35]
  uint8 byte_2E;
  uint8 byte_2F;

  static CFTTRenderTarget *ms_pCurrentTarget;
};

#endif  //_CFTTRENDERTARGET_H_