// // EditorUI::createGradientFromSelection from 0x10047b0f4 to 0x10047b5ac (1208 bytes) // // 2 xrefs: // > EditorUI::handleEditorAction @ 0x1001631e8 // > EditorCommandsPopup::onCommand @ 0x1004c5bd0 // // This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True! // // Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA // Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings // Generated at Fri, 27 Nov 2026 11:05:43 +0000 // void __fastcall EditorUI::createGradientFromSelection(__int64 a1) { __int64 v2; // x21 int v3; // w0 int v5; // w20 unsigned int v6; // w22 float v7; // s8 float v8; // s10 float v9; // s9 __int64 v10; // x0 _QWORD *v11; // x22 __int64 v12; // x21 __int64 v13; // x23 __int64 v14; // x26 __int64 v15; // x27 float v16; // s11 __int64 v17; // x22 __int64 v18; // x24 float v19; // s11 __int64 v20; // x25 __int64 v21; // x23 __int64 v22; // x0 __int64 v23; // x21 __int64 v24; // x0 __int64 v25; // x22 __int64 v26; // x0 __int64 v27; // x24 __int64 v28; // x0 __int64 v29; // x25 __int64 v30; // x22 __int64 v31; // x21 float v32; // s4 float v33; // s5 __int64 v34; // x8 __int64 v35; // x9 __int64 v36; // x10 __int64 v37; // x11 __int64 Object; // x0 __int64 v39; // x23 __int64 v40; // x0 double v41; // d0 void *v42; // x0 std::string __p; // [xsp+0h] [xbp-E0h] BYREF __int64 v44; // [xsp+18h] [xbp-C8h] BYREF __int64 v45; // [xsp+20h] [xbp-C0h] BYREF std::string __s; // [xsp+28h] [xbp-B8h] BYREF __int128 v47; // [xsp+40h] [xbp-A0h] BYREF __int128 v48; // [xsp+50h] [xbp-90h] int v49; // [xsp+60h] [xbp-80h] v2 = *(_QWORD *)(a1 + 896); v3 = sub_1002E757C(v2); if ( v3 != 2 && v3 != 4 ) { sub_100009900(&__s, "Create gradient failed."); EditorUI::showTextAlert(a1, &__s, 0, 1, 0); if ( SHIBYTE(__s.__r_.__value_.__r.__words[2]) < 0 ) { v42 = (void *)__s.__r_.__value_.__r.__words[0]; LABEL_70: operator delete(v42); return; } return; } v5 = v3; v6 = 0; v7 = 0.0; v8 = 0.0; v9 = 0.0; do { v10 = sub_1002E75A0(v2, v6); (*(void (__fastcall **)(__int128 *__return_ptr))(*(_QWORD *)v10 + 1360LL))(&v47); if ( v6 ) { if ( *(float *)&v47 < v7 ) v7 = *(float *)&v47; if ( *(float *)&v47 > v8 ) v8 = *(float *)&v47; if ( *((float *)&v47 + 1) > v9 ) v9 = *((float *)&v47 + 1); } else { v9 = *((float *)&v47 + 1); v8 = *(float *)&v47; v7 = *(float *)&v47; } ++v6; } while ( v5 != v6 ); if ( v5 == 2 ) { v30 = sub_1002E75A0(v2, 0); v31 = sub_1002E75A0(v2, 1u); (*(void (__fastcall **)(__int128 *__return_ptr, __int64))(*(_QWORD *)v30 + 1360LL))(&v47, v30); (*(void (__fastcall **)(__int64 *__return_ptr, __int64))(*(_QWORD *)v31 + 1360LL))(&v45, v31); v32 = vabds_f32(*(float *)&v47, *(float *)&v45); v33 = vabds_f32(*((float *)&v47 + 1), *((float *)&v45 + 1)); if ( *(float *)&v47 > *(float *)&v45 ) v34 = v31; else v34 = v30; if ( *(float *)&v47 > *(float *)&v45 ) v35 = v30; else v35 = v31; if ( *((float *)&v47 + 1) < *((float *)&v45 + 1) ) v36 = v31; else v36 = v30; if ( *((float *)&v47 + 1) < *((float *)&v45 + 1) ) v37 = v30; else v37 = v31; if ( v33 >= v32 ) v21 = 0; else v21 = v35; if ( v33 >= v32 ) v20 = 0; else v20 = v34; if ( v33 >= v32 ) v18 = v37; else v18 = 0; if ( v33 >= v32 ) v17 = v36; else v17 = 0; if ( v17 ) { LABEL_31: v22 = *(_QWORD *)(a1 + 1440); v47 = 0u; v48 = 0u; v49 = 1065353216; v23 = sub_100400CC4(v22, (__int64)&v47); sub_1000184EC((__int64)&v47); sub_10040360C(*(_QWORD *)(a1 + 1440), v17, v23); if ( v18 ) goto LABEL_32; goto LABEL_61; } } else { v11 = sub_1002E736C(); sub_1002E7570((__int64)v11, v2); qsort( *(void **)(v11[7] + 16LL), *(unsigned int *)v11[7], 8u, (int (__cdecl *)(const void *, const void *))sub_1001A8A3C); v12 = sub_1002E75A0((__int64)v11, 0); v13 = sub_1002E75A0((__int64)v11, 1u); v14 = sub_1002E75A0((__int64)v11, 2u); v15 = sub_1002E75A0((__int64)v11, 3u); (*(void (__fastcall **)(__int128 *__return_ptr, __int64))(*(_QWORD *)v12 + 1360LL))(&v47, v12); v16 = *(float *)&v47; (*(void (__fastcall **)(__int64 *__return_ptr, __int64))(*(_QWORD *)v13 + 1360LL))(&v45, v13); if ( v16 > *(float *)&v45 ) v17 = v13; else v17 = v12; if ( v17 == v12 ) v18 = v13; else v18 = v12; (*(void (__fastcall **)(__int128 *__return_ptr, __int64))(*(_QWORD *)v14 + 1360LL))(&v47, v14); v19 = *(float *)&v47; (*(void (__fastcall **)(__int64 *__return_ptr, __int64))(*(_QWORD *)v15 + 1360LL))(&v45, v15); if ( v19 > *(float *)&v45 ) v20 = v15; else v20 = v14; if ( v20 == v14 ) v21 = v15; else v21 = v14; if ( v17 ) goto LABEL_31; } LODWORD(v23) = 0; if ( v18 ) { LABEL_32: v24 = *(_QWORD *)(a1 + 1440); v47 = 0u; v48 = 0u; v49 = 1065353216; v25 = sub_100400CC4(v24, (__int64)&v47); sub_1000184EC((__int64)&v47); sub_10040360C(*(_QWORD *)(a1 + 1440), v18, v25); if ( v20 ) goto LABEL_33; LABEL_62: LODWORD(v27) = 0; if ( v21 ) goto LABEL_34; goto LABEL_63; } LABEL_61: LODWORD(v25) = 0; if ( !v20 ) goto LABEL_62; LABEL_33: v26 = *(_QWORD *)(a1 + 1440); v47 = 0u; v48 = 0u; v49 = 1065353216; v27 = sub_100400CC4(v26, (__int64)&v47); sub_1000184EC((__int64)&v47); sub_10040360C(*(_QWORD *)(a1 + 1440), v20, v27); if ( v21 ) { LABEL_34: v28 = *(_QWORD *)(a1 + 1440); v47 = 0u; v48 = 0u; v49 = 1065353216; v29 = sub_100400CC4(v28, (__int64)&v47); sub_1000184EC((__int64)&v47); sub_10040360C(*(_QWORD *)(a1 + 1440), v21, v29); goto LABEL_64; } LABEL_63: LODWORD(v29) = 0; LABEL_64: sub_1000262BC((float *)&v45, (float)(v8 + v7) * 0.5, v9 + 60.0); sub_1000262F4(&v44, (double *)&v45); EditorUI::getGridSnappedPos(a1, (float *)&v44, &v47); sub_10002630C(&v45, (double *)&v47); sub_1000262F4(&v47, (double *)&v45); Object = EditorUI::createObject(a1, 2903, (double *)&v47); if ( Object ) { v39 = Object; v40 = *(_QWORD *)(a1 + 1440); v47 = 0u; v48 = 0u; v49 = 1065353216; *(_DWORD *)(v39 + 1848) = sub_100401B54(v40, (__int64)&v47); sub_1000184EC((__int64)&v47); *(_BYTE *)(v39 + 1868) = v5 != 2; *(_DWORD *)(v39 + 1852) = v23; *(_DWORD *)(v39 + 1856) = v25; *(_DWORD *)(v39 + 1860) = v27; *(_DWORD *)(v39 + 1864) = v29; sub_1003FF8E0(*(_QWORD *)(a1 + 1440), v39); EditorUI::deselectAll(a1, v41); EditorUI::selectObject(a1, (unsigned int *)v39, 1); EditorUI::updateSelectionUI(a1); return; } sub_100009900(&__p, "Create gradient failed."); EditorUI::showTextAlert(a1, &__p, 0, 1, 0); if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 ) { v42 = (void *)__p.__r_.__value_.__r.__words[0]; goto LABEL_70; } }
GD Web Decomp Icon

GD Web Decomp

Raw Source