1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +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

@ -1871,7 +1871,8 @@ void Server::SendHUDSetParam(u16 peer_id, u16 param, const std::string &value)
}
void Server::SendSetSky(u16 peer_id, const video::SColor &bgcolor,
const std::string &type, const std::vector<std::string> &params)
const std::string &type, const std::vector<std::string> &params,
bool &clouds)
{
NetworkPacket pkt(TOCLIENT_SET_SKY, 0, peer_id);
pkt << bgcolor << type << (u16) params.size();
@ -1879,6 +1880,8 @@ void Server::SendSetSky(u16 peer_id, const video::SColor &bgcolor,
for(size_t i=0; i<params.size(); i++)
pkt << params[i];
pkt << clouds;
Send(&pkt);
}
@ -3254,13 +3257,14 @@ bool Server::setPlayerEyeOffset(RemotePlayer *player, v3f first, v3f third)
}
bool Server::setSky(RemotePlayer *player, const video::SColor &bgcolor,
const std::string &type, const std::vector<std::string> &params)
const std::string &type, const std::vector<std::string> &params,
bool &clouds)
{
if (!player)
return false;
player->setSky(bgcolor, type, params);
SendSetSky(player->peer_id, bgcolor, type, params);
player->setSky(bgcolor, type, params, clouds);
SendSetSky(player->peer_id, bgcolor, type, params, clouds);
return true;
}