//
// GJEffectManager::getColorSprite from 0x1002de470 to 0x1002de563 (243 bytes)
//
// 21 xrefs:
// > LevelEditorLayer::transferDefaultColors @ 0x1000eea75
// > LevelEditorLayer::transferDefaultColors @ 0x1000eeaa8
// > LevelEditorLayer::transferDefaultColors @ 0x1000eeadb
// > LevelEditorLayer::transferDefaultColors @ 0x1000eeb0e
// > GJBaseGameLayer::updateColor @ 0x10013c8c6
// > GJEffectManager::getColorAction @ 0x1002de3d0
// > GJEffectManager::activeColorForIndex @ 0x1002de440
// > GJEffectManager::activeOpacityForIndex @ 0x1002de584
// > GJEffectManager::processCopyColorPulseActions @ 0x1002ded48
// > GJEffectManager::processCopyColorPulseActions @ 0x1002ded8a
// > GJEffectManager::calculateInheritedColor @ 0x1002df185
// > GJEffectManager::colorForPulseEffect @ 0x1002df48b
// > GJEffectManager::setColorAction @ 0x1002df58a
// > GJEffectManager::calculateLightBGColor @ 0x1002edbb5
// > GJEffectManager::calculateLightBGColor @ 0x1002edced
// > GJEffectManager::calculateLightBGColor @ 0x1002edd0f
// > GJEffectManager::setupFromString @ 0x1002ee8a1
// > GJEffectManager::loadFromState @ 0x1002ef0d8
// > GameObject::saveActiveColors @ 0x1005c8c72
// > GameObject::saveActiveColors @ 0x1005c8c8b
// > GameObject::setupColorSprite @ 0x1005c8d73
//
// 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
//
ColorActionSprite *__fastcall GJEffectManager::getColorSprite(GJEffectManager *a1, int a2)
{
int v2; // eax
intptr_t v3; // rbx
ColorActionSprite *v4; // r14
v2 = 0;
if ( a2 > 0 )
v2 = a2;
v3 = 1101;
if ( v2 < 1101 )
v3 = (unsigned int)v2;
v4 = a1->m_colorActionSpriteVector.__begin_[v3];
if ( !v4 )
{
v4 = (ColorActionSprite *)operator new(0x158u);
cocos2d::CCNode::CCNode((__int64)v4);
v4->__vftable = (ColorActionSprite_vtbl *)off_100909C18;
v4->m_opacity = 255.0;
v4->m_colorID = 0;
v4->m_colorAction = nullptr;
if ( cocos2d::CCNode::init(v4) )
{
*(_WORD *)&v4->m_copyColor.g = -1;
*(_QWORD *)&v4->m_opacity = -3162570752LL;
cocos2d::CCObject::autorelease(v4);
}
else
{
((void (__fastcall *)(ColorActionSprite *))v4->~ColorActionSprite_0)(v4);
v4 = nullptr;
}
v4->m_colorID = v3;
((void (__fastcall *)(GJEffectManager *, ColorActionSprite *))a1->addChild)(a1, v4);
a1->m_colorActionSpriteVector.__begin_[v3] = v4;
cocos2d::CCDictionary::setObject(a1->m_unkDict150, v4, v3);
}
return v4;
}