//
// GJEffectManager::saveToState from 0x1002ee9a0 to 0x1002eee6f (1231 bytes)
//
// 1 xrefs:
// > PlayLayer::createCheckpoint @ 0x1000bb635
//
// 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 GJEffectManager::saveToState(GJEffectManager *a1, EffectManagerState *a2)
{
unsigned __int64 v3; // rcx
signed __int64 v4; // rdx
cocos2d::CCDictionary *m_unkObject148; // rax
cocos2d::CCDictElement *m_pElements; // rax
cocos2d::CCObject *m_pObject; // rsi
std::__vector_base::pointer begin; // rdx
if ( &a2->m_unorderedSet_int2 != &a1->m_unkMap4c8 )
{
a2->m_unorderedSet_int2.__table_.__p3_.__value_ = a1->m_unkMap4c8.__table_.__p3_.__value_;
sub_1000C5AA0(
&a2->m_unorderedSet_int2.__table_.__bucket_list_.__ptr_.__value_,
(__int64 *)a1->m_unkMap4c8.__table_.__p1_.__value_.__next_,
nullptr);
}
v3 = cocos2d::CCDictionary::count(a1->m_unkObject148);
v4 = ((char *)a2->m_unkVecCAState.__end_ - (char *)a2->m_unkVecCAState.__begin_) >> 2;
if ( v3 <= 0xF0F0F0F0F0F0F0F1LL * v4 )
{
if ( v3 < 0xF0F0F0F0F0F0F0F1LL * v4 )
{
v3 *= 68LL;
a2->m_unkVecCAState.__end_ = (std::__vector_base::pointer)((char *)a2->m_unkVecCAState.__begin_ + v3);
}
}
else
{
sub_1002F9130(a2, v3 - 0xF0F0F0F0F0F0F0F1LL * v4);
}
m_unkObject148 = a1->m_unkObject148;
if ( m_unkObject148 )
{
m_pElements = m_unkObject148->m_pElements;
if ( m_pElements )
{
v3 = 0;
do
{
m_pObject = m_pElements->m_pObject;
m_pElements = (cocos2d::CCDictElement *)m_pElements->hh.next;
begin = a2->m_unkVecCAState.__begin_;
*(&begin->m_fromColor.b + v3) = BYTE2(m_pObject[1].m_nTag);
*(_WORD *)(&begin->m_fromColor.r + v3) = m_pObject[1].m_nTag;
*(&begin->m_toColor.b + v3) = BYTE1(m_pObject[1].m_uReference);
*(_WORD *)(&begin->m_toColor.r + v3) = *(_WORD *)((char *)&m_pObject[1].m_nTag + 3);
*(&begin->m_color.b + v3) = BYTE4(m_pObject[1].__vftable);
*(_WORD *)(&begin->m_color.r + v3) = WORD1(m_pObject[1].__vftable);
*(&begin->m_paused + v3) = BYTE1(m_pObject[1].__vftable);
*(_DWORD *)((char *)&begin->m_duration + v3) = m_pObject[1].m_uAutoReleaseCount;
*(_QWORD *)((char *)&begin->m_playerColor + v3) = *(_QWORD *)&m_pObject[1].m_uIndexInArray;
*(&begin->m_blending + v3) = m_pObject[1].m_eObjType;
*(_QWORD *)((char *)&begin->m_fromOpacity + v3) = *(_QWORD *)&m_pObject[1].m_unknown2;
*(&begin->m_copyOpacity + v3) = BYTE1(m_pObject[2].m_nLuaID);
*(int *)((char *)&begin->m_copyID + v3) = m_pObject[2].m_uID;
*(cocos2d::ccHSVValue *)((char *)&begin->m_copyHSV + v3) = *(cocos2d::ccHSVValue *)&m_pObject[1].m_uOrderOfArrival;
*(int *)((char *)&begin->m_uniqueID + v3) = m_pObject[2].m_nTag;
*(&begin->m_legacyHSV + v3) = m_pObject[2].m_uAutoReleaseCount;
_mm_storel_ps(
(double *)((char *)&begin->m_deltaTime + v3),
_mm_shuffle_ps(
(__m128)*(unsigned __int64 *)&m_pObject[1].m_uID,
(__m128)*(unsigned __int64 *)&m_pObject[1].m_uID,
225));
v3 += 68LL;
}
while ( m_pElements );
}
}
if ( &a2->m_unkVecPulseEffectAction != &a1->m_pulseEffectVector )
sub_1002F92E0(
&a2->m_unkVecPulseEffectAction,
a1->m_pulseEffectVector.__begin_,
a1->m_pulseEffectVector.__end_,
0x8E38E38E38E38E39LL * (((char *)a1->m_pulseEffectVector.__end_ - (char *)a1->m_pulseEffectVector.__begin_) >> 3));
if ( &a2->m_unorderedMapInt_vectorPulseEffectAction != &a1->m_pulseEffectMap )
{
a2->m_unorderedMapInt_vectorPulseEffectAction.__table_.__p3_.__value_ = a1->m_pulseEffectMap.__table_.__p3_.__value_;
sub_1002F9440(
&a2->m_unorderedMapInt_vectorPulseEffectAction,
a1->m_pulseEffectMap.__table_.__p1_.__value_.__next_,
0,
v3);
}
if ( &a2->m_unorderedMapInt_OpacityEffectAction != &a1->m_opacityEffectMap )
{
a2->m_unorderedMapInt_OpacityEffectAction.__table_.__p3_.__value_ = a1->m_opacityEffectMap.__table_.__p3_.__value_;
sub_1002F9BF0(
&a2->m_unorderedMapInt_OpacityEffectAction,
a1->m_opacityEffectMap.__table_.__p1_.__value_.__next_,
0,
v3);
}
if ( &a2->m_unorderedSet_int1 != &a1->m_unkMap460 )
{
a2->m_unorderedSet_int1.__table_.__p3_.__value_ = a1->m_unkMap460.__table_.__p3_.__value_;
sub_1000C5AA0(
&a2->m_unorderedSet_int1.__table_.__bucket_list_.__ptr_.__value_,
(__int64 *)a1->m_unkMap460.__table_.__p1_.__value_.__next_,
nullptr);
}
if ( &a2->m_mapInt_Int != (std::map *)&a1->m_unkMap498 )
sub_1002FA2B0(&a2->m_mapInt_Int, a1->m_unkMap498.__tree_.__begin_node_, &a1->m_unkMap498.__tree_.__pair1_, v3);
if ( &a2->m_vectorSpawnTriggerAction != &a1->m_spawnTriggerActions )
sub_1002FA610(
&a2->m_vectorSpawnTriggerAction,
a1->m_spawnTriggerActions.__begin_,
a1->m_spawnTriggerActions.__end_,
0x8E38E38E38E38E39LL
* (((char *)a1->m_spawnTriggerActions.__end_ - (char *)a1->m_spawnTriggerActions.__begin_) >> 3));
if ( &a2->m_vectorGroupCommandObject2 != &a1->m_unkVector560 )
sub_1002FA9D0(
&a2->m_vectorGroupCommandObject2,
a1->m_unkVector560.__begin_,
a1->m_unkVector560.__end_,
0xFC0FC0FC0FC0FC1LL * (((char *)a1->m_unkVector560.__end_ - (char *)a1->m_unkVector560.__begin_) >> 3));
if ( &a2->m_unorderedMapInt_pair_double_double != &a1->m_unkMap578 )
{
a2->m_unorderedMapInt_pair_double_double.__table_.__p3_.__value_ = a1->m_unkMap578.__table_.__p3_.__value_;
sub_1002F2BF0(&a2->m_unorderedMapInt_pair_double_double, a1->m_unkMap578.__table_.__p1_.__value_.__next_, 0);
}
if ( &a2->m_vectorTouchToggleAction != &a1->m_unkVector1e0 )
sub_1002FB340(
&a2->m_vectorTouchToggleAction,
a1->m_unkVector1e0.__begin_,
a1->m_unkVector1e0.__end_,
0x6DB6DB6DB6DB6DB7LL * (((char *)a1->m_unkVector1e0.__end_ - (char *)a1->m_unkVector1e0.__begin_) >> 3));
if ( &a2->m_unorderedMapInt_vectorCountTriggerAction != &a1->m_countTriggerActions )
{
a2->m_unorderedMapInt_vectorCountTriggerAction.__table_.__p3_.__value_ = a1->m_countTriggerActions.__table_.__p3_.__value_;
sub_1002FB6F0(
&a2->m_unorderedMapInt_vectorCountTriggerAction,
a1->m_countTriggerActions.__table_.__p1_.__value_.__next_,
0,
v3);
}
if ( &a2->m_vectorToggleTriggerAction != &a1->m_unkVector248 )
sub_1002FC2D0(
&a2->m_vectorToggleTriggerAction,
a1->m_unkVector248.__begin_,
a1->m_unkVector248.__end_,
0xAAAAAAAAAAAAAAABLL * (((char *)a1->m_unkVector248.__end_ - (char *)a1->m_unkVector248.__begin_) >> 4));
if ( &a2->m_vectorCollisionTriggerAction != &a1->m_unkVector230 )
sub_1002FC680(
&a2->m_vectorCollisionTriggerAction,
a1->m_unkVector230.__begin_,
a1->m_unkVector230.__end_,
0x6DB6DB6DB6DB6DB7LL * (((char *)a1->m_unkVector230.__end_ - (char *)a1->m_unkVector230.__begin_) >> 3));
if ( &a2->m_unorderedMapInt_bool != &a1->m_unkMap288 )
{
a2->m_unorderedMapInt_bool.__table_.__p3_.__value_ = a1->m_unkMap288.__table_.__p3_.__value_;
sub_1000C1920(
&a2->m_unorderedMapInt_bool.__table_.__bucket_list_.__ptr_.__value_,
(__int64 *)a1->m_unkMap288.__table_.__p1_.__value_.__next_,
nullptr);
}
if ( &a2->m_itemCountMap != &a1->m_itemCountMap )
{
a2->m_itemCountMap.__table_.__p3_.__value_ = a1->m_itemCountMap.__table_.__p3_.__value_;
sub_1000C10A0(
&a2->m_itemCountMap.__table_.__bucket_list_.__ptr_.__value_,
(__int64 *)a1->m_itemCountMap.__table_.__p1_.__value_.__next_,
nullptr);
}
if ( &a2->m_timerItemMap != &a1->m_timerItemMap )
{
a2->m_timerItemMap.__table_.__p3_.__value_ = a1->m_timerItemMap.__table_.__p3_.__value_;
sub_1002FCA30(&a2->m_timerItemMap, a1->m_timerItemMap.__table_.__p1_.__value_.__next_, 0, v3);
}
if ( &a2->m_unorderedMapInt_vectorTimerTriggerAction != &a1->m_unkMap3f8 )
{
a2->m_unorderedMapInt_vectorTimerTriggerAction.__table_.__p3_.__value_ = a1->m_unkMap3f8.__table_.__p3_.__value_;
sub_1002FD230(
&a2->m_unorderedMapInt_vectorTimerTriggerAction,
a1->m_unkMap3f8.__table_.__p1_.__value_.__next_,
0,
v3);
}
}