| 413 | } |
| 414 | |
| 415 | IGraphics::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 | |
| 438 | IGraphics::CTextureHandle CGraphics_Threaded::LoadTextureRawMove(CImageInfo &Image, int Flags, const char *pTexName) |
| 439 | { |
no test coverage detected