//
// PlayLayer::pauseGame from 0x14051a370 to 0x14051a744 (980 bytes)
//
// 3 xrefs:
// > AppDelegate::pauseGame @ 0x140098ac6
// > UILayer::onPause @ 0x140672fef
// > ??> @ 0x14092ae3c
//
// This function is hookable on this platform (idp: pc, 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:33:35 +0000
//
// Hidden C++ exception states: #wind=3
void __fastcall PlayLayer::pauseGame(_BYTE *a1, char a2)
{
__int64 v4; // rcx
__int64 v5; // rdx
__int64 v6; // rcx
__int64 v7; // r8
__int64 v8; // r9
__int64 v9; // rdx
__int64 v10; // rcx
__int64 v11; // r8
__int64 v12; // r9
cocos2d::CCEGLView *v13; // rax
__int64 i; // r10
__int64 v15; // rdx
__int64 v16; // rcx
__int64 v17; // rcx
__int64 v18; // rcx
char *v19; // rdi
__int64 v20; // rax
struct __timeb64 Time; // [rsp+20h] [rbp-28h] BYREF
if ( !a1[13936] && !a1[15317] && !*(_BYTE *)(cocos2d::CCApplication::sharedApplication(a1) + 225) )
{
a1[2214] = 1;
(*(void (__fastcall **)(_BYTE *))(*(_QWORD *)a1 + 1320LL))(a1);
a1[15431] = 1;
PlayLayer::dtFlushCells(a1);
PlayLayer::dtCommitPlaytime(a1);
*((_QWORD *)a1 + 1918) = 0;
*((_QWORD *)a1 + 1919) = 0;
*((_QWORD *)a1 + 1920) = 0;
ftime64(&Time);
*((double *)a1 + 1925) = (double)Time.millitm / 1000.0 + (double)SLODWORD(Time.time);
*(_BYTE *)(cocos2d::CCDirector::sharedDirector(v4) + 178) = 0;
*(_BYTE *)(cocos2d::CCEGLView::sharedOpenGLView(v6, v5, v7, v8) + 237) = 0;
v13 = (cocos2d::CCEGLView *)cocos2d::CCEGLView::sharedOpenGLView(v10, v9, v11, v12);
cocos2d::CCEGLView::showCursor(v13, 1);
for ( i = *((_QWORD *)a1 + 1664); (*((_QWORD *)a1 + 1665) - i) / 24; i = *((_QWORD *)a1 + 1664) )
{
GJBaseGameLayer::handleButton((__int64)a1, *(_BYTE *)(i + 4), *(_DWORD *)i, *(_BYTE *)(i + 5) == 0);
memmove(
*((void **)a1 + 1664),
(const void *)(*((_QWORD *)a1 + 1664) + 24LL),
*((_QWORD *)a1 + 1665) - (*((_QWORD *)a1 + 1664) + 24LL));
*((_QWORD *)a1 + 1665) -= 24LL;
}
PlayerObject::releaseAllButtons(*((_QWORD *)a1 + 439));
v16 = *((_QWORD *)a1 + 440);
if ( v16 )
PlayerObject::releaseAllButtons(v16);
GJBaseGameLayer::pauseAudio(v16, v15);
if ( !qword_14090BFD0 )
{
Time.time = (__time64_t)operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(Time.time);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
}
PlayerObject::releaseAllButtons(*((_QWORD *)a1 + 439));
v17 = *((_QWORD *)a1 + 440);
if ( v17 )
PlayerObject::releaseAllButtons(v17);
v18 = *((_QWORD *)a1 + 1736);
*(_QWORD *)(v18 + 584) = -1;
*(_WORD *)(v18 + 578) = 0;
*(_BYTE *)(v18 + 580) = 0;
UILayer::resetUINodeState(v18);
UILayer::toggleMenuVisibility(*((_QWORD *)a1 + 1736), 0);
v19 = (char *)operator new(0x2A0u);
Time.time = (__time64_t)v19;
CCBlockLayer::CCBlockLayer((__int64)v19);
*(_QWORD *)v19 = &PauseLayer::`vftable';
*((_QWORD *)v19 + 40) = &PauseLayer::`vftable';
*((_QWORD *)v19 + 41) = &PauseLayer::`vftable';
*((_QWORD *)v19 + 42) = &PauseLayer::`vftable';
*((_QWORD *)v19 + 43) = &PauseLayer::`vftable';
*((_QWORD *)v19 + 44) = &PauseLayer::`vftable';
*((_QWORD *)v19 + 51) = &PauseLayer::`vftable';
*((_QWORD *)v19 + 54) = &PauseLayer::`vftable';
*((_QWORD *)v19 + 69) = &PauseLayer::`vftable';
*((_QWORD *)v19 + 70) = &PauseLayer::`vftable';
*((_QWORD *)v19 + 71) = &PauseLayer::`vftable';
*((_QWORD *)v19 + 72) = &PauseLayer::`vftable';
*(_WORD *)(v19 + 585) = 0;
*((_QWORD *)v19 + 74) = 0;
*((_DWORD *)v19 + 150) = 0;
*((_QWORD *)v19 + 76) = 0;
v19[616] = 0;
*((_QWORD *)v19 + 78) = 0;
*((_QWORD *)v19 + 79) = 0;
*((_QWORD *)v19 + 80) = 0;
*((_QWORD *)v19 + 81) = 0;
*((_QWORD *)v19 + 82) = 0;
*((_QWORD *)v19 + 83) = 0;
v19[584] = a2;
if ( CCBlockLayer::init((cocos2d::CCLayerColor *)v19) )
{
cocos2d::CCObject::autorelease((cocos2d::CCObject *)v19);
}
else
{
(*(void (__fastcall **)(char *, __int64))(*(_QWORD *)v19 + 8LL))(v19, 1);
v19 = nullptr;
}
v20 = (*(__int64 (__fastcall **)(_BYTE *))(*(_QWORD *)a1 + 504LL))(a1);
(*(void (__fastcall **)(__int64, char *, __int64))(*(_QWORD *)v20 + 456LL))(v20, v19, 10);
(*(void (__fastcall **)(_BYTE *))(*(_QWORD *)a1 + 712LL))(a1);
}
}