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

build 181016. freespot color override, vehicle start jolt sound, switch trackbed generation fixes

This commit is contained in:
tmj-fstate
2018-10-16 20:11:23 +02:00
parent 4474117878
commit 841e18f170
11 changed files with 155 additions and 57 deletions

View File

@@ -3932,6 +3932,13 @@ void TDynamicObject::RenderSounds() {
if( Global.iPause != 0 ) { return; }
if( ( m_startjoltplayed )
&& ( ( MoverParameters->AccSVBased < 0.01 )
|| ( GetVelocity() < 0.01 ) ) ) {
// if the vehicle comes to a stop set the movement jolt to play when it starts moving again
m_startjoltplayed = false;
}
double const dt{ Timer::GetDeltaRenderTime() };
double volume{ 0.0 };
double frequency{ 1.0 };
@@ -4387,6 +4394,17 @@ void TDynamicObject::RenderSounds() {
rscurve.stop();
}
// movement start jolt
if( false == m_startjoltplayed ) {
auto const velocity { GetVelocity() };
if( ( MoverParameters->AccSVBased > 0.2 )
&& ( velocity > 2.5 )
&& ( velocity < 15.0 ) ) {
m_startjolt.play( sound_flags::exclusive );
m_startjoltplayed = true;
}
}
// McZapkie! - to wazne - SoundFlag wystawiane jest przez moje moduly
// gdy zachodza pewne wydarzenia komentowane dzwiekiem.
if( TestFlag( MoverParameters->SoundFlag, sound::pneumatic ) ) {
@@ -5799,6 +5817,11 @@ void TDynamicObject::LoadMMediaFile( std::string const &TypeName, std::string co
couplersounds.dsbBufferClamp_loud = bufferclash;
}
}
else if( token == "startjolt:" ) {
// movement start jolt
m_startjolt.deserialize( parser, sound_type::single );
m_startjolt.owner( this );
}
} while( token != "" );