mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-04 21:10:32 +00:00
Merge branch 'development' into EngineAPI-Refactor
This commit is contained in:
commit
3a71c75596
1937 changed files with 102332 additions and 70549 deletions
|
|
@ -168,9 +168,9 @@ void SFXDevice::_removeBuffer( SFXBuffer* buffer )
|
|||
BufferIterator iter = T3D::find( mBuffers.begin(), mBuffers.end(), buffer );
|
||||
if( iter != mBuffers.end() )
|
||||
{
|
||||
SFXBuffer* buffer = *iter;
|
||||
SFXBuffer* curBuf = *iter;
|
||||
|
||||
mStatNumBufferBytes -= buffer->getMemoryUsed();
|
||||
mStatNumBufferBytes -= curBuf->getMemoryUsed();
|
||||
mStatNumBuffers --;
|
||||
|
||||
mBuffers.erase( iter );
|
||||
|
|
|
|||
|
|
@ -80,13 +80,13 @@ U32 SFXMemoryStream::read( U8* buffer, U32 length )
|
|||
|
||||
if( numBytesLeftInCurrentPacket )
|
||||
{
|
||||
const U32 numBytesToCopy = getMin( numBytesLeftInCurrentPacket, numBytesLeftToCopy );
|
||||
dMemcpy( &buffer[ bufferOffset ], &mCurrentPacket->data[ mCurrentPacketOffset ], numBytesToCopy );
|
||||
const U32 remainingNumBytesToCopy = getMin( numBytesLeftInCurrentPacket, numBytesLeftToCopy );
|
||||
dMemcpy( &buffer[ bufferOffset ], &mCurrentPacket->data[ mCurrentPacketOffset ], remainingNumBytesToCopy);
|
||||
|
||||
bufferOffset += numBytesToCopy;
|
||||
mCurrentPacketOffset += numBytesToCopy;
|
||||
numBytesLeftInCurrentPacket -= numBytesToCopy;
|
||||
numBytesLeftToCopy -= numBytesToCopy;
|
||||
bufferOffset += remainingNumBytesToCopy;
|
||||
mCurrentPacketOffset += remainingNumBytesToCopy;
|
||||
numBytesLeftInCurrentPacket -= remainingNumBytesToCopy;
|
||||
numBytesLeftToCopy -= remainingNumBytesToCopy;
|
||||
}
|
||||
|
||||
// Discard the packet if there's no data left.
|
||||
|
|
|
|||
|
|
@ -174,18 +174,18 @@ void SFXSoundscapeManager::update()
|
|||
// Activate SFXStates on the ambience. For state slots that
|
||||
// have changed, deactivate states that we have already activated.
|
||||
|
||||
for( U32 i = 0; i < SFXAmbience::MaxStates; ++ i )
|
||||
for( U32 ambState = 0; ambState < SFXAmbience::MaxStates; ++ambState)
|
||||
{
|
||||
SFXState* state = ambience->getState( i );
|
||||
if( soundscape->mStates[ i ] != state )
|
||||
SFXState* state = ambience->getState(ambState);
|
||||
if( soundscape->mStates[ambState] != state )
|
||||
{
|
||||
if( soundscape->mStates[ i ] )
|
||||
soundscape->mStates[ i ]->deactivate();
|
||||
if( soundscape->mStates[ambState] )
|
||||
soundscape->mStates[ambState]->deactivate();
|
||||
|
||||
if( state )
|
||||
state->activate();
|
||||
|
||||
soundscape->mStates[ i ] = state;
|
||||
soundscape->mStates[ambState] = state;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -674,9 +674,9 @@ void SFXSystem::_onRemoveSource( SFXSource* source )
|
|||
{
|
||||
// Check if it was a play once source.
|
||||
|
||||
Vector< SFXSource* >::iterator iter = T3D::find( mPlayOnceSources.begin(), mPlayOnceSources.end(), source );
|
||||
if ( iter != mPlayOnceSources.end() )
|
||||
mPlayOnceSources.erase_fast( iter );
|
||||
Vector< SFXSource* >::iterator sourceIter = T3D::find( mPlayOnceSources.begin(), mPlayOnceSources.end(), source );
|
||||
if (sourceIter != mPlayOnceSources.end() )
|
||||
mPlayOnceSources.erase_fast(sourceIter);
|
||||
|
||||
// Update the stats.
|
||||
|
||||
|
|
@ -684,9 +684,9 @@ void SFXSystem::_onRemoveSource( SFXSource* source )
|
|||
|
||||
if( dynamic_cast< SFXSound* >( source ) )
|
||||
{
|
||||
SFXSoundVector::iterator iter = T3D::find( mSounds.begin(), mSounds.end(), static_cast< SFXSound* >( source ) );
|
||||
if( iter != mSounds.end() )
|
||||
mSounds.erase_fast( iter );
|
||||
SFXSoundVector::iterator vectorIter = T3D::find( mSounds.begin(), mSounds.end(), static_cast< SFXSound* >( source ) );
|
||||
if(vectorIter != mSounds.end() )
|
||||
mSounds.erase_fast(vectorIter);
|
||||
|
||||
mStatNumSounds = mSounds.size();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue