//
// LevelEditorLayer::updateEditor from 0x1003582ac to 0x1003585a0 (756 bytes)
//
// 1 xrefs:
// > LevelEditorLayer::init @ 0x100357710
//
// 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
//
// local variable allocation has failed, the output may be wrong!
void __fastcall LevelEditorLayer::updateEditor(LevelEditorLayer *a1, float a2)
{
float ModifiedDelta; // s8
int *p_m_activeGradients; // x20
bool v5; // zf
float v6; // s0
cocos2d::CCNode *m_inShaderParent; // x20
_BOOL8 v8; // x1
cocos2d::CCNode *m_aboveShaderParent; // x20
_BOOL8 v10; // x1
float32x2_t *v11; // x0
float v12; // s2
double v13; // d0
double *v14; // x0
float32x2_t v15; // [xsp+0h] [xbp-40h] BYREF
float32x2_t v16; // [xsp+8h] [xbp-38h] BYREF
timeb v17; // [xsp+10h] [xbp-30h] BYREF
cocos2d::CCPoint v18; // 0:s0.4,4:s1.4
ModifiedDelta = a2;
p_m_activeGradients = &a1->m_activeGradients;
if ( a1->m_unk3b22 )
{
a1->m_unk3b22 = 0;
++a1->m_unk3b24;
}
v5 = a1->m_playbackMode == Playing;
a1->m_started = v5;
if ( v5 )
{
((void (__fastcall *)(LevelEditorLayer *, __n128))a1->update)(a1, *(__n128 *)&a2);
LABEL_22:
((void (__fastcall *)(DrawGridLayer *, float))a1->m_drawGridLayer->update)(a1->m_drawGridLayer, ModifiedDelta);
LevelEditorLayer::updateGridLayer(a1);
return;
}
GJBaseGameLayer::tryResumeAudio(a1);
if ( *((_BYTE *)p_m_activeGradients + 2264) == 1 )
ModifiedDelta = GJBaseGameLayer::getModifiedDelta(a1, ModifiedDelta);
else
a1->m_extraDelta = 0.0;
if ( ModifiedDelta > 0.0 )
{
a1->m_gameState.m_totalTime = a1->m_gameState.m_totalTime + ModifiedDelta;
if ( a1->m_editorUI )
{
ftime(&v17);
v6 = (double)(v17.millitm + 1000 * (unsigned __int64)(v17.time & 0xFFFFF)) / 1000.0 - a1->m_editorUI->m_keyTime;
if ( v6 < 10.0 )
a1->m_sessionTime = a1->m_sessionTime + ModifiedDelta;
}
GJBaseGameLayer::updateBGArtSpeed(a1, 0.1, 0.1);
LevelEditorLayer::updateGameObjects(a1);
((void (__fastcall *)(LevelEditorLayer *, float))a1->updateVisibility)(a1, ModifiedDelta);
LevelEditorLayer::updateGridLayerParent(a1);
m_inShaderParent = a1->m_inShaderParent;
v8 = ((unsigned int (__fastcall *)(cocos2d::CCNode *))m_inShaderParent->getChildrenCount)(m_inShaderParent) > 1
|| ((unsigned int (__fastcall *)(cocos2d::CCLayer *))a1->m_inShaderObjectLayer->getChildrenCount)(a1->m_inShaderObjectLayer) != 0;
((void (__fastcall *)(cocos2d::CCNode *, _BOOL8))m_inShaderParent->setVisible)(m_inShaderParent, v8);
m_aboveShaderParent = a1->m_aboveShaderParent;
v10 = ((unsigned int (__fastcall *)(cocos2d::CCNode *))m_aboveShaderParent->getChildrenCount)(m_aboveShaderParent) > 1
|| ((unsigned int (__fastcall *)(cocos2d::CCLayer *))a1->m_aboveShaderObjectLayer->getChildrenCount)(a1->m_aboveShaderObjectLayer) != 0;
((void (__fastcall *)(cocos2d::CCNode *, _BOOL8))m_aboveShaderParent->setVisible)(m_aboveShaderParent, v10);
GJBaseGameLayer::updateGradientLayers(a1);
GJBaseGameLayer::updateExtraGameLayers(a1);
((void (__fastcall *)(GJGroundLayer *, _QWORD))a1->m_groundLayer2->setVisible)(a1->m_groundLayer2, 0);
a1->m_gameState.m_cameraZoom = ((float (__fastcall *)(cocos2d::CCLayer *))a1->m_objectLayer->getScale)(a1->m_objectLayer);
v11 = (float32x2_t *)((__int64 (__fastcall *)(cocos2d::CCLayer *))a1->m_objectLayer->getPosition)(a1->m_objectLayer);
sub_1000229F0(v11, &qword_100886D98, (float32x2_t *)&v17);
sub_100022A14((float32x2_t *)&v17, &v15, 1.0 / a1->m_gameState.m_cameraZoom);
sub_1000229F0((float32x2_t *)&a1->m_gameState.m_cameraPosition2, &v15, &v16);
if ( a1->m_gameState.m_cameraZoom != a1->m_gameState.m_unkFloat4 )
sub_1000229D0(&v16, (double *)&a1->m_gameState.m_cameraPosition2);
sub_1000229B8((__int64 *)&v15, (__int64 *)&v16);
v18.x = a1->m_gameState.m_cameraZoom;
GJBaseGameLayer::updateCameraBGArt(a1, v18, v12);
a1->m_gameState.m_unkFloat4 = a1->m_gameState.m_cameraZoom;
v13 = sub_1000229D0(&a1->m_gameState.m_cameraPosition2, (double *)&v16);
v14 = (double *)((__int64 (__fastcall *)(cocos2d::CCLayer *, double))a1->m_objectLayer->getPosition)(
a1->m_objectLayer,
v13);
sub_1000229D0(&qword_100886D98, v14);
goto LABEL_22;
}
}