//
// GJBaseGameLayer::updateSavePositionObjects from 0x1001eb820 to 0x1001eb95c (316 bytes)
//
// 1 xrefs:
// > GJBaseGameLayer::update @ 0x1001fedcc
//
// 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 *p_m_cameraPosition2)
{
GJBaseGameLayer *v1; // x19
int m_unkUint5; // w8
unsigned int v3; // w9
unsigned int m_unkUint6; // w8
std::__hash_node_base, void *> *>::__next_pointer next; // x22
int v6; // w8
int next_high; // w26
GameObject *v8; // x21
int m_unkUint12; // w21
GameObject *m_player2; // x0
int v11; // w8
std::__vector_base::pointer begin; // x10
int v13; // [xsp+0h] [xbp-50h] BYREF
int *v14; // [xsp+8h] [xbp-48h] BYREF
v1 = p_m_cameraPosition2;
m_unkUint5 = p_m_cameraPosition2->m_gameState.m_unkUint5;
if ( !m_unkUint5 )
{
m_unkUint6 = p_m_cameraPosition2->m_gameState.m_unkUint6;
LABEL_5:
p_m_cameraPosition2->m_gameState.m_unkUint5 = m_unkUint6;
++p_m_cameraPosition2->m_gameState.m_unkUint11;
next = p_m_cameraPosition2->m_savePositionValues.__table_.__p1_.__value_.__next_;
if ( !next )
return;
while ( 1 )
{
v6 = (int)next[2].__next_;
next_high = HIDWORD(next[2].__next_);
v13 = v6;
if ( v6 < 1 )
{
if ( v6 == -3 )
{
m_unkUint12 = v1->m_gameState.m_unkUint12;
p_m_cameraPosition2 = (GJBaseGameLayer *)&v1->m_gameState.m_cameraPosition2;
}
else
{
if ( v6 == -2 )
{
m_player2 = v1->m_player2;
}
else
{
if ( v6 != -1 )
{
m_unkUint12 = 0;
goto LABEL_16;
}
m_player2 = v1->m_player1;
}
m_unkUint12 = m_player2->m_unk52C;
p_m_cameraPosition2 = (GJBaseGameLayer *)GameObject::getLastPosition(m_player2);
}
}
else
{
v14 = &v13;
v8 = (GameObject *)sub_100019F24(
(unsigned __int64)&v1->m_savePositionObjects,
&v13,
(__int64)&unk_10063A31C,
&v14)[3];
p_m_cameraPosition2 = (GJBaseGameLayer *)GameObject::getLastPosition(v8);
m_unkUint12 = v8->m_unk52C;
}
LABEL_16:
v11 = v1->m_gameState.m_unkUint11 % next_high + m_unkUint12;
begin = v1->m_gameState.m_unkVecFloat1.__begin_;
begin[2 * v11] = *(std::__vector_base::pointer)&p_m_cameraPosition2->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
begin[2 * v11 + 1] = *((std::__vector_base::pointer)&p_m_cameraPosition2->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable
+ 1);
next = next->__next_;
if ( !next )
return;
}
}
v3 = m_unkUint5 + 1000;
m_unkUint6 = p_m_cameraPosition2->m_gameState.m_unkUint6;
if ( v3 <= m_unkUint6 )
goto LABEL_5;
}