From: curt Date: Sat, 28 Sep 2002 03:57:37 +0000 (+0000) Subject: Panel night lighting acts as if lights are always turned on. We don't X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c7df5f36395e71a02fd2a32fc09b05e117be7a5c;p=flightgear.git Panel night lighting acts as if lights are always turned on. We don't really see anything different in the day, but as day turns to night the panel smoothly darkens and the lighting component becomes visible. Lights are wired to electrical system so if you kill power, you lose the lights. --- diff --git a/src/Cockpit/panel.cxx b/src/Cockpit/panel.cxx index 0199dd178..6ec50fd59 100644 --- a/src/Cockpit/panel.cxx +++ b/src/Cockpit/panel.cxx @@ -373,12 +373,14 @@ FGPanel::draw() glEnable(GL_BLEND); glEnable(GL_ALPHA_TEST); glEnable(GL_COLOR_MATERIAL); - // glColor4f(1.0, 1.0, 1.0, 1.0); - if ( cur_light_params.sun_angle * SGD_RADIANS_TO_DEGREES < 95.0 ) { - glColor4fv( cur_light_params.scene_diffuse ); - } else { - glColor4f(0.7, 0.2, 0.2, 1.0); + sgVec4 panel_color; + sgCopyVec4( panel_color, cur_light_params.scene_diffuse ); + if ( fgGetDouble("/systems/electrical/outputs/instrument-lights") > 1.0 ) { + if ( panel_color[0] < 0.7 ) panel_color[0] = 0.7; + if ( panel_color[1] < 0.2 ) panel_color[1] = 0.2; + if ( panel_color[2] < 0.2 ) panel_color[2] = 0.2; } + glColor4fv( panel_color ); if (_bg != 0) { glBindTexture(GL_TEXTURE_2D, _bg->getHandle()); // glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); @@ -877,12 +879,14 @@ FGTexturedLayer::draw () // From Curt: turn on the panel // lights after sundown. - if ( cur_light_params.sun_angle * SGD_RADIANS_TO_DEGREES < 95.0 ) { - glColor4fv( cur_light_params.scene_diffuse ); - } else { - glColor4f(0.7, 0.2, 0.2, 1.0); + sgVec4 panel_color; + sgCopyVec4( panel_color, cur_light_params.scene_diffuse ); + if ( fgGetDouble("/systems/electrical/outputs/instrument-lights") > 1.0 ) { + if ( panel_color[0] < 0.7 ) panel_color[0] = 0.7; + if ( panel_color[1] < 0.2 ) panel_color[1] = 0.2; + if ( panel_color[2] < 0.2 ) panel_color[2] = 0.2; } - + glColor4fv( panel_color ); glTexCoord2f(_texture.getMinX(), _texture.getMinY()); glVertex2f(-w2, -h2); glTexCoord2f(_texture.getMaxX(), _texture.getMinY()); glVertex2f(w2, -h2); diff --git a/src/Cockpit/steam.cxx b/src/Cockpit/steam.cxx index e5f058407..99875e6c9 100644 --- a/src/Cockpit/steam.cxx +++ b/src/Cockpit/steam.cxx @@ -318,6 +318,7 @@ void FGSteam::_CatchUp() More subtle flaw is having it not move or a travel limit occasionally due to some dirt in the tube or on the ball. */ + // cout << current_aircraft.fdm_state->get_A_Z_pilot() << endl; d = -current_aircraft.fdm_state->get_A_Z_pilot(); if ( d < 1 ) d = 1; set_lowpass ( & the_TC_rad,