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

Method LoadTexture

src/engine/client/graphics_threaded.cpp:463–480  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

461}
462
463IGraphics::CTextureHandle CGraphics_Threaded::LoadTexture(const char *pFilename, int StorageType, int Flags)
464{
465 dbg_assert(pFilename[0] != '\0', "Cannot load texture from file with empty filename"); // would cause Valgrind to crash otherwise
466
467 CImageInfo Image;
468 if(LoadPng(Image, pFilename, StorageType))
469 {
470 CTextureHandle Id = LoadTextureRawMove(Image, Flags, pFilename);
471 if(Id.IsValid())
472 {
473 if(g_Config.m_Debug)
474 log_trace("graphics/texture", "Loaded texture '%s'", pFilename);
475 return Id;
476 }
477 }
478
479 return m_NullTexture;
480}
481
482bool CGraphics_Threaded::LoadTextTextures(size_t Width, size_t Height, CTextureHandle &TextTexture, CTextureHandle &TextOutlineTexture, uint8_t *pTextData, uint8_t *pTextOutlineData)
483{

Callers 15

OnInitMethod · 0.80
OnMapLoadImplMethod · 0.80
GetSpeedupArrowMethod · 0.80
LoadEntitiesMethod · 0.80
LoadAssetFunction · 0.80
OnInitMethod · 0.80
OnInitMethod · 0.80
LoadThemeIconMethod · 0.80
GetFrontTextureMethod · 0.80
GetTeleTextureMethod · 0.80
GetSpeedupTextureMethod · 0.80
GetSwitchTextureMethod · 0.80

Calls 1

IsValidMethod · 0.45

Tested by

no test coverage detected