diff options
author | paramat <mat.gregory@virginmedia.com> | 2017-04-28 03:06:49 +0100 |
---|---|---|
committer | Auke Kok <sofar+github@foo-projects.org> | 2017-05-02 20:42:35 -0700 |
commit | ad9fcf859ec2347325830e09504ae96968b51ea8 (patch) | |
tree | 1f13dd4bdfe3f2aef666fce622634f1d0ee70e3f /src/sky.h | |
parent | f9fdb48dc85e53253ef93972355d3c7bc9d0ffb0 (diff) | |
download | hax-minetest-server-ad9fcf859ec2347325830e09504ae96968b51ea8.tar.gz hax-minetest-server-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 '')
-rw-r--r-- | src/sky.h | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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; |