123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653 |
- #include <dlfcn.h>
- #include <GLES2/gl2.h>
- #include <GLES3/gl3.h>
- #include <GLES2/gl2ext.h>
- #include <arm_neon.h>
- #include <dlfcn.h>
- #include "CFTTGraphicsDeviceOGLES.h"
- #include "CFTTShaderProgramOGLES.h"
- #include "CFTTAndroidDevice.h"
- #include "CFTTGraphicsBufferOGLES.h"
- #include "CFTTRenderTargetOGLES.h"
- #include "CFTTRenderToTextureOGLES.h"
- #include "FTTGraphics.h"
- #include "FTTFont.h"
- #include "CFTTCamera.h"
- //#include "memctrl.h"
- const GLenum GLenum_2FE084[] = {GL_LINES, GL_LINE_STRIP, GL_TRIANGLES, GL_TRIANGLE_STRIP};
- MYSTATIC const int dword_2FED60[] = {0x201, 0x202, 0x203, 0x204, 0x205, 0x206, 0x207, 0x203};
- const int dword_306400[] = {0, 0x1E01, 0x1E02, 0x1E03, 0x8507, 0x8508, 0x150A, 0};
- MYSTATIC GLuint dword_3063E0[] = {0x207, 0x202, 0x205, 0x201, 0x203, 0x204, 0x206, 0};
- uchar byte_5AA644;
- uchar byte_5AA684;
- uchar byte_5AA6C5;
- int g_iMainFBOWidth;
- int g_iMainFBOHeight;
- //-------------------------------------------------------------------------------------------------
- typedef void (*pfunc_glDiscardFramebufferEXT)(GLenum target,
- GLsizei numAttachments,
- const GLenum *attachments);
- pfunc_glDiscardFramebufferEXT func_glDiscardFramebufferEXT_5A9E80 = nullptr;
- //-------------------------------------------------------------------------------------------------
- const char *list_VENDOR_348A00[] = {
- "Imagination Technologies",
- "NVIDIA Corporation",
- "Broadcom",
- "ARM",
- "Qualcom",
- "Vivante Corporation",
- "\0",
- };
- //-------------------------------------------------------------------------------------------------
- const char *list_Imagination_3489C0[] = {
- "PowerVR SGX 544MP",
- "\0",
- };
- //-------------------------------------------------------------------------------------------------
- const char *list_NVIDIA_3489DC[] = {
- "NVIDIA Tegra 3",
- "NVIDIA Tegra 2",
- "NVIDIA Tegra",
- "\0",
- };
- //-------------------------------------------------------------------------------------------------
- const char *list_Qualcom_3489EC[] = {
- "Adreno (TM) 320",
- "Adreno 205",
- "Adreno (TM) 205",
- "Adreno (TM) 203",
- "\0",
- };
- //-------------------------------------------------------------------------------------------------
- const char *lsit_ARM_3489D0[] = {
- "Mali-400 MP",
- "Mali-400",
- "\0",
- };
- //-------------------------------------------------------------------------------------------------
- const char *list_Vivante_3489C8[] = {
- "GC1000 core",
- "\0",
- };
- //-------------------------------------------------------------------------------------------------
- //00203830 //^_^
- int findstr_203830(const char **list, const char *pName) {
- const char *v2 = pName;
- int i = 0;
- for (i = 0;; ++i) {
- const char *pr1 = list[i];
- if (!*pr1 || strstr(v2, pr1) == 0)
- break;
- }
- return i;
- }
- //-------------------------------------------------------------------------------------------------
- //0020289C -_- 经过单元测试,功能正常
- CFTTGraphicsDeviceOGLES::CFTTGraphicsDeviceOGLES() {
- }
- //-------------------------------------------------------------------------------------------------
- //002028E8 00202904 //^_^
- CFTTGraphicsDeviceOGLES::~CFTTGraphicsDeviceOGLES() {
- }
- //-------------------------------------------------------------------------------------------------
- //002038EC //^_^ 经过单元测试,功能正常
- uint CFTTGraphicsDeviceOGLES::ARGBToPlatform4444(uint a2) const {
- int dret = ((a2 >> 4) & 0xF00) | (a2 & 0xF0) | (a2 >> 28) | ((a2 >> 8) & 0xF000);
- return dret;
- }
- //-------------------------------------------------------------------------------------------------
- //002038CE //^_^
- ushort CFTTGraphicsDeviceOGLES::ARGBToPlatform4444(uint a2, uint a3, uint a4, uint a5) const {
- return (ushort)1;
- }
- //-------------------------------------------------------------------------------------------------
- //002038A8 //^_^
- uint CFTTGraphicsDeviceOGLES::ARGBToPlatformU32(uint a1) const {
- return 0;
- }
- //-------------------------------------------------------------------------------------------------
- //00203898 //^_^
- uint CFTTGraphicsDeviceOGLES::ARGBToPlatformU32(uint a2, uint a3, uint a4, uint a5) const {
- return 2;
- }
- //-------------------------------------------------------------------------------------------------
- //00203594 //^_- 经过单元测试,功能正常
- void CFTTGraphicsDeviceOGLES::AssessHardware() {
- }
- //-------------------------------------------------------------------------------------------------
- //0020387C //^_^
- bool CFTTGraphicsDeviceOGLES::DepthTextureSupported() const {
- return false;
- }
- //-------------------------------------------------------------------------------------------------
- //0020390A //^_^
- uint CFTTGraphicsDeviceOGLES::ExtractAFromPlatform4444(ushort a2) const {
- return 0;
- }
- //-------------------------------------------------------------------------------------------------
- //002038BA //^_^
- uint CFTTGraphicsDeviceOGLES::ExtractAFromPlatformU32(uint a2) const {
- return 0;
- }
- //-------------------------------------------------------------------------------------------------
- //0020391A //^_^
- uint CFTTGraphicsDeviceOGLES::ExtractBFromPlatform4444(ushort a2) const {
- return 0;
- }
- //-------------------------------------------------------------------------------------------------
- //002038C8 //^_^
- uint CFTTGraphicsDeviceOGLES::ExtractBFromPlatformU32(uint a2) const {
- return 0;
- }
- //-------------------------------------------------------------------------------------------------
- //00203914 //^_^
- uint CFTTGraphicsDeviceOGLES::ExtractGFromPlatform4444(ushort a2) const {
- return 1;
- }
- //-------------------------------------------------------------------------------------------------
- //002038C2 //^_^
- uint CFTTGraphicsDeviceOGLES::ExtractGFromPlatformU32(uint a2) const {
- return 1;
- }
- //-------------------------------------------------------------------------------------------------
- //00203910 //^_^
- uint CFTTGraphicsDeviceOGLES::ExtractRFromPlatform4444(ushort a2) const {
- return 1;
- }
- //-------------------------------------------------------------------------------------------------
- //002038BE //^_^
- uint CFTTGraphicsDeviceOGLES::ExtractRFromPlatformU32(uint8 a2) const {
- return a2;
- }
- //-------------------------------------------------------------------------------------------------
- //00202938 //^_^
- void CFTTGraphicsDeviceOGLES::GetGPUName(wchar_t *pCUPBuf, int len) const {
- LOGE("CFTTGraphicsDeviceOGLES::GetGPUName%p%x",pCUPBuf,len);
- }
- //-------------------------------------------------------------------------------------------------
- //00203868 //^_^
- int CFTTGraphicsDeviceOGLES::GetRendererFamily() const {
- return 0;
- }
- //-------------------------------------------------------------------------------------------------
- //0020386C //^_^
- int CFTTGraphicsDeviceOGLES::GetRendererType() const {
- return 0;
- }
- //-------------------------------------------------------------------------------------------------
- //00203870 //^_^
- int CFTTGraphicsDeviceOGLES::Matrices_FlipsRTT() const {
- return 1;
- }
- //-------------------------------------------------------------------------------------------------
- //00203874 //^_^
- int CFTTGraphicsDeviceOGLES::Matrices_FlipsY() const {
- return 0;
- }
- //-------------------------------------------------------------------------------------------------
- //00203878 //^_^
- int CFTTGraphicsDeviceOGLES::Matrices_NDCIsCube() const {
- return 1;
- }
- //-------------------------------------------------------------------------------------------------
- //00203920 //^_^
- int CFTTGraphicsDeviceOGLES::SupportsThreadedTextureLoading() {
- return 0;
- }
- //-------------------------------------------------------------------------------------------------
- //00203852 //^_- 经过单元测试,功能正常
- bool CFTTGraphicsDeviceOGLES::TrustGlGenerateMipmap() const {
- LOGI("CFTTGraphicsDeviceOGLES::TrustGlGenerateMipmap entry");
- bool bret = false;
- return bret;
- }
- //-------------------------------------------------------------------------------------------------
- //00202954 -_- 经过单元测试,功能正常
- bool CFTTGraphicsDeviceOGLES::beginScene(CFTTClearSettings const &pSetting,
- CFTTRenderTarget *pRenderTarget,
- bool a4) {
- LOGI("CFTTGraphicsDeviceOGLES::beginScene entry");
- bool r6_bool;
- LOGI("CFTTGraphicsDeviceOGLES::beginScene end");
- return true;
- }
- //-------------------------------------------------------------------------------------------------
- //00202924 //^_^
- int CFTTGraphicsDeviceOGLES::create() {
- AssessHardware();
- return 1;
- }
- //-------------------------------------------------------------------------------------------------
- //00203174 //^_^
- CFTTGraphicsBuffer *CFTTGraphicsDeviceOGLES::createGraphicsBuffer(EFTTGraphicsBufferType eType,
- EFTTGraphicsBufferVolatility eGbv,
- uint a3) {
- LOGI("CFTTGraphicsDeviceOGLES::createGraphicsBuffer: EFTTGraphicsBufferType=%d; EFTTGraphicsBufferVolatility=%d; a3=%d", eType, eGbv, a3);
- return nullptr;
- }
- //-------------------------------------------------------------------------------------------------
- //002030D4 //^_^
- CFTTRenderToTexture *CFTTGraphicsDeviceOGLES::createRenderToTexture(CFTTRTTSetup s) {
- return nullptr;
- }
- //-------------------------------------------------------------------------------------------------
- //00203090 //^_^
- CFTTRenderToTexture *CFTTGraphicsDeviceOGLES::createRenderToTexture(EFTTTexFormat eTexFormat,
- int a2,
- int a3,
- uint a4,
- int a5,
- EFTTRTTZBufMode eRTTZBufMode,
- bool b,
- EFTTTextureType eTextureType,
- uchar ub) {
- return nullptr;
- }
- //-------------------------------------------------------------------------------------------------
- //00203154 //^_^
- CFTTShaderProgram *CFTTGraphicsDeviceOGLES::createShaderProgram(CFTTUberShader const *pUberShader,
- uchar const *pShader,
- bool flag) {
- LOGI("CFTTGraphicsDeviceOGLES::createShaderProgram Entry");
- return nullptr;
- }
- //-------------------------------------------------------------------------------------------------
- //00203070 //^_^
- CFTTTexture *CFTTGraphicsDeviceOGLES::createTexture(int a2, int a3, int a4, EFTTTexFormat eTexFormat, EFTTTextureType eTextureType) {
- return nullptr;
- }
- //-------------------------------------------------------------------------------------------------
- //0020305C //^_^
- CFTTTexture *CFTTGraphicsDeviceOGLES::createTexture() {
- return nullptr;
- }
- //-------------------------------------------------------------------------------------------------
- //00202934
- void CFTTGraphicsDeviceOGLES::createVolatileResources() {
- //empty
- }
- //-------------------------------------------------------------------------------------------------
- //00202936
- void CFTTGraphicsDeviceOGLES::deleteVolatileResources() {
- //empty
- }
- //-------------------------------------------------------------------------------------------------
- //00202932
- void CFTTGraphicsDeviceOGLES::destroy() {
- //empty
- }
- //-------------------------------------------------------------------------------------------------
- //00203038 //^_^
- void CFTTGraphicsDeviceOGLES::disableScissorTest() {
- }
- //-------------------------------------------------------------------------------------------------
- //00203518 //^_- 经过单元测试,功能正常
- void CFTTGraphicsDeviceOGLES::drawIndexed(FTTPRIMTYPE eType, int a2, int a3, int dindex4, int a5) {
- LOGI("CFTTGraphicsDeviceOGLES::drawIndexed Entry");
- }
- //-------------------------------------------------------------------------------------------------
- //0020355C //^_^ 经过单元测试,功能正常
- void CFTTGraphicsDeviceOGLES::drawNonIndexed(FTTPRIMTYPE eType, int a2) {
- LOGI("CFTTGraphicsDeviceOGLES::drawNonIndexed Entry");
- LOGI("CFTTGraphicsDeviceOGLES::drawNonIndexed end");
- }
- //-------------------------------------------------------------------------------------------------
- //00202F54
- void CFTTGraphicsDeviceOGLES::enableScissorTest(GLint x, GLint y, GLint dWidth, GLint dHeight) {
- }
- //-------------------------------------------------------------------------------------------------
- //00202DC0 //^_^
- void CFTTGraphicsDeviceOGLES::enableStencilTest(bool a2) {
- }
- //-------------------------------------------------------------------------------------------------
- //00202C58 //^_^ 经过单元测试,功能正常
- void CFTTGraphicsDeviceOGLES::endScene() {
- }
- //-------------------------------------------------------------------------------------------------
- //00202CD4 //^_^
- int CFTTGraphicsDeviceOGLES::getDepthBufferBitDepth() const {
- return 1;
- }
- //-------------------------------------------------------------------------------------------------
- //00203114 //^_- 经过单元测试,功能正常
- int CFTTGraphicsDeviceOGLES::getTextureFormatSupport(EFTTTexFormat eFormat, bool a3, bool a4) {
- LOGI("CFTTGraphicsDeviceOGLES::getTextureFormatSupport entry");
- int result = 0;
- return result;
- }
- //-------------------------------------------------------------------------------------------------
- //00202CC4 //^_^
- int CFTTGraphicsDeviceOGLES::height() const {
- return 1;
- }
- //-------------------------------------------------------------------------------------------------
- //00202CE6 //^_^
- int CFTTGraphicsDeviceOGLES::resetDisplay(int, int, int, int) {
- return 1;
- }
- //-------------------------------------------------------------------------------------------------
- //00202D2C //^_- 经过单元测试,功能正常
- void CFTTGraphicsDeviceOGLES::setDepthTest(EFTTDepthTest eDepthTest, bool ba2) {
- LOGI("CFTTGraphicsDeviceOGLES::setDepthTest entry");
- LOGI("CFTTGraphicsDeviceOGLES::setDepthTest end");
- }
- //-------------------------------------------------------------------------------------------------
- //00202CF0 //^_^
- void CFTTGraphicsDeviceOGLES::setDither(bool ba2) {
- }
- //-------------------------------------------------------------------------------------------------
- //00203194 //^_^ 经过单元测试,功能正常
- void CFTTGraphicsDeviceOGLES::setIndexBuffer(CFTTGraphicsBuffer *pBuffer) {
- }
- //-------------------------------------------------------------------------------------------------
- //00202DFC //^_^
- void CFTTGraphicsDeviceOGLES::setStencilFunc(EFTTStencilFunc eFunc, GLuint a_ref, GLuint a_mask) {
- }
- //-------------------------------------------------------------------------------------------------
- //00202F38 //^_^
- void CFTTGraphicsDeviceOGLES::setStencilMask(GLuint a_mask) {
- }
- //-------------------------------------------------------------------------------------------------
- //00202E84
- void CFTTGraphicsDeviceOGLES::setStencilOp(EFTTStencilOp esfail,
- EFTTStencilOp ezfail,
- EFTTStencilOp ezpass) {
- //void glStencilOp(GLenum sfail, GLenum zfail, GLenum zpass)
- }
- //-------------------------------------------------------------------------------------------------
- //002031C4 //-_- 经过单元测试,功能正常
- void CFTTGraphicsDeviceOGLES::setVertexBuffer(CFTTGraphicsBuffer *pGraphBuf, uint a2, uint a3, uint a4) {
- uchar *r4_pbuf = (uchar *)a4;
- CFTTGraphicsBufferOGLES *pBufOGLES = (CFTTGraphicsBufferOGLES *)pGraphBuf;
- if (CFTTGLES2Wrapper::s_uBoundArrayBuffer != pBufOGLES->bindBuf_10) {
- CFTTGLES2Wrapper::s_uBoundArrayBuffer = pBufOGLES->bindBuf_10;
- glBindBuffer(GL_ARRAY_BUFFER, pBufOGLES->bindBuf_10);
- }
- //LOGE("CFTTGLES2Wrapper::s_bVertexAttribEnabled[0]=%x",CFTTGLES2Wrapper::s_bVertexAttribEnabled[0]);
- // LOGE("CFTTGLES2Wrapper::s_bVertexAttribEnabled[0]=%x",CFTTGLES2Wrapper::s_bVertexAttribEnabled[1]);
- // LOGE("CFTTGLES2Wrapper::s_bVertexAttribEnabled[0]=%x",CFTTGLES2Wrapper::s_bVertexAttribEnabled[2]);
- // LOGE("CFTTGLES2Wrapper::s_bVertexAttribEnabled[0]=%x",CFTTGLES2Wrapper::s_bVertexAttribEnabled[3]);
- // LOGE("CFTTGLES2Wrapper::s_bVertexAttribEnabled[0]=%x",CFTTGLES2Wrapper::s_bVertexAttribEnabled[4]);
- // LOGE("CFTTGLES2Wrapper::s_bVertexAttribEnabled[0]=%x",CFTTGLES2Wrapper::s_bVertexAttribEnabled[5]);
- // LOGE("CFTTGLES2Wrapper::s_bVertexAttribEnabled[0]=%x",CFTTGLES2Wrapper::s_bVertexAttribEnabled[6]);
- // LOGE("CFTTGLES2Wrapper::s_bVertexAttribEnabled[0]=%x",CFTTGLES2Wrapper::s_bVertexAttribEnabled[7]);
- // loc_2031EA
- if (!pBufOGLES->bindBuf_10)
- r4_pbuf = pBufOGLES->pBuf_C + a4; // 002031EE 04 44 ADD R4, R0
- // loc_2031F0
- uint r11_uint = a2 & 0xF00;
- uint r5_uint = a2 & 0xF000;
- uint r10_uint = r11_uint;
- if ((a2 & 0xF000000) != 0x2000000)
- r10_uint = 0;
- // 0020320C
- if (a2 & 0xF) {
- if (CFTTGLES2Wrapper::s_bVertexAttribEnabled[0]!=1) {
- // 0020321A
- CFTTGLES2Wrapper::s_bVertexAttribEnabled[0] = 1;
- glEnableVertexAttribArray(0);
- }
- // loc_203224
- switch (a2 & 0xF) {
- case 1:
- // loc_203238
- glVertexAttribPointer(0, 3, GL_FLOAT, false, a3, (const void *)r4_pbuf); // GL_FLOAT
- r4_pbuf += 12;
- break;
- case 2:
- // loc_20325C
- glVertexAttribPointer(0, 3, GL_SHORT, true, a3, (const void *)r4_pbuf);
- r4_pbuf += 8;
- break;
- case 3:
- // loc_203266
- glVertexAttribPointer(0, 3, GL_BYTE, false, a3, (const void *)r4_pbuf); // GL_BYTE
- r4_pbuf += 4;
- break;
- case 4:
- // loc_20327C
- glVertexAttribPointer(0, 2, GL_FLOAT, false, a3, (const void *)r4_pbuf); // GL_FLOAT
- r4_pbuf += 8;
- break;
- case 5:
- // loc_20328C
- glVertexAttribPointer(0, 4, GL_SHORT, true, a3, (const void *)r4_pbuf); // GL_SHORT
- r4_pbuf += 8;
- break;
- default:
- break;
- }
- } else if (CFTTGLES2Wrapper::s_bVertexAttribEnabled[0]) { // loc_20324E
- // 00203250
- CFTTGLES2Wrapper::s_bVertexAttribEnabled[0] = false;
- glDisableVertexAttribArray(0);
- }
- // break_20322E
- if (r5_uint) {
- // 002032A8
- if (CFTTGLES2Wrapper::s_bVertexAttribEnabled[2]!=1) {
- // 002032AC
- CFTTGLES2Wrapper::s_bVertexAttribEnabled[2] = 1;
- glEnableVertexAttribArray(2);
- }
- // loc_2032B6
- switch (r5_uint) {
- case 0x3000:
- // loc_2032EC
- glVertexAttribPointer(2, 3, GL_BYTE, true, a3, (const void *)r4_pbuf);
- r4_pbuf += 4;
- break;
- case 0x2000u:
- // loc_203302
- glVertexAttribPointer(2, 4, GL_SHORT, true, a3, (const void *)r4_pbuf);
- r4_pbuf += 8;
- break;
- case 0x1000u:
- // 002032C8
- glVertexAttribPointer(2, 3, GL_FLOAT, false, a3, (const void *)r4_pbuf);
- r4_pbuf += 12;
- break;
- }
- } else if (CFTTGLES2Wrapper::s_bVertexAttribEnabled[2]) { // loc_2032DE
- // 002032E0
- CFTTGLES2Wrapper::s_bVertexAttribEnabled[2] = false;
- glDisableVertexAttribArray(2);
- }
- // loc_203316
- uint r7_uint = a2 & 0xF0;
- if (r7_uint) {
- if (CFTTGLES2Wrapper::s_bVertexAttribEnabled[1]!=1) {
- CFTTGLES2Wrapper::s_bVertexAttribEnabled[1] = 1;
- glEnableVertexAttribArray(1);
- }
- // loc_203328
- if (r7_uint == 32) {
- // loc_203354
- glVertexAttribPointer(1, 4, GL_FLOAT, false, a3, (const void *)r4_pbuf);
- r4_pbuf += 16;
- } else if (r7_uint == 16) {
- // 00203330
- glVertexAttribPointer(1, 4, GL_UNSIGNED_BYTE, true, a3, (const void *)r4_pbuf);
- r4_pbuf += 4;
- }
- } else if (CFTTGLES2Wrapper::s_bVertexAttribEnabled[1]) { // loc_203346
- CFTTGLES2Wrapper::s_bVertexAttribEnabled[1] = false;
- glDisableVertexAttribArray(1);
- }
- // loc_203368
- if (r11_uint) {
- // 00203370
- if (CFTTGLES2Wrapper::s_bVertexAttribEnabled[3]!=1) {
- // 00203374
- CFTTGLES2Wrapper::s_bVertexAttribEnabled[3] = 1;
- glEnableVertexAttribArray(3);
- }
- // loc_20337E
- r11_uint=r11_uint&0xFFF;
- if (r11_uint == 0x200) {
- // loc_2033B2
- glVertexAttribPointer(3, 2, GL_SHORT, true, a3, (const void *)r4_pbuf);
- r4_pbuf += 4;
- } else if (r11_uint == 0x100) {
- // 0020338E
- glVertexAttribPointer(3, 2, GL_FLOAT, false, a3, (const void *)r4_pbuf);
- r4_pbuf += 8;
- }
- } else if (CFTTGLES2Wrapper::s_bVertexAttribEnabled[3]) { // loc_2033A4
- CFTTGLES2Wrapper::s_bVertexAttribEnabled[3] = false;
- glDisableVertexAttribArray(3);
- }
- // loc_2033C6
- if (r10_uint) {
- if (CFTTGLES2Wrapper::s_bVertexAttribEnabled[4]!=1) {
- CFTTGLES2Wrapper::s_bVertexAttribEnabled[4] = 1;
- glEnableVertexAttribArray(4);
- }
- // loc_2033E0
- if ((r10_uint & 0xFFF) == 0x200) {
- // loc_203414
- glVertexAttribPointer(4, 2, GL_SHORT, true, a3, (const void *)r4_pbuf);
- r4_pbuf += 4;
- } else if ((r10_uint & 0xFFF) == 0x100) {
- // loc_203428
- glVertexAttribPointer(4, 2, GL_FLOAT, false, a3, (const void *)r4_pbuf);
- r4_pbuf += 8;
- }
- } else if (CFTTGLES2Wrapper::s_bVertexAttribEnabled[4]) { // loc_203406
- CFTTGLES2Wrapper::s_bVertexAttribEnabled[4] = false;
- glDisableVertexAttribArray(4);
- }
- // loc_203428
- r5_uint = a2 & 0xF00000; ////loc_2033C6
- if (r5_uint) {
- // 0020342C
- if (CFTTGLES2Wrapper::s_bVertexAttribEnabled[5]!=1) {
- // 00203430
- CFTTGLES2Wrapper::s_bVertexAttribEnabled[5] = true;
- glEnableVertexAttribArray(5);
- }
- // loc_20343A
- if ((r5_uint&0xffffff) == 0x300000) {
- // loc_203474
- glVertexAttribPointer(5, 3, GL_BYTE, true, a3, (const void *)r4_pbuf);
- r4_pbuf += 4;
- } else if ((r5_uint&0xffffff) == 0x200000) {
- // loc_20348A
- glVertexAttribPointer(5, 4, GL_SHORT, true, a3, (const void *)r4_pbuf);
- r4_pbuf += 8;
- } else if ((r5_uint&0xffffff) == 0x100000) {
- // 00203450
- glVertexAttribPointer(5, 3, GL_FLOAT, false, a3, (const void *)r4_pbuf);
- r4_pbuf += 12;
- }
- } else if (CFTTGLES2Wrapper::s_bVertexAttribEnabled[5]) {
- CFTTGLES2Wrapper::s_bVertexAttribEnabled[5] = false;
- glDisableVertexAttribArray(5);
- }
- // loc_20349E
- if (a3 >= 0x10000000) {
- // 002034A6
- if (CFTTGLES2Wrapper::s_bVertexAttribEnabled[6]!=1) {
- // 002034AA
- CFTTGLES2Wrapper::s_bVertexAttribEnabled[6] = 0;
- glEnableVertexAttribArray(6);
- }
- // loc_2034B4
- glVertexAttribPointer(6, 4, GL_UNSIGNED_BYTE, false, a3, (const void *)r4_pbuf);
- r4_pbuf += 4; // 002034C8 04 34 ADDS R4, #4
- if (CFTTGLES2Wrapper::s_bVertexAttribEnabled[7]!=1) {
- CFTTGLES2Wrapper::s_bVertexAttribEnabled[7] = 1;
- glEnableVertexAttribArray(7);
- }
- // loc_2034D8
- glVertexAttribPointer(7, 4, GL_UNSIGNED_SHORT, true, a3, r4_pbuf);
- } else {
- // loc_2034EE
- if (CFTTGLES2Wrapper::s_bVertexAttribEnabled[6]) {
- CFTTGLES2Wrapper::s_bVertexAttribEnabled[6] = false;
- glDisableVertexAttribArray(6);
- }
- // loc_2034FA
- if (CFTTGLES2Wrapper::s_bVertexAttribEnabled[7]) {
- CFTTGLES2Wrapper::s_bVertexAttribEnabled[7] = false;
- glDisableVertexAttribArray(7);
- }
- }
- }
- //-------------------------------------------------------------------------------------------------
- //00202CE4
- void CFTTGraphicsDeviceOGLES::setWindowHandle(void *) {
- //empty
- }
- //-------------------------------------------------------------------------------------------------
- //00202CEA
- void CFTTGraphicsDeviceOGLES::setWireFrame(bool b) {
- }
- //-------------------------------------------------------------------------------------------------
- //00202CB4 //^_^
- int CFTTGraphicsDeviceOGLES::width() const {
- return 1;
- }
- //-------------------------------------------------------------------------------------------------
- /*
- 0020289C CFTTGraphicsDeviceOGLES::CFTTGraphicsDeviceOGLES()
- 00202938 CFTTGraphicsDeviceOGLES::GetGPUName(wchar_t *,int)
- 00202954 CFTTGraphicsDeviceOGLES::beginScene(CFTTClearSettings const&,CFTTRenderTarget *,bool)
- 00202D2C CFTTGraphicsDeviceOGLES::setDepthTest(EFTTDepthTest,bool)
- 00202DC0 CFTTGraphicsDeviceOGLES::enableStencilTest(bool)
- 0020305C CFTTGraphicsDeviceOGLES::createTexture()
- 00203070 CFTTGraphicsDeviceOGLES::createTexture(int,int,int,EFTTTexFormat,EFTTTextureType)
- 00203090 CFTTGraphicsDeviceOGLES::createRenderToTexture(EFTTTexFormat,int,int,uint,int,EFTTRTTZBufMode,bool,EFTTTextureType,uchar)
- 002030D4 CFTTGraphicsDeviceOGLES::createRenderToTexture(CFTTRTTSetup)
- 00203114 CFTTGraphicsDeviceOGLES::getTextureFormatSupport(EFTTTexFormat,bool,bool)
- 00203154 CFTTGraphicsDeviceOGLES::createShaderProgram(CFTTUberShader const*,uchar const*,bool)
- 00203174 CFTTGraphicsDeviceOGLES::createGraphicsBuffer(EFTTGraphicsBufferType,EFTTGraphicsBufferVolatility,uint)
- 00203194 CFTTGraphicsDeviceOGLES::setIndexBuffer(CFTTGraphicsBuffer *)
- 002031C4 CFTTGraphicsDeviceOGLES::setVertexBuffer(CFTTGraphicsBuffer *,uint,uint,uint)
- 00203518 CFTTGraphicsDeviceOGLES::drawIndexed(FTTPRIMTYPE,int,int,int,int)
- 00203594 CFTTGraphicsDeviceOGLES::AssessHardware()
- 00203852 CFTTGraphicsDeviceOGLES::TrustGlGenerateMipmap()
- 00203868 CFTTGraphicsDeviceOGLES::GetRendererFamily()
- 0020386C CFTTGraphicsDeviceOGLES::GetRendererType()
- 00203870 CFTTGraphicsDeviceOGLES::Matrices_FlipsRTT()
- 00203874 CFTTGraphicsDeviceOGLES::Matrices_FlipsY()
- 00203878 CFTTGraphicsDeviceOGLES::Matrices_NDCIsCube()
- 0020387C CFTTGraphicsDeviceOGLES::DepthTextureSupported()
- 00203898 CFTTGraphicsDeviceOGLES::ARGBToPlatformU32(uint,uint,uint,uint)
- 002038A8 CFTTGraphicsDeviceOGLES::ARGBToPlatformU32(uint)
- 002038EC CFTTGraphicsDeviceOGLES::ARGBToPlatform4444(uint)
- */
|