//
// EditorUI::updateZoom from 0x3872d8 to 0x38741e (326 bytes)
//
// 2 xrefs:
// > EditorUI::playtestStopped @ 0x3874ac
// > EditorUI::zoomGameLayer @ 0x387668
//
// 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 EditorUI::updateZoom(EditorUI *a1, float a2)
{
cocos2d::CCDirector *v4; // r0
LevelEditorLayer *m_editorLayer; // r0
cocos2d::CCNode *m_objectLayer; // r6
int v7; // r0
int v8; // r10
cocos2d::CCNode *v9; // r0
int v10; // r0
cocos2d::CCNode *v11; // r0
float v12; // s16
cocos2d::CCSize v13; // [sp+4h] [bp-2Ch] BYREF
cocos2d::CCPoint v14; // [sp+Ch] [bp-24h] BYREF
cocos2d::CCPoint v15; // [sp+14h] [bp-1Ch] BYREF
_BYTE v16[8]; // [sp+1Ch] [bp-14h] BYREF
cocos2d::CCPoint v17; // [sp+24h] [bp-Ch] BYREF
v4 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v13, v4);
m_editorLayer = a1->m_editorLayer;
m_objectLayer = m_editorLayer->m_objectLayer;
v7 = (int)m_editorLayer->getParent(m_editorLayer);
v8 = (*(int (__fastcall **)(int))(*(_DWORD *)v7 + 84))(v7);
v9 = a1->m_editorLayer->getParent(a1->m_editorLayer);
((void (__fastcall *)(cocos2d::CCNode *, int))v9->setScale)(v9, 1065353216);
cocos2d::CCPoint::CCPoint(&v17, v13.width * 0.5, v13.height * 0.5);
cocos2d::CCNode::convertToNodeSpace(&v14, m_objectLayer, &v17);
((void (__fastcall *)(cocos2d::CCLayer *, _DWORD))a1->m_editorLayer->m_objectLayer->setScale)(
a1->m_editorLayer->m_objectLayer,
LODWORD(a2));
cocos2d::CCNode::convertToWorldSpace(&v15, m_objectLayer, &v14);
cocos2d::CCPoint::CCPoint(&v17, v13.width * 0.5, v13.height * 0.5);
cocos2d::CCPoint::operator-(v16, &v17, &v15);
v10 = (int)m_objectLayer->getPosition(m_objectLayer);
cocos2d::CCPoint::operator+(&v17, v10, v16);
m_objectLayer->setPosition(m_objectLayer, &v17);
EditorUI::constrainGameLayerPosition(a1);
v11 = a1->m_editorLayer->getParent(a1->m_editorLayer);
((void (__fastcall *)(cocos2d::CCNode *, int))v11->setScale)(v11, v8);
EditorUI::updateSlider(a1);
v12 = 1.0 / a2;
((void (__fastcall *)(GJRotationControl *, _DWORD))a1->m_rotationControl->setScale)(
a1->m_rotationControl,
LODWORD(v12));
GJTransformControl::scaleButtons(a1->m_transformControl, v12);
}