Skip to content

Commit

Permalink
Fix landscape transparency issue (Fix #3512)
Browse files Browse the repository at this point in the history
- a wrong signal was triggered
  • Loading branch information
gzotti committed Mar 3, 2024
1 parent 06d9f6f commit 94d8e15
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 6 additions & 4 deletions src/core/modules/LandscapeMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -647,10 +647,7 @@ void LandscapeMgr::update(double deltaTime)
// If we have no atmosphere, we can assume windows and panels on spaceships etc. are switched on whenever the sun does not shine, i.e. when sun is blocked by landscape.
lightscapeBrightness= static_cast<double>(landscape->getOpacity(sunPos));
}

landscape->setBrightness(landscapeBrightness, lightscapeBrightness);
if (getFlagLandscapeUseTransparency())
landscape->setTransparency(landscapeTransparency);

messageFader.update(static_cast<int>(deltaTime*1000));
}
Expand Down Expand Up @@ -680,8 +677,13 @@ void LandscapeMgr::draw(StelCore* core)
}

// Draw the landscape
landscape->setTransparency( getFlagLandscapeUseTransparency() ? landscapeTransparency : 0.0);

if (oldLandscape)
{
oldLandscape->setTransparency( getFlagLandscapeUseTransparency() ? landscapeTransparency : 0.0);
oldLandscape->draw(core, flagPolyLineDisplayedOnly);
}
landscape->draw(core, flagPolyLineDisplayedOnly);

// Draw the cardinal points
Expand Down Expand Up @@ -1261,7 +1263,7 @@ bool LandscapeMgr::getFlagIllumination() const
void LandscapeMgr::setLandscapeTransparency(const double f)
{
landscapeTransparency = f;
emit landscapeDisplayedChanged(f);
emit landscapeTransparencyChanged(f);
}

double LandscapeMgr::getLandscapeTransparency() const
Expand Down
2 changes: 0 additions & 2 deletions src/core/modules/LandscapeMgr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -576,8 +576,6 @@ public slots:
flagLandscapeUseTransparency=b;
emit flagLandscapeUseTransparencyChanged(b);
}
if (!flagLandscapeUseTransparency) // equals to false
landscape->setTransparency(0.0);
}

/*
Expand Down

0 comments on commit 94d8e15

Please sign in to comment.