//AABB - [2020-04-13 11:57:46]
#ifndef _FTT2D_H_
#define _FTT2D_H_

#include "CFTTUberShader.h"
#include "CFTT2D_TextureUV.h"
#include "CFTTTextureAtlas.h"
#include "CFTT2D_TexturedVert.h"

enum EFTT2D_Blend {
  EFTT2D_Blend_0,
  EFTT2D_Blend_1,
  EFTT2D_Blend_2,
  EFTT2D_Blend_3,
  EFTT2D_Blend_4,
  EFTT2D_Blend_5,
  EFTT2D_Blend_6,
  EFTT2D_Blend_7,
  EFTT2D_Blend_8,
  EFTT2D_Blend_9,
  EFTT2D_Blend_10,
  EFTT2D_Blend_11,
  EFTT2D_Blend_12,
};

extern CFTTTexture *FTT2D_pDrawCallTexture;  //005AA7A0
extern int FTT2D_iOpenScenes;                //005AA7A4

//0020C8D8
void FTT2D_SetupBufSizes(int a1, int a2, int dLineCount);

//0020C8E4
void FTT2D_Init();

//0020C924
void FTT2D_Shutdown();

//0020C96C
void FTT2D_Begin();

//0020C9E4
void FTT2D_ClearTexture();

//0020CA28
void FTT2D_SetMaterial(int);

//0020CA4C
void FTT2D_SetDefaultMatBlend(EFTT2D_Blend eBland);

//0020CA68
void FTT2D_End();

//0020CA8C
void FTT2D_ForceFlush();

//0020CAA8
void FTT2D_OnFrameEnd() __attribute__((noinline));

//0020CABC
int FTT2D_GetMaterial();

//0020CAE0
void FTT2D_SetTexture(CFTTTexture *pTexture, ushort a2);

//0020CB58
void FTT2D_SetTextureUV(CFTT2D_TextureUV *pTextureUV, ushort a2);

//0020CC30
void FTT2D_SetTexture(CFTTTexture *, CFTT2D_TextureUV *, ushort);

//0020CC78
CFTTTexture *FTT2D_GetCurrentTexture() __attribute__((noinline));

//0020CC88
void FTT2D_SetTexture(CFTTTextureAtlas *, ushort, ushort);

//0020CCE8
void FTT2D_SetTexture(CFTTTextureAtlas *, ushort, CFTT2D_TextureUV *, ushort);

//0020CDA8
void FTT2D_UpdateTextureUVs(CFTT2D_TexturedVert *, int);

//0020CDF4
void FTT2D_EnableScissorTesting(int a1, int a2, int a3, int a4);

//0020CE14
void FTT2D_DisableScissorTesting();

//0020CE3C
void FTT2D_FlipY(bool);

//0020CE50
void FTT2D_FlipX(bool);

//0020CEDC
void FTT2D_OnMaterialModified(CFTTUberShader *pUberShader, int dIndex);

//0020CF04
CFTTTexture *FTT2D_GetCurrentDrawCallTexture();

//0020CF14
void FTT2D_OnTextureDeletion(CFTTTexture *pTexture);

//0020D6AC
void FTT2D_GenerateRectUVs(CFTT2D_TexturedVert *list_vert);

//0020D740
CFTT2D_TexturedVert *FTT2D_DrawLine(float f1, float f2, float f3, float f4);

//0020D78C
//int FTT2D_PrepareDrawLine<CFTT2D_TexturedVert>();
CFTT2D_TexturedVert *FTT2D_PrepareDrawLine();

//0020D7B4
CFTT2D_TexturedVert *FTT2D_DrawLineCol(float, float, float, float, uint);

//0020D818
CFTT2D_TexturedVert *FTT2D_DrawLineCol2(float f1, float f2, float f3, float f4,
                                        uint a5, uint a6);

//0020D88C
CFTT2D_TexturedVert *FTT2D_DrawLineP2P(float f1, float f2, float f3, float f4);

//0020D8B0
CFTT2D_TexturedVert *FTT2D_DrawLineP2PCol(float f1, float f2,
                                          float f3, float f4,
                                          uint a5);

//0020D8D4
CFTT2D_TexturedVert *FTT2D_DrawLineP2PCol2(float f1, float f2, float f3, float f4,
                                           uint a5, uint a6);

//0020D8F8
void FTT2D_DrawTriangle(float, float, float, float, float, float, bool, uint);

//0020D920
void FTT2D_DrawTriangle3(float, float, float, float, float, float,
                         bool, uint, uint, uint);

//0020D9E0
//int FTT2D_PrepareDrawTriangle<CFTT2D_TexturedVert>(bool);
template<typename T>
T *FTT2D_PrepareDrawTriangle(bool);

//0020DA1C
void FTT2D_DrawCircle(float, float, float, ushort, bool, uint);

//0020DB20
int FTT2D_DrawUnfilledRect(float, float, float, float, uint, float, float, float);

//0020DC20
//int FTT2D_GenerateRect<CFTT2D_TexturedVert>(CFTT2D_TexturedVert *, float, float, float, float, uint, uint, uint, uint, float, float, float);
template <typename T>
void FTT2D_GenerateRect(T *,
                        float, float, float, float,
                        uint, uint, uint, uint,
                        float, float, float);

//0020DD20
void FTT2D_DrawUnfilledRect4(float, float, float, float,
                             uint, uint, uint, uint,
                             float, float, float);

//0020DE3C
void FTT2D_DrawRect(float, float, float, float, uint, float, float, float);

//0020DEAC
//int FTT2D_PrepareDrawFilledRect<CFTT2D_TexturedVert>();
template <typename T>
T *FTT2D_PrepareDrawFilledRect();

//0020DED4
void FTT2D_DrawRect4(float f1, float f2, float f3, float f4,
                     uint argb5, uint argb6, uint argb7, uint argb8,
                     float f9, float f10, float f11);

//0020DF68
void FTT2D_DrawTexturedRect(float, float, float, float,
                            uint,
                            float, float, float);

//0020E028
//int FTT2D_PrepareDrawTexturedRect<CFTT2D_TexturedVert>();
template <typename T>
T *FTT2D_PrepareDrawTexturedRect();

//0020E058
void FTT2D_DrawTexturedRect4(float f1, float f2, float f3, float f4,
                             uint argb5, uint argb6, uint argb7, uint argb8,
                             float f9, float f10, float f11);

//0020E174
void FTT2D_DrawTexturedRect5(float, float, float, float,
                             uint, uint, uint, uint, uint,
                             float, float, float);

//0020E1A8
void FTT2D_DrawTexturedVertList(CFTT2D_TexturedVert *pTexturedVert, int a2);

//0020E1E0
void FTT2D_DrawTexturedVertStrip(CFTT2D_TexturedVert *pTexturedVert, int a2);

//00202860
void FTTPresentScene(bool b);

#endif  //_FTT2D_H_