//
// GameManager::loadFont from 0x10036c400 to 0x10036c4a4 (164 bytes)
//
// 6 xrefs:
// > PlayLayer::prepareCreateObjectsFromSetup @ 0x10007a725
// > LevelEditorLayer::createObjectsFromSetup @ 0x1000abd36
// > SelectFontLayer::updateFontLabel @ 0x100285766
// > GameManager::getFontFile @ 0x10036c4ce
// > GameManager::getFontTexture @ 0x10036c51e
// > SecretLayer5::init @ 0x10046f50f
//
// 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 12:29:00 +0000
//
__int64 __fastcall GameManager::loadFont(__int64 a1, int a2)
{
int v2; // eax
int v3; // r14d
__int64 result; // rax
__int64 v6; // rdi
__int64 CString; // r15
__int64 v8; // rax
__int64 v9; // rdi
__int64 v10; // r15
__int64 v11; // rax
char v12; // [rsp+0h] [rbp-20h]
v2 = 59;
if ( a2 < 59 )
v2 = a2;
v3 = 0;
if ( v2 > 0 )
v3 = v2;
result = *(unsigned int *)(a1 + 992);
if ( v3 != (_DWORD)result )
{
if ( (_DWORD)result )
{
v6 = sub_10088E820("gjFont%02d.png", v12);
CString = cocos2d::CCString::getCString(v6);
v8 = cocos2d::CCTextureCache::sharedTextureCache(v6);
result = cocos2d::CCTextureCache::removeTextureForKey(v8, CString);
}
if ( a2 > 0 )
{
v9 = sub_10088E820("gjFont%02d.png", v12);
v10 = cocos2d::CCString::getCString(v9);
v11 = cocos2d::CCTextureCache::sharedTextureCache(v9);
result = cocos2d::CCTextureCache::addImage(v11, v10, 0);
}
*(_DWORD *)(a1 + 992) = v3;
}
return result;
}