mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
build 200615. brake release sound tweak, low detail interior vehicle screens support
This commit is contained in:
15
DynObj.cpp
15
DynObj.cpp
@@ -4122,19 +4122,19 @@ void TDynamicObject::RenderSounds() {
|
||||
if( m_lastbrakepressure != -1.f ) {
|
||||
// calculate rate of pressure drop in brake cylinder, once it's been initialized
|
||||
auto const brakepressuredifference{ m_lastbrakepressure - MoverParameters->BrakePress };
|
||||
m_brakepressurechange = interpolate<float>( m_brakepressurechange, brakepressuredifference / dt, 0.005f );
|
||||
m_brakepressurechange = interpolate<float>( m_brakepressurechange, brakepressuredifference / dt, 0.05f );
|
||||
}
|
||||
m_lastbrakepressure = MoverParameters->BrakePress;
|
||||
// ensure some basic level of volume and scale it up depending on pressure in the cylinder; scale this by the air release rate
|
||||
volume = 20 * m_brakepressurechange * ( 0.25 + 0.75 * brakepressureratio );
|
||||
if( volume > 0.075f ) {
|
||||
if( ( m_brakepressurechange > 0.05 ) && ( brakepressureratio > 0.05 ) ) {
|
||||
rsUnbrake
|
||||
.gain( volume )
|
||||
.play( sound_flags::exclusive | sound_flags::looping );
|
||||
}
|
||||
else {
|
||||
// don't stop the sound too abruptly
|
||||
volume = std::max( 0.0, rsUnbrake.gain() - 0.2 * dt );
|
||||
volume = std::max( 0.0, rsUnbrake.gain() - 0.5 * dt );
|
||||
rsUnbrake.gain( volume );
|
||||
if( volume < 0.05 ) {
|
||||
rsUnbrake.stop();
|
||||
@@ -5011,6 +5011,9 @@ void TDynamicObject::LoadMMediaFile( std::string const &TypeName, std::string co
|
||||
if( pants[ i ].smElement[ 2 ] ) {
|
||||
pants[ i ].smElement[ 2 ]->WillBeAnimated();
|
||||
}
|
||||
else {
|
||||
ErrorLog( "Bad model: " + asFileName + " - missed submodel " + asAnimName, logtype::model ); // brak ramienia
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5026,6 +5029,9 @@ void TDynamicObject::LoadMMediaFile( std::string const &TypeName, std::string co
|
||||
if( pants[ i ].smElement[ 3 ] ) {
|
||||
pants[ i ].smElement[ 3 ]->WillBeAnimated();
|
||||
}
|
||||
else {
|
||||
ErrorLog( "Bad model: " + asFileName + " - missed submodel " + asAnimName, logtype::model ); // brak ramienia
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5044,6 +5050,9 @@ void TDynamicObject::LoadMMediaFile( std::string const &TypeName, std::string co
|
||||
pants[ i ].fMaxDist = 300 * 300; // nie podnosić w większej odległości
|
||||
pants[ i ].iNumber = i;
|
||||
}
|
||||
else {
|
||||
ErrorLog( "Bad model: " + asFileName + " - missed submodel " + asAnimName, logtype::model ); // brak ramienia
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7881,7 +7881,10 @@ bool TTrain::InitializeCab(int NewCabNo, std::string const &asFileName)
|
||||
opengl_texture *tex = nullptr;
|
||||
TSubModel *submodel = nullptr;
|
||||
if (submodelname != "none") {
|
||||
submodel = ( DynamicObject->mdKabina ? DynamicObject->mdKabina->GetFromName( submodelname ) : nullptr );
|
||||
submodel = (
|
||||
DynamicObject->mdKabina ? DynamicObject->mdKabina->GetFromName( submodelname ) :
|
||||
DynamicObject->mdLowPolyInt ? DynamicObject->mdLowPolyInt->GetFromName( submodelname ) :
|
||||
nullptr );
|
||||
if( submodel == nullptr ) {
|
||||
WriteLog( "Python Screen: submodel " + submodelname + " not found - Ignoring screen" );
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user