diff options
author | Ben Deutsch <ben@bendeutsch.de> | 2017-03-17 10:39:47 +0100 |
---|---|---|
committer | paramat <mat.gregory@virginmedia.com> | 2017-04-30 00:06:13 +0100 |
commit | f1d7a26b7c341b468f34325cec5c3d495f175a8f (patch) | |
tree | 9926a816208ec7b9384ba718be739953d9d3d773 /src/server.cpp | |
parent | 95409da87d009c352f27c737621972c2225796c9 (diff) | |
download | minetest-f1d7a26b7c341b468f34325cec5c3d495f175a8f.tar.gz minetest-f1d7a26b7c341b468f34325cec5c3d495f175a8f.tar.bz2 minetest-f1d7a26b7c341b468f34325cec5c3d495f175a8f.zip |
Add clouds API
Diffstat (limited to 'src/server.cpp')
-rw-r--r-- | src/server.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/server.cpp b/src/server.cpp index 2edf83947..9ef69cb37 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -1882,6 +1882,20 @@ void Server::SendSetSky(u16 peer_id, const video::SColor &bgcolor, Send(&pkt); } +void Server::SendCloudParams(u16 peer_id, float density, + const video::SColor &color_bright, + const video::SColor &color_ambient, + float height, + float thickness, + const v2f &speed) +{ + NetworkPacket pkt(TOCLIENT_CLOUD_PARAMS, 0, peer_id); + pkt << density << color_bright << color_ambient + << height << thickness << speed; + + Send(&pkt); +} + void Server::SendOverrideDayNightRatio(u16 peer_id, bool do_override, float ratio) { @@ -3196,6 +3210,22 @@ bool Server::setSky(RemotePlayer *player, const video::SColor &bgcolor, return true; } +bool Server::setClouds(RemotePlayer *player, float density, + const video::SColor &color_bright, + const video::SColor &color_ambient, + float height, + float thickness, + const v2f &speed) +{ + if (!player) + return false; + + SendCloudParams(player->peer_id, density, + color_bright, color_ambient, height, + thickness, speed); + return true; +} + bool Server::overrideDayNightRatio(RemotePlayer *player, bool do_override, float ratio) { |