mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
Fix archive
Incorrect cmake directory was messing up reading from zips STB was failing to read from zips, it was failing to get the file info, something we were using as an early out, now if that files on the filepath, we use the memory read instead since stream needs to be a success to get to that point.
This commit is contained in:
parent
5d1f306668
commit
cd6656be35
3 changed files with 16 additions and 5 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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue