//
// EditorUI::updateZoom from 0x10003d9a0 to 0x10003dc67 (711 bytes)
//
// 6 xrefs:
// > EditorUI::onStopPlaytest @ 0x10000c81d
// > EditorUI::zoomIn @ 0x10000c878
// > EditorUI::zoomOut @ 0x10000c8c9
// > EditorUI::playtestStopped @ 0x10003d993
// > EditorUI::zoomGameLayer @ 0x10003dcca
// > EditorUI::scrollWheel @ 0x1000518c8
//
// 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 EditorUI::updateZoom(EditorUI *a1, float a2)
{
cocos2d::CCDirector *v3; // rsi
LevelEditorLayer *m_editorLayer; // rdi
const cocos2d::CCPoint *m_objectLayer; // r14
__int64 v6; // rax
__int64 v7; // rax
__int64 v8; // rax
__int64 v9; // rax
int SectionCount; // eax
int v11; // ecx
float v12; // xmm0_4
GJRotationControl *m_rotationControl; // rdi
GJRotationControl_vtbl *v14; // rax
GJTransformControl *m_transformControl; // rbx
cocos2d::CCArray *m_warpSprites; // rax
cocos2d::ccArray *data; // rax
cocos2d::CCObject **arr; // r14
unsigned __int64 v19; // r15
__int64 v20; // rax
char v21; // [rsp+0h] [rbp-60h] BYREF
char v22[8]; // [rsp+8h] [rbp-58h] BYREF
char v23; // [rsp+10h] [rbp-50h] BYREF
char v24[8]; // [rsp+18h] [rbp-48h] BYREF
float XMin; // [rsp+20h] [rbp-40h]
float v26; // [rsp+24h] [rbp-3Ch]
float v27; // [rsp+28h] [rbp-38h] BYREF
float v28; // [rsp+2Ch] [rbp-34h]
float v29; // [rsp+30h] [rbp-30h]
float v30; // [rsp+34h] [rbp-2Ch]
double v31; // 0:xmm0_8.8
v29 = a2;
v3 = cocos2d::CCDirector::sharedDirector();
*(cocos2d::CCSize *)&v31 = cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v27);
m_editorLayer = a1->m_editorLayer;
m_objectLayer = (const cocos2d::CCPoint *)m_editorLayer->m_objectLayer;
v6 = ((__int64 (__fastcall *)(LevelEditorLayer *, cocos2d::CCDirector *, double))m_editorLayer->getParent)(
m_editorLayer,
v3,
v31);
v30 = (*(float (__fastcall **)(__int64))(*(_QWORD *)v6 + 168LL))(v6);
v7 = ((__int64 (__fastcall *)(LevelEditorLayer *))a1->m_editorLayer->getParent)(a1->m_editorLayer);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v7 + 160LL))(v7, 1.0);
sub_10028CBE0(&v23, v27 * 0.5, v28 * 0.5);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)&v21, m_objectLayer);
((void (__fastcall *)(cocos2d::CCLayer *, float))a1->m_editorLayer->m_objectLayer->setScale)(
a1->m_editorLayer->m_objectLayer,
v29);
cocos2d::CCNode::convertToWorldSpace((cocos2d::CCNode *)&v23, m_objectLayer);
sub_10028CBE0(v24, v27 * 0.5, 0.5 * v28);
sub_10028CD00(v22, v24, &v23);
v8 = (*(__int64 (__fastcall **)(const cocos2d::CCPoint *))(*(_QWORD *)m_objectLayer + 192LL))(m_objectLayer);
sub_10028CCE0(v24, v8);
(*(void (__fastcall **)(const cocos2d::CCPoint *, char *))(*(_QWORD *)m_objectLayer + 184LL))(m_objectLayer, v24);
EditorUI::constrainGameLayerPosition(a1, -100.0, -100.0);
v9 = ((__int64 (__fastcall *)(LevelEditorLayer *))a1->m_editorLayer->getParent)(a1->m_editorLayer);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v9 + 160LL))(v9, v30);
v30 = *(float *)((__int64 (__fastcall *)(cocos2d::CCLayer *))a1->m_editorLayer->m_objectLayer->getPosition)(a1->m_editorLayer->m_objectLayer);
XMin = EditorUI::getXMin(a1, 0);
SectionCount = LevelEditorLayer::getSectionCount(a1->m_editorLayer);
v11 = 100;
if ( SectionCount >= 101 )
v11 = SectionCount;
v26 = (float)v11 * -100.0;
v12 = ((float (__fastcall *)(cocos2d::CCLayer *))a1->m_editorLayer->m_objectLayer->getScale)(a1->m_editorLayer->m_objectLayer);
Slider::setValue(a1->m_positionSlider, fminf(fmaxf((float)(v30 - XMin) / (float)(v12 * v26), 0.0), 1.0));
m_rotationControl = a1->m_rotationControl;
v14 = m_rotationControl->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v30 = 1.0 / v29;
((void (__fastcall *)(GJRotationControl *))v14->setScale)(m_rotationControl);
m_transformControl = a1->m_transformControl;
m_warpSprites = m_transformControl->m_warpSprites;
if ( m_warpSprites )
{
data = m_warpSprites->data;
if ( data->num )
{
arr = data->arr;
v19 = (unsigned __int64)&arr[data->num - 1];
v29 = 0.69999999 * v30;
do
{
if ( !*arr )
break;
((void (__fastcall *)(cocos2d::CCObject *, float))(*arr)->__vftable[2].copyWithZone)(
*arr,
m_transformControl->m_buttonScale * v29);
++arr;
}
while ( (unsigned __int64)arr <= v19 );
}
}
v20 = ((__int64 (__fastcall *)(CCMenuItemSpriteExtra *))m_transformControl->m_warpLockButton->getNormalImage)(m_transformControl->m_warpLockButton);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v20 + 160LL))(v20, v30);
}