diff --git a/BeefySysLib/ResLib.cpp b/BeefySysLib/ResLib.cpp index a16eb508..8a9898c6 100644 --- a/BeefySysLib/ResLib.cpp +++ b/BeefySysLib/ResLib.cpp @@ -129,14 +129,12 @@ BF_EXPORT uint32* BF_CALLTYPE Res_LoadImage(char* inFileName, int& width, int& h imageData = new PVRData(); else { - BF_FATAL("Unknown texture format"); return NULL; // Unknown format } if (!imageData->LoadFromFile(fileName)) { imageData->Deref(); - BF_FATAL("Failed to load image"); return NULL; } diff --git a/BeefySysLib/gfx/RenderDevice.cpp b/BeefySysLib/gfx/RenderDevice.cpp index 346177fb..046a53ca 100644 --- a/BeefySysLib/gfx/RenderDevice.cpp +++ b/BeefySysLib/gfx/RenderDevice.cpp @@ -144,7 +144,6 @@ Texture* RenderDevice::LoadTexture(const StringImpl& fileName, int flags) imageData = new PVRData(); else { - BF_FATAL("Unknown texture format"); return NULL; // Unknown format } @@ -161,7 +160,8 @@ Texture* RenderDevice::LoadTexture(const StringImpl& fileName, int flags) if (!imageData->LoadFromMemory(addr, len)) { failed = true; - BF_FATAL("Failed to load image"); + delete imageData; + return NULL; } } else @@ -169,7 +169,8 @@ Texture* RenderDevice::LoadTexture(const StringImpl& fileName, int flags) if (!imageData->LoadFromFile(fileName)) { failed = true; - BF_FATAL("Failed to load image"); + delete imageData; + return NULL; } } }