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

Method LoadBotDecoration

src/game/client/components/skins7.cpp:434–455  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

432}
433
434void CSkins7::LoadBotDecoration()
435{
436 Graphics()->UnloadTexture(&m_BotTexture);
437
438 const char *pFilename = SKINS_DIR "/bot.png";
439 CImageInfo Info;
440 if(!Graphics()->LoadPng(Info, pFilename, IStorage::TYPE_ALL) ||
441 !Graphics()->IsImageFormatRgba(pFilename, Info) ||
442 !Graphics()->CheckImageDivisibility(pFilename, Info, 12, 5, false))
443 {
444 log_error("skins7", "Failed to load bot decoration '%s'", pFilename);
445 Info.Free();
446 }
447 else
448 {
449 if(Config()->m_Debug)
450 {
451 log_trace("skins7", "Loaded bot decoration '%s'", pFilename);
452 }
453 m_BotTexture = Graphics()->LoadTextureRawMove(Info, 0, pFilename);
454 }
455}
456
457void CSkins7::AddSkinFromConfigVariables(const char *pName, int Dummy)
458{

Callers

nothing calls this directly

Calls 8

GraphicsFunction · 0.85
UnloadTextureMethod · 0.80
IsImageFormatRgbaMethod · 0.80
LoadTextureRawMoveMethod · 0.80
ConfigFunction · 0.50
LoadPngMethod · 0.45
FreeMethod · 0.45

Tested by

no test coverage detected