123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209 |
- #include <jni.h>
- #include "gl3stub.h"
- #include "FTTGraphics.h"
- #include "AndroidApp.h"
- #include "CFTTUberShader.h"
- #include "CFTTGraphicsDeviceOGLES.h"
- #include "CFTTGraphicsDeviceOGLES3.h"
- #include "CFTTMaterialManager.h"
- #include "CFTTTextureManager.h"
- #include "CFTTTextureCache.h"
- #include "CFTTCamera.h"
- #include "FTT2D.h"
- #include "FTT3D.h"
- //#include "CFTTVulkanSetup.h"
- #include "CFTTGraphicsDevice.h"
- #include "CFTTMaterialManager.h"
- #include "memctrl.h"
- MYSTATIC int dMaterialBufSize_348964;
- MYSTATIC int dTextureBufSize_348968;
- bool g_bFTTVolatileAllocated;
- EScreenRotation ScreenRotation_5A9AC0;
- MYSTATIC bool bStencilBuffer_5A9E78;
- MYSTATIC float ScreenSize_5A9E7C;
- GLint g_iMainFBOZDepth;
- struct GraphicsBufferNode {
- ushort dat[6];
- };
- //-------------------------------------------------------------------------------------------------
- //002005FC //^_^ 经过单元测试,功能正常
- void FTTGraphicsInitializeCommon() {
- //0020060C STR R5, [R0]
- LOGI("FTTGraphicsInitializeCommon: entry");
- LOGI("FTTGraphicsInitializeCommon: End");
- }
- //-------------------------------------------------------------------------------------------------
- //002006DC //^_^
- void FTTGraphicsCleanupCommon() {
- }
- //-------------------------------------------------------------------------------------------------
- //00200764 //^_^
- void FTTResetMaterials() {
- }
- //-------------------------------------------------------------------------------------------------
- //0020078C //^_^
- bool FTTBeginScene(CFTTClearSettings const &pSetting, CFTTRenderTarget *pRenderTarget, bool a3) {
- return false;
- }
- //-------------------------------------------------------------------------------------------------
- //002007B0 //^_^
- void FTTEndScene() {
- g_pGraphicsDevice->endScene();
- }
- //-------------------------------------------------------------------------------------------------
- int dword_306350[] = {
- 0xC,
- 8,
- 4,
- 8,
- 8,
- 0,
- 0,
- 0,
- };
- //002007C4 -_- 经过单元测试,功能正常
- int FTTGraphics_CalculateVertexSize(int a1) {
- LOGI("FTTGraphics_CalculateVertexSize entry %d", a1);
- return 0;
- }
- //-------------------------------------------------------------------------------------------------
- //002008B8
- void FTTGetDescriptorFromFVF(TFTTVertexDescriptor *pVerDes, uint dCount, uint dVertexCount) {
- //???
- }
- //-------------------------------------------------------------------------------------------------
- //00200A78 ^_-(只有2行汇编不一样,只是汇编的写法不一样)
- int FTTGetFVFFromDescriptor(TFTTVertexDescriptor const *a1) {
- int result = 0;
- return 0;
- }
- //-------------------------------------------------------------------------------------------------
- //00200B58
- void FTTCreateVolatileResources() {
- }
- //-------------------------------------------------------------------------------------------------
- //00200B84
- void FTTDeleteVolatileResources() {
- //locret_200BA2
- }
- //-------------------------------------------------------------------------------------------------
- //00200BAC //^_^
- void FTTGraphicsInitialize_SetBufSizes(int dTextureBufSize, int dMaterialBufSize) {
- }
- //-------------------------------------------------------------------------------------------------
- //00200BBC
- void FTTGraphicsSetScreenRotation(EScreenRotation eScreen) {
- }
- //-------------------------------------------------------------------------------------------------
- //00200BC8 //^_^
- int FTTGraphicsGetScreenRotation() {
- return 0;
- }
- //-------------------------------------------------------------------------------------------------
- //00200BE8
- int FTTGraphics_IndexCountToPrimCount(FTTPRIMTYPE dPrimType, int a2) {
- int result = 0;
- return result;
- }
- //-------------------------------------------------------------------------------------------------
- //00200C14 //^_^
- int FTTGraphics_PrimCountToIndexCount(FTTPRIMTYPE dPrimType, int a2) {
- int result;
- return result;
- }
- //-------------------------------------------------------------------------------------------------
- //00202674 //^_^
- void FTTGraphicsEnableStencilBuffer(bool b) {
- LOGE("%xFTTGraphicsEnableStencilBuffer",b);
- }
- //-------------------------------------------------------------------------------------------------
- //00202680 //^_^
- bool FTTGraphicsIsStencilBufferEnabled() {
- return 0;
- }
- //-------------------------------------------------------------------------------------------------
- //0020268C //^_^ 经过单元测试,功能正常
- void FTTGraphicsAndroid_SetScreen(int width, int height) {
- //locret_2026C6
- LOGE("%x FTTGraphicsAndroid_SetScreen%x%x",rand(),width,height);
- }
- //-------------------------------------------------------------------------------------------------
- //002026E8 //^_^
- void FTTGraphicsAndroid_SetScreenSize(float size) {
- LOGE("%xFTTGraphicsAndroid_SetScreenSize%f",rand(),size);
- }
- //-------------------------------------------------------------------------------------------------
- //002026F4
- int FTTGraphicsAndroid_InitializeVulkanEarly() {
- //return CFTTVulkanSetup::InitializeEarly();
- LOGE("%xFTTGraphicsEnableStencilBuffer",rand());
- return rand();
- }
- //-------------------------------------------------------------------------------------------------
- //002026F8
- void FTTGraphicsAndroid_OnVulkanSurfaceAcquired(ANativeWindow *pWnd) {
- //??? Vulkan 相关暂时放弃
- // if (g_pGraphicsDevice) {
- // //g_pGraphicsDevice->hWnd_300 = pWnd; //vulkan
- // CFTTVulkanSetup::RecreateSurfaceAndSwapchain(pWnd);
- // } else {
- // g_pGraphicsDevice = new CFTTGraphicsDeviceVulkan(pWnd); //0x308
- // if (!g_pGraphicsDevice->create()) {
- // delete g_pGraphicsDevice;
- // g_pGraphicsDevice = nullptr;
- // }
- // }
- LOGE("FTTGraphicsAndroid_OnVulkanSurfaceAcquired%p",pWnd);
- }
- //-------------------------------------------------------------------------------------------------
- //00202744
- void FTTGraphicsAndroid_OnVulkanSurfaceLost() {
- //??? Vulkan 相关暂时放弃
- LOGI("FTTGraphicsAndroid_OnVulkanSurfaceLost: Entry");
- // if (g_pGraphicsDevice) {
- // if (g_pGraphicsDevice->GetRendererType() == 3) {
- // CFTTVulkanSetup::DestroySurfaceAndSwapchain();
- // }
- // }
- }
- //-------------------------------------------------------------------------------------------------
- //00202768
- float FTTGraphicsAndroid_GetScreenSize() {
- return ScreenSize_5A9E7C;
- }
- //-------------------------------------------------------------------------------------------------
- //00202774 //^_^ 经过单元测试,功能正常
- void FTTGraphicsInitialize(int a0) {
- LOGI("FTTGraphicsInitialize: Entry");
- LOGI("FTTGraphicsInitialize: End");
- }
- //-------------------------------------------------------------------------------------------------
- //00202834
- void FTTGraphicsCleanup() {
- }
- //-------------------------------------------------------------------------------------------------
- //00202874 //^_^
- int FTTGraphics_GetScreenWidth() {
- return g_iMainFBOWidth;
- }
- //-------------------------------------------------------------------------------------------------
- //00202884 //^_^
- int FTTGraphics_GetScreenHeight() {
- return g_iMainFBOHeight;
- }
- //-------------------------------------------------------------------------------------------------
- //00202894 //^_^
- float FTTGraphicsGetNativeScale() {
- return 1.0;
- }
- //-------------------------------------------------------------------------------------------------
|