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

Add player:set_sky() with simple skybox support

This commit is contained in:
Perttu Ahola 2013-05-02 23:52:50 +03:00 committed by sapier
parent e258675eab
commit 86a6cca3cf
11 changed files with 181 additions and 5 deletions

View file

@ -2026,6 +2026,25 @@ void Client::ProcessData(u8 *data, u32 datasize, u16 sender_peer_id)
((LocalPlayer *) player)->hotbar_selected_image = value;
}
}
else if(command == TOCLIENT_SET_SKY)
{
std::string datastring((char *)&data[2], datasize - 2);
std::istringstream is(datastring, std::ios_base::binary);
video::SColor *bgcolor = new video::SColor(readARGB8(is));
std::string *type = new std::string(deSerializeString(is));
u16 count = readU16(is);
std::vector<std::string> *params = new std::vector<std::string>;
for(size_t i=0; i<count; i++)
params->push_back(deSerializeString(is));
ClientEvent event;
event.type = CE_SET_SKY;
event.set_sky.bgcolor = bgcolor;
event.set_sky.type = type;
event.set_sky.params = params;
m_client_event_queue.push_back(event);
}
else
{
infostream<<"Client: Ignoring unknown command "