mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-28 18:07:29 +01:00
Revert "fix: yet other sonar sast fixes"
This reverts commit 403a6d1f9f.
This commit is contained in:
@@ -2408,7 +2408,7 @@ bool TMoverParameters::IncMainCtrl(int CtrlSpeed)
|
||||
{
|
||||
++MainCtrlPos;
|
||||
OK = true;
|
||||
if (EIMCtrlType == 0 && ( SpeedCtrlAutoTurnOffFlag & 1 ) == 1 && MainCtrlActualPos != MainCtrlPos)
|
||||
if (EIMCtrlType == 0 && SpeedCtrlAutoTurnOffFlag & 1 == 1 && MainCtrlActualPos != MainCtrlPos)
|
||||
{
|
||||
DecScndCtrl(2);
|
||||
SpeedCtrlUnit.IsActive = false;
|
||||
@@ -2591,7 +2591,7 @@ bool TMoverParameters::DecMainCtrl(int CtrlSpeed)
|
||||
{
|
||||
MainCtrlPos--;
|
||||
OK = true;
|
||||
if (EIMCtrlType == 0 && (SpeedCtrlAutoTurnOffFlag & 1) == 1 && MainCtrlActualPos != MainCtrlPos)
|
||||
if (EIMCtrlType == 0 && SpeedCtrlAutoTurnOffFlag & 1 == 1 && MainCtrlActualPos != MainCtrlPos)
|
||||
{
|
||||
DecScndCtrl(2);
|
||||
SpeedCtrlUnit.IsActive = false;
|
||||
@@ -2780,7 +2780,7 @@ bool TMoverParameters::IncScndCtrl(int CtrlSpeed)
|
||||
if (OK && EngineType == TEngineType::ElectricInductionMotor && ScndCtrlPosNo == 1 && MainCtrlPos > 0)
|
||||
{
|
||||
SpeedCtrlValue = Vel;
|
||||
if (EIMCtrlType == 0 && (SpeedCtrlAutoTurnOffFlag & 1) == 1)
|
||||
if (EIMCtrlType == 0 && SpeedCtrlAutoTurnOffFlag & 1 == 1)
|
||||
{
|
||||
MainCtrlActualPos = MainCtrlPos;
|
||||
}
|
||||
@@ -4586,11 +4586,14 @@ void TMoverParameters::UpdatePipePressure(double dt)
|
||||
|
||||
auto const lowvoltagepower{Power24vIsAvailable || Power110vIsAvailable};
|
||||
|
||||
// EngDmgFlag 32 (load destroyed) used to trigger this too; dropped, it has nothing to do with
|
||||
// the emergency brake (a broken coupler sets AlarmChainFlag instead)
|
||||
if (RadioStopFlag || AlarmChainFlag || (EIMCtrlEmergency && LocalBrakePosA >= 1.0) || SecuritySystem.is_braking() ||
|
||||
(SpringBrakeDriveEmergencyVel >= 0 && Vel > SpringBrakeDriveEmergencyVel && SpringBrake.IsActive) ||
|
||||
(0 == CabActive && (InactiveCabFlag & activation::emergencybrake) != 0))
|
||||
if (true == RadioStopFlag || true == AlarmChainFlag || (true == EIMCtrlEmergency && LocalBrakePosA >= 1.0) || SecuritySystem.is_braking() ||
|
||||
(SpringBrakeDriveEmergencyVel >= 0 && Vel > SpringBrakeDriveEmergencyVel && SpringBrake.IsActive)
|
||||
/*
|
||||
// NOTE: disabled because 32 is 'load destroyed' flag, what does this have to do with emergency brake?
|
||||
// (if it's supposed to be broken coupler, such event sets alarmchainflag instead when appropriate)
|
||||
|| ( true == TestFlag( EngDmgFlag, 32 ) )
|
||||
*/
|
||||
|| (0 == CabActive && InactiveCabFlag & activation::emergencybrake) || (SpringBrakeDriveEmergencyVel >= 0 && Vel > SpringBrakeDriveEmergencyVel && SpringBrake.IsActive))
|
||||
{
|
||||
EmergencyValveFlow = PF(0, PipePress, 0.15) * dt;
|
||||
}
|
||||
|
||||
@@ -81,9 +81,9 @@ bool opengl33_renderer::Init(GLFWwindow *Window)
|
||||
}
|
||||
|
||||
// rgb value for 5780 kelvin
|
||||
Global.DayLight.diffuse[0] = 1.0f; // 255 / 255
|
||||
Global.DayLight.diffuse[1] = 0.9490196f; // 242 / 255
|
||||
Global.DayLight.diffuse[2] = 0.9058824f; // 231 / 255
|
||||
Global.DayLight.diffuse[0] = 255.0f / 255.0f;
|
||||
Global.DayLight.diffuse[1] = 242.0f / 255.0f;
|
||||
Global.DayLight.diffuse[2] = 231.0f / 255.0f;
|
||||
Global.DayLight.is_directional = true;
|
||||
m_sunlight.id = opengl33_renderer::sunlight;
|
||||
|
||||
@@ -1956,7 +1956,7 @@ bool opengl33_renderer::Render(world_environment *Environment)
|
||||
// moon
|
||||
{
|
||||
Bind_Texture(0, m_moontexture);
|
||||
glm::vec3 mooncolor(1.0f, 0.9490196f, 0.9058824f);
|
||||
glm::vec3 mooncolor(255.0f / 255.0f, 242.0f / 255.0f, 231.0f / 255.0f);
|
||||
glm::vec4 color(mooncolor.r, mooncolor.g, mooncolor.b,
|
||||
// fade the moon if it's near the sun in the sky, especially during the day
|
||||
std::max<float>(0.f, 1.0 - 0.5 * Global.fLuminance - 0.65 * std::max(0.f, glm::dot(Environment->m_sun.getDirection(), Environment->m_moon.getDirection()))) * fogfactor);
|
||||
|
||||
@@ -88,9 +88,9 @@ opengl_renderer::Init( GLFWwindow *Window ) {
|
||||
::glEnable( opengl_renderer::sunlight );
|
||||
|
||||
// rgb value for 5780 kelvin
|
||||
Global.DayLight.diffuse[0] = 1.0f; // 255 / 255
|
||||
Global.DayLight.diffuse[1] = 0.9490196f; // 242 / 255
|
||||
Global.DayLight.diffuse[2] = 0.9058824f; // 231 / 255
|
||||
Global.DayLight.diffuse[ 0 ] = 255.0f / 255.0f;
|
||||
Global.DayLight.diffuse[ 1 ] = 242.0f / 255.0f;
|
||||
Global.DayLight.diffuse[ 2 ] = 231.0f / 255.0f;
|
||||
Global.DayLight.is_directional = true;
|
||||
m_sunlight.id = opengl_renderer::sunlight;
|
||||
// ::glLightf( opengl_renderer::sunlight, GL_SPOT_CUTOFF, 90.0f );
|
||||
@@ -1603,7 +1603,7 @@ opengl_renderer::Render( world_environment *Environment ) {
|
||||
if (!m_isATI)
|
||||
{
|
||||
Bind_Texture( m_moontexture );
|
||||
glm::vec3 mooncolor(1.0f, 0.9490196f, 0.9058824f);
|
||||
glm::vec3 mooncolor( 255.0f / 255.0f, 242.0f / 255.0f, 231.0f / 255.0f );
|
||||
::glColor4f(
|
||||
mooncolor.r, mooncolor.g, mooncolor.b,
|
||||
// fade the moon if it's near the sun in the sky, especially during the day
|
||||
|
||||
@@ -140,7 +140,7 @@ world_environment::update() {
|
||||
m_lightintensity = moonlightlevel;
|
||||
// if the moon is up, it overrides the twilight
|
||||
twilightfactor = 0.0f;
|
||||
keylightcolor = glm::vec3( 1.0f, 0.9490196f, 0.7921569f );
|
||||
keylightcolor = glm::vec3( 255.0f / 255.0f, 242.0f / 255.0f, 202.0f / 255.0f );
|
||||
}
|
||||
else {
|
||||
// regular situation with sun as the key light
|
||||
@@ -152,8 +152,8 @@ world_environment::update() {
|
||||
// include 'golden hour' effect in twilight lighting
|
||||
float const duskfactor = 1.25f - std::clamp( Global.SunAngle, 0.0f, 18.0f ) / 18.0f;
|
||||
keylightcolor = glm::mix(
|
||||
glm::vec3( 1.0f, 0.9490196f, 0.9058824f ), // 255, 242, 231 / 255
|
||||
glm::vec3( 0.9215686f, 0.4705882f, 0.1411765f ), // 235, 120, 36 / 255
|
||||
glm::vec3( 255.0f / 255.0f, 242.0f / 255.0f, 231.0f / 255.0f ),
|
||||
glm::vec3( 235.0f / 255.0f, 120.0f / 255.0f, 36.0f / 255.0f ),
|
||||
duskfactor );
|
||||
}
|
||||
// ...retrieve current sky colour and brightness...
|
||||
|
||||
Reference in New Issue
Block a user