{"type": "func", "start": 5370540048, "end": 5370540646, "name": "EditorUI::constrainGameLayerPosition", "pseudocode": "// \n// EditorUI::constrainGameLayerPosition from 0x1401bf010 to 0x1401bf266 (598 bytes)\n// \n// 9 xrefs:\n// > EditorUI::init @ 0x1401ab26c\n// > EditorUI::sliderChanged @ 0x1401ae0f8\n// > EditorUI::moveGamelayer @ 0x1401ae99e\n// > EditorUI::centerCameraOnPoint @ 0x1401b1530\n// > EditorUI::updateZoom @ 0x1401b4d7b\n// > EditorUI::ccTouchMoved @ 0x1401c07d3\n// > EditorUI::ccTouchMoved @ 0x1401c0cb6\n// > sub_1401C4B40 @ 0x1401c503e\n// > <???> @ 0x14091a57c\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 11:28:02 +0000\n// \n\n__int64 __fastcall EditorUI::constrainGameLayerPosition(__int64 a1, float a2, float a3)\n{\n  const struct cocos2d::CCPoint *v4; // rax\n  float v5; // xmm6_4\n  __int64 v6; // rcx\n  cocos2d::CCDirector *v7; // rax\n  float ScreenLeft; // xmm0_4\n  __int64 v9; // rbx\n  __int64 v10; // rax\n  __int64 v11; // rax\n  __int64 v12; // rcx\n  cocos2d::CCDirector *v13; // rax\n  float ScreenTop; // xmm6_4\n  __int64 v15; // rcx\n  cocos2d::CCDirector *v16; // rax\n  float ScreenRight; // xmm0_4\n  __int64 v18; // rax\n  __int64 v19; // rcx\n  __int64 v20; // rbx\n  int v21; // eax\n  __int64 v22; // rax\n  __int64 v23; // rax\n  __int64 v24; // rax\n  float v26[2]; // [rsp+20h] [rbp-60h] BYREF\n  float v27[2]; // [rsp+28h] [rbp-58h] BYREF\n  float v28[2]; // [rsp+30h] [rbp-50h] BYREF\n  _BYTE v29[8]; // [rsp+38h] [rbp-48h] BYREF\n  float v30; // [rsp+90h] [rbp+10h] BYREF\n  float v31; // [rsp+94h] [rbp+14h]\n  float v32; // [rsp+A8h] [rbp+28h] BYREF\n  float v33; // [rsp+ACh] [rbp+2Ch]\n\n  v4 = (const struct cocos2d::CCPoint *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(*(_QWORD *)(a1 + 1512) + 4296LL)\n                                                                          + 200LL))(*(_QWORD *)(*(_QWORD *)(a1 + 1512)\n                                                                                              + 4296LL));\n  cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v30, v4);\n  (*(void (__fastcall **)(_QWORD, int *))(**(_QWORD **)(*(_QWORD *)(a1 + 1512) + 4296LL) + 184LL))(\n    *(_QWORD *)(*(_QWORD *)(a1 + 1512) + 4296LL),\n    &dword_14090A6E8);\n  v5 = *(float *)(a1 + 900);\n  v7 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v6);\n  ScreenLeft = cocos2d::CCDirector::getScreenLeft(v7);\n  cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v27, ScreenLeft, v5);\n  v9 = *(_QWORD *)(*(_QWORD *)(a1 + 1512) + 4296LL);\n  cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v29, (float)(a2 * 30.0) - 30.0, (float)(a3 * 30.0) + 90.0);\n  cocos2d::CCNode::convertToWorldSpace(v9, &v32, v10);\n  cocos2d::CCNode::convertToNodeSpace(*(_QWORD *)(a1 + 1512), v29, &v32);\n  cocos2d::CCPoint::operator=(&v32, v11);\n  v13 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v12);\n  ScreenTop = cocos2d::CCDirector::getScreenTop(v13);\n  v16 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v15);\n  ScreenRight = cocos2d::CCDirector::getScreenRight(v16);\n  cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v28, ScreenRight, ScreenTop);\n  v18 = *(_QWORD *)(a1 + 1512);\n  v19 = *(_QWORD *)(v18 + 3528);\n  v20 = *(_QWORD *)(v18 + 4296);\n  v21 = 80;\n  if ( *(_BYTE *)(v19 + 461) )\n    v21 = 1000;\n  cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v29, 240030.0, (float)((float)((float)v21 * 30.0) + 90.0) + 30.0);\n  cocos2d::CCNode::convertToWorldSpace(v20, v26, v22);\n  cocos2d::CCNode::convertToNodeSpace(*(_QWORD *)(a1 + 1512), v29, v26);\n  cocos2d::CCPoint::operator=(v26, v23);\n  v24 = *(_QWORD *)(a1 + 1512);\n  v30 = fmaxf(fminf(v30, v27[0] - v32), v28[0] - v26[0]);\n  v31 = fmaxf(fminf(v31, v27[1] - v33), v28[1] - v26[1]);\n  return (*(__int64 (__fastcall **)(_QWORD, float *))(**(_QWORD **)(v24 + 4296) + 184LL))(*(_QWORD *)(v24 + 4296), &v30);\n}", "assembly": "; \n; EditorUI::constrainGameLayerPosition from 0x1401bf010 to 0x1401bf266 (598 bytes)\n; \n; 9 xrefs:\n; > EditorUI::init @ 0x1401ab26c\n; > EditorUI::sliderChanged @ 0x1401ae0f8\n; > EditorUI::moveGamelayer @ 0x1401ae99e\n; > EditorUI::centerCameraOnPoint @ 0x1401b1530\n; > EditorUI::updateZoom @ 0x1401b4d7b\n; > EditorUI::ccTouchMoved @ 0x1401c07d3\n; > EditorUI::ccTouchMoved @ 0x1401c0cb6\n; > sub_1401C4B40 @ 0x1401c503e\n; > <???> @ 0x14091a57c\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 11:28:02 +0000\n; \nmov     [rsp-8+arg_8], rbx                                             ; +0x0, 0x1401bf010\nmov     [rsp-8+arg_10], rdi                                            ; +0x5, 0x1401bf015\npush    rbp                                                            ; +0xa, 0x1401bf01a\nmov     rbp, rsp                                                       ; +0xb, 0x1401bf01b\nsub     rsp, 80h                                                       ; +0xe, 0x1401bf01e\nmov     rax, [rcx+5E8h]                                                ; +0x15, 0x1401bf025\nmov     rdi, rcx                                                       ; +0x1c, 0x1401bf02c\nmovaps  [rsp+80h+var_10], xmm6                                         ; +0x1f, 0x1401bf02f\nmovaps  [rsp+80h+var_20], xmm7                                         ; +0x24, 0x1401bf034\nmovaps  xmm7, xmm2                                                     ; +0x29, 0x1401bf039\nmovaps  [rsp+80h+var_30], xmm8                                         ; +0x2c, 0x1401bf03c\nmovaps  xmm8, xmm1                                                     ; +0x32, 0x1401bf042\nmov     rcx, [rax+10C8h]                                               ; +0x36, 0x1401bf046\nmovaps  [rsp+80h+var_40], xmm10                                        ; +0x3d, 0x1401bf04d\nmov     rax, [rcx]                                                     ; +0x43, 0x1401bf053\ncall    qword ptr [rax+0C8h]                                           ; +0x46, 0x1401bf056\nmov     rdx, rax                                                       ; +0x4c, 0x1401bf05c\nlea     rcx, [rbp+arg_0]                                               ; +0x4f, 0x1401bf05f\ncall    cs:??0CCPoint@cocos2d@@QEAA@AEBV01@@Z; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const &) ; +0x53, 0x1401bf063\nmov     rax, [rdi+5E8h]                                                ; +0x59, 0x1401bf069\nlea     rdx, dword_14090A6E8                                           ; +0x60, 0x1401bf070\nmov     rcx, [rax+10C8h]                                               ; +0x67, 0x1401bf077\nmov     rax, [rcx]                                                     ; +0x6e, 0x1401bf07e\ncall    qword ptr [rax+0B8h]                                           ; +0x71, 0x1401bf081\nmovss   xmm6, dword ptr [rdi+384h]                                     ; +0x77, 0x1401bf087\ncall    cs:?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x7f, 0x1401bf08f\nmov     rcx, rax                                                       ; +0x85, 0x1401bf095\ncall    cs:?getScreenLeft@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getScreenLeft(void) ; +0x88, 0x1401bf098\nmovaps  xmm2, xmm6                                                     ; +0x8e, 0x1401bf09e\nlea     rcx, [rbp+var_58]                                              ; +0x91, 0x1401bf0a1\nmovaps  xmm1, xmm0                                                     ; +0x95, 0x1401bf0a5\ncall    cs:??0CCPoint@cocos2d@@QEAA@MM@Z; cocos2d::CCPoint::CCPoint(float,float) ; +0x98, 0x1401bf0a8\nmovss   xmm10, cs:dword_140835624                                      ; +0x9e, 0x1401bf0ae\nlea     rcx, [rbp+var_48]                                              ; +0xa7, 0x1401bf0b7\nmov     rax, [rdi+5E8h]                                                ; +0xab, 0x1401bf0bb\nmulss   xmm7, xmm10                                                    ; +0xb2, 0x1401bf0c2\nmulss   xmm8, xmm10                                                    ; +0xb7, 0x1401bf0c7\nmov     rbx, [rax+10C8h]                                               ; +0xbc, 0x1401bf0cc\naddss   xmm7, cs:flt_140835780                                         ; +0xc3, 0x1401bf0d3\nsubss   xmm8, xmm10                                                    ; +0xcb, 0x1401bf0db\nmovaps  xmm2, xmm7                                                     ; +0xd0, 0x1401bf0e0\nmovaps  xmm1, xmm8                                                     ; +0xd3, 0x1401bf0e3\ncall    cs:??0CCPoint@cocos2d@@QEAA@MM@Z; cocos2d::CCPoint::CCPoint(float,float) ; +0xd7, 0x1401bf0e7\nlea     rdx, [rbp+arg_18]                                              ; +0xdd, 0x1401bf0ed\nmov     rcx, rbx                                                       ; +0xe1, 0x1401bf0f1\nmov     r8, rax                                                        ; +0xe4, 0x1401bf0f4\ncall    cs:?convertToWorldSpace@CCNode@cocos2d@@QEAA?AVCCPoint@2@AEBV32@@Z; cocos2d::CCNode::convertToWorldSpace(cocos2d::CCPoint const &) ; +0xe7, 0x1401bf0f7\nmov     rcx, [rdi+5E8h]                                                ; +0xed, 0x1401bf0fd\nlea     r8, [rbp+arg_18]                                               ; +0xf4, 0x1401bf104\nlea     rdx, [rbp+var_48]                                              ; +0xf8, 0x1401bf108\ncall    cs:?convertToNodeSpace@CCNode@cocos2d@@QEAA?AVCCPoint@2@AEBV32@@Z; cocos2d::CCNode::convertToNodeSpace(cocos2d::CCPoint const &) ; +0xfc, 0x1401bf10c\nmov     rdx, rax                                                       ; +0x102, 0x1401bf112\nlea     rcx, [rbp+arg_18]                                              ; +0x105, 0x1401bf115\ncall    cs:??4CCPoint@cocos2d@@QEAAAEAV01@AEBV01@@Z; cocos2d::CCPoint::operator=(cocos2d::CCPoint const &) ; +0x109, 0x1401bf119\ncall    cs:?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x10f, 0x1401bf11f\nmov     rcx, rax                                                       ; +0x115, 0x1401bf125\ncall    cs:?getScreenTop@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getScreenTop(void) ; +0x118, 0x1401bf128\nmovaps  xmm6, xmm0                                                     ; +0x11e, 0x1401bf12e\ncall    cs:?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x121, 0x1401bf131\nmov     rcx, rax                                                       ; +0x127, 0x1401bf137\ncall    cs:?getScreenRight@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getScreenRight(void) ; +0x12a, 0x1401bf13a\nmovaps  xmm2, xmm6                                                     ; +0x130, 0x1401bf140\nlea     rcx, [rbp+var_50]                                              ; +0x133, 0x1401bf143\nmovaps  xmm1, xmm0                                                     ; +0x137, 0x1401bf147\ncall    cs:??0CCPoint@cocos2d@@QEAA@MM@Z; cocos2d::CCPoint::CCPoint(float,float) ; +0x13a, 0x1401bf14a\nmov     rax, [rdi+5E8h]                                                ; +0x140, 0x1401bf150\nmov     edx, 3E8h                                                      ; +0x147, 0x1401bf157\nmovss   xmm1, cs:dword_140835C0C                                       ; +0x14c, 0x1401bf15c\nmov     rcx, [rax+0DC8h]                                               ; +0x154, 0x1401bf164\nmov     rbx, [rax+10C8h]                                               ; +0x15b, 0x1401bf16b\nmov     eax, 50h ; 'P'                                                 ; +0x162, 0x1401bf172\ncmp     byte ptr [rcx+1CDh], 0                                         ; +0x167, 0x1401bf177\nlea     rcx, [rbp+var_48]                                              ; +0x16e, 0x1401bf17e\ncmovnz  eax, edx                                                       ; +0x172, 0x1401bf182\nmovd    xmm2, eax                                                      ; +0x175, 0x1401bf185\ncvtdq2ps xmm2, xmm2                                                    ; +0x179, 0x1401bf189\nmulss   xmm2, xmm10                                                    ; +0x17c, 0x1401bf18c\naddss   xmm2, cs:flt_140835780                                         ; +0x181, 0x1401bf191\naddss   xmm2, xmm10                                                    ; +0x189, 0x1401bf199\ncall    cs:??0CCPoint@cocos2d@@QEAA@MM@Z; cocos2d::CCPoint::CCPoint(float,float) ; +0x18e, 0x1401bf19e\nlea     rdx, [rbp+var_60]                                              ; +0x194, 0x1401bf1a4\nmov     rcx, rbx                                                       ; +0x198, 0x1401bf1a8\nmov     r8, rax                                                        ; +0x19b, 0x1401bf1ab\ncall    cs:?convertToWorldSpace@CCNode@cocos2d@@QEAA?AVCCPoint@2@AEBV32@@Z; cocos2d::CCNode::convertToWorldSpace(cocos2d::CCPoint const &) ; +0x19e, 0x1401bf1ae\nlea     r8, [rbp+var_60]                                               ; +0x1a4, 0x1401bf1b4\nlea     rdx, [rbp+var_48]                                              ; +0x1a8, 0x1401bf1b8\nmov     rcx, [rdi+5E8h]                                                ; +0x1ac, 0x1401bf1bc\ncall    cs:?convertToNodeSpace@CCNode@cocos2d@@QEAA?AVCCPoint@2@AEBV32@@Z; cocos2d::CCNode::convertToNodeSpace(cocos2d::CCPoint const &) ; +0x1b3, 0x1401bf1c3\nmov     rdx, rax                                                       ; +0x1b9, 0x1401bf1c9\nlea     rcx, [rbp+var_60]                                              ; +0x1bc, 0x1401bf1cc\ncall    cs:??4CCPoint@cocos2d@@QEAAAEAV01@AEBV01@@Z; cocos2d::CCPoint::operator=(cocos2d::CCPoint const &) ; +0x1c0, 0x1401bf1d0\nmovss   xmm2, [rbp+arg_0]                                              ; +0x1c6, 0x1401bf1d6\nlea     rdx, [rbp+arg_0]                                               ; +0x1cb, 0x1401bf1db\nmovss   xmm0, [rbp+var_58]                                             ; +0x1cf, 0x1401bf1df\nsubss   xmm0, [rbp+arg_18]                                             ; +0x1d4, 0x1401bf1e4\nmovss   xmm1, [rbp+var_50]                                             ; +0x1d9, 0x1401bf1e9\nsubss   xmm1, [rbp+var_60]                                             ; +0x1de, 0x1401bf1ee\nmov     rax, [rdi+5E8h]                                                ; +0x1e3, 0x1401bf1f3\nminss   xmm2, xmm0                                                     ; +0x1ea, 0x1401bf1fa\nmovss   xmm0, [rbp+var_54]                                             ; +0x1ee, 0x1401bf1fe\nsubss   xmm0, [rbp+arg_1C]                                             ; +0x1f3, 0x1401bf203\nmaxss   xmm2, xmm1                                                     ; +0x1f8, 0x1401bf208\nmovss   xmm1, [rbp+var_4C]                                             ; +0x1fc, 0x1401bf20c\nsubss   xmm1, [rbp+var_5C]                                             ; +0x201, 0x1401bf211\nmovss   [rbp+arg_0], xmm2                                              ; +0x206, 0x1401bf216\nmovss   xmm2, [rbp+arg_4]                                              ; +0x20b, 0x1401bf21b\nminss   xmm2, xmm0                                                     ; +0x210, 0x1401bf220\nmaxss   xmm2, xmm1                                                     ; +0x214, 0x1401bf224\nmovss   [rbp+arg_4], xmm2                                              ; +0x218, 0x1401bf228\nmov     rcx, [rax+10C8h]                                               ; +0x21d, 0x1401bf22d\nmov     rax, [rcx]                                                     ; +0x224, 0x1401bf234\ncall    qword ptr [rax+0B8h]                                           ; +0x227, 0x1401bf237\nmovaps  xmm6, [rsp+80h+var_10]                                         ; +0x22d, 0x1401bf23d\nlea     r11, [rsp+80h+var_s0]                                          ; +0x232, 0x1401bf242\nmov     rbx, [r11+18h]                                                 ; +0x23a, 0x1401bf24a\nmov     rdi, [r11+20h]                                                 ; +0x23e, 0x1401bf24e\nmovaps  xmm8, xmmword ptr [r11-30h]                                    ; +0x242, 0x1401bf252\nmovaps  xmm10, xmmword ptr [r11-40h]                                   ; +0x247, 0x1401bf257\nmovaps  xmm7, [rsp+80h+var_20]                                         ; +0x24c, 0x1401bf25c\nmov     rsp, r11                                                       ; +0x251, 0x1401bf261\npop     rbp                                                            ; +0x254, 0x1401bf264\nretn                                                                   ; +0x255, 0x1401bf265", "xrefs": ["EditorUI::init @ 0x1401ab26c", "EditorUI::sliderChanged @ 0x1401ae0f8", "EditorUI::moveGamelayer @ 0x1401ae99e", "EditorUI::centerCameraOnPoint @ 0x1401b1530", "EditorUI::updateZoom @ 0x1401b4d7b", "EditorUI::ccTouchMoved @ 0x1401c07d3", "EditorUI::ccTouchMoved @ 0x1401c0cb6", "sub_1401C4B40 @ 0x1401c503e", "<???> @ 0x14091a57c"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}