//
// FMODLevelVisualizer::init from 0x8d502c to 0x8d5468 (1084 bytes)
//
// 3 xrefs:
// > FMODLevelVisualizer::create @ 0x8d54bc
// > ??> @ 0x66df8
// > ??> @ 0x119cff0
//
// 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
//
bool FMODLevelVisualizer::init(FMODLevelVisualizer *a1)
{
int v3; // w24
cocos2d::CCTextureCache *v4; // x0
cocos2d::CCTexture2D *v5; // x19
cocos2d::CCSpriteBatchNode *v6; // x20
cocos2d::CCSprite *v7; // x19
float width; // s1
void (__fastcall *setScaleX)(cocos2d::CCSprite *__hidden, float); // x1
float v10; // s9
float v11; // s1
float v12; // s2
float v13; // s8
unsigned int v14; // w19
float v15; // s8
void (__fastcall *setAnchorPoint)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x28
cocos2d::CCSprite *v17; // x27
cocos2d::CCSprite *v18; // x19
void (__fastcall *v19)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x20
bool v20; // [xsp+ABh] [xbp+ABh]
unsigned int v21; // [xsp+ACh] [xbp+ACh]
char v22; // [xsp+B8h] [xbp+B8h] BYREF
__int16 v23; // [xsp+B9h] [xbp+B9h]
cocos2d::CCPoint v24; // [xsp+C0h] [xbp+C0h] BYREF
cocos2d::CCPoint v25; // [xsp+C8h] [xbp+C8h] BYREF
cocos2d::CCPoint v26; // [xsp+D0h] [xbp+D0h] BYREF
v20 = cocos2d::CCNode::init(a1);
if ( v20 )
{
v3 = 0;
a1->setContentSize(a1, &stru_1242E68);
v4 = cocos2d::CCTextureCache::sharedTextureCache();
v5 = cocos2d::CCTextureCache::addImage(v4, "PixelSheet_01.png", 0);
cocos2d::CCTexture2D::setAliasTexParameters(v5);
v6 = cocos2d::CCSpriteBatchNode::createWithTexture(v5, (unsigned int)&off_18 + 5);
a1->addChild(a1, v6);
v6->setTag(v6, 50);
v7 = cocos2d::CCSprite::createWithSpriteFrameName("pixelart_base_001.png");
v6->addChild_0(v6, v7, -1);
v7->setColor(v7, (const cocos2d::ccColor3B *)&unk_EEDED0);
width = v7->m_obRect.size.width;
setScaleX = v7->setScaleX;
a1->m_width = width;
setScaleX(v7, 10.0 / width);
v7->setScaleY(v7, 100.0 / a1->m_width);
cocos2d::CCPoint::CCPoint(&v24, -3.0, -48.0);
v10 = 6.0 / a1->m_width;
do
{
cocos2d::CCPoint::CCPoint(&v25, &v24);
if ( v3 == 1 )
{
v22 = -1;
v21 = 200;
v23 = 255;
v11 = 57.6;
v13 = 0.85;
v12 = 0.6;
}
else if ( v3 == 2 )
{
v11 = 81.6;
v12 = 0.85;
v22 = -1;
v23 = 0;
v21 = 300;
v13 = 1.0;
}
else
{
v11 = 0.0;
v22 = 0;
v21 = 100;
v23 = 255;
v13 = 0.6;
v12 = 0.0;
}
v14 = 0;
v15 = v13 - v12;
v25.y = v25.y + v11;
while ( 1 )
{
v17 = cocos2d::CCSprite::createWithSpriteFrameName("pixelart_base_001.png");
v6->addChild_0(v6, v17, v14);
v17->setColor(v17, (const cocos2d::ccColor3B *)&v22);
if ( !v14 )
v17->setOpacity(v17, 100);
v17->setPosition(v17, &v25);
setAnchorPoint = v17->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v26, 0.0, 0.0);
setAnchorPoint(v17, &v26);
v17->setScaleX(v17, v10);
v17->setScaleY(v17, (float)(v15 * 96.0) / a1->m_width);
if ( v14 )
break;
v14 = 1;
}
++v3;
v17->setTag(v17, v21);
}
while ( v3 != 3 );
v18 = cocos2d::CCSprite::createWithSpriteFrameName("pixelart_base_001.png");
v6->addChild_0(v6, v18, 2);
v18->setColor(v18, (const cocos2d::ccColor3B *)&unk_EEDED0);
v18->setPosition(v18, &v24);
v19 = v18->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v26, 0.0, 0.0);
v19(v18, &v26);
v18->setScaleX(v18, v10);
v18->setScaleY(v18, 1.0 / a1->m_width);
v18->setTag(v18, 400);
FMODLevelVisualizer::updateVisualizer(a1, 0.0, 0.0, 0.0);
}
return v20;
}