mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
Soft fail on image loading failure
This commit is contained in:
parent
fa256701c7
commit
90ba850618
2 changed files with 4 additions and 5 deletions
|
@ -129,14 +129,12 @@ BF_EXPORT uint32* BF_CALLTYPE Res_LoadImage(char* inFileName, int& width, int& h
|
||||||
imageData = new PVRData();
|
imageData = new PVRData();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BF_FATAL("Unknown texture format");
|
|
||||||
return NULL; // Unknown format
|
return NULL; // Unknown format
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!imageData->LoadFromFile(fileName))
|
if (!imageData->LoadFromFile(fileName))
|
||||||
{
|
{
|
||||||
imageData->Deref();
|
imageData->Deref();
|
||||||
BF_FATAL("Failed to load image");
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -144,7 +144,6 @@ Texture* RenderDevice::LoadTexture(const StringImpl& fileName, int flags)
|
||||||
imageData = new PVRData();
|
imageData = new PVRData();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BF_FATAL("Unknown texture format");
|
|
||||||
return NULL; // Unknown format
|
return NULL; // Unknown format
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -161,7 +160,8 @@ Texture* RenderDevice::LoadTexture(const StringImpl& fileName, int flags)
|
||||||
if (!imageData->LoadFromMemory(addr, len))
|
if (!imageData->LoadFromMemory(addr, len))
|
||||||
{
|
{
|
||||||
failed = true;
|
failed = true;
|
||||||
BF_FATAL("Failed to load image");
|
delete imageData;
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -169,7 +169,8 @@ Texture* RenderDevice::LoadTexture(const StringImpl& fileName, int flags)
|
||||||
if (!imageData->LoadFromFile(fileName))
|
if (!imageData->LoadFromFile(fileName))
|
||||||
{
|
{
|
||||||
failed = true;
|
failed = true;
|
||||||
BF_FATAL("Failed to load image");
|
delete imageData;
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue