//
// cocos2d::CCProgressTimer::initWithSprite from 0x18005ffe0 to 0x180060173 (403 bytes)
//
// 3 xrefs:
// > cocos2d::CCProgressTimer::create @ 0x18005fca6
// > ??> @ 0x18014cf68
// > ??> @ 0x1801bd4e0
//
// 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:21:50 +0000
//
char __fastcall cocos2d::CCProgressTimer::initWithSprite(
cocos2d::CCProgressTimer *this,
struct cocos2d::CCSprite *a2,
__int64 a3,
float a4)
{
float v6; // xmm0_4
int v7; // ecx
float *v8; // rax
__int64 v9; // rbx
float *v10; // rax
float *v11; // rax
cocos2d::CCObject *v12; // rcx
__int64 v13; // rbx
__int64 v14; // rax
void *v15; // rcx
__int64 v16; // rbx
cocos2d::CCShaderCache *v17; // rax
struct cocos2d::CCGLProgram *v18; // rax
float v20; // [rsp+40h] [rbp+8h] BYREF
if ( *((float *)this + 87) != 0.0 )
{
v6 = cocos2d::clampf(this, 0.0, 100.0, a4);
v7 = *((_DWORD *)this + 86);
*((float *)this + 87) = v6;
if ( v7 )
{
if ( v7 == 1 )
cocos2d::CCProgressTimer::updateBar(this);
}
else
{
cocos2d::CCProgressTimer::updateRadial(this);
}
}
*((_QWORD *)this + 46) = 0;
*((_DWORD *)this + 90) = 0;
v8 = kmVec2Fill(&v20, 0.5, 0.5);
cocos2d::CCNode::setAnchorPoint(this, (const struct cocos2d::CCPoint *)v8);
v9 = *(_QWORD *)this;
*((_DWORD *)this + 86) = 0;
*((_BYTE *)this + 392) = 0;
v10 = kmVec2Fill(&v20, 0.5, 0.5);
(*(void (__fastcall **)(cocos2d::CCProgressTimer *, float *))(v9 + 912))(this, v10);
v11 = kmVec2Fill(&v20, 1.0, 1.0);
cocos2d::CCSize::operator=((_DWORD *)this + 96, v11);
if ( *((struct cocos2d::CCSprite **)this + 44) != a2 )
{
if ( a2 )
cocos2d::CCObject::retain(a2);
v12 = *((cocos2d::CCObject **)this + 44);
if ( v12 )
cocos2d::CCObject::release(v12);
v13 = *(_QWORD *)this;
*((_QWORD *)this + 44) = a2;
v14 = (*(__int64 (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)a2 + 320LL))(a2);
(*(void (__fastcall **)(cocos2d::CCProgressTimer *, __int64))(v13 + 312))(this, v14);
v15 = *((void **)this + 46);
if ( v15 )
{
free(v15);
*((_QWORD *)this + 46) = 0;
*((_DWORD *)this + 90) = 0;
}
}
v16 = *(_QWORD *)this;
v17 = cocos2d::CCShaderCache::sharedShaderCache();
v18 = cocos2d::CCShaderCache::programForKey(v17, "ShaderPositionTextureColor");
(*(void (__fastcall **)(cocos2d::CCProgressTimer *, struct cocos2d::CCGLProgram *))(v16 + 656))(this, v18);
return 1;
}