//
// GJBaseGameLayer::spawnObject from 0x10012cf20 to 0x10012d0db (443 bytes)
//
// 4 xrefs:
// > sub_100135C00 @ 0x100135c0c
// > ??> @ 0x1008b7328
// > ??> @ 0x1008c0678
// > ??> @ 0x1008c18a8
//
// 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::spawnObject(
GJBaseGameLayer *a1,
GameObject *a2,
double a3,
std::vector *const a4)
{
std::vector *v4; // r15
char v5; // al
std::vector *v7; // r14
GameObject *v8; // rdi
std::__hash_node_base, void *> *>::__next_pointer next; // rdi
std::__hash_node_base, void *> *> *v10; // rbx
std::__hash_node_base, void *> *> **value; // rdi
GameObject *v12; // rdi
std::unordered_map v13; // [rsp+0h] [rbp-50h] BYREF
double v14; // [rsp+30h] [rbp-20h]
v14 = a3;
if ( a2->m_classType == Effect )
{
if ( !a2->m_isGroupDisabled )
{
if ( a2[1].m_bUseChildIndex
|| (v4 = a4, v5 = ((__int64 (__fastcall *)(GameObject *))a2->hasBeenActivated)(a2), a4 = v4, !v5) )
{
if ( BYTE1(a2[1].m_sAdditionalTransform.b) == 1 )
{
v7 = a4;
if ( GameObject::isSpawnableTrigger(a2) )
{
if ( v7->__begin_ == v7->__end_ )
{
((void (__fastcall *)(GameObject *, double))a2->triggerActivated)(a2, 0.0);
v12 = a2;
if ( a2->m_objectID == 1268 )
{
SpawnTriggerGameObject::updateRemapKeys((SpawnTriggerGameObject *)a2, v7);
v12 = a2;
*(double *)&a2[1].m_sQuad.br.colors.r = v14;
}
((void (__fastcall *)(GameObject *, GJBaseGameLayer *, _QWORD, std::vector *))v12->triggerObject)(
v12,
a1,
0,
v7);
}
else
{
memset(&v13, 0, 32);
v13.__table_.__p3_.__value_ = 1.0;
GJBaseGameLayer::applyRemap(a1, (EffectGameObject *)a2, v7, &v13);
((void (__fastcall *)(GameObject *, double))a2->triggerActivated)(a2, 0.0);
v8 = a2;
if ( a2->m_objectID == 1268 )
{
SpawnTriggerGameObject::updateRemapKeys((SpawnTriggerGameObject *)a2, v7);
v8 = a2;
*(double *)&a2[1].m_sQuad.br.colors.r = v14;
}
((void (__fastcall *)(GameObject *, GJBaseGameLayer *, _QWORD, std::vector *))v8->triggerObject)(
v8,
a1,
0,
v7);
if ( v7->__begin_ != v7->__end_ )
GJBaseGameLayer::restoreRemap((GJBaseGameLayer *)v8, (EffectGameObject *)a2, &v13);
next = v13.__table_.__p1_.__value_.__next_;
if ( v13.__table_.__p1_.__value_.__next_ )
{
do
{
v10 = next->__next_;
operator delete(next);
next = v10;
}
while ( v10 );
}
value = v13.__table_.__bucket_list_.__ptr_.__value_;
v13.__table_.__bucket_list_.__ptr_.__value_ = nullptr;
if ( value )
operator delete(value);
}
}
}
}
}
}
else
{
((void (__fastcall *)(GameObject *))a2->animationTriggered)(a2);
}
}