//
// GJBaseGameLayer::updateSavePositionObjects from 0x10012c0c0 to 0x10012c20a (330 bytes)
//
// 1 xrefs:
// > GJBaseGameLayer::update @ 0x1001525c1
//
// 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 GJBaseGameLayer::updateSavePositionObjects(GJBaseGameLayer *a1)
{
__m128 y_low; // xmm0
const cocos2d::CCPoint *m_unkUint5; // rcx
unsigned int m_unkUint6; // eax
std::__hash_node_base, void *> *>::__next_pointer next; // r12
GameObject *v6; // r13
int m_unk52C; // r13d
int v8; // edx
std::__vector_base::pointer begin; // rsi
int v10; // eax
int next_high; // r15d
PlayerObject *m_player2; // rdi
int *v13; // [rsp+0h] [rbp-40h] BYREF
cocos2d::CCPoint *p_m_cameraPosition2; // [rsp+8h] [rbp-38h]
int v15; // [rsp+10h] [rbp-30h] BYREF
m_unkUint5 = (const cocos2d::CCPoint *)(unsigned int)a1->m_gameState.m_unkUint5;
if ( !(_DWORD)m_unkUint5 )
{
m_unkUint6 = a1->m_gameState.m_unkUint6;
goto LABEL_5;
}
m_unkUint5 = (const cocos2d::CCPoint *)(unsigned int)((_DWORD)m_unkUint5 + 1000);
m_unkUint6 = a1->m_gameState.m_unkUint6;
if ( (unsigned int)m_unkUint5 <= m_unkUint6 )
{
LABEL_5:
a1->m_gameState.m_unkUint5 = m_unkUint6;
++a1->m_gameState.m_unkUint11;
next = a1->m_savePositionValues.__table_.__p1_.__value_.__next_;
if ( !next )
return;
p_m_cameraPosition2 = &a1->m_gameState.m_cameraPosition2;
do
{
v10 = (int)next[2].__next_;
v15 = v10;
next_high = HIDWORD(next[2].__next_);
if ( v10 > 0 )
{
v13 = &v15;
v6 = (GameObject *)sub_10010B9C0(
(float *)&a1->m_savePositionObjects,
&v15,
y_low,
(__int64)&unk_100816AE0,
&v13)[3];
m_unkUint5 = GameObject::getLastPosition(v6);
m_unk52C = v6->m_unk52C;
}
else
{
if ( v10 == -3 )
{
m_unk52C = a1->m_gameState.m_unkUint12;
m_unkUint5 = p_m_cameraPosition2;
goto LABEL_8;
}
if ( v10 == -2 )
{
m_player2 = a1->m_player2;
goto LABEL_15;
}
m_unk52C = 0;
if ( v10 == -1 )
{
m_player2 = a1->m_player1;
LABEL_15:
m_unk52C = m_player2->m_unk52C;
m_unkUint5 = GameObject::getLastPosition(m_player2);
}
}
LABEL_8:
v8 = m_unk52C + a1->m_gameState.m_unkUint11 % next_high;
begin = a1->m_gameState.m_unkVecFloat1.__begin_;
begin[2 * v8] = m_unkUint5->x;
y_low = (__m128)LODWORD(m_unkUint5->y);
begin[2 * v8 + 1] = y_low.f32[0];
next = next->__next_;
}
while ( next );
}
}