Landscape.cpp   Landscape.cpp 
skipping to change at line 34 skipping to change at line 34
#include "StelFileMgr.hpp" #include "StelFileMgr.hpp"
#include "StelIniParser.hpp" #include "StelIniParser.hpp"
#include "StelLocation.hpp" #include "StelLocation.hpp"
#include "StelCore.hpp" #include "StelCore.hpp"
#include "StelPainter.hpp" #include "StelPainter.hpp"
#include <QDebug> #include <QDebug>
#include <QSettings> #include <QSettings>
#include <QVarLengthArray> #include <QVarLengthArray>
Landscape::Landscape(float _radius) : radius(_radius), skyBrightness(1.), a ngleRotateZOffset(0.) Landscape::Landscape(float _radius) : radius(_radius), skyBrightness(1.), n ightBrightness(0.8), angleRotateZOffset(0.)
{ {
validLandscape = 0; validLandscape = 0;
} }
Landscape::~Landscape() Landscape::~Landscape()
{ {
} }
// Load attributes common to all landscapes // Load attributes common to all landscapes
void Landscape::loadCommon(const QSettings& landscapeIni, const QString& la ndscapeId) void Landscape::loadCommon(const QSettings& landscapeIni, const QString& la ndscapeId)
skipping to change at line 404 skipping to change at line 404
// and the texture in between is correctly stretched. // and the texture in between is correctly stretched.
// TODO: (1) Replace fog cylinder by similar texture, which could be painted as image layer in Photoshop/Gimp. // TODO: (1) Replace fog cylinder by similar texture, which could be painted as image layer in Photoshop/Gimp.
// (2) Implement calibrated && tan_mode // (2) Implement calibrated && tan_mode
StelProjector::ModelViewTranformP transfo = core->getAltAzModelViewT ransform(StelCore::RefractionOff); StelProjector::ModelViewTranformP transfo = core->getAltAzModelViewT ransform(StelCore::RefractionOff);
transfo->combine(Mat4d::zrotation(-angleRotateZOffset*M_PI/180.f)); transfo->combine(Mat4d::zrotation(-angleRotateZOffset*M_PI/180.f));
sPainter.setProjector(core->getProjection(transfo)); sPainter.setProjector(core->getProjection(transfo));
if (!landFader.getInterstate()) if (!landFader.getInterstate())
return; return;
const float nightModeFilter = StelApp::getInstance().getVisionModeNi if (StelApp::getInstance().getVisionModeNight())
ght() ? 0.f : 1.f; sPainter.setColor(skyBrightness*nightBrightness, 0.0, 0.0, l
sPainter.setColor(skyBrightness, skyBrightness*nightModeFilter, skyB andFader.getInterstate());
rightness*nightModeFilter, landFader.getInterstate()); else
sPainter.setColor(skyBrightness, skyBrightness, skyBrightnes
s, landFader.getInterstate());
foreach (const LOSSide& side, precomputedSides) foreach (const LOSSide& side, precomputedSides)
{ {
side.tex->bind(); side.tex->bind();
sPainter.drawSphericalTriangles(side.arr, true, NULL, false) ; sPainter.drawSphericalTriangles(side.arr, true, NULL, false) ;
} }
} }
// Draw the ground // Draw the ground
void LandscapeOldStyle::drawGround(StelCore* core, StelPainter& sPainter) c onst void LandscapeOldStyle::drawGround(StelCore* core, StelPainter& sPainter) c onst
{ {
if (!landFader.getInterstate()) if (!landFader.getInterstate())
return; return;
const float vshift = (tanMode || calibrated) ? const float vshift = (tanMode || calibrated) ?
radius*std::tan(groundAngleShift*M_PI/180.) : radius*std::tan(groundAngleShift*M_PI/180.) :
radius*std::sin(groundAngleShift*M_PI/180.); radius*std::sin(groundAngleShift*M_PI/180.);
StelProjector::ModelViewTranformP transfo = core->getAltAzModelViewT ransform(StelCore::RefractionOff); StelProjector::ModelViewTranformP transfo = core->getAltAzModelViewT ransform(StelCore::RefractionOff);
transfo->combine(Mat4d::zrotation((groundAngleRotateZ-angleRotateZOf fset)*M_PI/180.f) * Mat4d::translation(Vec3d(0,0,vshift))); transfo->combine(Mat4d::zrotation((groundAngleRotateZ-angleRotateZOf fset)*M_PI/180.f) * Mat4d::translation(Vec3d(0,0,vshift)));
sPainter.setProjector(core->getProjection(transfo)); sPainter.setProjector(core->getProjection(transfo));
float nightModeFilter = StelApp::getInstance().getVisionModeNight() if (StelApp::getInstance().getVisionModeNight())
? 0.f : 1.f; sPainter.setColor(skyBrightness*nightBrightness, 0.0, 0.0, l
sPainter.setColor(skyBrightness, skyBrightness*nightModeFilter, skyB andFader.getInterstate());
rightness*nightModeFilter, landFader.getInterstate()); else
sPainter.setColor(skyBrightness, skyBrightness, skyBrightnes
s, landFader.getInterstate());
groundTex->bind(); groundTex->bind();
sPainter.setArrays((Vec3d*)groundVertexArr.constData(), (Vec2f*)grou ndTexCoordArr.constData()); sPainter.setArrays((Vec3d*)groundVertexArr.constData(), (Vec2f*)grou ndTexCoordArr.constData());
sPainter.drawFromArray(StelPainter::Triangles, groundVertexArr.size( )/3); sPainter.drawFromArray(StelPainter::Triangles, groundVertexArr.size( )/3);
} }
LandscapeFisheye::LandscapeFisheye(float _radius) : Landscape(_radius) LandscapeFisheye::LandscapeFisheye(float _radius) : Landscape(_radius)
{} {}
LandscapeFisheye::~LandscapeFisheye() LandscapeFisheye::~LandscapeFisheye()
{ {
skipping to change at line 479 skipping to change at line 484
if(!validLandscape) return; if(!validLandscape) return;
if(!landFader.getInterstate()) return; if(!landFader.getInterstate()) return;
StelProjector::ModelViewTranformP transfo = core->getAltAzModelViewT ransform(StelCore::RefractionOff); StelProjector::ModelViewTranformP transfo = core->getAltAzModelViewT ransform(StelCore::RefractionOff);
transfo->combine(Mat4d::zrotation(-(angleRotateZ+(angleRotateZOffset *M_PI/180.)))); transfo->combine(Mat4d::zrotation(-(angleRotateZ+(angleRotateZOffset *M_PI/180.))));
const StelProjectorP prj = core->getProjection(transfo); const StelProjectorP prj = core->getProjection(transfo);
StelPainter sPainter(prj); StelPainter sPainter(prj);
// Normal transparency mode // Normal transparency mode
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
float nightModeFilter = StelApp::getInstance().getVisionModeNight() if (StelApp::getInstance().getVisionModeNight())
? 0.f : 1.f; sPainter.setColor(skyBrightness*nightBrightness, 0.0, 0.0, l
sPainter.setColor(skyBrightness, skyBrightness*nightModeFilter, skyB andFader.getInterstate());
rightness*nightModeFilter, landFader.getInterstate()); else
sPainter.setColor(skyBrightness, skyBrightness, skyBrightnes
s, landFader.getInterstate());
glEnable(GL_CULL_FACE); glEnable(GL_CULL_FACE);
sPainter.enableTexture2d(true); sPainter.enableTexture2d(true);
glEnable(GL_BLEND); glEnable(GL_BLEND);
mapTex->bind(); mapTex->bind();
// Patch GZ: (40,20)->(cols,rows) // Patch GZ: (40,20)->(cols,rows)
sPainter.sSphereMap(radius,cols,rows,texFov,1); sPainter.sSphereMap(radius,cols,rows,texFov,1);
glDisable(GL_CULL_FACE); glDisable(GL_CULL_FACE);
} }
skipping to change at line 541 skipping to change at line 548
if(!validLandscape) return; if(!validLandscape) return;
if(!landFader.getInterstate()) return; if(!landFader.getInterstate()) return;
StelProjector::ModelViewTranformP transfo = core->getAltAzModelViewT ransform(StelCore::RefractionOff); StelProjector::ModelViewTranformP transfo = core->getAltAzModelViewT ransform(StelCore::RefractionOff);
transfo->combine(Mat4d::zrotation(-(angleRotateZ+(angleRotateZOffset *M_PI/180.)))); transfo->combine(Mat4d::zrotation(-(angleRotateZ+(angleRotateZOffset *M_PI/180.))));
const StelProjectorP prj = core->getProjection(transfo); const StelProjectorP prj = core->getProjection(transfo);
StelPainter sPainter(prj); StelPainter sPainter(prj);
// Normal transparency mode // Normal transparency mode
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
float nightModeFilter = StelApp::getInstance().getVisionModeNight() if (StelApp::getInstance().getVisionModeNight())
? 0. : 1.; sPainter.setColor(skyBrightness*nightBrightness, 0.0, 0.0, l
sPainter.setColor(skyBrightness, skyBrightness*nightModeFilter, skyB andFader.getInterstate());
rightness*nightModeFilter, landFader.getInterstate()); else
sPainter.setColor(skyBrightness, skyBrightness, skyBrightnes
s, landFader.getInterstate());
glEnable(GL_CULL_FACE); glEnable(GL_CULL_FACE);
sPainter.enableTexture2d(true); sPainter.enableTexture2d(true);
glEnable(GL_BLEND); glEnable(GL_BLEND);
mapTex->bind(); mapTex->bind();
// TODO: verify that this works correctly for custom projections // TODO: verify that this works correctly for custom projections
// seam is at East // seam is at East
//sPainter.sSphere(radius, 1.0, 40, 20, 1, true); //sPainter.sSphere(radius, 1.0, 40, 20, 1, true);
// GZ: Want better angle resolution, optional! // GZ: Want better angle resolution, optional!
 End of changes. 5 change blocks. 
17 lines changed or deleted 26 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/