//
// LevelEditorLayer::toggleLockActiveLayer from 0x46110c to 0x46117c (112 bytes)
//
// 1 xrefs:
// > EditorUI::onLockLayer @ 0x48446e
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:48:53 +0000
//
int __fastcall LevelEditorLayer::toggleLockActiveLayer(int this)
{
__int16 v1; // r3
int v2; // r4
unsigned int v3; // r1
int v4; // r2
int v5; // r3
int v6; // r3
int v7; // r3
v1 = *(_WORD *)(this + 11826);
if ( (unsigned __int16)(v1 - 1) <= 0x270Eu && *(_BYTE *)(this + 11702) )
{
v2 = *(_DWORD *)(this + 12000);
v3 = (unsigned int)v1 >> 5;
v4 = 1 << (v1 & 0x1F);
v5 = *(_DWORD *)(v2 + 4 * v3);
if ( (v5 & v4) != 0 )
v6 = v5 & ~v4;
else
v6 = v5 | v4;
*(_DWORD *)(v2 + 4 * v3) = v6;
if ( ((1 << (*(_WORD *)(this + 11826) & 0x1F))
& *(_DWORD *)(*(_DWORD *)(this + 12000) + 4 * ((unsigned int)*(__int16 *)(this + 11826) >> 5))) != 0 )
v7 = 1;
else
v7 = -1;
*(_DWORD *)(this + 12012) += v7;
}
return this;
}