// CFE - [2020-04-13 11:57:46]
#ifndef _CFE_H_
#define _CFE_H_

#include "XMATH.h"
#include "CFTTTexture.h"
#include "CFTTJobQueue.h"
#include "CFEScreen.h"
#include "CGameLoop.h"
#include "CFTTTexLoadOptions.h"
#include "FTTMutex.h"

/*
001199F4  CFE::StoreUniformSpaceDimensions(float f1, float f2)
00119A10  CFE::SetToUniformSpace()
00119AC0  CFE::SetViewport_Uniform()
00119BCC  CFE::Begin2DScene()
00119BE0  CFE::SetupUniformRes()
00119C28  CFE::BeginCustom2DScene(float f1)
00119C58  CFE::SetupCustomRes(float d1)
00119D60  CFE::ResetCustom2DScene()
00119D8C  CFE::End2DScene()
00119D90  CFE::GetUniformXFromNativeX(float f1)
00119DCC  CFE::GetUniformYFromNativeY(float f1)
00119E08  CFE::GetNativeXFromUniformX(float f1)
00119E48  CFE::GetNativeYFromUniformY(float f1)
00119E88  CFE::RoundToNativeXPixel(float f1)
00119ED4  CFE::RoundToNativeYPixel(float f1)
00119F20  CFE::SetNativeHardwareSize(float f1, float f2)
00119F30  CFE::ResolveScreenDims()
001522AC  CFE::Init()
00152394  CFE::Forward(int a1, bool b1, bool b2)
00152464  CFE::Exit()
0015249C  CFE::InitialiseBannerAds()
001524BC  CFE::AllowBannerAds()
00152508  CFE::RemoveBannerAd()
0015251C  CFE::ShutDown()
001525B4  CFE::PauseSoundForRecording()
001525C6  CFE::PlaySoundAfterRecording()
001525CC  CFE::CheckMusic()
0015261C  CFE::ProcessAdverts()
0015263C  CFE::AttemptToPlayVideoAd(bool b1, int a2 ,bool b3 ,bool b4)
00152714  CFE::AttemptToDisplayInterstitialAd()
00152770  CFE::AttemptToStartVideoAdNetworks()
00152864  CFE::AllowVideoAds(EVideoAdZones)
00152914  CFE::VideoAnalytics(int a1)
00152918  CFE::PlayRewardedVideo(int a1, void * pdat)
00152998  CFE::VideoAdEnergyRewardCallback(int a1, int a2, bool b3, char const* pdata)
00152A74  CFE::VideoAdCurrencyRewardCallback(int a1, int a2, bool b1, char const* pdata)
00152BB8  CFE::ReadyToPlayVideoAd(bool b1, int a2, bool b3)
00152C08  CFE::PassedVideoTime()
00152C44  CFE::UpdateAdvertTimings(bool b)
00152CD4  CFE::PassedFullScreenTime()
00152D0C  CFE::AndroidExitAppCB(int a1, void * pdata)
00152D50  CFE::GetAnalyticsVideoSourceFromZone(EVideoAdZones e)
00152D94  CFE::Process(float f)
0015307C  CFE::DeleteTopScreen()
001530C8  CFE::SetupStack(int * pdata, int a2)
001530EC  CFE::Back(bool b1, bool b2)
00153190  CFE::RenderScreen(int a1)
001531AC  CFE::RenderAdBackground(bool b)
00153208  CFE::RenderFrameRate()
0015320C  CFE::Render()
00153274  CFE::RenderInner()
00153318  CFE::GetScreenID()
00153348  CFE::NewScreen(int)
00153528  CFE::BackToScreen(int a1, bool b)
001535B4  CFE::GetBGTexture()
00153618  CFE::DisplayInitialMessage()
001536AC  CFE::ShopCB(int a1, void * pdata)
001536B6  CFE::ShowShop(bool b)
001536FC  CFE::OpenFacebookLink()
0015371C  CFE::OpenTwitterLink()
0015373C  CFE::DeleteScreenStack()
00153758  CFE::LoadSideStoryFirstNISIfExists()
00153820  CFE::SetInitialAdvertTimings()
00153884  CFE::AllowInterstitials()
001538DC  CFE::AlwaysShowLevelSelectVideoAds()
00153908  CFE::CouldHaveVideoAds(EVideoAdZones)
0015399C  CFE::CouldHaveInterstitials()
001539D8  CFE::AddBannerAd()
001539F4  CFE::CurrentScreenHasBackButton()
00153A20  CFE::OpenTermsOfServiceURL()
00153A2C  CFE::OpenPrivacyPolicyURL()
00153A38  CFE::OpenTermsOfService()
00153A88  CFE::OpenPrivacyPolicy()
00153AD8  CFE::ContinueTermsOfServiceNativeDialog()
00153B4C  CFE::ShowNativeDialogForTerms()
00153BEC  CFE::StoreMinimiseTime()
00153C04  CFE::CheckTimeMinimised()
00153C3C  CFE::PerformHousekeeping()
00153CC4  CFE::DeleteHeadshot()

共79个函数
*/

enum EVideoAdZones {
  EVideoAdZones_0,
  EVideoAdZones_1,
  EVideoAdZones_2,
  EVideoAdZones_3,
  EVideoAdZones_4,
};

class CFE {
public:
  // 001199F4
  static void StoreUniformSpaceDimensions(float w, float h);

  // 00119A10
  static void SetToUniformSpace();

  // 00119AC0
  static void SetViewport_Uniform();

  // 00119BCC
  static void Begin2DScene();

  // 00119BE0
  static void SetupUniformRes();

  // 00119C28
  static void BeginCustom2DScene(float f1);

  // 00119C58
  static void SetupCustomRes(float d1);

  // 00119D60
  static void ResetCustom2DScene();

  // 00119D8C
  static void End2DScene();

  // 00119D90
  static float GetUniformXFromNativeX(float f1);

  // 00119DCC
  static float GetUniformYFromNativeY(float f1);

  // 00119E08
  static float GetNativeXFromUniformX(float f1);

  // 00119E48
  static float GetNativeYFromUniformY(float f1);

  // 00119E88
  static float RoundToNativeXPixel(float f1);

  // 00119ED4
  static float RoundToNativeYPixel(float f1);

  // 00119F20
  static void SetNativeHardwareSize(float fw, float fh);

  // 00119F30
  static void ResolveScreenDims();

  // 001522AC
  static void Init();

  // 00152394
  static void Forward(int a1, bool b1, bool b2);

  // 00152464
  static void Exit();

  // 0015249C
  static void InitialiseBannerAds();

  // 001524BC
  static bool AllowBannerAds();

  // 00152508
  static void RemoveBannerAd();

  // 0015251C
  static void ShutDown();

  // 001525B4
  static void PauseSoundForRecording();

  // 001525C6
  static void PlaySoundAfterRecording();

  // 001525CC
  static bool CheckMusic();

  // 0015261C give up
  static bool ProcessAdverts();

  // 0015263C
  static void AttemptToPlayVideoAd(bool b1, int a2, bool b3, bool b4);

  // 00152714 give up
  static int AttemptToDisplayInterstitialAd();

  // 00152770 give up
  static void AttemptToStartVideoAdNetworks();

  // 00152864 give up
  static bool AllowVideoAds(EVideoAdZones);

  // 00152914 empty
  static void VideoAnalytics(int a1);

  // 00152918 give up
  static void PlayRewardedVideo(int a1, void* pdat);

  // 00152998 give up
  static void VideoAdEnergyRewardCallback(int a1, int a2, bool b3, char const* pdata);

  // 00152A74 give up
  static void VideoAdCurrencyRewardCallback(int a1, int a2, bool b1, char const* pdata);

  // 00152BB8
  static bool ReadyToPlayVideoAd(bool b1, int a2, bool b3);

  // 00152C08 give up
  static bool PassedVideoTime();

  // 00152C44
  static void UpdateAdvertTimings(bool b);

  // 00152CD4 give up
  static bool PassedFullScreenTime();

  // 00152D0C
  static void AndroidExitAppCB(int a1, void* pData);

  // 00152D50 give up
  static EVideoAdZones GetAnalyticsVideoSourceFromZone(EVideoAdZones e);

  // 00152D94
  static int Process(float f);

  // 0015307C
  static void DeleteTopScreen();

  // 001530C8
  static void SetupStack(int* pdata, int dCount);

  // 001530EC
  static void Back(bool b1, bool b2);

  // 00153190
  static void RenderScreen(int a1);

  // 001531AC
  static void RenderAdBackground(bool b);

  // 00153208
  static void RenderFrameRate();

  // 0015320C
  static void Render();

  // 00153274
  static void RenderInner();

  // 00153318
  static int GetScreenID();

  // 00153348
  static CFEScreen* NewScreen(int);

  // 00153528
  static void BackToScreen(int a1, bool b2);

  // 001535B4
  static CFTTTexture* GetBGTexture();

  // 00153618
  static void DisplayInitialMessage();

  // 001536AC
  static void ShopCB(int a1, void* pdata);

  // 001536B6
  static void ShowShop(bool b);

  // 001536FC
  static void OpenFacebookLink();

  // 0015371C
  static void OpenTwitterLink();

  // 0015373C
  static void DeleteScreenStack();

  // 00153758
  static void LoadSideStoryFirstNISIfExists();

  // 00153820
  static void SetInitialAdvertTimings();

  // 00153884
  static bool AllowInterstitials();

  // 001538DC
  static bool AlwaysShowLevelSelectVideoAds();

  // 00153908
  static bool CouldHaveVideoAds(EVideoAdZones);

  // 0015399C
  static bool CouldHaveInterstitials();

  // 001539D8
  static void AddBannerAd();

  // 001539F4
  static bool CurrentScreenHasBackButton();

  // 00153A20
  static void OpenTermsOfServiceURL();

  // 00153A2C
  static void OpenPrivacyPolicyURL();

  // 00153A38
  static void OpenTermsOfService();

  // 00153A88
  static void OpenPrivacyPolicy();

  // 00153AD8
  static void ContinueTermsOfServiceNativeDialog();

  // 00153B4C
  static bool ShowNativeDialogForTerms();

  // 00153BEC
  static void StoreMinimiseTime();

  // 00153C04
  static void CheckTimeMinimised();

  // 00153C3C
  static void PerformHousekeeping();

  // 00153CC4
  static void DeleteHeadshot();

  static float s_fUniformWidth;
  static float s_fUniformHeight;
  static float s_fHardwareWidth;
  static float s_fHardwareHeight;
  static TRect s_tOffsetAndResolution_Software;
  static TRect s_tOffsetAndResolution_Hardware;
  static TRect tOffsetAndResolution_SoftwareNative;
  static TRect tOffsetAndResolution_HardwareNative;
  static float ms_fDestCustomViewportPercentage;
  static float ms_fCustomViewportPercentage;
  static bool ms_bCustomViewportActive;
  static time_t m_tMinimiseTime;
  static int m_iScreenStackPos;
  static CFEScreen* m_apScreenStack[16];
  static EFEScreen m_apScreenStackID[16];
  static CFTTTexture* s_pBGTexture;
  static bool ms_bShuttingDown;
  static int s_iUnpauseSoundCounter;
  static CFTTJobQueue* ms_pJobQueue;
  static bool m_bDeleteTopScreen;
  static int m_eScreen;
  static int m_eLastFlowDirection;  //??? enum
  static int ms_iFrame;
  static int m_iFirstInGameScreen;
  static int ms_iProcessFrames;
  static bool s_bCouldHaveBannerAds;

  static FTTMutex s_tRenderMutex;  // 00354170
};

extern int SCR_SAFE_TOP;
extern int SCR_SAFE_BOTTOM;
extern int SCR_SAFE_LEFT;
extern int SCR_SAFE_RIGHT;
extern int SCR_WID;  // 003365EC
extern int SCR_HEI;  // 003365F0

#endif  //_CFE_H_