build 210905. vehicle startup logic enhancements, whois event enhancement, line breaker activation type, material shadow rank, shadow rank cutoff value, shadow angle cutoff value, minor bug fixes

This commit is contained in:
tmj-fstate
2021-09-05 21:09:46 +02:00
parent 2e86b3a5e9
commit 26d09440b0
28 changed files with 360 additions and 112 deletions

View File

@@ -95,15 +95,29 @@ openal_source::update( double const Deltatime, glm::vec3 const &Listenervelocity
sound_change = false;
::alGetSourcei( id, AL_BUFFERS_PROCESSED, &sound_index );
// for multipart sounds trim away processed sources until only one remains, the last one may be set to looping by the controller
// for multipart sounds trim away processed buffers until only one remains, the last one may be set to looping by the controller
// TBD, TODO: instead of change flag move processed buffer ids to separate queue, for accurate tracking of longer buffer sequences
ALuint bufferid;
ALuint discard;
while( ( sound_index > 0 )
&& ( sounds.size() > 1 ) ) {
::alSourceUnqueueBuffers( id, 1, &bufferid );
::alSourceUnqueueBuffers( id, 1, &discard );
sounds.erase( std::begin( sounds ) );
--sound_index;
sound_change = true;
// potentially adjust starting point of the last buffer (to reduce chance of reverb effect with multiple, looping copies playing)
if( ( controller->start() > 0.f ) && ( sounds.size() == 1 ) ) {
ALint bufferid;
::alGetSourcei(
id,
AL_BUFFER,
&bufferid );
ALint buffersize;
::alGetBufferi( bufferid, AL_SIZE, &buffersize );
::alSourcei(
id,
AL_SAMPLE_OFFSET,
static_cast<ALint>( controller->start() * ( buffersize / sizeof( std::int16_t ) ) ) );
}
}
int state;