mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 19:49:19 +02: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 ) {
|
if( m_lastbrakepressure != -1.f ) {
|
||||||
// calculate rate of pressure drop in brake cylinder, once it's been initialized
|
// calculate rate of pressure drop in brake cylinder, once it's been initialized
|
||||||
auto const brakepressuredifference{ m_lastbrakepressure - MoverParameters->BrakePress };
|
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;
|
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
|
// 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 );
|
volume = 20 * m_brakepressurechange * ( 0.25 + 0.75 * brakepressureratio );
|
||||||
if( volume > 0.075f ) {
|
if( ( m_brakepressurechange > 0.05 ) && ( brakepressureratio > 0.05 ) ) {
|
||||||
rsUnbrake
|
rsUnbrake
|
||||||
.gain( volume )
|
.gain( volume )
|
||||||
.play( sound_flags::exclusive | sound_flags::looping );
|
.play( sound_flags::exclusive | sound_flags::looping );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// don't stop the sound too abruptly
|
// 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 );
|
rsUnbrake.gain( volume );
|
||||||
if( volume < 0.05 ) {
|
if( volume < 0.05 ) {
|
||||||
rsUnbrake.stop();
|
rsUnbrake.stop();
|
||||||
@@ -5011,6 +5011,9 @@ void TDynamicObject::LoadMMediaFile( std::string const &TypeName, std::string co
|
|||||||
if( pants[ i ].smElement[ 2 ] ) {
|
if( pants[ i ].smElement[ 2 ] ) {
|
||||||
pants[ i ].smElement[ 2 ]->WillBeAnimated();
|
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 ] ) {
|
if( pants[ i ].smElement[ 3 ] ) {
|
||||||
pants[ i ].smElement[ 3 ]->WillBeAnimated();
|
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 ].fMaxDist = 300 * 300; // nie podnosić w większej odległości
|
||||||
pants[ i ].iNumber = i;
|
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;
|
opengl_texture *tex = nullptr;
|
||||||
TSubModel *submodel = nullptr;
|
TSubModel *submodel = nullptr;
|
||||||
if (submodelname != "none") {
|
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 ) {
|
if( submodel == nullptr ) {
|
||||||
WriteLog( "Python Screen: submodel " + submodelname + " not found - Ignoring screen" );
|
WriteLog( "Python Screen: submodel " + submodelname + " not found - Ignoring screen" );
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user