mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-21 22:59:19 +02:00
Merge pull request #27 from MaSzyna-EU07/new-dedicated-features
New dedicated features
This commit is contained in:
17
DynObj.cpp
17
DynObj.cpp
@@ -6790,6 +6790,23 @@ void TDynamicObject::LoadMMediaFile( std::string const &TypeName, std::string co
|
|||||||
m_powertrainsounds.dsbWejscie_na_bezoporow.deserialize( parser, sound_type::single );
|
m_powertrainsounds.dsbWejscie_na_bezoporow.deserialize( parser, sound_type::single );
|
||||||
m_powertrainsounds.dsbWejscie_na_bezoporow.owner( this );
|
m_powertrainsounds.dsbWejscie_na_bezoporow.owner( this );
|
||||||
}
|
}
|
||||||
|
// przekazniki od kierunku jazdy
|
||||||
|
else if (token == "directionrelay_d:") {
|
||||||
|
// przekaznik od kierunku jazdy do przodu
|
||||||
|
sDirectionRelayD.deserialize(parser, sound_type::single);
|
||||||
|
sDirectionRelayD.owner(this);
|
||||||
|
}
|
||||||
|
else if (token == "directionrelay_r:") {
|
||||||
|
// przekaznik od kierunku jazdy do tylu
|
||||||
|
sDirectionRelayR.deserialize(parser, sound_type::single);
|
||||||
|
sDirectionRelayR.owner(this);
|
||||||
|
}
|
||||||
|
else if (token == "directionrelay_n:")
|
||||||
|
{
|
||||||
|
// przekaznik od kierunku jazdy do tylu
|
||||||
|
sDirectionRelayN.deserialize(parser, sound_type::single);
|
||||||
|
sDirectionRelayN.owner(this);
|
||||||
|
}
|
||||||
else if( token == "wejscie_na_drugi_uklad:" ) {
|
else if( token == "wejscie_na_drugi_uklad:" ) {
|
||||||
m_powertrainsounds.motor_parallel.deserialize( parser, sound_type::single );
|
m_powertrainsounds.motor_parallel.deserialize( parser, sound_type::single );
|
||||||
m_powertrainsounds.motor_parallel.owner( this );
|
m_powertrainsounds.motor_parallel.owner( this );
|
||||||
|
|||||||
3
DynObj.h
3
DynObj.h
@@ -516,6 +516,9 @@ private:
|
|||||||
std::vector<axle_sounds> m_axlesounds;
|
std::vector<axle_sounds> m_axlesounds;
|
||||||
// engine sounds
|
// engine sounds
|
||||||
powertrain_sounds m_powertrainsounds;
|
powertrain_sounds m_powertrainsounds;
|
||||||
|
sound_source sDirectionRelayD { sound_placement::engine }; // przekaznik kierunkowy do przodu
|
||||||
|
sound_source sDirectionRelayN { sound_placement::engine }; // przekaznik kierunkowy neutral
|
||||||
|
sound_source sDirectionRelayR { sound_placement::engine }; // przekaznik kierunkowy wstecz
|
||||||
sound_source sConverter { sound_placement::engine };
|
sound_source sConverter { sound_placement::engine };
|
||||||
sound_source sBRVent {sound_placement::engine};
|
sound_source sBRVent {sound_placement::engine};
|
||||||
sound_source sCompressor { sound_placement::engine }; // NBMX wrzesien 2003
|
sound_source sCompressor { sound_placement::engine }; // NBMX wrzesien 2003
|
||||||
|
|||||||
33
Train.cpp
33
Train.cpp
@@ -8476,12 +8476,45 @@ bool TTrain::Update( double const Deltatime )
|
|||||||
if (!FreeFlyModeFlag && simulation::Train == this) // don't bother if we're outside
|
if (!FreeFlyModeFlag && simulation::Train == this) // don't bother if we're outside
|
||||||
update_screens(Deltatime);
|
update_screens(Deltatime);
|
||||||
|
|
||||||
|
// update direction relay
|
||||||
|
if (prevBatState != mvOccupied->Power24vIsAvailable)
|
||||||
|
SetupDirectionRelays();
|
||||||
|
if (prevDirection != mvOccupied->DirActive)
|
||||||
|
UpdateDirectionRelays();
|
||||||
|
|
||||||
|
prevBatState = mvOccupied->Power24vIsAvailable;
|
||||||
|
prevDirection = mvOccupied->DirActive;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// sounds
|
// sounds
|
||||||
update_sounds( Deltatime );
|
update_sounds( Deltatime );
|
||||||
|
|
||||||
return true; //(DynamicObject->Update(dt));
|
return true; //(DynamicObject->Update(dt));
|
||||||
} // koniec update
|
} // koniec update
|
||||||
|
|
||||||
|
void TTrain::UpdateDirectionRelays() {
|
||||||
|
if (mvOccupied->DirActive < 0 && mvOccupied->Power24vIsAvailable) // wstecz
|
||||||
|
Dynamic()->sDirectionRelayR.play();
|
||||||
|
if (mvOccupied->DirActive == 0 && mvOccupied->Power24vIsAvailable) // neutral
|
||||||
|
Dynamic()->sDirectionRelayN.play();
|
||||||
|
if (mvOccupied->DirActive > 0 && mvOccupied->Power24vIsAvailable) // przod
|
||||||
|
Dynamic()->sDirectionRelayD.play();
|
||||||
|
}
|
||||||
|
|
||||||
|
void TTrain::SetupDirectionRelays() {
|
||||||
|
if (mvOccupied->Power24vIsAvailable)
|
||||||
|
{
|
||||||
|
if (mvOccupied->DirActive < 0 && mvOccupied->Power24vIsAvailable) // wstecz
|
||||||
|
Dynamic()->sDirectionRelayR.play();
|
||||||
|
if (mvOccupied->DirActive > 0 && mvOccupied->Power24vIsAvailable) // przod
|
||||||
|
Dynamic()->sDirectionRelayD.play();
|
||||||
|
}
|
||||||
|
else if (mvOccupied->DirActive != 0) // neutral
|
||||||
|
Dynamic()->sDirectionRelayN.play();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
TTrain::update_sounds( double const Deltatime ) {
|
TTrain::update_sounds( double const Deltatime ) {
|
||||||
|
|
||||||
|
|||||||
4
Train.h
4
Train.h
@@ -164,6 +164,10 @@ class TTrain {
|
|||||||
return m_controlmapper.find( Control ); }
|
return m_controlmapper.find( Control ); }
|
||||||
void UpdateCab();
|
void UpdateCab();
|
||||||
bool Update( double const Deltatime );
|
bool Update( double const Deltatime );
|
||||||
|
void UpdateDirectionRelays();
|
||||||
|
void SetupDirectionRelays();
|
||||||
|
bool prevBatState = false;
|
||||||
|
int prevDirection = 0;
|
||||||
void add_distance( double const Distance );
|
void add_distance( double const Distance );
|
||||||
// McZapkie-310302: ladowanie parametrow z pliku
|
// McZapkie-310302: ladowanie parametrow z pliku
|
||||||
bool LoadMMediaFile(std::string const &asFileName);
|
bool LoadMMediaFile(std::string const &asFileName);
|
||||||
|
|||||||
Reference in New Issue
Block a user