From 9ff38bdf7f13d293471310a79148c34cbd0748d7 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Tue, 29 Jul 2025 20:35:59 +0200 Subject: [PATCH] Sky: Get custom sun and moon tinting to work again This fixes a regression introduced by commit 58ccf0b. --- src/client/sky.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/client/sky.cpp b/src/client/sky.cpp index ee3172c10..7dde1bb0d 100644 --- a/src/client/sky.cpp +++ b/src/client/sky.cpp @@ -711,6 +711,7 @@ static void getTextureAsImage(video::IImage *&dst, const std::string &name, ITex dst = nullptr; } if (tsrc->isKnownSourceImage(name)) { + infostream << "Sky: loading image " << name << std::endl; auto *texture = tsrc->getTexture(name); assert(texture); auto *driver = RenderingEngine::get_video_driver(); @@ -726,7 +727,7 @@ void Sky::setSunTexture(const std::string &sun_texture, { // Ignore matching textures (with modifiers) entirely, // 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; getTextureAsImage(m_sun_tonemap, sun_tonemap, tsrc); } @@ -756,7 +757,7 @@ void Sky::setSunriseTexture(const std::string &sunglow_texture, ITextureSource* tsrc) { // Ignore matching textures (with modifiers) entirely. - if (m_sun_params.sunrise == sunglow_texture) + if (m_sun_params.sunrise == sunglow_texture && !m_first_update) return; m_sun_params.sunrise = sunglow_texture; 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, // 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; getTextureAsImage(m_moon_tonemap, moon_tonemap, tsrc); }