//
// GJPathSprite::changeToLockedArt from 0xa6dc24 to 0xa6df10 (748 bytes)
//
// 3 xrefs:
// > GJPathPage::playUnlockAnimation @ 0xa6e028
// > GJPathSprite::updateState @ 0xa6eef8
// > ??> @ 0x79860
//
// 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 GJPathSprite::changeToLockedArt(GJPathSprite *a1)
{
cocos2d::CCString *v2; // x0
char *CString; // x0
char *v4; // x1
CCSpriteGrayscale *v5; // x21
char *v6; // x0
void (__fastcall *setPosition)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x26
unsigned int v8; // w0
float v9; // s0
void (__fastcall *setColor)(cocos2d::CCSprite *__hidden, const cocos2d::ccColor3B *); // x3
cocos2d::CCSprite *v11; // x21
void (__fastcall *v12)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x25
void (__fastcall *v13)(cocos2d::CCSprite *__hidden, const cocos2d::ccColor3B *); // x3
char *v14; // x20
unsigned int *v15; // x1
int v16; // w2
unsigned int *v17; // x21
int v18; // w0
char *v19; // [xsp+58h] [xbp+58h] BYREF
_BYTE v20[8]; // [xsp+60h] [xbp+60h] BYREF
cocos2d::CCPoint v21; // [xsp+68h] [xbp+68h] BYREF
const char *v22; // [xsp+70h] [xbp+70h] BYREF
cocos2d::CCPoint v23; // 0:kr00_8.8
v2 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"pathIcon_%02d_001.png",
(const char *)(unsigned int)a1->m_pathNumber);
CString = (char *)cocos2d::CCString::getCString(v2);
sub_D153B8((int)&v19, CString);
v4 = v19;
a1->m_bDontDraw = 1;
sub_D153B8((int)&v22, v4);
v5 = CCSpriteGrayscale::createWithSpriteFrameName(&v22);
v6 = (char *)(v22 - 24);
if ( v22 - 24 != (const char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v15 = (unsigned int *)(v22 - 8);
do
v16 = __ldaxr(v15);
while ( __stlxr(v16 - 1, v15) );
}
else
{
v16 = *((_DWORD *)v22 - 2);
*((_DWORD *)v22 - 2) = v16 - 1;
}
if ( v16 <= 0 )
operator delete(v6);
}
a1->addChild_0(a1, v5, -1);
setPosition = v5->setPosition;
v23 = cocos2d::CCNode::convertToNodeSpace(a1, &stru_1244548);
((void (__fastcall *)(CCSpriteGrayscale *, const char **, float, float))setPosition)(v5, &v22, v23.x, v23.y);
v8 = a1->m_pathNumber - 3;
if ( v8 > 5 )
v9 = 3.0;
else
v9 = flt_F146B0[v8];
CCSpriteWithHue::setEvenLuminance(v5, v9);
setColor = v5->setColor;
memset(&v22, 40, 3);
setColor(v5, (const cocos2d::ccColor3B *)&v22);
v11 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_lockGray_001.png");
a1->addChild_0(a1, v11, 1);
v12 = v11->setPosition;
cocos2d::CCNode::convertToNodeSpace(a1, &stru_1244548);
cocos2d::CCPoint::CCPoint(&v21, 0.0, 0.0);
cocos2d::CCPoint::operator+(&v22, v20, &v21);
v12(v11, (const cocos2d::CCPoint *)&v22);
v11->setScale(v11, 1.0);
v13 = v11->setColor;
LOWORD(v22) = -14136;
BYTE2(v22) = -56;
v13(v11, (const cocos2d::ccColor3B *)&v22);
v14 = v19 - 24;
if ( v19 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v17 = (unsigned int *)(v19 - 8);
do
v18 = __ldaxr(v17);
while ( __stlxr(v18 - 1, v17) );
}
else
{
v18 = *((_DWORD *)v19 - 2);
*((_DWORD *)v19 - 2) = v18 - 1;
}
if ( v18 <= 0 )
operator delete(v14);
}
}