mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 15:09:19 +02:00
minor refactoring and bug fixes
This commit is contained in:
@@ -5064,6 +5064,7 @@ void TDynamicObject::LoadMMediaFile( std::string BaseDir, std::string TypeName,
|
|||||||
// pliki z turbogeneratorem
|
// pliki z turbogeneratorem
|
||||||
m_powertrainsounds.engine_turbo.deserialize( parser, sound_type::multipart, sound_parameters::range );
|
m_powertrainsounds.engine_turbo.deserialize( parser, sound_type::multipart, sound_parameters::range );
|
||||||
m_powertrainsounds.engine_turbo.owner( this );
|
m_powertrainsounds.engine_turbo.owner( this );
|
||||||
|
m_powertrainsounds.engine_turbo.gain( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
else if( token == "small-compressor:" ) {
|
else if( token == "small-compressor:" ) {
|
||||||
|
|||||||
@@ -8115,9 +8115,9 @@ void TMoverParameters::LoadFIZ_Cntrl( std::string const &line ) {
|
|||||||
else if( autorelay == "Yes" ) { AutoRelayType = 1; }
|
else if( autorelay == "Yes" ) { AutoRelayType = 1; }
|
||||||
else { AutoRelayType = 0; }
|
else { AutoRelayType = 0; }
|
||||||
|
|
||||||
CoupledCtrl = ( extract_value( "CoupledCtrl", line ) == "Yes" );
|
extract_value( CoupledCtrl, "CoupledCtrl", line, "" );
|
||||||
|
|
||||||
ScndS = ( extract_value( "ScndS", line ) == "Yes" ); // brak pozycji rownoleglej przy niskiej nastawie PSR
|
extract_value( ScndS, "ScndS", line, "" ); // brak pozycji rownoleglej przy niskiej nastawie PSR
|
||||||
|
|
||||||
extract_value( InitialCtrlDelay, "IniCDelay", line, "" );
|
extract_value( InitialCtrlDelay, "IniCDelay", line, "" );
|
||||||
extract_value( CtrlDelay, "SCDelay", line, "" );
|
extract_value( CtrlDelay, "SCDelay", line, "" );
|
||||||
@@ -8209,8 +8209,8 @@ void TMoverParameters::LoadFIZ_Blending(std::string const &line) {
|
|||||||
extract_value(MED_Vmin, "MED_Vmin", line, "0");
|
extract_value(MED_Vmin, "MED_Vmin", line, "0");
|
||||||
extract_value(MED_Vref, "MED_Vref", line, to_string(Vmax));
|
extract_value(MED_Vref, "MED_Vref", line, to_string(Vmax));
|
||||||
extract_value(MED_amax, "MED_amax", line, "9.81");
|
extract_value(MED_amax, "MED_amax", line, "9.81");
|
||||||
MED_EPVC = (extract_value("MED_EPVC", line).find("Yes") != std::string::npos);
|
extract_value(MED_EPVC, "MED_EPVC", line, "");
|
||||||
MED_Ncor = (extract_value("MED_Ncor", line).find("Yes") != std::string::npos);
|
extract_value(MED_Ncor, "MED_Ncor", line, "");
|
||||||
|
|
||||||
}
|
}
|
||||||
void TMoverParameters::LoadFIZ_Light( std::string const &line ) {
|
void TMoverParameters::LoadFIZ_Light( std::string const &line ) {
|
||||||
@@ -8241,7 +8241,7 @@ void TMoverParameters::LoadFIZ_Security( std::string const &line ) {
|
|||||||
extract_value( SecuritySystem.AwareMinSpeed, "AwareMinSpeed", line, "" );
|
extract_value( SecuritySystem.AwareMinSpeed, "AwareMinSpeed", line, "" );
|
||||||
extract_value( SecuritySystem.SoundSignalDelay, "SoundSignalDelay", line, "" );
|
extract_value( SecuritySystem.SoundSignalDelay, "SoundSignalDelay", line, "" );
|
||||||
extract_value( SecuritySystem.EmergencyBrakeDelay, "EmergencyBrakeDelay", line, "" );
|
extract_value( SecuritySystem.EmergencyBrakeDelay, "EmergencyBrakeDelay", line, "" );
|
||||||
SecuritySystem.RadioStop = ( extract_value( "RadioStop", line ).find( "Yes" ) != std::string::npos );
|
extract_value( SecuritySystem.RadioStop, "RadioStop", line, "" );
|
||||||
}
|
}
|
||||||
|
|
||||||
void TMoverParameters::LoadFIZ_Clima( std::string const &line ) {
|
void TMoverParameters::LoadFIZ_Clima( std::string const &line ) {
|
||||||
@@ -8320,7 +8320,6 @@ void TMoverParameters::LoadFIZ_Engine( std::string const &Input ) {
|
|||||||
// TODO: unify naming scheme and sort out which diesel engine params are used where and how
|
// TODO: unify naming scheme and sort out which diesel engine params are used where and how
|
||||||
extract_value( nmax, "nmax", Input, "" );
|
extract_value( nmax, "nmax", Input, "" );
|
||||||
nmax /= 60.0;
|
nmax /= 60.0;
|
||||||
// nmax = dizel_nmax; // not sure if this is needed, but just in case
|
|
||||||
extract_value( dizel_nmax_cutoff, "nmax_cutoff", Input, "0.0" );
|
extract_value( dizel_nmax_cutoff, "nmax_cutoff", Input, "0.0" );
|
||||||
dizel_nmax_cutoff /= 60.0;
|
dizel_nmax_cutoff /= 60.0;
|
||||||
extract_value( dizel_AIM, "AIM", Input, "1.0" );
|
extract_value( dizel_AIM, "AIM", Input, "1.0" );
|
||||||
@@ -8338,7 +8337,7 @@ void TMoverParameters::LoadFIZ_Engine( std::string const &Input ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
hydro_TC = (extract_value("IsTC", Input) == "Yes");
|
extract_value(hydro_TC, "IsTC", Input, "");
|
||||||
if (true == hydro_TC) {
|
if (true == hydro_TC) {
|
||||||
extract_value(hydro_TC_TMMax, "TC_TMMax", Input, "");
|
extract_value(hydro_TC_TMMax, "TC_TMMax", Input, "");
|
||||||
extract_value(hydro_TC_CouplingPoint, "TC_CP", Input, "");
|
extract_value(hydro_TC_CouplingPoint, "TC_CP", Input, "");
|
||||||
@@ -8353,7 +8352,7 @@ void TMoverParameters::LoadFIZ_Engine( std::string const &Input ) {
|
|||||||
extract_value(hydro_TC_LockupSpeed, "TC_LS", Input, "");
|
extract_value(hydro_TC_LockupSpeed, "TC_LS", Input, "");
|
||||||
extract_value(hydro_TC_UnlockSpeed, "TC_ULS", Input, "");
|
extract_value(hydro_TC_UnlockSpeed, "TC_ULS", Input, "");
|
||||||
|
|
||||||
hydro_R = (extract_value("IsRetarder", Input) == "Yes");
|
extract_value(hydro_R, "IsRetarder", Input, "");
|
||||||
if (true == hydro_R) {
|
if (true == hydro_R) {
|
||||||
extract_value(hydro_R_Placement, "R_Place", Input, "");
|
extract_value(hydro_R_Placement, "R_Place", Input, "");
|
||||||
extract_value(hydro_R_TorqueInIn, "R_TII", Input, "");
|
extract_value(hydro_R_TorqueInIn, "R_TII", Input, "");
|
||||||
@@ -8414,7 +8413,7 @@ void TMoverParameters::LoadFIZ_Engine( std::string const &Input ) {
|
|||||||
extract_value( eimc[ eimc_p_Imax ], "Imax", Input, "" );
|
extract_value( eimc[ eimc_p_Imax ], "Imax", Input, "" );
|
||||||
extract_value( eimc[ eimc_p_abed ], "abed", Input, "" );
|
extract_value( eimc[ eimc_p_abed ], "abed", Input, "" );
|
||||||
extract_value( eimc[ eimc_p_eped ], "edep", Input, "" );
|
extract_value( eimc[ eimc_p_eped ], "edep", Input, "" );
|
||||||
EIMCLogForce = ( extract_value( "eimclf", Input ) == "Yes" );
|
extract_value( EIMCLogForce, "eimclf", Input, "" );
|
||||||
|
|
||||||
Flat = ( extract_value( "Flat", Input ) == "1" );
|
Flat = ( extract_value( "Flat", Input ) == "1" );
|
||||||
|
|
||||||
|
|||||||
@@ -4371,7 +4371,7 @@ bool TTrain::Update( double const Deltatime )
|
|||||||
asCarName[i] = p->name();
|
asCarName[i] = p->name();
|
||||||
bPants[iUnitNo - 1][0] = (bPants[iUnitNo - 1][0] || p->MoverParameters->PantFrontUp);
|
bPants[iUnitNo - 1][0] = (bPants[iUnitNo - 1][0] || p->MoverParameters->PantFrontUp);
|
||||||
bPants[iUnitNo - 1][1] = (bPants[iUnitNo - 1][1] || p->MoverParameters->PantRearUp);
|
bPants[iUnitNo - 1][1] = (bPants[iUnitNo - 1][1] || p->MoverParameters->PantRearUp);
|
||||||
bComp[iUnitNo - 1][0] = (bComp[iUnitNo - 1][0] || p->MoverParameters->CompressorAllow);
|
bComp[iUnitNo - 1][0] = (bComp[iUnitNo - 1][0] || p->MoverParameters->CompressorAllow || (p->MoverParameters->CompressorStart == start::automatic));
|
||||||
bSlip[i] = p->MoverParameters->SlippingWheels;
|
bSlip[i] = p->MoverParameters->SlippingWheels;
|
||||||
if (p->MoverParameters->CompressorSpeed > 0.00001)
|
if (p->MoverParameters->CompressorSpeed > 0.00001)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -135,6 +135,14 @@ sound_source::deserialize( cParser &Input, sound_type const Legacytype, int cons
|
|||||||
// restore parser behaviour
|
// restore parser behaviour
|
||||||
Input.autoclear( inputautoclear );
|
Input.autoclear( inputautoclear );
|
||||||
|
|
||||||
|
// catch and correct oddball cases with the same sample assigned as all parts of multipart sound
|
||||||
|
if( m_sounds[ begin ].buffer == m_sounds[ main ].buffer ) {
|
||||||
|
m_sounds[ begin ].buffer = null_handle;
|
||||||
|
}
|
||||||
|
if( m_sounds[ end ].buffer == m_sounds[ main ].buffer ) {
|
||||||
|
m_sounds[ end ].buffer = null_handle;
|
||||||
|
}
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user