//
// PlayLayer::screenFlipObject from 0x10011dd38 to 0x10011df44 (524 bytes)
//
// 1 xrefs:
// > PlayLayer::updateVisibility @ 0x10011ccbc
//
// 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 PlayLayer::screenFlipObject(PlayLayer *a1, GameObject *a2)
{
float m_levelFlipping; // s9
cocos2d::CCDirector *v5; // x0
__int64 *v6; // x0
__n128 v7; // q1
__n128 v8; // q0
float v9; // s0
bool v11; // w8
int v12; // w21
float m_cameraFlip; // s9
float v14; // s0
bool v15; // zf
__int64 v16; // x8
__int64 v17; // x10
__n128 v18; // q0
bool v19; // zf
__int64 v20; // x8
__int64 v21; // x10
int v22; // [xsp+8h] [xbp-48h] BYREF
__int64 v23; // [xsp+10h] [xbp-40h] BYREF
float v24; // [xsp+18h] [xbp-38h]
cocos2d::CCSize WinSize; // 0:kr00_8.8
if ( a1->m_cameraFlip == -1.0 )
m_levelFlipping = 1.0 - a1->m_gameState.m_levelFlipping;
else
m_levelFlipping = a1->m_gameState.m_levelFlipping;
v5 = cocos2d::CCDirector::sharedDirector();
WinSize = cocos2d::CCDirector::getWinSize(v5);
v6 = (__int64 *)((__int64 (__fastcall *)(GameObject *, float, float))a2->getPosition)(
a2,
WinSize.width,
WinSize.height);
sub_1000229B8(&v23, v6);
v7.n128_u32[0] = HIDWORD(v23);
v8.n128_f32[0] = *(float *)&v23
+ (float)((float)((float)(v24 / a1->m_gameState.m_cameraZoom)
+ (float)((float)(*(float *)&v23 - a1->m_gameState.m_cameraPosition.x) * -2.0))
* m_levelFlipping);
sub_100022980(v8, v7, &v22);
((void (__fastcall *)(GameObject *, int *))a2->setPosition)(a2, &v22);
v9 = fabsf(((float (__fastcall *)(GameObject *))a2->getRotation)(a2));
v11 = v9 != 270.0 && v9 != 90.0;
v12 = (int)v9 % 90;
m_cameraFlip = a1->m_cameraFlip;
if ( m_cameraFlip != 1.0 || a1->m_gameState.m_levelFlipping < 0.5 )
{
if ( m_cameraFlip == 1.0 )
{
if ( !a1->m_gameState.m_unkBool11 || a1->m_gameState.m_levelFlipping > 0.5 )
return;
goto LABEL_25;
}
v14 = a1->m_gameState.m_levelFlipping;
if ( v14 > 0.5 )
{
if ( v14 < 0.5 || !a1->m_gameState.m_unkBool11 )
return;
LABEL_25:
v19 = !v11;
v20 = 996;
if ( v19 )
v20 = 997;
v21 = 1232;
if ( !v19 )
v21 = 1224;
(*(void (__fastcall **)(GameObject *, _QWORD))((char *)&a2->copyWithZone + v21))(
a2,
*((unsigned __int8 *)&a2->CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable
+ v20));
if ( v12 )
{
v18.n128_u32[0] = LODWORD(a2->m_startRotationX);
if ( m_cameraFlip != 1.0 )
v18.n128_f32[0] = -v18.n128_f32[0];
goto LABEL_32;
}
return;
}
}
v15 = !v11;
v16 = 996;
if ( v15 )
v16 = 997;
v17 = 1232;
if ( !v15 )
v17 = 1224;
(*(void (__fastcall **)(GameObject *, bool))((char *)&a2->copyWithZone + v17))(
a2,
(*((_BYTE *)&a2->CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable
+ v16)
& 1) == 0);
if ( v12 )
{
v18.n128_f32[0] = -a2->m_startRotationX;
LABEL_32:
((void (__fastcall *)(GameObject *, __n128))a2->setRotation)(a2, v18);
}
}