Landscape.cpp   Landscape.cpp 
/* /*
* Stellarium * Stellarium
* Copyright (C) 2003 Fabien Chereau * Copyright (C) 2003 Fabien Chereau
* Copyright (C) 2011 Bogdan Marinov
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 * as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. * of the License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 90 skipping to change at line 91
location.longitude = StelUtils::getDecAngle(landscapeIni.val ue("location/longitude").toString())*180./M_PI; location.longitude = StelUtils::getDecAngle(landscapeIni.val ue("location/longitude").toString())*180./M_PI;
if (landscapeIni.contains("location/country")) if (landscapeIni.contains("location/country"))
location.country = landscapeIni.value("location/country").to String(); location.country = landscapeIni.value("location/country").to String();
if (landscapeIni.contains("location/state")) if (landscapeIni.contains("location/state"))
location.state = landscapeIni.value("location/state").toStri ng(); location.state = landscapeIni.value("location/state").toStri ng();
if (landscapeIni.contains("location/name")) if (landscapeIni.contains("location/name"))
location.name = landscapeIni.value("location/name").toString (); location.name = landscapeIni.value("location/name").toString ();
else else
location.name = name; location.name = name;
location.landscapeKey = name; location.landscapeKey = name;
// New entries by GZ.
if (landscapeIni.contains("location/light_pollution"))
defaultBortleIndex = landscapeIni.value("location/light_poll
ution").toInt();
else defaultBortleIndex=-1; // mark "invalid/no change".
if (defaultBortleIndex<=0) defaultBortleIndex=-1; // also allow neg.
values in ini file, signalling "no change".
if (defaultBortleIndex>9) defaultBortleIndex=9; // correct bad value
s.
if (landscapeIni.contains("location/display_fog"))
defaultFogSetting = landscapeIni.value("location/display_fog
").toInt();
else defaultFogSetting=-1;
if (landscapeIni.contains("location/atmospheric_extinction_coefficie
nt"))
defaultExtinctionCoefficient = landscapeIni.value("location/
atmospheric_extinction_coefficient").toDouble();
else defaultExtinctionCoefficient=-1.0;
if (landscapeIni.contains("location/atmospheric_temperature"))
defaultTemperature = landscapeIni.value("location/atmospheri
c_temperature").toDouble();
else defaultTemperature=-1000.0;
if (landscapeIni.contains("location/atmospheric_pressure"))
defaultPressure = landscapeIni.value("location/atmospheric_p
ressure").toDouble();
else defaultPressure=-2.0; // "no change"
} }
#include <iostream> #include <iostream>
const QString Landscape::getTexturePath(const QString& basename, const QStr ing& landscapeId) const QString Landscape::getTexturePath(const QString& basename, const QStr ing& landscapeId)
{ {
// look in the landscape directory first, and if not found default t o global textures directory // look in the landscape directory first, and if not found default t o global textures directory
QString path; QString path;
try try
{ {
path = StelFileMgr::findFile("landscapes/" + landscapeId + " /" + basename); path = StelFileMgr::findFile("landscapes/" + landscapeId + " /" + basename);
skipping to change at line 142 skipping to change at line 161
sideTexs = NULL; sideTexs = NULL;
} }
if (sides) delete [] sides; if (sides) delete [] sides;
} }
void LandscapeOldStyle::load(const QSettings& landscapeIni, const QString& landscapeId) void LandscapeOldStyle::load(const QSettings& landscapeIni, const QString& landscapeId)
{ {
// TODO: put values into hash and call create method to consolidate code // TODO: put values into hash and call create method to consolidate code
loadCommon(landscapeIni, landscapeId); loadCommon(landscapeIni, landscapeId);
// Patch GZ:
if (landscapeIni.contains("landscape/tesselate_rows")) if (landscapeIni.contains("landscape/tesselate_rows"))
rows = landscapeIni.value("landscape/tesselate_rows").toInt( ); rows = landscapeIni.value("landscape/tesselate_rows").toInt( );
else rows=8; else rows=8;
if (landscapeIni.contains("landscape/tesselate_cols")) if (landscapeIni.contains("landscape/tesselate_cols"))
cols = landscapeIni.value("landscape/tesselate_cols").toInt( ); cols = landscapeIni.value("landscape/tesselate_cols").toInt( );
else cols=16; else cols=16;
QString type = landscapeIni.value("landscape/type").toString(); QString type = landscapeIni.value("landscape/type").toString();
if(type != "old_style") if(type != "old_style")
{ {
qWarning() << "Landscape type mismatch for landscape " << la ndscapeId qWarning() << "Landscape type mismatch for landscape " << la ndscapeId
<< ", expected old_style, found " << type << ". No landscape in use."; << ", expected old_style, found " << type << ". No landscape in use.";
validLandscape = 0; validLandscape = 0;
return; return;
} }
// Load sides textures // Load sides textures
nbSideTexs = landscapeIni.value("landscape/nbsidetex", 0).toInt(); nbSideTexs = landscapeIni.value("landscape/nbsidetex", 0).toInt();
sideTexs = new StelTextureSP[nbSideTexs]; sideTexs = new StelTextureSP[nbSideTexs];
for (int i=0;i<nbSideTexs;++i) for (int i=0; i<nbSideTexs; ++i)
{ {
QString tmp = QString("tex%1").arg(i); QString textureKey = QString("landscape/tex%1").arg(i);
sideTexs[i] = StelApp::getInstance().getTextureManager().cre QString textureName = landscapeIni.value(textureKey).toStrin
ateTexture(getTexturePath(landscapeIni.value(QString("landscape/")+tmp).toS g();
tring(), landscapeId)); const QString texturePath = getTexturePath(textureName, land
scapeId);
sideTexs[i] = StelApp::getInstance().getTextureManager().cre
ateTexture(texturePath);
} }
QMap<int, int> texToSide; QMap<int, int> texToSide;
// Init sides parameters // Init sides parameters
nbSide = landscapeIni.value("landscape/nbside", 0).toInt(); nbSide = landscapeIni.value("landscape/nbside", 0).toInt();
sides = new landscapeTexCoord[nbSide]; sides = new landscapeTexCoord[nbSide];
QString s;
int texnum; int texnum;
float a,b,c,d;
for (int i=0;i<nbSide;++i) for (int i=0;i<nbSide;++i)
{ {
QString tmp = QString("side%1").arg(i); QString key = QString("landscape/side%1").arg(i);
s = landscapeIni.value(QString("landscape/")+tmp).toString() QString description = landscapeIni.value(key).toString();
; //sscanf(s.toLocal8Bit(),"tex%d:%f:%f:%f:%f",&texnum,&a,&b,&
sscanf(s.toLocal8Bit(),"tex%d:%f:%f:%f:%f",&texnum,&a,&b,&c, c,&d);
&d); QStringList parameters = description.split(':');
//TODO: How should be handled an invalid texture description
?
QString textureName = parameters.value(0);
texnum = textureName.right(textureName.length() - 3).toInt()
;
sides[i].tex = sideTexs[texnum]; sides[i].tex = sideTexs[texnum];
sides[i].texCoords[0] = a; sides[i].texCoords[0] = parameters.at(1).toFloat();
sides[i].texCoords[1] = b; sides[i].texCoords[1] = parameters.at(2).toFloat();
sides[i].texCoords[2] = c; sides[i].texCoords[2] = parameters.at(3).toFloat();
sides[i].texCoords[3] = d; sides[i].texCoords[3] = parameters.at(4).toFloat();
//qDebug() << i << texnum << sides[i].texCoords[0] << sides[
i].texCoords[1] << sides[i].texCoords[2] << sides[i].texCoords[3];
// Prior to precomputing the sides, we used to match E to si de0 // Prior to precomputing the sides, we used to match E to si de0
// in r4598 the precomputing was put in place and caused a p roblem for // in r4598 the precomputing was put in place and caused a p roblem for
// old_style landscapes which had a z rotation on the side t extures // old_style landscapes which had a z rotation on the side t extures
// and where side0 did not map to tex0 // and where side0 did not map to tex0
// texToSide is a nasty hack to replace the old behaviour // texToSide is a nasty hack to replace the old behaviour
texToSide[i] = texnum; texToSide[i] = texnum;
} }
nbDecorRepeat = landscapeIni.value("landscape/nb_decor_repeat", 1).t oInt(); nbDecorRepeat = landscapeIni.value("landscape/nb_decor_repeat", 1).t oInt();
groundTex = StelApp::getInstance().getTextureManager().createTexture QString groundTexName = landscapeIni.value("landscape/groundtex").to
(getTexturePath(landscapeIni.value("landscape/groundtex").toString(), lands String();
capeId), StelTexture::StelTextureParams(true)); QString groundTexPath = getTexturePath(groundTexName, landscapeId);
s = landscapeIni.value("landscape/ground").toString(); groundTex = StelApp::getInstance().getTextureManager().createTexture
sscanf(s.toLocal8Bit(),"groundtex:%f:%f:%f:%f",&a,&b,&c,&d); (groundTexPath, StelTexture::StelTextureParams(true));
QString description = landscapeIni.value("landscape/ground").toStrin
g();
//sscanf(description.toLocal8Bit(),"groundtex:%f:%f:%f:%f",&a,&b,&c,
&d);
QStringList parameters = description.split(':');
groundTexCoord.tex = groundTex; groundTexCoord.tex = groundTex;
groundTexCoord.texCoords[0] = a; groundTexCoord.texCoords[0] = parameters.at(1).toFloat();
groundTexCoord.texCoords[1] = b; groundTexCoord.texCoords[1] = parameters.at(2).toFloat();
groundTexCoord.texCoords[2] = c; groundTexCoord.texCoords[2] = parameters.at(3).toFloat();
groundTexCoord.texCoords[3] = d; groundTexCoord.texCoords[3] = parameters.at(4).toFloat();
fogTex = StelApp::getInstance().getTextureManager().createTexture(ge QString fogTexName = landscapeIni.value("landscape/fogtex").toString
tTexturePath(landscapeIni.value("landscape/fogtex").toString(), landscapeId ();
), StelTexture::StelTextureParams(true, GL_LINEAR, GL_REPEAT)); QString fogTexPath = getTexturePath(fogTexName, landscapeId);
s = landscapeIni.value("landscape/fog").toString(); fogTex = StelApp::getInstance().getTextureManager().createTexture(fo
sscanf(s.toLocal8Bit(),"fogtex:%f:%f:%f:%f",&a,&b,&c,&d); gTexPath, StelTexture::StelTextureParams(true, GL_LINEAR, GL_REPEAT));
description = landscapeIni.value("landscape/fog").toString();
//sscanf(description.toLocal8Bit(),"fogtex:%f:%f:%f:%f",&a,&b,&c,&d)
;
parameters = description.split(':');
fogTexCoord.tex = fogTex; fogTexCoord.tex = fogTex;
fogTexCoord.texCoords[0] = a; fogTexCoord.texCoords[0] = parameters.at(1).toFloat();
fogTexCoord.texCoords[1] = b; fogTexCoord.texCoords[1] = parameters.at(2).toFloat();
fogTexCoord.texCoords[2] = c; fogTexCoord.texCoords[2] = parameters.at(3).toFloat();
fogTexCoord.texCoords[3] = d; fogTexCoord.texCoords[3] = parameters.at(4).toFloat();
fogAltAngle = landscapeIni.value("landscape/fog_alt_angle", 0 .).toFloat(); fogAltAngle = landscapeIni.value("landscape/fog_alt_angle", 0 .).toFloat();
fogAngleShift = landscapeIni.value("landscape/fog_angle_shift", 0.).toFloat(); fogAngleShift = landscapeIni.value("landscape/fog_angle_shift", 0.).toFloat();
decorAltAngle = landscapeIni.value("landscape/decor_alt_angle", 0.).toFloat(); decorAltAngle = landscapeIni.value("landscape/decor_alt_angle", 0.).toFloat();
decorAngleShift = landscapeIni.value("landscape/decor_angle_shift ", 0.).toFloat(); decorAngleShift = landscapeIni.value("landscape/decor_angle_shift ", 0.).toFloat();
angleRotateZ = landscapeIni.value("landscape/decor_angle_rotat ez", 0.).toFloat(); angleRotateZ = landscapeIni.value("landscape/decor_angle_rotat ez", 0.).toFloat();
groundAngleShift = landscapeIni.value("landscape/ground_angle_shif t", 0.).toFloat(); groundAngleShift = landscapeIni.value("landscape/ground_angle_shif t", 0.).toFloat();
groundAngleRotateZ = landscapeIni.value("landscape/ground_angle_rota tez", 0.).toFloat(); groundAngleRotateZ = landscapeIni.value("landscape/ground_angle_rota tez", 0.).toFloat();
drawGroundFirst = landscapeIni.value("landscape/draw_ground_first ", 0).toInt(); drawGroundFirst = landscapeIni.value("landscape/draw_ground_first ", 0).toInt();
tanMode = landscapeIni.value("landscape/tan_mode", false) .toBool(); tanMode = landscapeIni.value("landscape/tan_mode", false) .toBool();
skipping to change at line 319 skipping to change at line 349
x0 = x1; x0 = x1;
tx0 = tx1; tx0 = tx1;
} }
precomputedSides.append(precompSide); precomputedSides.append(precompSide);
} }
} }
} }
void LandscapeOldStyle::draw(StelCore* core) void LandscapeOldStyle::draw(StelCore* core)
{ {
StelPainter painter(core->getProjection(StelCore::FrameAltAz)); StelPainter painter(core->getProjection(StelCore::FrameAltAz, StelCo re::RefractionOff));
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND); glEnable(GL_BLEND);
painter.enableTexture2d(true); painter.enableTexture2d(true);
glEnable(GL_CULL_FACE); glEnable(GL_CULL_FACE);
if (!validLandscape) if (!validLandscape)
return; return;
if (drawGroundFirst) if (drawGroundFirst)
drawGround(core, painter); drawGround(core, painter);
drawDecor(core, painter); drawDecor(core, painter);
skipping to change at line 342 skipping to change at line 372
drawFog(core, painter); drawFog(core, painter);
} }
// Draw the horizon fog // Draw the horizon fog
void LandscapeOldStyle::drawFog(StelCore* core, StelPainter& sPainter) cons t void LandscapeOldStyle::drawFog(StelCore* core, StelPainter& sPainter) cons t
{ {
if (!fogFader.getInterstate()) if (!fogFader.getInterstate())
return; return;
const float vpos = (tanMode||calibrated) ? radius*std::tan(fogAngleS hift*M_PI/180.) : radius*std::sin(fogAngleShift*M_PI/180.); const float vpos = (tanMode||calibrated) ? radius*std::tan(fogAngleS hift*M_PI/180.) : radius*std::sin(fogAngleShift*M_PI/180.);
sPainter.setProjector(core->getProjection(core->getNavigator()->getA StelProjector::ModelViewTranformP transfo = core->getAltAzModelViewT
ltAzModelViewMat() * Mat4d::translation(Vec3d(0.,0.,vpos)))); ransform(StelCore::RefractionOff);
transfo->combine(Mat4d::translation(Vec3d(0.,0.,vpos)));
sPainter.setProjector(core->getProjection(transfo));
glBlendFunc(GL_ONE, GL_ONE); glBlendFunc(GL_ONE, GL_ONE);
const float nightModeFilter = StelApp::getInstance().getVisionModeNi ght() ? 0.f : 1.f; const float nightModeFilter = StelApp::getInstance().getVisionModeNi ght() ? 0.f : 1.f;
sPainter.setColor(fogFader.getInterstate()*(0.1f+0.1f*skyBrightness) , sPainter.setColor(fogFader.getInterstate()*(0.1f+0.1f*skyBrightness) ,
fogFader.getInterstate()*(0.1f+0.1f*skyBrightness) *nightModeFilter, fogFader.getInterstate()*(0.1f+0.1f*skyBrightness) *nightModeFilter,
fogFader.getInterstate()*(0.1f+0.1f*skyBrightness) *nightModeFilter); fogFader.getInterstate()*(0.1f+0.1f*skyBrightness) *nightModeFilter);
fogTex->bind(); fogTex->bind();
const float height = (tanMode||calibrated) ? radius*std::tan(fogAltA ngle*M_PI/180.) : radius*std::sin(fogAltAngle*M_PI/180.); const float height = (tanMode||calibrated) ? radius*std::tan(fogAltA ngle*M_PI/180.) : radius*std::sin(fogAltAngle*M_PI/180.);
sPainter.sCylinder(radius, height, 64, 1); sPainter.sCylinder(radius, height, 64, 1);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
} }
skipping to change at line 365 skipping to change at line 397
void LandscapeOldStyle::drawDecor(StelCore* core, StelPainter& sPainter) co nst void LandscapeOldStyle::drawDecor(StelCore* core, StelPainter& sPainter) co nst
{ {
// Patched by Georg Zotti: I located an undocumented switch tan_mode , maybe tan_mode=true means cylindrical panorama projection. // Patched by Georg Zotti: I located an undocumented switch tan_mode , maybe tan_mode=true means cylindrical panorama projection.
// anyway, the old code makes unfortunately no sense. // anyway, the old code makes unfortunately no sense.
// I added a switch "calibrated" for the ini file. If true, it works as this landscape apparently was originally intended. // I added a switch "calibrated" for the ini file. If true, it works as this landscape apparently was originally intended.
// So I corrected the texture coordinates so that decorAltAngle is t he total angle, decorAngleShift the lower angle, // So I corrected the texture coordinates so that decorAltAngle is t he total angle, decorAngleShift the lower angle,
// 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
Mat4d mat = core->getNavigator()->getAltAzModelViewMat() * Mat4d::zr StelProjector::ModelViewTranformP transfo = core->getAltAzModelViewT
otation(-angleRotateZOffset*M_PI/180.f); ransform(StelCore::RefractionOff);
sPainter.setProjector(core->getProjection(mat)); transfo->combine(Mat4d::zrotation(-angleRotateZOffset*M_PI/180.f));
sPainter.setProjector(core->getProjection(transfo));
if (!landFader.getInterstate()) if (!landFader.getInterstate())
return; return;
const float nightModeFilter = StelApp::getInstance().getVisionModeNi ght() ? 0.f : 1.f; const float nightModeFilter = StelApp::getInstance().getVisionModeNi ght() ? 0.f : 1.f;
sPainter.setColor(skyBrightness, skyBrightness*nightModeFilter, skyB rightness*nightModeFilter, landFader.getInterstate()); sPainter.setColor(skyBrightness, skyBrightness*nightModeFilter, skyB rightness*nightModeFilter, 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 StelNavigator* nav = core->getNavigator();
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.);
Mat4d mat = nav->getAltAzModelViewMat() * Mat4d::zrotation((groundAn StelProjector::ModelViewTranformP transfo = core->getAltAzModelViewT
gleRotateZ-angleRotateZOffset)*M_PI/180.f) * Mat4d::translation(Vec3d(0,0,v ransform(StelCore::RefractionOff);
shift)); transfo->combine(Mat4d::zrotation((groundAngleRotateZ-angleRotateZOf
sPainter.setProjector(core->getProjection(mat)); fset)*M_PI/180.f) * Mat4d::translation(Vec3d(0,0,vshift)));
sPainter.setProjector(core->getProjection(transfo));
float nightModeFilter = StelApp::getInstance().getVisionModeNight() ? 0.f : 1.f; float nightModeFilter = StelApp::getInstance().getVisionModeNight() ? 0.f : 1.f;
sPainter.setColor(skyBrightness, skyBrightness*nightModeFilter, skyB rightness*nightModeFilter, landFader.getInterstate()); sPainter.setColor(skyBrightness, skyBrightness*nightModeFilter, skyB rightness*nightModeFilter, 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)
{} {}
skipping to change at line 437 skipping to change at line 472
mapTex = StelApp::getInstance().getTextureManager().createTexture(_m aptex, StelTexture::StelTextureParams(true)); mapTex = StelApp::getInstance().getTextureManager().createTexture(_m aptex, StelTexture::StelTextureParams(true));
texFov = atexturefov*M_PI/180.f; texFov = atexturefov*M_PI/180.f;
angleRotateZ = aangleRotateZ*M_PI/180.f; angleRotateZ = aangleRotateZ*M_PI/180.f;
} }
void LandscapeFisheye::draw(StelCore* core) void LandscapeFisheye::draw(StelCore* core)
{ {
if(!validLandscape) return; if(!validLandscape) return;
if(!landFader.getInterstate()) return; if(!landFader.getInterstate()) return;
StelNavigator* nav = core->getNavigator(); StelProjector::ModelViewTranformP transfo = core->getAltAzModelViewT
const StelProjectorP prj = core->getProjection(nav->getAltAzModelVie ransform(StelCore::RefractionOff);
wMat() * Mat4d::zrotation(-(angleRotateZ+(angleRotateZOffset*M_PI/180.)))); transfo->combine(Mat4d::zrotation(-(angleRotateZ+(angleRotateZOffset
*M_PI/180.))));
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() ? 0.f : 1.f; float nightModeFilter = StelApp::getInstance().getVisionModeNight() ? 0.f : 1.f;
sPainter.setColor(skyBrightness, skyBrightness*nightModeFilter, skyB rightness*nightModeFilter, landFader.getInterstate()); sPainter.setColor(skyBrightness, skyBrightness*nightModeFilter, skyB rightness*nightModeFilter, landFader.getInterstate());
glEnable(GL_CULL_FACE); glEnable(GL_CULL_FACE);
sPainter.enableTexture2d(true); sPainter.enableTexture2d(true);
glEnable(GL_BLEND); glEnable(GL_BLEND);
skipping to change at line 498 skipping to change at line 534
name = _name; name = _name;
mapTex = StelApp::getInstance().getTextureManager().createTexture(_m aptex, StelTexture::StelTextureParams(true)); mapTex = StelApp::getInstance().getTextureManager().createTexture(_m aptex, StelTexture::StelTextureParams(true));
angleRotateZ = _angleRotateZ*M_PI/180.f; angleRotateZ = _angleRotateZ*M_PI/180.f;
} }
void LandscapeSpherical::draw(StelCore* core) void LandscapeSpherical::draw(StelCore* core)
{ {
if(!validLandscape) return; if(!validLandscape) return;
if(!landFader.getInterstate()) return; if(!landFader.getInterstate()) return;
StelNavigator* nav = core->getNavigator(); StelProjector::ModelViewTranformP transfo = core->getAltAzModelViewT
const StelProjectorP prj = core->getProjection(nav->getAltAzModelVie ransform(StelCore::RefractionOff);
wMat() * Mat4d::zrotation(-(angleRotateZ+(angleRotateZOffset*M_PI/180.)))); transfo->combine(Mat4d::zrotation(-(angleRotateZ+(angleRotateZOffset
*M_PI/180.))));
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() ? 0. : 1.; float nightModeFilter = StelApp::getInstance().getVisionModeNight() ? 0. : 1.;
sPainter.setColor(skyBrightness, skyBrightness*nightModeFilter, skyB rightness*nightModeFilter, landFader.getInterstate()); sPainter.setColor(skyBrightness, skyBrightness*nightModeFilter, skyB rightness*nightModeFilter, landFader.getInterstate());
glEnable(GL_CULL_FACE); glEnable(GL_CULL_FACE);
sPainter.enableTexture2d(true); sPainter.enableTexture2d(true);
glEnable(GL_BLEND); glEnable(GL_BLEND);
 End of changes. 19 change blocks. 
53 lines changed or deleted 106 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/