//
// SpriteDescription::initDescription from 0x68da8c to 0x68dd7c (752 bytes)
//
// 2 xrefs:
// > SpriteDescription::createDescription @ 0x68dde4
// > ??> @ 0xe2de0
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:50:34 +0000
//
__int64 __fastcall SpriteDescription::initDescription(SpriteDescription *this, DS_Dictionary *a2)
{
char *v4; // x0
float v5; // s0
char v6; // w0
char *v7; // x20
char *v8; // x20
char *v9; // x20
_BOOL4 v11; // w0
cocos2d::CCSpriteFrameCache *StringForKey; // x0
cocos2d::CCSpriteFrameCache *v13; // x0
const char *v14; // x1
cocos2d::CCObject *v15; // x0
__int64 v16; // x19
__int64 *v17; // x0
__int64 v18; // [xsp+40h] [xbp+40h] BYREF
__int64 v19; // [xsp+48h] [xbp+48h] BYREF
size_t v20; // [xsp+50h] [xbp+50h]
void *v21; // [xsp+58h] [xbp+58h]
__int64 v22; // [xsp+60h] [xbp+60h] BYREF
size_t v23; // [xsp+68h] [xbp+68h]
char *v24; // [xsp+70h] [xbp+70h]
DS_Dictionary::getVec2ForKey(&v18, a2, "position");
cocos2d::CCPoint::operator=((char *)this + 56, &v18);
DS_Dictionary::getVec2ForKey(&v18, a2, "flipped");
cocos2d::CCPoint::operator=((char *)this + 72, &v18);
DS_Dictionary::getVec2ForKey(&v18, a2, "scale");
cocos2d::CCPoint::operator=((char *)this + 64, &v18);
DS_Dictionary::getStringForKey(&v22, a2, "rotation");
v4 = (char *)&v22 + 1;
if ( (v22 & 1) != 0 )
v4 = v24;
v5 = atof(v4);
v6 = v22;
*((float *)this + 20) = v5;
if ( (v6 & 1) != 0 )
operator delete(v24);
DS_Dictionary::getStringForKey(&v22, a2, "zValue");
if ( (v22 & 1) != 0 )
{
v7 = v24;
*((_DWORD *)this + 21) = atoi(v24);
operator delete(v7);
}
else
{
*((_DWORD *)this + 21) = atoi((const char *)&v22 + 1);
}
DS_Dictionary::getStringForKey(&v22, a2, "tag");
if ( (v22 & 1) != 0 )
{
v8 = v24;
*((_DWORD *)this + 22) = atoi(v24);
operator delete(v8);
}
else
{
*((_DWORD *)this + 22) = atoi((const char *)&v22 + 1);
}
DS_Dictionary::getStringForKey(&v22, a2, "usesCustomTag");
if ( (v22 & 1) != 0 )
{
v9 = v24;
*((_BYTE *)this + 92) = atoi(v24) != 0;
operator delete(v9);
if ( !*((_BYTE *)this + 92) )
return 1;
}
else
{
v11 = atoi((const char *)&v22 + 1) != 0;
*((_BYTE *)this + 92) = v11;
if ( !v11 )
return 1;
}
StringForKey = (cocos2d::CCSpriteFrameCache *)DS_Dictionary::getStringForKey(&v19, a2, "texture");
v13 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(StringForKey);
v14 = (char *)&v19 + 1;
if ( (v19 & 1) != 0 )
v14 = (const char *)v21;
v15 = (cocos2d::CCObject *)cocos2d::CCSpriteFrameCache::spriteFrameByName(v13, v14);
*((_QWORD *)this + 12) = v15;
cocos2d::CCObject::retain(v15);
v22 = 0;
v23 = 0;
v24 = nullptr;
v16 = *((_QWORD *)this + 12);
if ( (v19 & 1) != 0 )
{
std::string::__init(&v22, v21, v20);
}
else
{
v24 = (char *)v21;
v22 = v19;
v23 = v20;
}
v17 = (__int64 *)(v16 + 160);
if ( (__int64 *)(v16 + 160) != &v22 )
{
if ( (v22 & 1) != 0 )
std::string::assign(v17, v24, v23);
else
std::string::assign(v17, (char *)&v22 + 1, (unsigned __int8)v22 >> 1);
}
if ( (v22 & 1) != 0 )
operator delete(v24);
if ( (v19 & 1) != 0 )
operator delete(v21);
return 1;
}