//CFEImages - [2020-04-13 11:57:46]
#ifndef _CFEIMAGES_H_
#define _CFEIMAGES_H_

#include "CFTTTextureAtlas.h"

/*
0014C6F8 CFEImages::CFEImages()
0014C734 CFEImages::~CFEImages()
0014C71C CFEImages::ClearCache()
0014C738 CFEImages::Free()
0014C758 CFEImages::FreeAtlases()
0014C7D0 CFEImages::GetInstance()
0014C80C CFEImages::GetTexture(char const*,bool,EFTTTexFormat,bool,bool,bool)
0014C8E8 CFEImages::HighToLowResProcess(CFTTTexture **)
0014CC84 CFEImages::CacheFree()
0014CCBC CFEImages::LoadAtlasData()
0014CE24 CFEImages::ReorderAtlases()
0014CE5E CFEImages::SwapAtlasPositions(ushort,ushort)
0014CE9A CFEImages::FreeAtlasCache(bool)
0014CEEE CFEImages::FreeAtlasCacheByTimestamp()
0014CF60 CFEImages::FindAndOpenAtlas(TAtlasData *,char const*)

0x10
*/

//0xC    0014D002 0C 35         ADDS            R5, #0xC
struct TAtlasData {
  CFTTTextureAtlas *pTextureAtlas_0;
  short field_4;  //大多数代码是按照2个字节short读写，少数是按4个字节int读取，总体上，我认为是short. anderson
                  //0014CFEA   LDR             R2, [R2,#4]
  short field_6;
  uint32_t dTick_8;
};

class CFEImages {
public:
  CFEImages();                      //0014C6F8
  ~CFEImages();                     //0014C734
  void ClearCache();                //0014C71C
  void Free();                      //0014C738
  void FreeAtlases();               //0014C758
  static CFEImages *GetInstance();  //0014C7D0
  CFTTTexture *GetTexture(char const *pFileName,
                          bool b, EFTTTexFormat e,
                          bool b1,
                          bool b2, bool b3);          //0014C80C
  void HighToLowResProcess(CFTTTexture **);           //0014C8E8
  void CacheFree();                                   //0014CC84
  void LoadAtlasData();                               //0014CCBC
  void ReorderAtlases();                              //0014CE24
  void SwapAtlasPositions(ushort, ushort);            //0014CE5E
  void FreeAtlasCache(bool);                          //0014CE9A
  void FreeAtlasCacheByTimestamp();                   //0014CEEE
  bool FindAndOpenAtlas(TAtlasData *, char const *);  //0014CF60

  bool byte_0;
  TAtlasData *list_4;
  uint **pHashTable_8;
  int *list_count_C;

  static uchar s_tLoadScreenTextures[1088];
  static CFEImages *s_pInst;
  static bool s_bScaleLoadedTexture;
};

#endif  //_CFEIMAGES_H_