Skip to content

Commit

Permalink
Remove unnecessary filename length check for images
Browse files Browse the repository at this point in the history
  • Loading branch information
Robyt3 committed Jul 20, 2023
1 parent 2e39c23 commit a6cc3a5
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/engine/client/graphics_threaded.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -505,18 +505,13 @@ IGraphics::CTextureHandle CGraphics_Threaded::LoadTextureRaw(int Width, int Heig
// simple uncompressed RGBA loaders
IGraphics::CTextureHandle CGraphics_Threaded::LoadTexture(const char *pFilename, int StorageType, int StoreFormat, int Flags)
{
int l = str_length(pFilename);
IGraphics::CTextureHandle ID;
CImageInfo Img;

if(l < 3)
return CTextureHandle();
if(LoadPNG(&Img, pFilename, StorageType))
{
if(StoreFormat == CImageInfo::FORMAT_AUTO)
StoreFormat = Img.m_Format;

ID = LoadTextureRaw(Img.m_Width, Img.m_Height, Img.m_Format, Img.m_pData, StoreFormat, Flags, pFilename);
IGraphics::CTextureHandle ID = LoadTextureRaw(Img.m_Width, Img.m_Height, Img.m_Format, Img.m_pData, StoreFormat, Flags, pFilename);
free(Img.m_pData);
if(ID.Id() != m_InvalidTexture.Id() && g_Config.m_Debug)
dbg_msg("graphics/texture", "loaded %s", pFilename);
Expand Down

0 comments on commit a6cc3a5

Please sign in to comment.