aboutsummaryrefslogtreecommitdiff
path: root/src/game.cpp
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/game.cpp
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/game.cpp')
-rw-r--r--src/game.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/game.cpp b/src/game.cpp
index ba6530d80..7dd9c942d 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -3255,6 +3255,8 @@ void Game::processClientEvents(CameraOrientation *cam)
case CE_SET_SKY:
sky->setVisible(false);
+ // Whether clouds are visible in front of a custom skybox
+ sky->setCloudsEnabled(event.set_sky.clouds);
if (skybox) {
skybox->remove();
@@ -3264,6 +3266,7 @@ void Game::processClientEvents(CameraOrientation *cam)
// Handle according to type
if (*event.set_sky.type == "regular") {
sky->setVisible(true);
+ sky->setCloudsEnabled(true);
} else if (*event.set_sky.type == "skybox" &&
event.set_sky.params->size() == 6) {
sky->setFallbackBgColor(*event.set_sky.bgcolor);