//
// cocos2d::CCSprite::initWithTexture from 0x18008eee0 to 0x18008f067 (391 bytes)
//
// 9 xrefs:
// > ??> @ 0x1800f1ce8
// > ??> @ 0x1800f21d0
// > ??> @ 0x1800f2d80
// > ??> @ 0x18010a1c0
// > ??> @ 0x18010d1d8
// > ??> @ 0x1801465d0
// > ??> @ 0x1801465e0
// > ??> @ 0x18014cf68
// > ??> @ 0x1801bfe8c
//
// This function is hookable on this platform (idp: pc, 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 11:22:07 +0000
//
char __fastcall cocos2d::CCSprite::initWithTexture(
cocos2d::CCSprite *this,
struct cocos2d::CCTexture2D *a2,
const struct cocos2d::CCRect *a3,
unsigned __int8 a4)
{
__int64 v8; // rax
__int64 v9; // rbx
float *v10; // rax
__int64 v11; // rbx
cocos2d::CCShaderCache *v12; // rax
struct cocos2d::CCGLProgram *v13; // rax
float v15[6]; // [rsp+20h] [rbp-18h] BYREF
if ( !(unsigned __int8)cocos2d::CCNodeRGBA::init(this) )
return 0;
v8 = *(_QWORD *)this;
*((_QWORD *)this + 46) = 0;
*((_BYTE *)this + 377) = 0;
(*(void (__fastcall **)(cocos2d::CCSprite *, _QWORD))(v8 + 1048))(this, 0);
v9 = *(_QWORD *)this;
*((_WORD *)this + 278) = 1;
*((_DWORD *)this + 101) = 1;
*((_DWORD *)this + 102) = 771;
*((_BYTE *)this + 558) = 0;
v10 = kmVec2Fill(v15, 0.5, 0.5);
(*(void (__fastcall **)(cocos2d::CCSprite *, float *))(v9 + 288))(this, v10);
cocos2d::CCSize::operator=((_DWORD *)this + 111, dword_1801B2840);
*((_BYTE *)this + 378) = 0;
*(_OWORD *)((char *)this + 460) = 0;
v15[0] = NAN;
*(_OWORD *)((char *)this + 476) = 0;
*(_OWORD *)((char *)this + 492) = 0;
*(_OWORD *)((char *)this + 508) = 0;
*(_OWORD *)((char *)this + 524) = 0;
*(_OWORD *)((char *)this + 540) = 0;
v11 = *(_QWORD *)this;
*((_DWORD *)this + 124) = -1;
*((_DWORD *)this + 136) = -1;
*((_DWORD *)this + 118) = -1;
*((_DWORD *)this + 130) = -1;
v12 = cocos2d::CCShaderCache::sharedShaderCache();
v13 = cocos2d::CCShaderCache::programForKey(v12, "ShaderPositionTextureColor");
(*(void (__fastcall **)(cocos2d::CCSprite *, struct cocos2d::CCGLProgram *))(v11 + 656))(this, v13);
(*(void (__fastcall **)(char *, struct cocos2d::CCTexture2D *))(*((_QWORD *)this + 43) + 24LL))(
(char *)this + 344,
a2);
(*(void (__fastcall **)(cocos2d::CCSprite *, const struct cocos2d::CCRect *, _QWORD, char *))(*(_QWORD *)this + 984LL))(
this,
a3,
a4,
(char *)a3 + 8);
(*(void (__fastcall **)(cocos2d::CCSprite *, _QWORD))(*(_QWORD *)this + 968LL))(this, 0);
*((_BYTE *)this + 559) = 0;
return 1;
}