//
// GameObject::commonSetup from 0x14018dcf0 to 0x14018ded2 (482 bytes)
//
// 31 xrefs:
// > EditorUI::alignObjects @ 0x1401220a7
// > EndPortalObject::init @ 0x140137da9
// > GameObject::createWithKey @ 0x14018c18b
// > GameObject::createWithKey @ 0x14018c472
// > GameObject::createWithKey @ 0x14018d1d7
// > GameObject::createWithFrame @ 0x14018dc66
// > GameObject::initWithTexture @ 0x14018dcda
// > EnhancedGameObject::init @ 0x1401a479d
// > TextGameObject::create @ 0x1401a754f
// > LevelPage::addSecretCoin @ 0x14031c403
// > PlayerObject::init @ 0x140386957
// > PlayLayer::createCheckpoint @ 0x1403b53ac
// > GradientTriggerObject::init @ 0x140499244
// > ParticleGameObject::init @ 0x14049fc44
// > AnimatedGameObject::init @ 0x1404a2d9e
// > EffectGameObject::init @ 0x1404a589d
// > KeyframeAnimTriggerObject::init @ 0x1404b15b4
// > StartPosObject::init @ 0x1404b1fcd
// > LabelGameObject::init @ 0x1404b3474
// > KeyframeGameObject::init @ 0x1404b5454
// > EventLinkTrigger::init @ 0x1404b8854
// > SpawnTriggerGameObject::init @ 0x1404b90a4
// > CheckpointGameObject::init @ 0x1404b9db4
// > EndTriggerGameObject::init @ 0x1404bcc84
// > UISettingsGameObject::init @ 0x1404bd294
// > AudioLineGuideGameObject::init @ 0x1404c1474
// > PlayerControlGameObject::init @ 0x1404c27d4
// > ObjectControlGameObject::init @ 0x1404c2d84
// > SpawnParticleGameObject::init @ 0x1404c3554
// > RotateGameplayGameObject::init @ 0x1404c3f14
// > ??> @ 0x1406cb8a4
//
// 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
//
// Hidden C++ exception states: #wind=3
void GameObject::commonSetup(GameObject *a1)
{
__int64 v2; // rcx
char v3; // al
__int64 v4; // rax
GJSpriteColor *m_baseColor; // rdx
int v6; // eax
void *v7; // [rsp+30h] [rbp+8h]
v2 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v7 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v7);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v2 = qword_1406C2ED8;
}
v3 = *(_BYTE *)(v2 + 698);
a1->m_editorEnabled = v3;
if ( !v3 )
{
v4 = *(_QWORD *)(v2 + 520);
if ( v4 )
a1->m_goEffectManager = *(GJEffectManager **)(v4 + 2384);
}
m_baseColor = a1->m_baseColor;
if ( !m_baseColor )
{
m_baseColor = (GJSpriteColor *)operator new(0x28u);
*(_QWORD *)&m_baseColor->m_colorID = 0;
m_baseColor->m_opacity = 1.0;
m_baseColor->m_baseOpacity = 1.0;
m_baseColor->m_hsv = (cocos2d::ccHSVValue)xmmword_1406BA148;
*(_WORD *)&m_baseColor->m_usesHSV = 0;
*(_WORD *)&m_baseColor->m_customColor.r = -1;
m_baseColor->m_customColor.b = -1;
a1->m_baseColor = m_baseColor;
}
m_baseColor->m_defaultColorID = 1004;
m_baseColor->m_colorID = 0;
a1->m_opacityMod = 1.0;
a1->m_defaultZOrder = 2;
*(_DWORD *)&a1->m_enterType = -1;
a1->m_unk3E8 = 1;
qword_1406C2EE0 = 214013 * qword_1406C2EE0 + 2531011;
a1->m_varianceIndex = (int)(float)((float)((float)(((unsigned __int64)qword_1406C2EE0 >> 16) & 0x7FFF) / 32767.0)
* 1900.0);
a1->m_width = a1->m_obRect.size.width;
a1->m_height = a1->m_obRect.size.height;
a1->m_spriteWidthScale = 1.0;
a1->m_spriteHeightScale = 1.0;
v6 = dword_1406BA158;
a1->m_uniqueID = dword_1406BA158;
a1->m_unknown5 = v6;
dword_1406BA158 = v6 + 1;
a1->m_startScaleX = 1.0;
a1->m_startScaleY = 1.0;
*(_QWORD *)&a1->m_startRotationX = 0;
((void (__fastcall *)(GameObject *))a1->setScaleX)(a1);
((void (__fastcall *)(GameObject *))a1->setScaleY)(a1);
a1->m_isActivated = 0;
a1->m_isDirty = 1;
a1->m_isObjectRectDirty = 1;
}