{"type": "func", "start": 6443235632, "end": 6443236231, "name": "cocos2d::CCDirector::setProjection", "pseudocode": "// \n// cocos2d::CCDirector::setProjection from 0x1800bf930 to 0x1800bfb87 (599 bytes)\n// \n// 10 xrefs:\n// > cocos2d::CCGridBase::afterDraw @ 0x1800225e8\n// > cocos2d::CCGridBase::setActive @ 0x18002394d\n// > cocos2d::CCRenderTexture::begin @ 0x18005f3fb\n// > cocos2d::CCEGLView::updateWindow @ 0x1800792a3\n// > cocos2d::CCDirector::reshapeProjection @ 0x1800bf29e\n// > cocos2d::CCDirector::setGLDefaultValues @ 0x1800bf65c\n// > <???> @ 0x180141e58\n// > <???> @ 0x180141e68\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b936c\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 cocos2d::CCDirector::setProjection(cocos2d::CCDirector *this, enum cocos2d::ccDirectorProjection a2)\n{\n  cocos2d *m_pProjectionDelegate; // rcx\n  float v5; // xmm7_4\n  __int64 v6; // rdx\n  float v7; // [rsp+48h] [rbp-C0h] BYREF\n  float v8; // [rsp+4Ch] [rbp-BCh]\n  int v9; // [rsp+50h] [rbp-B8h] BYREF\n  float v10[4]; // [rsp+60h] [rbp-A8h] BYREF\n  float v11[6]; // [rsp+70h] [rbp-98h] BYREF\n  float v12[16]; // [rsp+88h] [rbp-80h] BYREF\n  float v13[16]; // [rsp+C8h] [rbp-40h] BYREF\n\n  cocos2d::cc_timeval::operator=(&v7, &this->m_obWinSizeInPoints);\n  if ( this->m_pobOpenGLView )\n  {\n    cocos2d::cc_timeval::operator=(&v9, &this->m_obWinSizeInPoints);\n    ((void (__fastcall *)(cocos2d::CCEGLView *))this->m_pobOpenGLView->setViewPortInPoints)(this->m_pobOpenGLView);\n  }\n  if ( a2 )\n  {\n    m_pProjectionDelegate = (cocos2d *)(unsigned int)(a2 - 1);\n    if ( a2 == kCCDirectorProjection3D )\n    {\n      v5 = this->m_obWinSizeInPoints.height / 1.1547005;\n      kmGLMatrixMode(5889);\n      kmGLLoadIdentity();\n      kmMat4PerspectiveProjection((__int64)v13, v6, v7 / v8, 0.1, v5 + v5);\n      kmGLMultMatrix(v13);\n      kmGLMatrixMode(5888);\n      kmGLLoadIdentity();\n      kmVec3Fill(v11, v7 * 0.5, v8 * 0.5, v5);\n      kmVec3Fill(v10, v7 * 0.5, v8 * 0.5, 0.0);\n      kmVec3Fill((float *)&v9, 0.0, 1.0, 0.0);\n      kmMat4LookAt((__int64)v12, v11, (__int64)v10, (__int64)&v9);\n      kmGLMultMatrix(v12);\n    }\n    else if ( a2 == kCCDirectorProjectionCustom )\n    {\n      m_pProjectionDelegate = (cocos2d *)this->m_pProjectionDelegate;\n      if ( m_pProjectionDelegate )\n        (**(void (__fastcall ***)(cocos2d *))m_pProjectionDelegate)(m_pProjectionDelegate);\n    }\n  }\n  else\n  {\n    kmGLMatrixMode(5889);\n    kmGLLoadIdentity();\n    kmMat4OrthographicProjection((__int64)v12, 0.0, v7, 0.0, v8, -1024.0, 1024.0);\n    kmGLMultMatrix(v12);\n    kmGLMatrixMode(5888);\n    kmGLLoadIdentity();\n  }\n  this->m_eProjection = a2;\n  cocos2d::ccSetProjectionMatrixDirty(m_pProjectionDelegate);\n}", "assembly": "; \n; cocos2d::CCDirector::setProjection from 0x1800bf930 to 0x1800bfb87 (599 bytes)\n; \n; 10 xrefs:\n; > cocos2d::CCGridBase::afterDraw @ 0x1800225e8\n; > cocos2d::CCGridBase::setActive @ 0x18002394d\n; > cocos2d::CCRenderTexture::begin @ 0x18005f3fb\n; > cocos2d::CCEGLView::updateWindow @ 0x1800792a3\n; > cocos2d::CCDirector::reshapeProjection @ 0x1800bf29e\n; > cocos2d::CCDirector::setGLDefaultValues @ 0x1800bf65c\n; > <???> @ 0x180141e58\n; > <???> @ 0x180141e68\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b936c\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\nmov     r11, rsp                                                       ; +0x0, 0x1800bf930\nmov     [r11+18h], rbx                                                 ; +0x3, 0x1800bf933\nmov     [r11+20h], rdi                                                 ; +0x7, 0x1800bf937\npush    rbp                                                            ; +0xb, 0x1800bf93b\nlea     rbp, [r11-38h]                                                 ; +0xc, 0x1800bf93c\nsub     rsp, 130h                                                      ; +0x10, 0x1800bf940\nmov     rax, cs:__security_cookie                                      ; +0x17, 0x1800bf947\nxor     rax, rsp                                                       ; +0x1e, 0x1800bf94e\nmov     [rbp+30h+var_30], rax                                          ; +0x21, 0x1800bf951\nmov     edi, edx                                                       ; +0x25, 0x1800bf955\nmov     [r11+10h], rsi                                                 ; +0x27, 0x1800bf957\nlea     rdx, [rcx+138h]                                                ; +0x2b, 0x1800bf95b\nmov     rbx, rcx                                                       ; +0x32, 0x1800bf962\nlea     rcx, [rsp+130h+var_F0]                                         ; +0x35, 0x1800bf965\ncall    ??4cc_timeval@cocos2d@@QEAAAEAU01@$$QEAU01@@Z; cocos2d::cc_timeval::operator=(cocos2d::cc_timeval &&) ; +0x3a, 0x1800bf96a\ncmp     qword ptr [rbx+0B8h], 0                                        ; +0x3f, 0x1800bf96f\njz      short loc_1800BF9AF                                            ; +0x47, 0x1800bf977\nlea     rdx, [rbx+138h]                                                ; +0x49, 0x1800bf979\nlea     rcx, [rsp+130h+var_E8]                                         ; +0x50, 0x1800bf980\ncall    ??4cc_timeval@cocos2d@@QEAAAEAU01@$$QEAU01@@Z; cocos2d::cc_timeval::operator=(cocos2d::cc_timeval &&) ; +0x55, 0x1800bf985\nmov     rcx, [rbx+0B8h]                                                ; +0x5a, 0x1800bf98a\nxorps   xmm2, xmm2                                                     ; +0x61, 0x1800bf991\nmovss   xmm0, [rsp+130h+var_E4]                                        ; +0x64, 0x1800bf994\nxorps   xmm1, xmm1                                                     ; +0x6a, 0x1800bf99a\nmovss   xmm3, [rsp+130h+var_E8]                                        ; +0x6d, 0x1800bf99d\nmovss   [rsp+130h+var_110], xmm0                                       ; +0x73, 0x1800bf9a3\nmov     rax, [rcx]                                                     ; +0x79, 0x1800bf9a9\ncall    qword ptr [rax+60h]                                            ; +0x7c, 0x1800bf9ac\nmov     rsi, [rsp+130h+arg_8]                                          ; +0x7f, 0x1800bf9af\nmov     ecx, edi                                                       ; +0x87, 0x1800bf9b7\ntest    edi, edi                                                       ; +0x89, 0x1800bf9b9\njz      loc_1800BFAF7                                                  ; +0x8b, 0x1800bf9bb\nsub     ecx, 1                                                         ; +0x91, 0x1800bf9c1\njz      short loc_1800BF9E9                                            ; +0x94, 0x1800bf9c4\ncmp     ecx, 1                                                         ; +0x96, 0x1800bf9c6\njnz     loc_1800BFB5B                                                  ; +0x99, 0x1800bf9c9\nmov     rcx, [rbx+158h]                                                ; +0x9f, 0x1800bf9cf\ntest    rcx, rcx                                                       ; +0xa6, 0x1800bf9d6\njz      loc_1800BFB5B                                                  ; +0xa9, 0x1800bf9d9\nmov     rax, [rcx]                                                     ; +0xaf, 0x1800bf9df\ncall    qword ptr [rax]                                                ; +0xb2, 0x1800bf9e2\njmp     loc_1800BFB5B                                                  ; +0xb4, 0x1800bf9e4\nmovaps  [rsp+130h+var_18+8], xmm6                                      ; +0xb9, 0x1800bf9e9\nmov     ecx, 1701h                                                     ; +0xc1, 0x1800bf9f1\nmovaps  [rsp+130h+var_28+8], xmm7                                      ; +0xc6, 0x1800bf9f6\nmovss   xmm7, dword ptr [rbx+13Ch]                                     ; +0xce, 0x1800bf9fe\ndivss   xmm7, cs:dword_18010758C                                       ; +0xd6, 0x1800bfa06\ncall    kmGLMatrixMode                                                 ; +0xde, 0x1800bfa0e\ncall    kmGLLoadIdentity                                               ; +0xe3, 0x1800bfa13\nlea     rcx, [rbp+30h+var_70]                                          ; +0xe8, 0x1800bfa18\nmovss   xmm2, [rsp+130h+var_F0]                                        ; +0xec, 0x1800bfa1c\nmovaps  xmm0, xmm7                                                     ; +0xf2, 0x1800bfa22\ndivss   xmm2, [rsp+130h+var_EC]                                        ; +0xf5, 0x1800bfa25\nmovss   xmm3, cs:flt_1800E8D34                                         ; +0xfb, 0x1800bfa2b\naddss   xmm0, xmm7                                                     ; +0x103, 0x1800bfa33\nmovss   xmm1, cs:dword_1800FEDF0                                       ; +0x107, 0x1800bfa37\nmovss   [rsp+130h+var_110], xmm0                                       ; +0x10f, 0x1800bfa3f\ncall    kmMat4PerspectiveProjection                                    ; +0x115, 0x1800bfa45\nlea     rcx, [rbp+30h+var_70]                                          ; +0x11a, 0x1800bfa4a\ncall    kmGLMultMatrix                                                 ; +0x11e, 0x1800bfa4e\nmov     ecx, 1700h                                                     ; +0x123, 0x1800bfa53\ncall    kmGLMatrixMode                                                 ; +0x128, 0x1800bfa58\ncall    kmGLLoadIdentity                                               ; +0x12d, 0x1800bfa5d\nmovss   xmm2, [rsp+130h+var_EC]                                        ; +0x132, 0x1800bfa62\nlea     rcx, [rsp+130h+var_C8]                                         ; +0x138, 0x1800bfa68\nmovss   xmm1, [rsp+130h+var_F0]                                        ; +0x13d, 0x1800bfa6d\nmovaps  xmm3, xmm7                                                     ; +0x143, 0x1800bfa73\nmovss   xmm6, cs:dword_1800E6308                                       ; +0x146, 0x1800bfa76\nmulss   xmm2, xmm6                                                     ; +0x14e, 0x1800bfa7e\nmulss   xmm1, xmm6                                                     ; +0x152, 0x1800bfa82\ncall    kmVec3Fill                                                     ; +0x156, 0x1800bfa86\nmovss   xmm2, [rsp+130h+var_EC]                                        ; +0x15b, 0x1800bfa8b\nlea     rcx, [rsp+130h+var_D8]                                         ; +0x161, 0x1800bfa91\nmovss   xmm1, [rsp+130h+var_F0]                                        ; +0x166, 0x1800bfa96\nxorps   xmm3, xmm3                                                     ; +0x16c, 0x1800bfa9c\nmulss   xmm2, xmm6                                                     ; +0x16f, 0x1800bfa9f\nmulss   xmm1, xmm6                                                     ; +0x173, 0x1800bfaa3\ncall    kmVec3Fill                                                     ; +0x177, 0x1800bfaa7\nmovss   xmm2, cs:flt_1800E61A8                                         ; +0x17c, 0x1800bfaac\nlea     rcx, [rsp+130h+var_E8]                                         ; +0x184, 0x1800bfab4\nxorps   xmm3, xmm3                                                     ; +0x189, 0x1800bfab9\nxorps   xmm1, xmm1                                                     ; +0x18c, 0x1800bfabc\ncall    kmVec3Fill                                                     ; +0x18f, 0x1800bfabf\nlea     r9, [rsp+130h+var_E8]                                          ; +0x194, 0x1800bfac4\nlea     r8, [rsp+130h+var_D8]                                          ; +0x199, 0x1800bfac9\nlea     rdx, [rsp+130h+var_C8]                                         ; +0x19e, 0x1800bface\nlea     rcx, [rbp+30h+var_B0]                                          ; +0x1a3, 0x1800bfad3\ncall    kmMat4LookAt                                                   ; +0x1a7, 0x1800bfad7\nlea     rcx, [rbp+30h+var_B0]                                          ; +0x1ac, 0x1800bfadc\ncall    kmGLMultMatrix                                                 ; +0x1b0, 0x1800bfae0\nmovaps  xmm7, [rsp+130h+var_28+8]                                      ; +0x1b5, 0x1800bfae5\nmovaps  xmm6, [rsp+130h+var_18+8]                                      ; +0x1bd, 0x1800bfaed\njmp     short loc_1800BFB5B                                            ; +0x1c5, 0x1800bfaf5\nmov     ecx, 1701h                                                     ; +0x1c7, 0x1800bfaf7\ncall    kmGLMatrixMode                                                 ; +0x1cc, 0x1800bfafc\ncall    kmGLLoadIdentity                                               ; +0x1d1, 0x1800bfb01\nmovss   xmm0, cs:dword_1801075A0                                       ; +0x1d6, 0x1800bfb06\nlea     rcx, [rbp+30h+var_B0]                                          ; +0x1de, 0x1800bfb0e\nmovss   xmm1, cs:dword_1801075A8                                       ; +0x1e2, 0x1800bfb12\nxorps   xmm3, xmm3                                                     ; +0x1ea, 0x1800bfb1a\nmovss   xmm2, [rsp+130h+var_F0]                                        ; +0x1ed, 0x1800bfb1d\nmovss   [rsp+130h+var_100], xmm0                                       ; +0x1f3, 0x1800bfb23\nmovss   xmm0, [rsp+130h+var_EC]                                        ; +0x1f9, 0x1800bfb29\nmovss   [rsp+130h+var_108], xmm1                                       ; +0x1ff, 0x1800bfb2f\nxorps   xmm1, xmm1                                                     ; +0x205, 0x1800bfb35\nmovss   [rsp+130h+var_110], xmm0                                       ; +0x208, 0x1800bfb38\ncall    kmMat4OrthographicProjection                                   ; +0x20e, 0x1800bfb3e\nlea     rcx, [rbp+30h+var_B0]                                          ; +0x213, 0x1800bfb43\ncall    kmGLMultMatrix                                                 ; +0x217, 0x1800bfb47\nmov     ecx, 1700h                                                     ; +0x21c, 0x1800bfb4c\ncall    kmGLMatrixMode                                                 ; +0x221, 0x1800bfb51\ncall    kmGLLoadIdentity                                               ; +0x226, 0x1800bfb56\nmov     [rbx+134h], edi                                                ; +0x22b, 0x1800bfb5b\ncall    ?ccSetProjectionMatrixDirty@cocos2d@@YAXXZ; cocos2d::ccSetProjectionMatrixDirty(void) ; +0x231, 0x1800bfb61\nmov     rcx, [rbp+30h+var_30]                                          ; +0x236, 0x1800bfb66\nxor     rcx, rsp; StackCookie                                          ; +0x23a, 0x1800bfb6a\ncall    __security_check_cookie                                        ; +0x23d, 0x1800bfb6d\nlea     r11, [rsp+130h+var_s0]                                         ; +0x242, 0x1800bfb72\nmov     rbx, [r11+20h]                                                 ; +0x24a, 0x1800bfb7a\nmov     rdi, [r11+28h]                                                 ; +0x24e, 0x1800bfb7e\nmov     rsp, r11                                                       ; +0x252, 0x1800bfb82\npop     rbp                                                            ; +0x255, 0x1800bfb85\nretn                                                                   ; +0x256, 0x1800bfb86", "xrefs": ["cocos2d::CCGridBase::afterDraw @ 0x1800225e8", "cocos2d::CCGridBase::setActive @ 0x18002394d", "cocos2d::CCRenderTexture::begin @ 0x18005f3fb", "cocos2d::CCEGLView::updateWindow @ 0x1800792a3", "cocos2d::CCDirector::reshapeProjection @ 0x1800bf29e", "cocos2d::CCDirector::setGLDefaultValues @ 0x1800bf65c", "<???> @ 0x180141e58", "<???> @ 0x180141e68", "<???> @ 0x1801438a8", "<???> @ 0x1801b936c"], "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"}