1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

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).
This commit is contained in:
paramat 2017-04-28 03:06:49 +01:00 committed by Auke Kok
parent f9fdb48dc8
commit ad9fcf859e
12 changed files with 53 additions and 20 deletions

View file

@ -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);