Planet.cpp   Planet.cpp 
skipping to change at line 230 skipping to change at line 230
return getVMagnitude(core, false)-15.f; return getVMagnitude(core, false)-15.f;
} }
else else
{ {
return getVMagnitude(core, false) - 8.f; return getVMagnitude(core, false) - 8.f;
} }
} }
Vec3f Planet::getInfoColor(void) const Vec3f Planet::getInfoColor(void) const
{ {
return StelApp::getInstance().getVisionModeNight() ? Vec3f(0.8, 0.2, Vec3f col = ((SolarSystem*)StelApp::getInstance().getModuleMgr().get
0.4) : ((SolarSystem*)StelApp::getInstance().getModuleMgr().getModule("Sol Module("SolarSystem"))->getLabelsColor();
arSystem"))->getLabelsColor(); if (StelApp::getInstance().getVisionModeNight())
col = StelUtils::getNightColor(col);
return col;
} }
double Planet::getCloseViewFov(const StelCore* core) const double Planet::getCloseViewFov(const StelCore* core) const
{ {
return std::atan(radius*sphereScale*2.f/getEquinoxEquatorialPos(core ).length())*180./M_PI * 4; return std::atan(radius*sphereScale*2.f/getEquinoxEquatorialPos(core ).length())*180./M_PI * 4;
} }
double Planet::getSatellitesFov(const StelCore* core) const double Planet::getSatellitesFov(const StelCore* core) const
{ {
// TODO: calculate from satellite orbits rather than hard code // TODO: calculate from satellite orbits rather than hard code
skipping to change at line 812 skipping to change at line 815
if (flagLighting) if (flagLighting)
{ {
sPainter->getLight().enable(); sPainter->getLight().enable();
// Set the main source of light to be the sun // Set the main source of light to be the sun
Vec3d sunPos(0); Vec3d sunPos(0);
core->getHeliocentricEclipticModelViewTransform()->f orward(sunPos); core->getHeliocentricEclipticModelViewTransform()->f orward(sunPos);
sPainter->getLight().setPosition(Vec4f(sunPos[0],sun Pos[1],sunPos[2],1.f)); sPainter->getLight().setPosition(Vec4f(sunPos[0],sun Pos[1],sunPos[2],1.f));
// Set the light parameters taking sun as the light source // Set the light parameters taking sun as the light source
static const Vec4f diffuse = Vec4f(2.f,2.f,2.f,1.f); static Vec4f diffuse = Vec4f(2.f,2.f,2.f,1.f);
static const Vec4f zero = Vec4f(0.f,0.f,0.f,0.f); static Vec4f zero = Vec4f(0.f,0.f,0.f,0.f);
static const Vec4f ambient = Vec4f(0.02f,0.02f,0.02f static Vec4f ambient = Vec4f(0.02f,0.02f,0.02f,0.02f
,0.02f); );
if (StelApp::getInstance().getVisionModeNight())
{
diffuse[1] = 0.; diffuse[2] = 0.;
ambient[1] = 0.; ambient[2] = 0.;
}
else
{
diffuse[1] = 2.; diffuse[2] = 2.;
ambient[1] = 0.02; ambient[2] = 0.02;
}
sPainter->getLight().setAmbient(ambient); sPainter->getLight().setAmbient(ambient);
sPainter->getLight().setDiffuse(diffuse); sPainter->getLight().setDiffuse(diffuse);
sPainter->getLight().setSpecular(zero); sPainter->getLight().setSpecular(zero);
sPainter->getMaterial().setAmbient(ambient); sPainter->getMaterial().setAmbient(ambient);
sPainter->getMaterial().setEmission(zero); sPainter->getMaterial().setEmission(zero);
sPainter->getMaterial().setShininess(0.f); sPainter->getMaterial().setShininess(0.f);
sPainter->getMaterial().setSpecular(zero); sPainter->getMaterial().setSpecular(zero);
} }
else else
skipping to change at line 901 skipping to change at line 914
void Planet::drawSphere(StelPainter* painter, float screenSz) void Planet::drawSphere(StelPainter* painter, float screenSz)
{ {
if (texMap) if (texMap)
{ {
// For lazy loading, return if texture not yet loaded // For lazy loading, return if texture not yet loaded
if (!texMap->bind()) if (!texMap->bind())
{ {
return; return;
} }
} }
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
if (StelApp::getInstance().getVisionModeNight())
painter->setColor(1.f, 0.f, 0.f);
else
painter->setColor(1.f, 1.f, 1.f);
painter->enableTexture2d(true); painter->enableTexture2d(true);
glDisable(GL_BLEND); glDisable(GL_BLEND);
glEnable(GL_CULL_FACE); glEnable(GL_CULL_FACE);
// Draw the spheroid itself // Draw the spheroid itself
// Adapt the number of facets according with the size of the sphere for optimization // Adapt the number of facets according with the size of the sphere for optimization
int nb_facet = (int)(screenSz * 40/50); // 40 facets for 1024 pixels diameter on screen int nb_facet = (int)(screenSz * 40/50); // 40 facets for 1024 pixels diameter on screen
if (nb_facet<10) nb_facet = 10; if (nb_facet<10) nb_facet = 10;
if (nb_facet>40) nb_facet = 40; if (nb_facet>40) nb_facet = 40;
painter->setShadeModel(StelPainter::ShadeModelSmooth); painter->setShadeModel(StelPainter::ShadeModelSmooth);
skipping to change at line 1063 skipping to change at line 1082
{ {
screenSz -= 50; screenSz -= 50;
screenSz /= 250.0; screenSz /= 250.0;
if (screenSz < 0.0) screenSz = 0.0; if (screenSz < 0.0) screenSz = 0.0;
else if (screenSz > 1.0) screenSz = 1.0; else if (screenSz > 1.0) screenSz = 1.0;
const int slices = 128+(int)((256-128)*screenSz); const int slices = 128+(int)((256-128)*screenSz);
const int stacks = 8+(int)((32-8)*screenSz); const int stacks = 8+(int)((32-8)*screenSz);
// Normal transparency mode // Normal transparency mode
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
sPainter->setColor(1.f, 1.f, 1.f); if (StelApp::getInstance().getVisionModeNight())
sPainter->setColor(1.f, 0.f, 0.f);
else
sPainter->setColor(1.f, 1.f, 1.f);
sPainter->enableTexture2d(true); sPainter->enableTexture2d(true);
glEnable(GL_CULL_FACE); glEnable(GL_CULL_FACE);
glEnable(GL_BLEND); glEnable(GL_BLEND);
if (tex) tex->bind(); if (tex) tex->bind();
Mat4d mat = transfo->getApproximateLinearTransfo(); Mat4d mat = transfo->getApproximateLinearTransfo();
// solve the ring wraparound by culling: // solve the ring wraparound by culling:
// decide if we are above or below the ring plane // decide if we are above or below the ring plane
const double h = mat.r[ 8]*mat.r[12] const double h = mat.r[ 8]*mat.r[12]
 End of changes. 4 change blocks. 
8 lines changed or deleted 30 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/