//
// GameObject::addNewSlope02Glow from 0x14029fe90 to 0x1402a0097 (519 bytes)
//
// 3 xrefs:
// > GameObject::setupCustomSprites @ 0x1402b2d88
// > GameObject::setupCustomSprites @ 0x1402b9d93
// > ??> @ 0x14091d99c
//
// 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:29:15 +0000
//
__int64 __fastcall GameObject::addNewSlope02Glow(__int64 a1, char a2)
{
__int64 result; // rax
__int128 *v4; // rdx
_QWORD *v5; // rax
size_t v6; // r8
void **v7; // rcx
struct cocos2d::CCSprite *v8; // rbx
void *v9; // r8
_BYTE v10[8]; // [rsp+30h] [rbp-29h] BYREF
__int128 v11; // [rsp+38h] [rbp-21h] BYREF
__int64 v12; // [rsp+48h] [rbp-11h]
unsigned __int64 v13; // [rsp+50h] [rbp-9h]
__int128 *v14; // [rsp+58h] [rbp-1h]
void *Block[2]; // [rsp+60h] [rbp+7h] BYREF
__m128i si128; // [rsp+70h] [rbp+17h]
_QWORD v17[4]; // [rsp+80h] [rbp+27h] BYREF
result = *(_QWORD *)(a1 + 752);
if ( result )
{
if ( a2 )
*(_BYTE *)(result + 559) = 1;
v11 = 0;
*(_QWORD *)&v11 = sub_14003D460(0x20u);
v12 = 26;
v13 = 31;
strcpy((char *)v11, "blockOutline_15new_001.png");
v14 = &v11;
v4 = &v11;
if ( v13 > 0xF )
v4 = (__int128 *)v11;
v5 = sub_14004DEC0(v17, v4, "_001.png", "_glow_001.png");
if ( v5[3] > 0xFu )
v5 = (_QWORD *)*v5;
*(_OWORD *)Block = 0;
si128 = 0;
v6 = -1;
do
++v6;
while ( *((_BYTE *)v5 + v6) );
sub_14003D230(Block, v5, v6);
sub_14003D310((__int64)v17);
sub_14003D310((__int64)&v11);
v7 = Block;
if ( si128.m128i_i64[1] > 0xFuLL )
v7 = (void **)Block[0];
v8 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)v7);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v9 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v9 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v9 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v9);
}
si128 = _mm_load_si128((const __m128i *)&Size);
LOBYTE(Block[0]) = 0;
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v8 + 352LL))(v8);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCSprite *))(**(_QWORD **)(a1 + 752) + 464LL))(
*(_QWORD *)(a1 + 752),
v8);
cocos2d::CCNode::convertToNodeSpace(*(_QWORD *)(a1 + 752), v10, &unk_14090A8F0);
return (*(__int64 (__fastcall **)(struct cocos2d::CCSprite *, _BYTE *))(*(_QWORD *)v8 + 184LL))(v8, v10);
}
return result;
}