mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-05 19:31:04 +00:00
Allow fog color to be overriden properly (#14296)
This commit is contained in:
parent
a29d3cf074
commit
9e3a11534f
11 changed files with 96 additions and 84 deletions
|
@ -54,12 +54,12 @@ public:
|
|||
|
||||
float getBrightness() { return m_brightness; }
|
||||
|
||||
const video::SColor &getBgColor() const
|
||||
video::SColor getBgColor() const
|
||||
{
|
||||
return m_visible ? m_bgcolor : m_fallback_bg_color;
|
||||
}
|
||||
|
||||
const video::SColor &getSkyColor() const
|
||||
video::SColor getSkyColor() const
|
||||
{
|
||||
return m_visible ? m_skycolor : m_fallback_bg_color;
|
||||
}
|
||||
|
@ -90,6 +90,7 @@ public:
|
|||
const video::SColorf &getCloudColor() const { return m_cloudcolor_f; }
|
||||
|
||||
void setVisible(bool visible) { m_visible = visible; }
|
||||
|
||||
// Set only from set_sky API
|
||||
void setCloudsEnabled(bool clouds_enabled) { m_clouds_enabled = clouds_enabled; }
|
||||
void setFallbackBgColor(video::SColor fallback_bg_color)
|
||||
|
@ -111,17 +112,23 @@ public:
|
|||
const std::string &use_sun_tint);
|
||||
void setInClouds(bool clouds) { m_in_clouds = clouds; }
|
||||
void clearSkyboxTextures() { m_sky_params.textures.clear(); }
|
||||
void addTextureToSkybox(const std::string &texture, int material_id,
|
||||
void addTextureToSkybox(const std::string &texture, int material_id,
|
||||
ITextureSource *tsrc);
|
||||
const video::SColorf &getCurrentStarColor() const { return m_star_color; }
|
||||
|
||||
// Note: the Sky class doesn't use these values. It just stores them.
|
||||
void setFogDistance(s16 fog_distance) { m_sky_params.fog_distance = fog_distance; }
|
||||
s16 getFogDistance() const { return m_sky_params.fog_distance; }
|
||||
|
||||
void setFogStart(float fog_start) { m_sky_params.fog_start = fog_start; }
|
||||
float getFogStart() const { return m_sky_params.fog_start; }
|
||||
|
||||
void setVolumetricLightStrength(float volumetric_light_strength) { m_sky_params.volumetric_light_strength = volumetric_light_strength; }
|
||||
float getVolumetricLightStrength() const { return m_sky_params.volumetric_light_strength; }
|
||||
void setFogColor(video::SColor v) { m_sky_params.fog_color = v; }
|
||||
video::SColor getFogColor() const {
|
||||
if (m_sky_params.fog_color.getAlpha() > 0)
|
||||
return m_sky_params.fog_color;
|
||||
return getBgColor();
|
||||
}
|
||||
|
||||
private:
|
||||
aabb3f m_box;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue