mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-19 06:33:49 +00:00
Merge pull request #2220 from irei1as/development
Changes for SFXSound::setPosition(time)
This commit is contained in:
commit
b6185370be
3 changed files with 29 additions and 2 deletions
|
|
@ -281,9 +281,22 @@ void AsyncPacketBufferedInputStream< Stream, Packet >::_requestNext()
|
|||
IResettable* resettable = dynamic_cast< IResettable* >( s );
|
||||
if( resettable )
|
||||
{
|
||||
IPositionable< U32 >* positionable = dynamic_cast< IPositionable< U32 >* >( &Deref( stream ) );
|
||||
U32 pos;
|
||||
if(positionable)
|
||||
pos = positionable->getPosition();
|
||||
|
||||
resettable->reset();
|
||||
isEOS = false;
|
||||
this->mNumRemainingSourceElements = mNumTotalSourceElements;
|
||||
|
||||
if( positionable )
|
||||
{
|
||||
positionable->setPosition(pos);
|
||||
U32 dur = stream->getDuration();
|
||||
if(dur != 0) //avoiding division by zero? not needed, probably
|
||||
this->mNumRemainingSourceElements -= (U32)(mNumTotalSourceElements*(F32)pos/dur);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if( isEOS )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue