// // GJBaseGameLayer::positionUIObjects from 0x1001e1790 to 0x1001e1b54 (964 bytes) // // 1 xrefs: // > GJBaseGameLayer::updateSpecialGroupData @ 0x1001dfc04 // // This function is hookable on this platform! // // Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA // Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings // void __fastcall GJBaseGameLayer::positionUIObjects(GJBaseGameLayer *a1) { cocos2d::CCDirector *v2; // x0 __n128 v3; // q0 __n128 v4; // q1 _DWORD *v5; // x0 float v6; // s8 float v7; // s10 cocos2d::CCArray *m_objects; // x8 cocos2d::ccArray *data; // x9 __int64 num; // x8 float v11; // s8 float v12; // s9 float v13; // s10 cocos2d::CCObject **arr; // x24 unsigned __int64 v15; // x25 float v16; // s11 cocos2d::CCObject *v17; // x27 cocos2d::CCArray *Group; // x21 cocos2d::CCObject *v19; // x22 GameObject *MainObject; // x23 __n128 v21; // q0 __int64 v22; // x20 unsigned int *v24; // x9 __int64 v25; // x8 GameObject **v26; // x28 unsigned __int64 v27; // x26 GameObject *v28; // x23 int m_uOrderOfArrival; // w10 int m_nZOrder; // w9 int v31; // w8 bool v32; // zf float v33; // s2 float v34; // s2 float v35; // s2 float v36; // s0 float v37; // s0 float v38; // s0 float v39; // s0 cocos2d::ccArray *v40; // x9 __int64 v41; // x8 GameObject **v42; // x20 unsigned __int64 v43; // x25 GameObject *v44; // x23 double v45; // d0 unsigned __int64 v46; // [xsp+0h] [xbp-C0h] __int64 v47; // [xsp+8h] [xbp-B8h] float32x2_t v48; // [xsp+10h] [xbp-B0h] BYREF float32x2_t v49; // [xsp+18h] [xbp-A8h] BYREF float32x2_t v50; // [xsp+20h] [xbp-A0h] BYREF float32x2_t v51; // [xsp+28h] [xbp-98h] BYREF float32x2_t v52; // [xsp+30h] [xbp-90h] BYREF __int64 v53; // [xsp+38h] [xbp-88h] BYREF int v54; // [xsp+40h] [xbp-80h] BYREF float v55; // [xsp+48h] [xbp-78h] float v56; // [xsp+4Ch] [xbp-74h] v2 = cocos2d::CCDirector::sharedDirector(); cocos2d::CCDirector::getWinSize(v2); v3.n128_f32[0] = v55 * 0.5; v4.n128_f32[0] = v56 * 0.5; v5 = sub_100022980(v3, v4, &v54); v6 = v55; v7 = v56; v47 = sub_10024A15C(v5); m_objects = a1->m_objects; if ( m_objects ) { data = m_objects->data; num = data->num; if ( (_DWORD)num ) { v11 = v6 * 0.5; v12 = v7 * 0.5; v13 = v11 / 240.0; arr = data->arr; v15 = (unsigned __int64)&arr[num - 1]; v16 = v12 / 160.0; v46 = v15; do { v17 = *arr; if ( !*arr ) return; if ( v17[18].m_uReference == 3613 ) { Group = GJBaseGameLayer::getGroup(a1, v17[26].m_uID); v19 = cocos2d::CCDictionary::objectForKey(a1->m_parentGroupsDict, (int)v17[26].m_uID); MainObject = GJBaseGameLayer::tryGetMainObject(a1, v17[26].m_nLuaID); v22 = (__int64)Group; if ( v19 ) { v22 = v47; sub_10024A45C(v47); v21 = sub_10024A2D0(v47, v19); } if ( MainObject && v22 != 0 ) { ((void (__fastcall *)(__int64 *__return_ptr, GameObject *, __n128))MainObject->getStartPos)( &v53, MainObject, v21); v24 = *(unsigned int **)(v22 + 56); v25 = *v24; if ( (_DWORD)v25 ) { v26 = *((GameObject ***)v24 + 2); v27 = (unsigned __int64)&v26[v25 - 1]; while ( 1 ) { v28 = *v26; if ( !*v26 ) goto LABEL_66; if ( !v28->m_isUIObject ) break; LABEL_16: if ( (unsigned __int64)++v26 > v27 ) goto LABEL_66; } GJBaseGameLayer::addUIObject(a1, *v26); ((void (__fastcall *)(float32x2_t *__return_ptr, GameObject *))v28->getStartPos)(&v52, v28); sub_1000229B8((__int64 *)&v51, (__int64 *)&v52); m_uOrderOfArrival = v17[32].m_uOrderOfArrival; if ( v52.f32[0] >= *(float *)&v53 ) m_nZOrder = 4; else m_nZOrder = 3; if ( v17[32].m_nZOrder >= 2u ) m_nZOrder = v17[32].m_nZOrder; if ( v52.f32[1] >= *((float *)&v53 + 1) ) v31 = 8; else v31 = 7; if ( m_uOrderOfArrival ) v32 = m_uOrderOfArrival == 5; else v32 = 1; if ( !v32 ) v31 = v17[32].m_uOrderOfArrival; switch ( m_nZOrder ) { case 4: v35 = v52.f32[0] - (float)(*(float *)&v53 + 240.0); if ( LOBYTE(v17[32].m_unknown5) ) v35 = v13 * v35; v34 = v55 + v35; break; case 3: v34 = v52.f32[0] - (float)(*(float *)&v53 + -240.0); if ( LOBYTE(v17[32].m_unknown5) ) v34 = v13 * v34; break; case 2: v33 = v52.f32[0] - *(float *)&v53; if ( LOBYTE(v17[32].m_unknown5) ) v33 = v13 * v33; v34 = v11 + v33; break; default: LABEL_44: switch ( v31 ) { case 8: v38 = v52.f32[1] - (float)(*((float *)&v53 + 1) + 160.0); if ( BYTE1(v17[32].m_unknown5) ) v38 = v16 * v38; v37 = v56 + v38; break; case 7: v37 = v52.f32[1] - (float)(*((float *)&v53 + 1) + -160.0); if ( BYTE1(v17[32].m_unknown5) ) v37 = v16 * v37; break; case 6: v36 = v52.f32[1] - *((float *)&v53 + 1); if ( BYTE1(v17[32].m_unknown5) ) v36 = v16 * v36; v37 = v12 + v36; break; default: LABEL_57: v39 = sub_1000229B8((__int64 *)&v50, (__int64 *)&v51); ((void (__fastcall *)(GameObject *, float32x2_t *, float))v28->setStartPos)(v28, &v50, v39); if ( v28 == v19 ) { if ( Group ) { sub_1000229F0(&v51, &v52, &v50); v40 = Group->data; v41 = v40->num; if ( (_DWORD)v41 ) { v42 = (GameObject **)v40->arr; v43 = (unsigned __int64)&v42[v41 - 1]; do { v44 = *v42; if ( !*v42 ) break; if ( !v44->m_isUIObject ) { GJBaseGameLayer::addUIObject(a1, *v42); ((void (__fastcall *)(float32x2_t *__return_ptr, GameObject *))v44->getStartPos)( &v48, v44); *(float32x2_t *)&v45 = sub_1000229DC(&v48, &v50, &v49); ((void (__fastcall *)(GameObject *, float32x2_t *, double))v44->setStartPos)( v44, &v49, v45); } ++v42; } while ( (unsigned __int64)v42 <= v43 ); } } } goto LABEL_16; } v51.f32[1] = v37; goto LABEL_57; } v51.f32[0] = v34; goto LABEL_44; } LABEL_66: v15 = v46; } } ++arr; } while ( (unsigned __int64)arr <= v15 ); } } }
GD Web Decomp Icon

GD Web Decomp

Raw Source