{"type": "func", "start": 4301195488, "end": 4301195909, "name": "CCSpriteWithHue::draw", "pseudocode": "// \n// CCSpriteWithHue::draw from 0x1005f08e0 to 0x1005f0a85 (421 bytes)\n// \n// 2 xrefs:\n// > <???> @ 0x10097a480\n// > <???> @ 0x10097aa38\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\nvoid __fastcall CCSpriteWithHue::draw(CCSpriteWithHue *a1)\n{\n  cocos2d::CCGLProgram *v2; // rax\n  cocos2d::CCGLProgram *v3; // rax\n  unsigned int v4; // eax\n  cocos2d::CCGLProgram *v5; // rax\n  cocos2d::CCGLProgram *v6; // rax\n  cocos2d::CCGLProgram *v7; // rax\n\n  if ( !a1->m_bDontDraw )\n  {\n    if ( a1->_realOpacity )\n    {\n      cocos2d::ccGLEnable(a1->m_eGLServerState);\n      ((void (__fastcall *)(CCSpriteWithHue *))a1->getShaderProgram)(a1);\n      v2 = (cocos2d::CCGLProgram *)((__int64 (__fastcall *)(CCSpriteWithHue *))a1->getShaderProgram)(a1);\n      cocos2d::CCGLProgram::use(v2);\n      v3 = (cocos2d::CCGLProgram *)((__int64 (__fastcall *)(CCSpriteWithHue *))a1->getShaderProgram)(a1);\n      cocos2d::CCGLProgram::setUniformsForBuiltins(v3);\n      cocos2d::ccGLBlendFunc(a1->m_sBlendFunc.src, a1->m_sBlendFunc.dst);\n      v4 = ((__int64 (__fastcall *)(cocos2d::CCTexture2D *))a1->m_pobTexture->getName)(a1->m_pobTexture);\n      cocos2d::ccGLBindTexture2D(v4);\n      cocos2d::ccGLEnableVertexAttribs(7u);\n      v5 = (cocos2d::CCGLProgram *)((__int64 (__fastcall *)(CCSpriteWithHue *))a1->getShaderProgram)(a1);\n      cocos2d::CCGLProgram::setUniformLocationWithMatrix3fv(v5, a1->m_uHueLoc, (float *)&a1->m_colorMatrix, 1u);\n      v6 = (cocos2d::CCGLProgram *)((__int64 (__fastcall *)(CCSpriteWithHue *))a1->getShaderProgram)(a1);\n      cocos2d::CCGLProgram::setUniformLocationWith1f(v6, a1->m_uAlphaLoc, (float)a1->_displayedOpacity / 255.0);\n      v7 = (cocos2d::CCGLProgram *)((__int64 (__fastcall *)(CCSpriteWithHue *))a1->getShaderProgram)(a1);\n      cocos2d::CCGLProgram::setUniformLocationWith3f(\n        v7,\n        a1->m_uLumLoc,\n        a1->m_luminance.__elems_[0],\n        a1->m_luminance.__elems_[1],\n        a1->m_luminance.__elems_[2]);\n      glVertexAttribPointer(0, 3, 0x1406u, 0, 24, &a1->m_sQuad);\n      glVertexAttribPointer(2u, 2, 0x1406u, 0, 24, &a1->m_sQuad.tl.texCoords);\n      glVertexAttribPointer(1u, 4, 0x1401u, 1u, 24, &a1->m_sQuad.tl.colors);\n      glDrawArrays(5u, 0, 4);\n      ++dword_1009A4FB0;\n    }\n  }\n}", "assembly": "; \n; CCSpriteWithHue::draw from 0x1005f08e0 to 0x1005f0a85 (421 bytes)\n; \n; 2 xrefs:\n; > <???> @ 0x10097a480\n; > <???> @ 0x10097aa38\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\ncmp     byte ptr [rdi+22Fh], 0                                         ; +0x0, 0x1005f08e0\njnz     locret_1005F0A84                                               ; +0x7, 0x1005f08e7\ncmp     byte ptr [rdi+149h], 0                                         ; +0xd, 0x1005f08ed\njz      locret_1005F0A84                                               ; +0x14, 0x1005f08f4\npush    rbp                                                            ; +0x1a, 0x1005f08fa\nmov     rbp, rsp                                                       ; +0x1b, 0x1005f08fb\npush    rbx                                                            ; +0x1e, 0x1005f08fe\npush    rax                                                            ; +0x1f, 0x1005f08ff\nmov     eax, [rdi+0F8h]                                                ; +0x20, 0x1005f0900\nmov     rbx, rdi                                                       ; +0x26, 0x1005f0906\nmov     edi, eax                                                       ; +0x29, 0x1005f0909\ncall    cocos2d__ccGLEnable                                            ; +0x2b, 0x1005f090b\nmov     rax, [rbx]                                                     ; +0x30, 0x1005f0910\nmov     rdi, rbx                                                       ; +0x33, 0x1005f0913\ncall    qword ptr [rax+280h]                                           ; +0x36, 0x1005f0916\nmov     rax, [rbx]                                                     ; +0x3c, 0x1005f091c\nmov     rdi, rbx                                                       ; +0x3f, 0x1005f091f\ncall    qword ptr [rax+280h]                                           ; +0x42, 0x1005f0922\nmov     rdi, rax                                                       ; +0x48, 0x1005f0928\ncall    cocos2d__CCGLProgram__use                                      ; +0x4b, 0x1005f092b\nmov     rax, [rbx]                                                     ; +0x50, 0x1005f0930\nmov     rdi, rbx                                                       ; +0x53, 0x1005f0933\ncall    qword ptr [rax+280h]                                           ; +0x56, 0x1005f0936\nmov     rdi, rax                                                       ; +0x5c, 0x1005f093c\ncall    cocos2d__CCGLProgram__setUniformsForBuiltins                   ; +0x5f, 0x1005f093f\nmov     edi, [rbx+194h]; sfactor                                       ; +0x64, 0x1005f0944\nmov     esi, [rbx+198h]; dfactor                                       ; +0x6a, 0x1005f094a\ncall    cocos2d__ccGLBlendFunc                                         ; +0x70, 0x1005f0950\nmov     rdi, [rbx+1A0h]                                                ; +0x75, 0x1005f0955\nmov     rax, [rdi]                                                     ; +0x7c, 0x1005f095c\ncall    qword ptr [rax+68h]                                            ; +0x7f, 0x1005f095f\nmov     edi, eax; texture                                              ; +0x82, 0x1005f0962\ncall    cocos2d__ccGLBindTexture2D                                     ; +0x84, 0x1005f0964\nmov     edi, 7                                                         ; +0x89, 0x1005f0969\ncall    cocos2d__ccGLEnableVertexAttribs                               ; +0x8e, 0x1005f096e\nmov     rax, [rbx]                                                     ; +0x93, 0x1005f0973\nmov     rdi, rbx                                                       ; +0x96, 0x1005f0976\ncall    qword ptr [rax+280h]                                           ; +0x99, 0x1005f0979\nmov     esi, [rbx+288h]                                                ; +0x9f, 0x1005f097f\nlea     rdx, [rbx+264h]                                                ; +0xa5, 0x1005f0985\nmov     rdi, rax                                                       ; +0xac, 0x1005f098c\nmov     ecx, 1                                                         ; +0xaf, 0x1005f098f\ncall    cocos2d__CCGLProgram__setUniformLocationWithMatrix3fv          ; +0xb4, 0x1005f0994\nmov     rax, [rbx]                                                     ; +0xb9, 0x1005f0999\nmov     rdi, rbx                                                       ; +0xbc, 0x1005f099c\ncall    qword ptr [rax+280h]                                           ; +0xbf, 0x1005f099f\nmovzx   ecx, byte ptr [rbx+148h]                                       ; +0xc5, 0x1005f09a5\ncvtsi2ss xmm0, ecx                                                     ; +0xcc, 0x1005f09ac\nmov     esi, [rbx+28Ch]                                                ; +0xd0, 0x1005f09b0\ndivss   xmm0, cs:dword_100815C10                                       ; +0xd6, 0x1005f09b6\nmov     rdi, rax                                                       ; +0xde, 0x1005f09be\ncall    cocos2d__CCGLProgram__setUniformLocationWith1f                 ; +0xe1, 0x1005f09c1\nmov     rax, [rbx]                                                     ; +0xe6, 0x1005f09c6\nmov     rdi, rbx                                                       ; +0xe9, 0x1005f09c9\ncall    qword ptr [rax+280h]                                           ; +0xec, 0x1005f09cc\nmov     esi, [rbx+290h]                                                ; +0xf2, 0x1005f09d2\nmovss   xmm0, dword ptr [rbx+258h]                                     ; +0xf8, 0x1005f09d8\nmovss   xmm1, dword ptr [rbx+25Ch]                                     ; +0x100, 0x1005f09e0\nmovss   xmm2, dword ptr [rbx+260h]                                     ; +0x108, 0x1005f09e8\nmov     rdi, rax                                                       ; +0x110, 0x1005f09f0\ncall    cocos2d__CCGLProgram__setUniformLocationWith3f                 ; +0x113, 0x1005f09f3\nlea     r9, [rbx+1CCh]; pointer                                        ; +0x118, 0x1005f09f8\nxor     edi, edi; index                                                ; +0x11f, 0x1005f09ff\nmov     esi, 3; size                                                   ; +0x121, 0x1005f0a01\nmov     edx, 1406h; type                                               ; +0x126, 0x1005f0a06\nxor     ecx, ecx; normalized                                           ; +0x12b, 0x1005f0a0b\nmov     r8d, 18h; stride                                               ; +0x12d, 0x1005f0a0d\ncall    _glVertexAttribPointer                                         ; +0x133, 0x1005f0a13\nlea     r9, [rbx+1DCh]; pointer                                        ; +0x138, 0x1005f0a18\nmov     edi, 2; index                                                  ; +0x13f, 0x1005f0a1f\nmov     esi, 2; size                                                   ; +0x144, 0x1005f0a24\nmov     edx, 1406h; type                                               ; +0x149, 0x1005f0a29\nxor     ecx, ecx; normalized                                           ; +0x14e, 0x1005f0a2e\nmov     r8d, 18h; stride                                               ; +0x150, 0x1005f0a30\ncall    _glVertexAttribPointer                                         ; +0x156, 0x1005f0a36\nadd     rbx, 1D8h                                                      ; +0x15b, 0x1005f0a3b\nmov     edi, 1; index                                                  ; +0x162, 0x1005f0a42\nmov     esi, 4; size                                                   ; +0x167, 0x1005f0a47\nmov     edx, 1401h; type                                               ; +0x16c, 0x1005f0a4c\nmov     ecx, 1; normalized                                             ; +0x171, 0x1005f0a51\nmov     r8d, 18h; stride                                               ; +0x176, 0x1005f0a56\nmov     r9, rbx; pointer                                               ; +0x17c, 0x1005f0a5c\ncall    _glVertexAttribPointer                                         ; +0x17f, 0x1005f0a5f\nmov     edi, 5; mode                                                   ; +0x184, 0x1005f0a64\nxor     esi, esi; first                                                ; +0x189, 0x1005f0a69\nmov     edx, 4; count                                                  ; +0x18b, 0x1005f0a6b\ncall    _glDrawArrays                                                  ; +0x190, 0x1005f0a70\nlea     rax, dword_1009A4FB0                                           ; +0x195, 0x1005f0a75\ninc     dword ptr [rax]                                                ; +0x19c, 0x1005f0a7c\nadd     rsp, 8                                                         ; +0x19e, 0x1005f0a7e\npop     rbx                                                            ; +0x1a2, 0x1005f0a82\npop     rbp                                                            ; +0x1a3, 0x1005f0a83\nretn                                                                   ; +0x1a4, 0x1005f0a84", "xrefs": ["<???> @ 0x10097a480", "<???> @ 0x10097aa38"], "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"}