mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-19 02:09:17 +02:00
engine revolutions change rate tweak for diesel-electric vehicles, support for combined engine revving sound, alerter ui indicator
This commit is contained in:
18
DynObj.cpp
18
DynObj.cpp
@@ -4596,6 +4596,12 @@ void TDynamicObject::LoadMMediaFile( std::string BaseDir, std::string TypeName,
|
||||
m_powertrainsounds.engine.m_amplitudefactor /= amplitudedivisor;
|
||||
}
|
||||
|
||||
else if( token == "dieselinc:" ) {
|
||||
// dzwiek przy wlazeniu na obroty woodwarda
|
||||
m_powertrainsounds.engine_revving.deserialize( parser, sound_type::single, sound_parameters::range );
|
||||
m_powertrainsounds.engine_revving.owner( this );
|
||||
}
|
||||
|
||||
else if( ( token == "tractionmotor:" )
|
||||
&& ( MoverParameters->Power > 0 ) ) {
|
||||
// plik z dzwiekiem silnika, mnozniki i ofsety amp. i czest.
|
||||
@@ -4659,12 +4665,6 @@ void TDynamicObject::LoadMMediaFile( std::string BaseDir, std::string TypeName,
|
||||
rsDerailment.owner( this );
|
||||
}
|
||||
|
||||
else if( token == "dieselinc:" ) {
|
||||
// dzwiek przy wlazeniu na obroty woodwarda
|
||||
m_powertrainsounds.engine_revving.deserialize( parser, sound_type::single, sound_parameters::range );
|
||||
m_powertrainsounds.engine_revving.owner( this );
|
||||
}
|
||||
|
||||
else if( token == "curve:" ) {
|
||||
rscurve.deserialize( parser, sound_type::single, sound_parameters::range );
|
||||
rscurve.owner( this );
|
||||
@@ -5595,8 +5595,14 @@ TDynamicObject::powertrain_sounds::render( TMoverParameters const &Vehicle, doub
|
||||
}
|
||||
engine_revs_last = Vehicle.enrot * 60;
|
||||
|
||||
if( false == engine_revving.is_combined() ) {
|
||||
// if the sound comes with multiple samples we reuse rpm-based calculation from the engine
|
||||
frequency = engine_revving.m_frequencyoffset + engine_revving.m_frequencyfactor * 1.0;
|
||||
}
|
||||
|
||||
if( enginerevvolume > 0.02 ) {
|
||||
engine_revving
|
||||
.pitch( frequency )
|
||||
.gain( enginerevvolume )
|
||||
.play( sound_flags::exclusive | sound_flags::looping );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user