mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Add clouds API
This commit is contained in:
parent
95409da87d
commit
f1d7a26b7c
17 changed files with 357 additions and 50 deletions
|
@ -1168,6 +1168,34 @@ void Client::handleCommand_HudSetSky(NetworkPacket* pkt)
|
|||
m_client_event_queue.push(event);
|
||||
}
|
||||
|
||||
void Client::handleCommand_CloudParams(NetworkPacket* pkt)
|
||||
{
|
||||
f32 density;
|
||||
video::SColor color_bright;
|
||||
video::SColor color_ambient;
|
||||
f32 height;
|
||||
f32 thickness;
|
||||
v2f speed;
|
||||
|
||||
*pkt >> density >> color_bright >> color_ambient
|
||||
>> height >> thickness >> speed;
|
||||
|
||||
ClientEvent event;
|
||||
event.type = CE_CLOUD_PARAMS;
|
||||
event.cloud_params.density = density;
|
||||
// use the underlying u32 representation, because we can't
|
||||
// use struct members with constructors here, and this way
|
||||
// we avoid using new() and delete() for no good reason
|
||||
event.cloud_params.color_bright = color_bright.color;
|
||||
event.cloud_params.color_ambient = color_ambient.color;
|
||||
event.cloud_params.height = height;
|
||||
event.cloud_params.thickness = thickness;
|
||||
// same here: deconstruct to skip constructor
|
||||
event.cloud_params.speed_x = speed.X;
|
||||
event.cloud_params.speed_y = speed.Y;
|
||||
m_client_event_queue.push(event);
|
||||
}
|
||||
|
||||
void Client::handleCommand_OverrideDayNightRatio(NetworkPacket* pkt)
|
||||
{
|
||||
bool do_override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue