{"type": "func", "start": 5369007248, "end": 5369007727, "name": "CCSpriteWithHue::draw", "pseudocode": "// \n// CCSpriteWithHue::draw from 0x140048c90 to 0x140048e6f (479 bytes)\n// \n// 5 xrefs:\n// > <???> @ 0x140530f08\n// > <???> @ 0x140531448\n// > <???> @ 0x14066319c\n// > <???> @ 0x1406631ac\n// > <???> @ 0x1406c4be4\n// \n// This function is hookable on this platform!\n// \n// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings\n// \n\n// write access to const memory has been detected, the output may be wrong!\nvoid CCSpriteWithHue::draw(CCSpriteWithHue *a1)\n{\n  cocos2d::CCGLProgram *v2; // rax\n  cocos2d::CCGLProgram *v3; // rax\n  GLuint v4; // eax\n  unsigned int v5; // edx\n  unsigned int v6; // edx\n  cocos2d::CCGLProgram *v7; // rax\n  float v8; // xmm6_4\n  cocos2d::CCGLProgram *v9; // rax\n  cocos2d::CCGLProgram *v10; // rax\n\n  if ( !a1->m_bDontDraw )\n  {\n    if ( a1->_realOpacity )\n    {\n      cocos2d::ccGLEnable((cocos2d *)(unsigned int)a1->m_eGLServerState);\n      a1->getShaderProgram(a1);\n      v2 = a1->getShaderProgram(a1);\n      cocos2d::CCGLProgram::use(v2);\n      v3 = a1->getShaderProgram(a1);\n      cocos2d::CCGLProgram::setUniformsForBuiltins(v3);\n      cocos2d::ccGLBlendFunc((cocos2d *)a1->m_sBlendFunc.src, a1->m_sBlendFunc.dst);\n      v4 = a1->m_pobTexture->getName(a1->m_pobTexture);\n      cocos2d::ccGLBindTexture2D((cocos2d *)v4, v5);\n      cocos2d::ccGLEnableVertexAttribs((cocos2d *)7, v6);\n      v7 = a1->getShaderProgram(a1);\n      cocos2d::CCGLProgram::setUniformLocationWithMatrix3fv(v7, a1->m_uHueLoc, (float *)&a1->m_colorMatrix, 1u);\n      v8 = (float)a1->_displayedOpacity / 255.0;\n      v9 = a1->getShaderProgram(a1);\n      cocos2d::CCGLProgram::setUniformLocationWith1f(v9, a1->m_uAlphaLoc, v8);\n      v10 = a1->getShaderProgram(a1);\n      cocos2d::CCGLProgram::setUniformLocationWith3f(\n        v10,\n        a1->m_uLumLoc,\n        a1->m_luminance._Elems[0],\n        a1->m_luminance._Elems[1],\n        a1->m_luminance._Elems[2]);\n      _glewVertexAttribPointer(0, 3, 5126);\n      _glewVertexAttribPointer(2, 2, 5126);\n      _glewVertexAttribPointer(1, 4, 5121);\n      glDrawArrays(5u, 0, 4);\n      ++g_uNumberOfDraws;\n    }\n  }\n}", "assembly": "; \n; CCSpriteWithHue::draw from 0x140048c90 to 0x140048e6f (479 bytes)\n; \n; 5 xrefs:\n; > <???> @ 0x140530f08\n; > <???> @ 0x140531448\n; > <???> @ 0x14066319c\n; > <???> @ 0x1406631ac\n; > <???> @ 0x1406c4be4\n; \n; This function is hookable on this platform!\n; \n; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA\n; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings\n; \n\npush    rdi                                                            ; +0x0, 0x140048c90\nsub     rsp, 40h                                                       ; +0x2, 0x140048c92\ncmp     byte ptr [rcx+22Fh], 0                                         ; +0x6, 0x140048c96\nmov     rdi, rcx                                                       ; +0xd, 0x140048c9d\njnz     loc_140048E69                                                  ; +0x10, 0x140048ca0\ncmp     byte ptr [rcx+149h], 0                                         ; +0x16, 0x140048ca6\njz      loc_140048E69                                                  ; +0x1d, 0x140048cad\nmov     ecx, [rcx+0F8h]                                                ; +0x23, 0x140048cb3\nmov     [rsp+48h+arg_0], rbx                                           ; +0x29, 0x140048cb9\nmovaps  [rsp+48h+var_18], xmm6                                         ; +0x2e, 0x140048cbe\ncall    cs:?ccGLEnable@cocos2d@@YAXW4ccGLServerState@1@@Z; cocos2d::ccGLEnable(cocos2d::ccGLServerState) ; +0x33, 0x140048cc3\nmov     rax, [rdi]                                                     ; +0x39, 0x140048cc9\nmov     rcx, rdi                                                       ; +0x3c, 0x140048ccc\ncall    qword ptr [rax+278h]                                           ; +0x3f, 0x140048ccf\nmov     rax, [rdi]                                                     ; +0x45, 0x140048cd5\nmov     rcx, rdi                                                       ; +0x48, 0x140048cd8\ncall    qword ptr [rax+278h]                                           ; +0x4b, 0x140048cdb\nmov     rcx, rax                                                       ; +0x51, 0x140048ce1\ncall    cs:?use@CCGLProgram@cocos2d@@QEAAXXZ; cocos2d::CCGLProgram::use(void) ; +0x54, 0x140048ce4\nmov     rax, [rdi]                                                     ; +0x5a, 0x140048cea\nmov     rcx, rdi                                                       ; +0x5d, 0x140048ced\ncall    qword ptr [rax+278h]                                           ; +0x60, 0x140048cf0\nmov     rcx, rax                                                       ; +0x66, 0x140048cf6\ncall    cs:?setUniformsForBuiltins@CCGLProgram@cocos2d@@QEAAXXZ; cocos2d::CCGLProgram::setUniformsForBuiltins(void) ; +0x69, 0x140048cf9\nmov     edx, [rdi+198h]                                                ; +0x6f, 0x140048cff\nmov     ecx, [rdi+194h]                                                ; +0x75, 0x140048d05\ncall    cs:?ccGLBlendFunc@cocos2d@@YAXII@Z; cocos2d::ccGLBlendFunc(uint,uint) ; +0x7b, 0x140048d0b\nmov     rcx, [rdi+1A0h]                                                ; +0x81, 0x140048d11\nmov     rax, [rcx]                                                     ; +0x88, 0x140048d18\ncall    qword ptr [rax+60h]                                            ; +0x8b, 0x140048d1b\nmov     ecx, eax                                                       ; +0x8e, 0x140048d1e\ncall    cs:?ccGLBindTexture2D@cocos2d@@YAXI@Z; cocos2d::ccGLBindTexture2D(uint) ; +0x90, 0x140048d20\nmov     ecx, 7                                                         ; +0x96, 0x140048d26\ncall    cs:?ccGLEnableVertexAttribs@cocos2d@@YAXI@Z; cocos2d::ccGLEnableVertexAttribs(uint) ; +0x9b, 0x140048d2b\nmov     rax, [rdi]                                                     ; +0xa1, 0x140048d31\nmov     rcx, rdi                                                       ; +0xa4, 0x140048d34\ncall    qword ptr [rax+278h]                                           ; +0xa7, 0x140048d37\nmov     edx, [rdi+28Ch]                                                ; +0xad, 0x140048d3d\nlea     r8, [rdi+268h]                                                 ; +0xb3, 0x140048d43\nmov     rcx, rax                                                       ; +0xba, 0x140048d4a\nmov     r9d, 1                                                         ; +0xbd, 0x140048d4d\ncall    cs:?setUniformLocationWithMatrix3fv@CCGLProgram@cocos2d@@QEAAXHPEAMI@Z; cocos2d::CCGLProgram::setUniformLocationWithMatrix3fv(int,float *,uint) ; +0xc3, 0x140048d53\nmovzx   eax, byte ptr [rdi+148h]                                       ; +0xc9, 0x140048d59\nmov     rcx, rdi                                                       ; +0xd0, 0x140048d60\nmovd    xmm6, eax                                                      ; +0xd3, 0x140048d63\nmov     rax, [rdi]                                                     ; +0xd7, 0x140048d67\ncvtdq2ps xmm6, xmm6                                                    ; +0xda, 0x140048d6a\ndivss   xmm6, cs:dword_140623418                                       ; +0xdd, 0x140048d6d\ncall    qword ptr [rax+278h]                                           ; +0xe5, 0x140048d75\nmov     edx, [rdi+290h]                                                ; +0xeb, 0x140048d7b\nmovaps  xmm2, xmm6                                                     ; +0xf1, 0x140048d81\nmov     rcx, rax                                                       ; +0xf4, 0x140048d84\ncall    cs:?setUniformLocationWith1f@CCGLProgram@cocos2d@@QEAAXHM@Z; cocos2d::CCGLProgram::setUniformLocationWith1f(int,float) ; +0xf7, 0x140048d87\nmov     rax, [rdi]                                                     ; +0xfd, 0x140048d8d\nmov     rcx, rdi                                                       ; +0x100, 0x140048d90\ncall    qword ptr [rax+278h]                                           ; +0x103, 0x140048d93\nmovss   xmm0, dword ptr [rdi+264h]                                     ; +0x109, 0x140048d99\nmov     rcx, rax                                                       ; +0x111, 0x140048da1\nmovss   xmm3, dword ptr [rdi+260h]                                     ; +0x114, 0x140048da4\nmovss   xmm2, dword ptr [rdi+25Ch]                                     ; +0x11c, 0x140048dac\nmov     edx, [rdi+294h]                                                ; +0x124, 0x140048db4\nmovss   [rsp+48h+var_28], xmm0                                         ; +0x12a, 0x140048dba\ncall    cs:?setUniformLocationWith3f@CCGLProgram@cocos2d@@QEAAXHMMM@Z; cocos2d::CCGLProgram::setUniformLocationWith3f(int,float,float,float) ; +0x130, 0x140048dc0\nmov     rax, cs:__glewVertexAttribPointer                              ; +0x136, 0x140048dc6\nlea     rbx, [rdi+1CCh]                                                ; +0x13d, 0x140048dcd\nxor     r9d, r9d                                                       ; +0x144, 0x140048dd4\nmov     [rsp+48h+var_20], rbx                                          ; +0x147, 0x140048dd7\nxor     ecx, ecx                                                       ; +0x14c, 0x140048ddc\nmov     [rsp+48h+var_28], 18h                                          ; +0x14e, 0x140048dde\nmov     r8d, 1406h                                                     ; +0x156, 0x140048de6\nlea     edx, [r9+3]                                                    ; +0x15c, 0x140048dec\ncall    qword ptr [rax]                                                ; +0x160, 0x140048df0\nlea     rax, [rbx+10h]                                                 ; +0x162, 0x140048df2\nmov     edx, 2                                                         ; +0x166, 0x140048df6\nmov     [rsp+48h+var_20], rax                                          ; +0x16b, 0x140048dfb\nxor     r9d, r9d                                                       ; +0x170, 0x140048e00\nmov     rax, cs:__glewVertexAttribPointer                              ; +0x173, 0x140048e03\nmov     ecx, edx                                                       ; +0x17a, 0x140048e0a\nmov     r8d, 1406h                                                     ; +0x17c, 0x140048e0c\nmov     [rsp+48h+var_28], 18h                                          ; +0x182, 0x140048e12\ncall    qword ptr [rax]                                                ; +0x18a, 0x140048e1a\nmov     edx, 4                                                         ; +0x18c, 0x140048e1c\nlea     rax, [rbx+0Ch]                                                 ; +0x191, 0x140048e21\nmov     [rsp+48h+var_20], rax                                          ; +0x195, 0x140048e25\nmov     r9b, 1                                                         ; +0x19a, 0x140048e2a\nmov     [rsp+48h+var_28], 18h                                          ; +0x19d, 0x140048e2d\nmov     r8d, 1401h                                                     ; +0x1a5, 0x140048e35\nlea     ecx, [rdx-3]                                                   ; +0x1ab, 0x140048e3b\nmov     rax, cs:__glewVertexAttribPointer                              ; +0x1ae, 0x140048e3e\ncall    qword ptr [rax]                                                ; +0x1b5, 0x140048e45\nxor     edx, edx; first                                                ; +0x1b7, 0x140048e47\nlea     ecx, [rdx+5]; mode                                             ; +0x1b9, 0x140048e49\nlea     r8d, [rdx+4]; count                                            ; +0x1bc, 0x140048e4c\ncall    cs:glDrawArrays                                                ; +0x1c0, 0x140048e50\nmov     rax, cs:?g_uNumberOfDraws@@3IA; uint g_uNumberOfDraws          ; +0x1c6, 0x140048e56\nmovaps  xmm6, [rsp+48h+var_18]                                         ; +0x1cd, 0x140048e5d\nmov     rbx, [rsp+48h+arg_0]                                           ; +0x1d2, 0x140048e62\ninc     dword ptr [rax]                                                ; +0x1d7, 0x140048e67\nadd     rsp, 40h                                                       ; +0x1d9, 0x140048e69\npop     rdi                                                            ; +0x1dd, 0x140048e6d\nretn                                                                   ; +0x1de, 0x140048e6e", "xrefs": ["<???> @ 0x140530f08", "<???> @ 0x140531448", "<???> @ 0x14066319c", "<???> @ 0x1406631ac", "<???> @ 0x1406c4be4"], "is_objc": false, "is_arm32": false, "is_arm64": false, "bida_info": "8.0.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings"}