mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-19 09:59:18 +02:00
build 181011. door locking cab indicator, freespot opacity tweak
This commit is contained in:
@@ -5512,6 +5512,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
|
||||
@@ -5570,6 +5571,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 );
|
||||
@@ -7142,6 +7144,7 @@ void TTrain::clear_cab_controls()
|
||||
btLampkaRadioStop.Clear();
|
||||
btLampkaHamulecReczny.Clear();
|
||||
btLampkaBlokadaDrzwi.Clear();
|
||||
btLampkaDoorLockOff.Clear();
|
||||
btInstrumentLight.Clear();
|
||||
btDashboardLight.Clear();
|
||||
btTimetableLight.Clear();
|
||||
@@ -7503,6 +7506,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 },
|
||||
|
||||
1
Train.h
1
Train.h
@@ -540,6 +540,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;
|
||||
|
||||
31
renderer.cpp
31
renderer.cpp
@@ -2550,15 +2550,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
|
||||
@@ -3393,7 +3399,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 ) );
|
||||
}
|
||||
|
||||
@@ -276,7 +276,7 @@ init() {
|
||||
"kurek trojdrogowy pantografow",
|
||||
"ogrzewanie pociagu",
|
||||
"sygnalizacja hamowania",
|
||||
"sygnalizacja blokady drzwi",
|
||||
"blokada drzwi",
|
||||
"prady drugiego czlonu",
|
||||
"oswietlenie przyrzadow",
|
||||
"oswietlenie pulpitu",
|
||||
|
||||
Reference in New Issue
Block a user