MCPcopy Create free account
hub / github.com/ddnet/ddnet / LoadThemeIcon

Method LoadThemeIcon

src/game/client/components/menu_background.cpp:96–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94}
95
96void CMenuBackground::LoadThemeIcon(CTheme &Theme)
97{
98 char aIconPath[IO_MAX_PATH_LENGTH];
99 str_format(aIconPath, sizeof(aIconPath), "themes/%s.png", Theme.m_Name.empty() ? "none" : Theme.m_Name.c_str());
100 Theme.m_IconTexture = Graphics()->LoadTexture(aIconPath, IStorage::TYPE_ALL);
101
102 char aBuf[32 + IO_MAX_PATH_LENGTH];
103 if(Theme.m_IconTexture.IsNullTexture())
104 str_format(aBuf, sizeof(aBuf), "failed to load theme icon '%s'", aIconPath);
105 else
106 str_format(aBuf, sizeof(aBuf), "loaded theme icon '%s'", aIconPath);
107 Console()->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "menuthemes", aBuf);
108}
109
110int CMenuBackground::ThemeScan(const char *pName, int IsDir, int DirType, void *pUser)
111{

Callers 1

ThemeScanMethod · 0.80

Calls 5

str_formatFunction · 0.85
GraphicsFunction · 0.85
LoadTextureMethod · 0.80
IsNullTextureMethod · 0.80
PrintMethod · 0.45

Tested by

no test coverage detected