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

Method LoadTextureRawMove

src/engine/client/graphics_threaded.cpp:438–461  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

436}
437
438IGraphics::CTextureHandle CGraphics_Threaded::LoadTextureRawMove(CImageInfo &Image, int Flags, const char *pTexName)
439{
440 if(Image.m_Format != CImageInfo::FORMAT_RGBA)
441 {
442 // Moving not possible, texture needs to be converted
443 IGraphics::CTextureHandle TextureHandle = LoadTextureRaw(Image, Flags, pTexName);
444 Image.Free();
445 return TextureHandle;
446 }
447
448 LoadTextureAddWarning(Image.m_Width, Image.m_Height, Flags, pTexName);
449
450 if(Image.m_Width == 0 || Image.m_Height == 0)
451 return IGraphics::CTextureHandle();
452
453 IGraphics::CTextureHandle TextureHandle = FindFreeTextureIndex();
454 CCommandBuffer::SCommand_Texture_Create Cmd = LoadTextureCreateCommand(TextureHandle.Id(), Image.m_Width, Image.m_Height, Flags);
455 Cmd.m_pData = Image.m_pData;
456 Image.m_pData = nullptr;
457 Image.Free();
458 AddCmd(Cmd);
459
460 return TextureHandle;
461}
462
463IGraphics::CTextureHandle CGraphics_Threaded::LoadTexture(const char *pFilename, int StorageType, int Flags)
464{

Callers 9

UploadEntityLayerTextMethod · 0.80
MenuImageScanMethod · 0.80
LoadSkinPartMethod · 0.80
LoadXmasHatMethod · 0.80
LoadBotDecorationMethod · 0.80
LoadFinishMethod · 0.80
UpdateFilePreviewMethod · 0.80

Calls 4

CTextureHandleClass · 0.85
LoadTextureCreateCommandFunction · 0.85
FreeMethod · 0.45
IdMethod · 0.45

Tested by

no test coverage detected