//
// GameObject::resetObject from 0x1401906d0 to 0x14019091c (588 bytes)
//
// 7 xrefs:
// > EnhancedGameObject::resetObject @ 0x1401a4939
// > ??> @ 0x140556810
// > ??> @ 0x140556f80
// > ??> @ 0x14055dfb8
// > ??> @ 0x14060e1b0
// > ??> @ 0x1406cb904
// > ??> @ 0x1406cb910
//
// 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)
{
_BOOL8 m_startFlipX; // rdx
unsigned __int64 v2; // rax
float m_startScaleX; // xmm1_4
float m_startScaleY; // xmm1_4
GameObject_vtbl *v6; // rax
double m_positionX; // xmm0_8
double x; // xmm2_8
double y; // xmm0_8
GameObject_vtbl *v10; // rax
__int64 v11; // rax
char v12; // [rsp+30h] [rbp+8h] BYREF
m_startFlipX = a1->m_startFlipX;
v2 = 214013 * qword_1406C2EE0 + 2531011;
a1->m_isDisabled = 0;
qword_1406C2EE0 = v2;
a1->m_isDisabled2 = 0;
a1->m_isUnmodifiedPosDirty = 1;
a1->m_unk4fb = 0;
a1->m_enabledGroupsCounter = 0;
a1->m_isGroupDisabled = 0;
a1->m_varianceIndex = (int)(float)((float)((float)((v2 >> 16) & 0x7FFF) / 32767.0) * 1900.0);
a1->setFlipX(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);
((void (__fastcall *)(GameObject *))a1->setRotationY)(a1);
}
m_positionX = a1->m_positionX;
x = a1->m_startPosition.x;
*(_DWORD *)&a1->m_enterType = -1;
a1->m_unk3E8 = 1;
a1->m_unk4C8 = -1;
if ( m_positionX != x
|| a1->m_positionY != a1->m_startPosition.y
|| a1->m_rotationXOffset != 0.0
|| a1->m_rotationYOffset != 0.0
|| a1->m_scaleXOffset != 0.0
|| a1->m_scaleYOffset != 0.0 )
{
y = a1->m_startPosition.y;
*(_QWORD *)&a1->m_scaleXOffset = 0;
a1->m_rotationXOffset = 0.0;
a1->m_rotationYOffset = 0.0;
a1->m_isDirty = 1;
a1->m_isObjectRectDirty = 1;
a1->m_positionX = x;
a1->m_positionY = y;
}
v10 = a1->CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
*(_QWORD *)&a1->m_positionXOffset = 0;
a1->m_unk2A8 = 0.0;
a1->m_unk2B0 = 0.0;
*(_QWORD *)&a1->m_unk2BC = 0;
*(_QWORD *)&a1->m_unmodifiedPositionX = 0;
v11 = ((__int64 (__fastcall *)(GameObject *, char *))v10->getRealPosition)(a1, &v12);
cocos2d::CCPoint::operator=(&a1->m_lastPosition, v11);
a1->m_customScaleX = a1->m_scaleX;
a1->m_customScaleY = a1->m_scaleY;
}