mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-08 21:24:34 +00:00
Few changes to fix the preload failures
Adds extra error output for erroneous buffer preload SndStream now correctly sets sndfile to null when it closes, Also extra error reporting around the read function SFXResource now returns a new threadsaferef each time we openstream. This should only be called on a fresh instance.
This commit is contained in:
parent
d4c0c6fd3d
commit
b625250af0
3 changed files with 100 additions and 53 deletions
|
|
@ -79,5 +79,9 @@ bool SFXResource::exists( String filename )
|
|||
|
||||
ThreadSafeRef<SFXStream> SFXResource::openStream()
|
||||
{
|
||||
return mStream;
|
||||
// Open a fresh independent stream from the file each time
|
||||
ThreadSafeRef<SFXStream> freshStream = SFXFileStream::create(mFileName);
|
||||
if (!freshStream)
|
||||
Con::errorf("SFXResource::openStream() - failed to reopen '%s'", mFileName.c_str());
|
||||
return freshStream;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue