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

Method LoadTextureRaw

src/engine/client/graphics_threaded.cpp:415–436  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

413}
414
415IGraphics::CTextureHandle CGraphics_Threaded::LoadTextureRaw(const CImageInfo &Image, int Flags, const char *pTexName)
416{
417 LoadTextureAddWarning(Image.m_Width, Image.m_Height, Flags, pTexName);
418
419 if(Image.m_Width == 0 || Image.m_Height == 0)
420 return IGraphics::CTextureHandle();
421
422 IGraphics::CTextureHandle TextureHandle = FindFreeTextureIndex();
423 CCommandBuffer::SCommand_Texture_Create Cmd = LoadTextureCreateCommand(TextureHandle.Id(), Image.m_Width, Image.m_Height, Flags);
424
425 // Copy texture data and convert if necessary
426 uint8_t *pTmpData;
427 if(!ConvertToRgbaAlloc(pTmpData, Image))
428 {
429 log_warn("graphics", "Converted image '%s' to RGBA, consider making its file format RGBA.", pTexName ? pTexName : "(no name)");
430 }
431 Cmd.m_pData = pTmpData;
432
433 AddCmd(Cmd);
434
435 return TextureHandle;
436}
437
438IGraphics::CTextureHandle CGraphics_Threaded::LoadTextureRawMove(CImageInfo &Image, int Flags, const char *pTexName)
439{

Callers 8

OnMapLoadImplMethod · 0.80
GetEntitiesMethod · 0.80
MenuImageScanMethod · 0.80
LoadSkinPartMethod · 0.80
ReplaceImageMethod · 0.80
AddImageMethod · 0.80
ImageInfoToEditorImageFunction · 0.80
LoadMethod · 0.80

Calls 4

CTextureHandleClass · 0.85
LoadTextureCreateCommandFunction · 0.85
ConvertToRgbaAllocFunction · 0.85
IdMethod · 0.45

Tested by

no test coverage detected