//
// CharacterColorPage::toggleShip from 0x1400a1570 to 0x1400a1692 (290 bytes)
//
// 3 xrefs:
// > CharacterColorPage::init @ 0x1400a0ef8
// > ??> @ 0x140913094
// > ??> @ 0x1409130a0
//
// 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:26:06 +0000
//
// Hidden C++ exception states: #wind=2
__int64 __fastcall CharacterColorPage::toggleShip(__int64 a1, __int64 a2)
{
__int64 v3; // rsi
__int64 v4; // rcx
__int64 v5; // rdx
unsigned int v6; // ebx
__int64 v7; // rax
void *v9; // [rsp+48h] [rbp+10h]
void *v10; // [rsp+48h] [rbp+10h]
v3 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 952LL))(a2);
if ( (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)a2 + 56LL))(a2) == 1 )
{
v4 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v9 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v9);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v4 = qword_14090BFD0;
}
v5 = (unsigned int)(*(_DWORD *)(v4 + 916) - *(_DWORD *)(v4 + 920));
v6 = 8;
}
else
{
v7 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v10 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v10);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v7 = qword_14090BFD0;
}
v5 = (unsigned int)(*(_DWORD *)(v7 + 760) - *(_DWORD *)(v7 + 764));
v6 = 1;
}
SimplePlayer::updatePlayerFrame(v3, v5, v6);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v3 + 160LL))(v3);
return (*(__int64 (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a2 + 64LL))(a2, v6);
}