mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-12 16:15:20 +02:00
Sky: Get custom sun and moon tinting to work again
This fixes a regression introduced by commit 58ccf0b
.
This commit is contained in:
@@ -711,6 +711,7 @@ static void getTextureAsImage(video::IImage *&dst, const std::string &name, ITex
|
|||||||
dst = nullptr;
|
dst = nullptr;
|
||||||
}
|
}
|
||||||
if (tsrc->isKnownSourceImage(name)) {
|
if (tsrc->isKnownSourceImage(name)) {
|
||||||
|
infostream << "Sky: loading image " << name << std::endl;
|
||||||
auto *texture = tsrc->getTexture(name);
|
auto *texture = tsrc->getTexture(name);
|
||||||
assert(texture);
|
assert(texture);
|
||||||
auto *driver = RenderingEngine::get_video_driver();
|
auto *driver = RenderingEngine::get_video_driver();
|
||||||
@@ -726,7 +727,7 @@ void Sky::setSunTexture(const std::string &sun_texture,
|
|||||||
{
|
{
|
||||||
// Ignore matching textures (with modifiers) entirely,
|
// Ignore matching textures (with modifiers) entirely,
|
||||||
// but lets at least update the tonemap before hand.
|
// but lets at least update the tonemap before hand.
|
||||||
if (m_sun_params.tonemap != sun_tonemap) {
|
if (m_sun_params.tonemap != sun_tonemap || m_first_update) {
|
||||||
m_sun_params.tonemap = sun_tonemap;
|
m_sun_params.tonemap = sun_tonemap;
|
||||||
getTextureAsImage(m_sun_tonemap, sun_tonemap, tsrc);
|
getTextureAsImage(m_sun_tonemap, sun_tonemap, tsrc);
|
||||||
}
|
}
|
||||||
@@ -756,7 +757,7 @@ void Sky::setSunriseTexture(const std::string &sunglow_texture,
|
|||||||
ITextureSource* tsrc)
|
ITextureSource* tsrc)
|
||||||
{
|
{
|
||||||
// Ignore matching textures (with modifiers) entirely.
|
// Ignore matching textures (with modifiers) entirely.
|
||||||
if (m_sun_params.sunrise == sunglow_texture)
|
if (m_sun_params.sunrise == sunglow_texture && !m_first_update)
|
||||||
return;
|
return;
|
||||||
m_sun_params.sunrise = sunglow_texture;
|
m_sun_params.sunrise = sunglow_texture;
|
||||||
m_materials[2].setTexture(0, tsrc->getTextureForMesh(
|
m_materials[2].setTexture(0, tsrc->getTextureForMesh(
|
||||||
@@ -769,7 +770,7 @@ void Sky::setMoonTexture(const std::string &moon_texture,
|
|||||||
{
|
{
|
||||||
// Ignore matching textures (with modifiers) entirely,
|
// Ignore matching textures (with modifiers) entirely,
|
||||||
// but lets at least update the tonemap before hand.
|
// but lets at least update the tonemap before hand.
|
||||||
if (m_moon_params.tonemap != moon_tonemap) {
|
if (m_moon_params.tonemap != moon_tonemap || m_first_update) {
|
||||||
m_moon_params.tonemap = moon_tonemap;
|
m_moon_params.tonemap = moon_tonemap;
|
||||||
getTextureAsImage(m_moon_tonemap, moon_tonemap, tsrc);
|
getTextureAsImage(m_moon_tonemap, moon_tonemap, tsrc);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user