//
// cocos2d::CCSpriteFrame::initWithTextureFilename from 0x100357e10 to 0x100358001 (497 bytes)
//
// 3 xrefs:
// > cocos2d::CCSpriteFrame::initWithTextureFilename_1 @ 0x100357774
// > cocos2d::CCSpriteFrame::create @ 0x100357db4
// > cocos2d::CCSpriteFrame::copyWithZone @ 0x10035824a
//
// 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
//
bool __fastcall cocos2d::CCSpriteFrame::initWithTextureFilename(
cocos2d::CCSpriteFrame *a1,
const char *a2,
const cocos2d::CCRect *a3,
bool a4,
const cocos2d::CCPoint *a5,
const cocos2d::CCSize *a6)
{
cocos2d::CCDirector *v10; // rax
cocos2d::CCDirector *v11; // rax
cocos2d::CCDirector *v12; // rax
cocos2d::CCDirector *v13; // rax
__m128 v14; // xmm3
cocos2d::CCDirector *v15; // rax
float v16; // xmm0_4
cocos2d::CCDirector *v17; // rax
float v18; // xmm0_4
cocos2d::CCDirector *v19; // rax
float v20; // xmm0_4
cocos2d::CCDirector *v21; // rax
float v22; // xmm0_4
unsigned __int64 v24[2]; // [rsp+8h] [rbp-48h] BYREF
float height; // [rsp+18h] [rbp-38h]
float width; // [rsp+1Ch] [rbp-34h]
float y; // [rsp+20h] [rbp-30h]
float x; // [rsp+24h] [rbp-2Ch]
a1->m_pobTexture = nullptr;
std::string::assign((std::string *)&a1->m_strTextureFilename, a2);
sub_10028D1A0((__m128 *)&a1->m_obRectInPixels, (unsigned __int64 *)a3);
x = a3->origin.x;
v10 = cocos2d::CCDirector::sharedDirector();
x = x / sub_1004849C0(v10);
y = a3->origin.y;
v11 = cocos2d::CCDirector::sharedDirector();
y = y / sub_1004849C0(v11);
width = a3->size.width;
v12 = cocos2d::CCDirector::sharedDirector();
width = width / sub_1004849C0(v12);
height = a3->size.height;
v13 = cocos2d::CCDirector::sharedDirector();
v14 = (__m128)LODWORD(height);
v14.f32[0] = height / sub_1004849C0(v13);
sub_10028CC00((__int64)v24, x, y, (__m128)LODWORD(width), v14);
sub_10028D1A0((__m128 *)&a1->m_obRect, v24);
sub_10028CC90(&a1->m_obOffsetInPixels, (double *)a5);
x = a1->m_obOffsetInPixels.x;
v15 = cocos2d::CCDirector::sharedDirector();
v16 = sub_1004849C0(v15);
x = x / v16;
y = a1->m_obOffsetInPixels.y;
v17 = cocos2d::CCDirector::sharedDirector();
v18 = sub_1004849C0(v17);
sub_10028CBE0((float *)v24, x, y / v18);
sub_10028CC90(&a1->m_obOffset, (double *)v24);
sub_10028CFF0(&a1->m_obOriginalSizeInPixels, a6);
x = a1->m_obOriginalSizeInPixels.width;
v19 = cocos2d::CCDirector::sharedDirector();
v20 = sub_1004849C0(v19);
x = x / v20;
y = a1->m_obOriginalSizeInPixels.height;
v21 = cocos2d::CCDirector::sharedDirector();
v22 = sub_1004849C0(v21);
sub_10028CBF0((float *)v24, x, y / v22);
sub_10028CFF0(&a1->m_obOriginalSize, v24);
a1->m_bRotated = a4;
return 1;
}