MilkyWay.cpp   MilkyWay.cpp 
skipping to change at line 37 skipping to change at line 37
#include "StelApp.hpp" #include "StelApp.hpp"
#include "StelTextureMgr.hpp" #include "StelTextureMgr.hpp"
#include "StelCore.hpp" #include "StelCore.hpp"
#include "StelSkyDrawer.hpp" #include "StelSkyDrawer.hpp"
#include "StelPainter.hpp" #include "StelPainter.hpp"
#include <QDebug> #include <QDebug>
#include <QSettings> #include <QSettings>
// Class which manages the displaying of the Milky Way // Class which manages the displaying of the Milky Way
MilkyWay::MilkyWay() : radius(1.f), color(1.f, 1.f, 1.f) MilkyWay::MilkyWay() : color(1.f, 1.f, 1.f)
{ {
setObjectName("MilkyWay"); setObjectName("MilkyWay");
fader = new LinearFader(); fader = new LinearFader();
} }
MilkyWay::~MilkyWay() MilkyWay::~MilkyWay()
{ {
delete fader; delete fader;
fader = NULL; fader = NULL;
} }
skipping to change at line 61 skipping to change at line 61
QSettings* conf = StelApp::getInstance().getSettings(); QSettings* conf = StelApp::getInstance().getSettings();
Q_ASSERT(conf); Q_ASSERT(conf);
setTexture("milkyway.png"); setTexture("milkyway.png");
setFlagShow(conf->value("astro/flag_milky_way").toBool()); setFlagShow(conf->value("astro/flag_milky_way").toBool());
setIntensity(conf->value("astro/milky_way_intensity",1.).toDouble()) ; setIntensity(conf->value("astro/milky_way_intensity",1.).toDouble()) ;
} }
void MilkyWay::setTexture(const QString& texFile) void MilkyWay::setTexture(const QString& texFile)
{ {
tex = StelApp::getInstance().getTextureManager().createTexture(texFi le); tex = StelApp::getInstance().getTextureManager().createTexture(texFi le);
} }
void MilkyWay::update(double deltaTime) {fader->update((int)(deltaTime*1000 ));} void MilkyWay::update(double deltaTime) {fader->update((int)(deltaTime*1000 ));}
void MilkyWay::setFlagShow(bool b){*fader = b;} void MilkyWay::setFlagShow(bool b){*fader = b;}
bool MilkyWay::getFlagShow(void) const {return *fader;} bool MilkyWay::getFlagShow(void) const {return *fader;}
void MilkyWay::draw(StelCore* core) void MilkyWay::draw(StelCore* core)
{ {
skipping to change at line 97 skipping to change at line 96
c = Vec3f(0.34165, 0.429666, 0.63586); c = Vec3f(0.34165, 0.429666, 0.63586);
float lum = core->getSkyDrawer()->surfacebrightnessToLuminance(13.5) ; float lum = core->getSkyDrawer()->surfacebrightnessToLuminance(13.5) ;
// Get the luminance scaled between 0 and 1 // Get the luminance scaled between 0 and 1
float aLum =eye->adaptLuminanceScaled(lum*fader->getInterstate()); float aLum =eye->adaptLuminanceScaled(lum*fader->getInterstate());
// Bound a maximum luminance // Bound a maximum luminance
aLum = qMin(0.38, aLum*2.); aLum = qMin(0.38, aLum*2.);
c*=aLum; // intensity of 1.0 is "proper", but allow boost for dim screens
if (c[0]<0) c[0]=0; if (c[0]<0) c[0]=0;
if (c[1]<0) c[1]=0; if (c[1]<0) c[1]=0;
if (c[2]<0) c[2]=0; if (c[2]<0) c[2]=0;
StelPainter sPainter(prj); StelPainter sPainter(prj);
glColor3fv(c); sPainter.setColor(c[0],c[1],c[2]);
glEnable(GL_CULL_FACE); glEnable(GL_CULL_FACE);
glEnable(GL_TEXTURE_2D); sPainter.enableTexture2d(true);
glDisable(GL_BLEND); glDisable(GL_BLEND);
tex->bind(); tex->bind();
sPainter.sSphere(radius,1.0,20,20,1); sPainter.sSphere(1.,1.0,20,20,1);
glDisable(GL_CULL_FACE); glDisable(GL_CULL_FACE);
} }
 End of changes. 6 change blocks. 
6 lines changed or deleted 6 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from