summaryrefslogtreecommitdiff
path: root/src/sky.h
diff options
context:
space:
mode:
authorparamat <mat.gregory@virginmedia.com>2017-04-28 03:06:49 +0100
committerAuke Kok <sofar+github@foo-projects.org>2017-05-02 20:42:35 -0700
commitad9fcf859ec2347325830e09504ae96968b51ea8 (patch)
tree1f13dd4bdfe3f2aef666fce622634f1d0ee70e3f /src/sky.h
parentf9fdb48dc85e53253ef93972355d3c7bc9d0ffb0 (diff)
downloadminetest-ad9fcf859ec2347325830e09504ae96968b51ea8.tar.gz
minetest-ad9fcf859ec2347325830e09504ae96968b51ea8.tar.bz2
minetest-ad9fcf859ec2347325830e09504ae96968b51ea8.zip
Set sky API: Add bool for clouds in front of custom skybox
Default true. Add 'm_clouds_enabled' bool to sky.h, set from new bool in 'set sky' API. Make 'getCloudsVisible()' depend on 'm_clouds_enabled' instead of 'm_visible' (whether normal sky is visible).
Diffstat (limited to 'src/sky.h')
-rw-r--r--src/sky.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/sky.h b/src/sky.h
index 72cb2d581..c9678a80b 100644
--- a/src/sky.h
+++ b/src/sky.h
@@ -65,10 +65,12 @@ public:
return m_visible ? m_skycolor : m_fallback_bg_color;
}
- bool getCloudsVisible() { return m_clouds_visible && m_visible; }
+ bool getCloudsVisible() { return m_clouds_visible && m_clouds_enabled; }
const video::SColorf &getCloudColor() { 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(const video::SColor &fallback_bg_color)
{
m_fallback_bg_color = fallback_bg_color;
@@ -123,7 +125,8 @@ private:
bool m_sunlight_seen;
float m_brightness;
float m_cloud_brightness;
- bool m_clouds_visible;
+ bool m_clouds_visible; // Whether clouds are disabled due to player underground
+ bool m_clouds_enabled; // Initialised to true, reset only by set_sky API
bool m_directional_colored_fog;
video::SColorf m_bgcolor_bright_f;
video::SColorf m_skycolor_bright_f;