//
// GameObject::resetObject from 0x647034 to 0x647274 (576 bytes)
//
// 6 xrefs:
// > EnhancedGameObject::resetObject @ 0x64728c
// > ??> @ 0x2ee00
// > ??> @ 0x11539a8
// > ??> @ 0x1154978
// > ??> @ 0x1165b28
// > ??> @ 0x1177368
//
// 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 GameObject::resetObject(GameObject *a1)
{
unsigned __int64 v2; // x2
__int64 v3; // x4
float m_startScaleX; // s0
float m_startScaleY; // s0
GameObject_vtbl *v6; // x1
float x; // s0
double m_positionX; // d1
double v9; // d0
float y; // s2
double v11; // d2
cocos2d::CCPoint (__fastcall *getRealPosition)(GameObject *__hidden); // x2
float v13; // s0
float v14; // s1
_QWORD v15[2]; // [xsp+30h] [xbp+30h] BYREF
v2 = 214013 * qword_1242080 + 2531011;
a1->m_isUnmodifiedPosDirty = 1;
a1->m_isDisabled = 0;
v3 = _stack_chk_guard;
a1->m_isDisabled2 = 0;
a1->m_unk4fb = 0;
qword_1242080 = v2;
v15[1] = v3;
a1->m_varianceIndex = (int)(float)((float)((float)((v2 >> 16) & 0x7FFF) / 32767.0) * 1900.0);
GameObject::resetGroupDisabled(a1);
a1->setFlipX(a1, a1->m_startFlipX);
a1->setFlipY(a1, a1->m_startFlipY);
m_startScaleX = a1->m_startScaleX;
if ( a1->m_scaleX != m_startScaleX )
GameObject::updateCustomScaleX(a1, m_startScaleX);
m_startScaleY = a1->m_startScaleY;
if ( a1->m_scaleY != m_startScaleY )
GameObject::updateCustomScaleY(a1, m_startScaleY);
v6 = a1->CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
if ( a1->m_startRotationX == a1->m_startRotationY )
{
((void (__fastcall *)(GameObject *))v6->setRotation)(a1);
}
else
{
((void (__fastcall *)(GameObject *))v6->setRotationX)(a1);
a1->setRotationY(a1, a1->m_startRotationY);
}
x = a1->m_startPosition.x;
m_positionX = a1->m_positionX;
a1->m_enterType = -1;
v9 = x;
a1->m_exitType = -1;
a1->m_unk3E8 = 1;
a1->m_unk4C8 = -1;
y = a1->m_startPosition.y;
if ( m_positionX != v9 )
{
v11 = y;
LABEL_9:
a1->m_isDirty = 1;
a1->m_isObjectRectDirty = 1;
a1->m_positionX = v9;
a1->m_scaleXOffset = 0.0;
a1->m_scaleYOffset = 0.0;
a1->m_positionY = v11;
a1->m_rotationXOffset = 0.0;
a1->m_rotationYOffset = 0.0;
goto LABEL_10;
}
v11 = y;
if ( a1->m_positionY != v11
|| a1->m_rotationXOffset != 0.0
|| a1->m_rotationYOffset != 0.0
|| a1->m_scaleXOffset != 0.0
|| a1->m_scaleYOffset != 0.0 )
{
goto LABEL_9;
}
LABEL_10:
getRealPosition = a1->getRealPosition;
a1->m_positionXOffset = 0.0;
a1->m_positionYOffset = 0.0;
a1->m_unk2A8 = 0.0;
a1->m_unk2B0 = 0.0;
a1->m_unk2BC = 0.0;
a1->m_unk2C0 = 0.0;
a1->m_unmodifiedPositionX = 0.0;
a1->m_unmodifiedPositionY = 0.0;
((void (__fastcall *)(_QWORD *__return_ptr, GameObject *))getRealPosition)(v15, a1);
cocos2d::CCPoint::operator=(&a1->m_lastPosition, v13, v14);
*(_QWORD *)&a1->m_customScaleX = *(_QWORD *)&a1->m_scaleX;
}