mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-12 15:14:35 +00:00
Merge remote-tracking branch 'upstream/development' into ShaderConstBuffer-CleanupRefactor
This commit is contained in:
commit
d8636f754b
9 changed files with 58 additions and 70 deletions
|
|
@ -1279,9 +1279,14 @@ template<> void *Resource<GBitmap>::create(const Torque::Path &path)
|
|||
const String extension = path.getExtension();
|
||||
if( !bmp->readBitmap( extension, path ) )
|
||||
{
|
||||
Con::errorf( "Resource<GBitmap>::create - error reading '%s'", path.getFullPath().c_str() );
|
||||
delete bmp;
|
||||
bmp = NULL;
|
||||
// we can only get here if the stream was successful, so attempt to read the stream.
|
||||
Con::warnf("Was unable to load as file, going to try the stream instead.");
|
||||
if (!bmp->readBitmapStream(extension, stream, stream.getStreamSize()))
|
||||
{
|
||||
Con::errorf("Resource<GBitmap>::create - error reading '%s'", path.getFullPath().c_str());
|
||||
delete bmp;
|
||||
bmp = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return bmp;
|
||||
|
|
|
|||
|
|
@ -195,7 +195,12 @@ bool sReadSTB(const Torque::Path& path, GBitmap* bitmap)
|
|||
if (!stbi_info(path.getFullPath().c_str(), &x, &y, &channels))
|
||||
{
|
||||
FrameAllocator::setWaterMark(prevWaterMark);
|
||||
return false;
|
||||
const char* stbErr = stbi_failure_reason();
|
||||
|
||||
if (!stbErr)
|
||||
stbErr = "Unknown Error!";
|
||||
|
||||
Con::errorf("STB get file info: %s", stbErr);
|
||||
}
|
||||
|
||||
// do this to map 2 channels to 4, 2 channel not supported by gbitmap yet..
|
||||
|
|
@ -325,8 +330,7 @@ bool sReadStreamSTB(Stream& stream, GBitmap* bitmap, U32 len)
|
|||
if (!stbErr)
|
||||
stbErr = "Unknown Error!";
|
||||
|
||||
Con::errorf("STB failed to get image info: %s", stbErr);
|
||||
return false;
|
||||
Con::errorf("STB get memory info: %s", stbErr);
|
||||
}
|
||||
|
||||
S32 reqCom = comp;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue