//
// cocos2d::CCSprite::updateTransform from 0x100289320 to 0x10028982d (1293 bytes)
//
// 78 xrefs:
// > ??> @ 0x1008b40c8
// > ??> @ 0x1008b80b0
// > ??> @ 0x1008c4370
// > ??> @ 0x1008c4ba8
// > ??> @ 0x1008c53a0
// > ??> @ 0x1008c5b98
// > ??> @ 0x1008c6390
// > ??> @ 0x1008c6b88
// > ??> @ 0x1008c7380
// > ??> @ 0x1008c7b78
// > ??> @ 0x1008c8360
// > ??> @ 0x1008c8b70
// > ??> @ 0x1008c93e8
// > ??> @ 0x1008c9bf8
// > ??> @ 0x1008ca408
// > ??> @ 0x1008cac18
// > ??> @ 0x1008cb428
// > ??> @ 0x1008cbc38
// > ??> @ 0x1008cc448
// > ??> @ 0x1008ccc58
// > ??> @ 0x1008cd468
// > ??> @ 0x1008cdc78
// > ??> @ 0x1008ce4a0
// > ??> @ 0x1008cecf8
// > ??> @ 0x1008cf520
// > ??> @ 0x1008cfd48
// > ??> @ 0x1008d0570
// > ??> @ 0x1008d0d98
// > ??> @ 0x1008d15a8
// > ??> @ 0x1008d1db8
// > ??> @ 0x1008d25c8
// > ??> @ 0x1008d2dd8
// > ??> @ 0x1008d35e8
// > ??> @ 0x1008d3df8
// > ??> @ 0x1008d4608
// > ??> @ 0x1008d4e18
// > ??> @ 0x1008d5628
// > ??> @ 0x1008d5e38
// > ??> @ 0x1008d6648
// > ??> @ 0x1008d6e58
// > ??> @ 0x1008d7668
// > ??> @ 0x1008d7e78
// > ??> @ 0x1008d8688
// > ??> @ 0x1008d8e98
// > ??> @ 0x1008dd478
// > ??> @ 0x1008e09a8
// > ??> @ 0x1008f0620
// > ??> @ 0x1008f39b0
// > ??> @ 0x100904da8
// > ??> @ 0x100909980
// > ??> @ 0x10090b9b8
// > ??> @ 0x100913460
// > ??> @ 0x100914708
// > ??> @ 0x100915298
// > ??> @ 0x10091c028
// > ??> @ 0x10091c5b0
// > ??> @ 0x10091da08
// > ??> @ 0x10091dfa8
// > ??> @ 0x100923640
// > ??> @ 0x100927fd8
// > ??> @ 0x10092ad30
// > ??> @ 0x100933a08
// > ??> @ 0x100934230
// > ??> @ 0x10093c8d0
// > ??> @ 0x10093ce80
// > ??> @ 0x100942110
// > ??> @ 0x10094e828
// > ??> @ 0x1009716f0
// > ??> @ 0x100971ed8
// > ??> @ 0x1009726e8
// > ??> @ 0x100974950
// > ??> @ 0x100974f08
// > ??> @ 0x1009754c0
// > ??> @ 0x10097a4b0
// > ??> @ 0x10097aa68
// > ??> @ 0x100985538
// > ??> @ 0x100991920
// > ??> @ 0x100996148
//
// 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
//
void __fastcall cocos2d::CCSprite::updateTransform(cocos2d::CCSprite *a1)
{
cocos2d::CCNode *m_pParent; // rax
__m128 x_low; // xmm2
__m128 y_low; // xmm3
__m128 a_low; // xmm0
__m128 b_low; // xmm4
__m128 v7; // xmm6
__m128 v8; // xmm5
__m128 v9; // xmm7
__m128 v10; // xmm3
__m128 v11; // xmm1
__m128 v12; // xmm0
__m128 v13; // xmm4
__m128 v14; // xmm1
__m128 v15; // xmm5
__m128 v16; // xmm3
__m128 v17; // xmm5
float m_fBlVertexMod; // xmm2_4
__m128 v19; // xmm6
__m128 v20; // xmm7
float m_fVertexZ; // xmm2_4
__m128 v22; // xmm4
float m_fBrVertexMod; // xmm9_4
__m128 v24; // xmm4
__m128 v25; // xmm8
__m128 v26; // xmm10
float m_fTlVertexMod; // xmm8_4
__m128 v28; // xmm5
__int64 v29; // rax
float v30; // xmm3_4
float m_fTrVertexMod; // xmm3_4
__m128 v32; // xmm1
cocos2d::CCTextureAtlas *m_pobTextureAtlas; // rdi
cocos2d::CCAffineTransform v34; // [rsp+0h] [rbp-40h] BYREF
cocos2d::CCAffineTransform v35; // [rsp+18h] [rbp-28h] BYREF
if ( ((unsigned __int8 (__fastcall *)(cocos2d::CCSprite *))a1->isDirty)(a1) )
{
if ( !a1->m_bVisible )
goto LABEL_6;
m_pParent = a1->m_pParent;
if ( !m_pParent || m_pParent == a1->m_pobBatchNode )
{
a1->m_bShouldBeHidden = 0;
((void (__fastcall *)(cocos2d::CCAffineTransform *, cocos2d::CCSprite *))a1->nodeToParentTransform)(&v35, a1);
}
else
{
if ( HIBYTE(m_pParent[1].m_fRotationX) == 1 )
{
LABEL_6:
*(_QWORD *)&a1->m_sQuad.bl.vertices.x = 0;
a1->m_sQuad.bl.vertices.z = 0.0;
*(_QWORD *)&a1->m_sQuad.tr.vertices.x = 0;
a1->m_sQuad.tr.vertices.z = 0.0;
*(_QWORD *)&a1->m_sQuad.tl.vertices.x = 0;
a1->m_sQuad.tl.vertices.z = 0.0;
*(_QWORD *)&a1->m_sQuad.br.vertices.x = 0;
a1->m_sQuad.br.vertices.z = 0.0;
a1->m_bShouldBeHidden = 1;
if ( a1->m_bDontDraw )
goto LABEL_37;
goto LABEL_35;
}
a1->m_bShouldBeHidden = 0;
((void (__fastcall *)(cocos2d::CCAffineTransform *, cocos2d::CCSprite *))a1->nodeToParentTransform)(&v34, a1);
cocos2d::CCAffineTransformConcat(&v35, &v34, (const cocos2d::CCAffineTransform *)&a1->m_pParent[1].m_fRotationY);
}
a1->m_transformToBatch = v35;
if ( a1->m_bDontDraw )
{
LABEL_34:
if ( a1->m_bDontDraw )
{
LABEL_37:
a1->m_bRecursiveDirty = 0;
((void (__fastcall *)(cocos2d::CCSprite *, _QWORD))a1->setDirty)(a1, 0);
goto LABEL_38;
}
LABEL_35:
m_pobTextureAtlas = a1->m_pobTextureAtlas;
if ( m_pobTextureAtlas )
cocos2d::CCTextureAtlas::updateQuad(m_pobTextureAtlas, &a1->m_sQuad, a1->m_uAtlasIndex);
goto LABEL_37;
}
if ( !a1->_realOpacity )
{
*(_QWORD *)&a1->m_sQuad.bl.vertices.x = 0;
a1->m_sQuad.bl.vertices.z = 0.0;
*(_QWORD *)&a1->m_sQuad.tr.vertices.x = 0;
a1->m_sQuad.tr.vertices.z = 0.0;
*(_QWORD *)&a1->m_sQuad.tl.vertices.x = 0;
a1->m_sQuad.tl.vertices.z = 0.0;
*(_QWORD *)&a1->m_sQuad.br.vertices.x = 0;
a1->m_sQuad.br.vertices.z = 0.0;
if ( a1->m_bDontDraw )
goto LABEL_37;
goto LABEL_35;
}
sub_10028CFC0(&v35, &a1->m_obRect.size);
x_low = (__m128)LODWORD(a1->m_obOffsetPosition.x);
y_low = (__m128)LODWORD(a1->m_obOffsetPosition.y);
a_low = (__m128)LODWORD(v35.a);
a_low.f32[0] = v35.a + x_low.f32[0];
b_low = (__m128)LODWORD(v35.b);
b_low.f32[0] = v35.b + y_low.f32[0];
v7 = (__m128)*(unsigned __int64 *)&a1->m_transformToBatch.a;
v8 = (__m128)*(unsigned __int64 *)&a1->m_transformToBatch.c;
v9 = (__m128)*(unsigned __int64 *)&a1->m_transformToBatch.tx;
v10 = _mm_mul_ps(_mm_blend_ps(y_low, v8, 14), _mm_insert_ps(v8, y_low, 16));
v11 = _mm_mul_ps(_mm_moveldup_ps(a_low), v7);
v12 = _mm_add_ps(_mm_add_ps(v11, v10), v9);
v13 = _mm_mul_ps(_mm_moveldup_ps(b_low), v8);
v14 = _mm_add_ps(_mm_add_ps(v11, v13), v9);
v15 = _mm_mul_ps(_mm_moveldup_ps(x_low), v7);
v16 = _mm_add_ps(_mm_add_ps(v10, v15), v9);
v17 = _mm_add_ps(_mm_add_ps(v15, v13), v9);
if ( !a1->m_bUseVertexMod )
{
m_fVertexZ = a1->m_fVertexZ;
_mm_storel_ps((double *)&a1->m_sQuad.bl.vertices.x, v16);
a1->m_sQuad.bl.vertices.z = m_fVertexZ;
_mm_storel_ps((double *)&a1->m_sQuad.br.vertices.x, v12);
a1->m_sQuad.br.vertices.z = m_fVertexZ;
_mm_storel_ps((double *)&a1->m_sQuad.tl.vertices.x, v17);
a1->m_sQuad.tl.vertices.z = m_fVertexZ;
LABEL_33:
_mm_storel_ps((double *)&a1->m_sQuad.tr.vertices.x, v14);
a1->m_sQuad.tr.vertices.z = m_fVertexZ;
goto LABEL_34;
}
m_fBlVertexMod = a1->m_fBlVertexMod;
v19 = _mm_sub_ps(v17, v16);
if ( m_fBlVertexMod == 0.0 )
{
m_fVertexZ = a1->m_fVertexZ;
v22 = v16;
}
else
{
v20 = (__m128)0x3F800000u;
v20.f32[0] = 1.0 - m_fBlVertexMod;
v22 = _mm_sub_ps(v17, _mm_mul_ps(_mm_moveldup_ps(v20), v19));
m_fVertexZ = a1->m_fVertexZ;
a1->m_sQuad.bl.texCoords.v = a1->m_fTextureTop
- (float)((float)(a1->m_fTextureTop - a1->m_fTextureBottom) * v20.f32[0]);
}
_mm_storel_ps((double *)&a1->m_sQuad.bl.vertices.x, v22);
a1->m_sQuad.bl.vertices.z = m_fVertexZ;
m_fBrVertexMod = a1->m_fBrVertexMod;
v24 = _mm_sub_ps(v14, v12);
v25 = v12;
if ( m_fBrVertexMod != 0.0 )
{
v26 = (__m128)0x3F800000u;
v26.f32[0] = 1.0 - m_fBrVertexMod;
v25 = _mm_sub_ps(v14, _mm_mul_ps(_mm_moveldup_ps(v26), v24));
a1->m_sQuad.br.texCoords.v = a1->m_fTextureTop
- (float)((float)(a1->m_fTextureTop - a1->m_fTextureBottom)
* (float)(1.0 - m_fBrVertexMod));
}
_mm_storel_ps((double *)&a1->m_sQuad.br.vertices.x, v25);
a1->m_sQuad.br.vertices.z = m_fVertexZ;
m_fTlVertexMod = a1->m_fTlVertexMod;
if ( m_fTlVertexMod == 0.0 )
{
_mm_storel_ps((double *)&a1->m_sQuad.tl.vertices.x, v17);
v29 = 468;
v30 = m_fVertexZ;
}
else
{
v28 = (__m128)0x3F800000u;
v28.f32[0] = 1.0 - m_fTlVertexMod;
_mm_storel_ps((double *)&a1->m_sQuad.tl.vertices.x, _mm_add_ps(_mm_mul_ps(v19, _mm_moveldup_ps(v28)), v16));
a1->m_sQuad.tl.vertices.z = m_fVertexZ;
if ( m_fTlVertexMod < 0.0 )
goto LABEL_28;
if ( a1->m_bRectRotated )
{
v30 = (float)((float)(a1->m_fTextureRight - a1->m_fTextureLeft) * v28.f32[0]) + a1->m_fTextureLeft;
v29 = 476;
}
else
{
v30 = (float)((float)(a1->m_fTextureTop - a1->m_fTextureBottom) * v28.f32[0]) + a1->m_fTextureBottom;
v29 = 480;
}
}
*(float *)((char *)&a1->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable + v29) = v30;
LABEL_28:
m_fTrVertexMod = a1->m_fTrVertexMod;
if ( m_fTrVertexMod != 0.0 )
{
v32 = (__m128)0x3F800000u;
v32.f32[0] = 1.0 - m_fTrVertexMod;
_mm_storel_ps((double *)&a1->m_sQuad.tr.vertices.x, _mm_add_ps(_mm_mul_ps(v24, _mm_moveldup_ps(v32)), v12));
a1->m_sQuad.tr.vertices.z = m_fVertexZ;
if ( m_fTrVertexMod >= 0.0 )
{
if ( a1->m_bRectRotated )
{
a1->m_sQuad.tr.texCoords.u = (float)((float)(a1->m_fTextureRight - a1->m_fTextureLeft) * v32.f32[0])
+ a1->m_fTextureLeft;
if ( a1->m_bDontDraw )
goto LABEL_37;
}
else
{
a1->m_sQuad.tr.texCoords.v = (float)((float)(a1->m_fTextureTop - a1->m_fTextureBottom) * v32.f32[0])
+ a1->m_fTextureBottom;
if ( a1->m_bDontDraw )
goto LABEL_37;
}
goto LABEL_35;
}
goto LABEL_34;
}
goto LABEL_33;
}
LABEL_38:
cocos2d::CCNode::updateTransform(a1);
}