16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 20:39:18 +02:00

Merge branch 'tmj-dev' into milek-dev

This commit is contained in:
milek7
2018-10-11 15:30:19 +02:00
5 changed files with 30 additions and 11 deletions

View File

@@ -5524,6 +5524,7 @@ bool TTrain::Update( double const Deltatime )
btLampkaDoorLeft.Turn(mvOccupied->DoorLeftOpened);
btLampkaDoorRight.Turn(mvOccupied->DoorRightOpened);
btLampkaBlokadaDrzwi.Turn(mvOccupied->DoorBlockedFlag());
btLampkaDoorLockOff.Turn( false == mvOccupied->DoorLockEnabled );
btLampkaDepartureSignal.Turn( mvControlled->DepartureSignal );
btLampkaNapNastHam.Turn((mvControlled->ActiveDir != 0) && (mvOccupied->EpFuse)); // napiecie na nastawniku hamulcowym
btLampkaForward.Turn(mvControlled->ActiveDir > 0); // jazda do przodu
@@ -5582,6 +5583,7 @@ bool TTrain::Update( double const Deltatime )
btLampkaDoorLeft.Turn( false );
btLampkaDoorRight.Turn( false );
btLampkaBlokadaDrzwi.Turn( false );
btLampkaDoorLockOff.Turn( false );
btLampkaDepartureSignal.Turn( false );
btLampkaNapNastHam.Turn( false );
btLampkaForward.Turn( false );
@@ -7160,6 +7162,7 @@ void TTrain::clear_cab_controls()
btLampkaRadioStop.Clear();
btLampkaHamulecReczny.Clear();
btLampkaBlokadaDrzwi.Clear();
btLampkaDoorLockOff.Clear();
btInstrumentLight.Clear();
btDashboardLight.Clear();
btTimetableLight.Clear();
@@ -7521,6 +7524,7 @@ bool TTrain::initialize_button(cParser &Parser, std::string const &Label, int co
{ "i-radiostop:", btLampkaRadioStop },
{ "i-manual_brake:", btLampkaHamulecReczny },
{ "i-door_blocked:", btLampkaBlokadaDrzwi },
{ "i-door_blockedoff:", btLampkaDoorLockOff },
{ "i-slippery:", btLampkaPoslizg },
{ "i-contactors:", btLampkaStyczn },
{ "i-conv_ovld:", btLampkaNadmPrzetw },

View File

@@ -541,6 +541,7 @@ public: // reszta może by?publiczna
TButton btLampkaDoorRight;
TButton btLampkaDepartureSignal;
TButton btLampkaBlokadaDrzwi;
TButton btLampkaDoorLockOff;
TButton btLampkaHamulecReczny;
TButton btLampkaForward; // Ra: lampki w przód i w ty?dla komputerowych kabin
TButton btLampkaBackward;

View File

@@ -2575,15 +2575,21 @@ opengl_renderer::Render( TSubModel *Submodel ) {
( Submodel->fCosViewAngle - Submodel->fCosFalloffAngle ) / ( Submodel->fCosHotspotAngle - Submodel->fCosFalloffAngle ),
0.f, 1.f );
lightlevel *= anglefactor;
float const precipitationfactor { interpolate( 1.f, 0.25f, clamp( Global.Overcast * 0.75f - 0.5f, 0.f, 1.f ) ) };
lightlevel *= precipitationfactor;
// distance attenuation. NOTE: since it's fixed pipeline with built-in gamma correction we're using linear attenuation
// we're capping how much effect the distance attenuation can have, otherwise the lights get too tiny at regular distances
float const distancefactor { std::max( 0.5f, ( Submodel->fSquareMaxDist - TSubModel::fSquareDist ) / Submodel->fSquareMaxDist ) };
auto const pointsize { std::max( 3.f, 5.f * distancefactor * anglefactor ) };
// additionally reduce light strength for farther sources in rain or snow
if( Global.Overcast > 0.75f ) {
float const precipitationfactor{
interpolate(
interpolate( 1.f, 0.25f, clamp( Global.Overcast * 0.75f - 0.5f, 0.f, 1.f ) ),
1.f,
distancefactor ) };
lightlevel *= precipitationfactor;
}
if( lightlevel > 0.f ) {
// distance attenuation. NOTE: since it's fixed pipeline with built-in gamma correction we're using linear attenuation
// we're capping how much effect the distance attenuation can have, otherwise the lights get too tiny at regular distances
float const distancefactor { std::max( 0.5f, ( Submodel->fSquareMaxDist - TSubModel::fSquareDist ) / Submodel->fSquareMaxDist ) };
auto const pointsize { std::max( 3.f, 5.f * distancefactor * anglefactor ) };
// material configuration:
Bind_Material( null_handle );
// limit impact of dense fog on the lights
@@ -3418,7 +3424,16 @@ opengl_renderer::Render_Alpha( TSubModel *Submodel ) {
Bind_Material( Submodel->m_material );
}
// ...colors...
::glColor3fv( glm::value_ptr( Submodel->f4Diffuse ) ); // McZapkie-240702: zamiast ub
if( Submodel->fVisible < 1.f ) {
::glColor4f(
Submodel->f4Diffuse.r,
Submodel->f4Diffuse.g,
Submodel->f4Diffuse.b,
Submodel->fVisible );
}
else {
::glColor3fv( glm::value_ptr( Submodel->f4Diffuse ) ); // McZapkie-240702: zamiast ub
}
if( ( true == m_renderspecular ) && ( m_sunlight.specular.a > 0.01f ) ) {
::glMaterialfv( GL_FRONT, GL_SPECULAR, glm::value_ptr( Submodel->f4Specular * m_sunlight.specular.a * m_speculartranslucentscalefactor ) );
}

View File

@@ -276,7 +276,7 @@ init() {
"kurek trojdrogowy pantografow",
"ogrzewanie pociagu",
"sygnalizacja hamowania",
"sygnalizacja blokady drzwi",
"blokada drzwi",
"prady drugiego czlonu",
"oswietlenie przyrzadow",
"oswietlenie pulpitu",

View File

@@ -1,2 +1 @@
#define VERSION_INFO "M7 10.10.2018, based on tmj-8a904f4"
#define VERSION_INFO "M7 11.10.2018, based on tmj-67211a43"