16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-18 03:09:18 +02:00

Merge commit 'd8170c932b448ba6888e702746b5ae22632062d8' into sim

This commit is contained in:
milek7
2022-01-05 01:02:56 +01:00
76 changed files with 9277 additions and 5749 deletions

View File

@@ -21,7 +21,9 @@ openal_source::bind( sound_source *Controller, uint32_sequence Sounds, Iterator_
::alSourceQueueBuffers( id, static_cast<ALsizei>( buffers.size() ), buffers.data() );
::alSourceRewind( id );
// sound controller can potentially request playback to start from certain buffer point
if( controller->start() == 0.f ) {
// for multipart sounds the offset is applied only to last piece during playback
// for single sound we also make sure not to apply the offset to optional bookends
if( controller->start() == 0.f || is_multipart || controller->is_bookend( buffers.front() ) ) {
// regular case with no offset, reset bound source just in case
::alSourcei( id, AL_SAMPLE_OFFSET, 0 );
}