Comment 4 for bug 682033

Revision history for this message
RossMitchell (rossmitchell) wrote :

Further fixes for the various sky lines which do not respond to Night Vision setting (such as equator)
My solution is to calculate a local color for lines, and also labels, the calculation is lifted from SkyGrid::draw
source code was 0.11.4a

in /src/core/modules/GridLinesMgr.cpp function SkyLine::draw replace these lines:

 // Initialize a painter and set openGL state
 StelPainter sPainter(prj);
 sPainter.setColor(color[0], color[1], color[2], fader.getInterstate());
 glEnable(GL_BLEND);
 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // Normal transparency mode

 Vec4f textColor(color[0], color[1], color[2], 0);

with these, where a new local variable lcolor is conditionally set redish:
 // Initialize a painter and set openGL state
 StelPainter sPainter(prj);
 Vec3f lcolor;
 lcolor = color;
 if(StelApp::getInstance().getVisionModeNight()) { //code lifted fron SkyGrid::draw
  lcolor[0] = (color[0] + color[1] + color[2]) / 3.0;
  lcolor[1] = lcolor[2] = 0.;
 }
 sPainter.setColor(lcolor[0], lcolor[1], lcolor[2], fader.getInterstate());
 glEnable(GL_BLEND);
 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // Normal transparency mode

 Vec4f textColor(lcolor[0], lcolor[1], lcolor[2], 0);

Not sure if this is the most elegant solution, but it works.