//
// cocos2d::CCEGLView::toggleFullScreen from 0x180078de0 to 0x18007902f (591 bytes)
//
// 5 xrefs:
// > ??> @ 0x18013b430
// > ??> @ 0x18013b444
// > ??> @ 0x18013b454
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b4b00
//
// 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 cocos2d::CCEGLView::toggleFullScreen(cocos2d::CCEGLView *this, char a2, char a3, char a4)
{
__int64 v5; // rax
int *v6; // rax
cocos2d::CCRect *v7; // rax
float v8; // xmm3_4
cocos2d::CCRect *v9; // rax
struct cocos2d::CCRect *v10; // rax
unsigned int height; // ebx
unsigned int width; // edi
HWND v13; // rax
float v14; // [rsp+20h] [rbp-48h]
cocos2d::CCRect v15; // [rsp+40h] [rbp-28h] BYREF
cocos2d::CCRect v16; // [rsp+50h] [rbp-18h] BYREF
if ( *((_BYTE *)this + 232) != a2 || *((_BYTE *)this + 233) != a3 || *((_BYTE *)this + 234) != a4 )
{
*((_BYTE *)this + 232) = a2;
*((_BYTE *)this + 233) = a3;
*((_BYTE *)this + 234) = a4;
BYTE1(cocos2d::CCApplication::sharedApplication()[2].m_startupScriptFilename.m_data.m_size) = *((_BYTE *)this + 232);
sub_1800D4950(*((_QWORD *)this + 25));
cocos2d::CCRect::CCRect(&v15);
if ( *((_BYTE *)this + 232) )
{
v5 = sub_1800D41B0();
*((_QWORD *)this + 26) = v5;
v6 = (int *)sub_1800D41F0(v5);
v7 = cocos2d::CCRect::CCRect(&v16, 0.0, 0.0, (float)*v6, (float)v6[1]);
cocos2d::CCRect::operator=((float *)&v15.origin, (float *)&v7->origin);
if ( *((_BYTE *)this + 233) )
{
sub_1800D4D00(131077, 0);
if ( *((_BYTE *)this + 234) )
{
v15.size.width = v15.size.width + 1.0;
v15.size.height = v15.size.height + 1.0;
}
*((_QWORD *)this + 26) = 0;
}
}
else
{
sub_1800D4D00(131077, 1);
v8 = *((float *)this + 54);
v14 = *((float *)this + 55);
*((_QWORD *)this + 26) = 0;
v9 = cocos2d::CCRect::CCRect(&v16, 0.0, 0.0, v8, v14);
cocos2d::CCRect::operator=((float *)&v15.origin, (float *)&v9->origin);
}
*((_DWORD *)this + 48) = 1065353216;
v10 = cocos2d::CCRect::CCRect(&v16, &v15);
cocos2d::CCEGLView::setupWindow(this, v10);
height = (int)v15.size.height;
width = (int)v15.size.width;
sub_1800D4CB0(*((_QWORD *)this + 25));
sub_1800D4B50(*((_QWORD *)this + 25), width, height);
cocos2d::CCEGLView::updateWindow(this, width, height);
sub_1800D44D0(*((_QWORD *)this + 25));
if ( *((_BYTE *)this + 232) && *((_BYTE *)this + 233) )
{
if ( *((_BYTE *)this + 234) )
{
v13 = (HWND)sub_1800D8320(*((_QWORD *)this + 25));
SetWindowPos(v13, HWND_MESSAGE|0x2LL, 0, 0, 0, 0, 0x53u);
}
}
}
}