mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
Bug fixes:
Generating image previews of image assets was failing DDS remove redundant check for stream status. STB requires the file to be free before being written to, move check to make sure we can open the path into gBitmap and remove FileStream checks from everywhere else.
This commit is contained in:
parent
0b451aa7b5
commit
63682c43ec
11 changed files with 39 additions and 111 deletions
|
|
@ -568,12 +568,14 @@ void DDSFile::SurfaceData::dumpImage(DDSFile *dds, U32 mip, const char *file)
|
|||
|
||||
FileStream stream;
|
||||
|
||||
stream.open( file, Torque::FS::File::Write );
|
||||
|
||||
if ( stream.getStatus() == Stream::Ok )
|
||||
if (!stream.open(file, Torque::FS::File::Write))
|
||||
{
|
||||
// Write it out.
|
||||
foo->writeBitmap("png", file);
|
||||
Con::errorf("DDSFile::SurfaceData::dumpImage() - Error opening file for writing: %s !", file);
|
||||
}
|
||||
|
||||
if(!foo->writeBitmap("png", file))
|
||||
{
|
||||
Con::errorf("DDSFile::SurfaceData::dumpImage() - Error writing %s !", file);
|
||||
}
|
||||
|
||||
// Clean up.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue