CFTTTexture.cpp 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. #include "CFTTTexture.h"
  2. #include "CFTTFileSystem.h"
  3. #include "FTT2D.h"
  4. #include "memctrl.h"
  5. TFTTTexture_FileHandler *CFTTTexture::ms_pFileHandlers;
  6. int dword_30B230[20] = {16, 16, 16, 32, 4, 8, 8, 24, 8, 16, 2, 2, 4, 4, 4, 32, 64, 128, 0, 0};
  7. //-------------------------------------------------------------------------------------------------
  8. //00221DE8 //^_^ 经过单元测试,功能正常
  9. int GetBPP(EFTTTexFormat eFormat) {
  10. int dret;
  11. LOGE("GetBPP%x",eFormat);
  12. return rand();
  13. }
  14. //-------------------------------------------------------------------------------------------------
  15. //00221FE4 ^_- 经过单元测试,功能正常
  16. int GetFullMipChainCount(int dWidth, int dHeight, EFTTTexFormat eFormat) {
  17. int dr0 = 1;
  18. return dr0;
  19. }
  20. //-------------------------------------------------------------------------------------------------
  21. //00222034 //^_^
  22. CFTTTexture::CFTTTexture() {
  23. }
  24. //-------------------------------------------------------------------------------------------------
  25. //00222070 0022208C //^_^
  26. CFTTTexture::~CFTTTexture() {
  27. FTT2D_OnTextureDeletion(this);
  28. }
  29. //-------------------------------------------------------------------------------------------------
  30. //00222090 static //^_^
  31. void CFTTTexture::AddFileHandler(TFTTTexture_FileHandler *pFileHandler) {
  32. // 005CB218 00222092
  33. }
  34. //-------------------------------------------------------------------------------------------------
  35. //002220CC static //^_-
  36. TFTTTexture_FileHandler *CFTTTexture::DetermineBestTextureFile(char const *pDat,
  37. char *pOut,
  38. int dOutLen) {
  39. LOGI("CFTTTexture::DetermineBestTextureFil");
  40. return nullptr;
  41. }
  42. //-------------------------------------------------------------------------------------------------
  43. // static
  44. //00222128 //^_- 经过单元测试,功能正常
  45. CFTTFile *CFTTTexture::OpenBestTextureFile(char const *pFileName, TFTTTexture_FileHandler **ppFileHandler) {
  46. LOGI("CFTTTexture::OpenBestTextureFile entry %s", pFileName);
  47. LOGI("CFTTTexture::OpenBestTextureFile end");
  48. return nullptr;
  49. }
  50. //-------------------------------------------------------------------------------------------------
  51. //002221EC static
  52. bool CFTTTexture::BufferCheckFormat(void const *pDat,
  53. int a2,
  54. TFTTTexture_FileHandler const **ppFileHandler) {
  55. bool bret = false;
  56. return bret;
  57. }
  58. //-------------------------------------------------------------------------------------------------
  59. //00222224 static
  60. bool CFTTTexture::FileIsValid(char const *pFileName) {
  61. bool bret = false;
  62. // loc_222272
  63. return bret;
  64. }
  65. //-------------------------------------------------------------------------------------------------
  66. //00222278 static
  67. bool CFTTTexture::FileExists(char const *pFileName, bool b) {
  68. bool bret = false;
  69. // loc_2222AC
  70. return bret;
  71. }
  72. //-------------------------------------------------------------------------------------------------
  73. //002222D4 //^_^
  74. CFTTTexture *CFTTTexture::LoadBuffer(void const *pDat,
  75. int dLen,
  76. CFTTTexLoadOptions const &pTexOpt,
  77. TFTTTexture_FileHandler const *pFileHandler) {
  78. CFTTTexture *pret = nullptr;
  79. return pret;
  80. }
  81. //-------------------------------------------------------------------------------------------------
  82. //00222324 //^_^
  83. CFTTTexture *CFTTTexture::LoadName(char const *pName0, CFTTTexLoadOptions const &pTexLoadOpt1, bool b2) {
  84. CFTTTexture *r7_pTexture = (CFTTTexture*)rand();
  85. LOGI("CFTTTexture::LoadName End%x%x%x",pName0,pTexLoadOpt1.field_15,b2);
  86. return r7_pTexture;
  87. }
  88. //-------------------------------------------------------------------------------------------------
  89. //002223F8
  90. bool CFTTTexture::SaveName(char const *, EFTTTextureSaveQuality, EFTTRendererType) {
  91. return false;
  92. }
  93. //-------------------------------------------------------------------------------------------------
  94. //00222474
  95. bool CFTTTexture::CanSaveName(char const *, int *, int *, char *, int) {
  96. return false;
  97. }
  98. //-------------------------------------------------------------------------------------------------
  99. //00222528
  100. void CFTTTexture::RenderSaveCube(char const *, bool, CFTTVector32x4) {
  101. }
  102. //-------------------------------------------------------------------------------------------------
  103. //00222860
  104. int CFTTTexture::SplitCube() {
  105. return 0;
  106. }
  107. //-------------------------------------------------------------------------------------------------
  108. //002228DC
  109. void CFTTTexture::SaveCube(char const *) {
  110. }
  111. //-------------------------------------------------------------------------------------------------
  112. //0022294C //^_^
  113. void CFTTTexture::ResetAllFlags(int a2) {
  114. if ((flag_24 ^ a2) << 30)
  115. a2 |= 0x20u;
  116. flag_24 = a2;
  117. }
  118. //-------------------------------------------------------------------------------------------------
  119. //0022295C //^_^
  120. void CFTTTexture::ApplyTexLoadOptions(CFTTTexLoadOptions const &pTexOpt) {
  121. }
  122. //-------------------------------------------------------------------------------------------------
  123. //00222994 //^_^
  124. void CFTTTexture::AddFlags(int a2) {
  125. }
  126. //-------------------------------------------------------------------------------------------------
  127. //002229AA //^_^
  128. void CFTTTexture::RemoveAlpha() {
  129. }
  130. //-------------------------------------------------------------------------------------------------