diff options
author | Perttu Ahola <celeron55@gmail.com> | 2013-05-02 23:52:50 +0300 |
---|---|---|
committer | sapier <Sapier at GMX dot net> | 2014-02-01 18:34:26 +0100 |
commit | 86a6cca3cf641fc2c88184ad26d2be3d7e7460f7 (patch) | |
tree | 25406b5df8244667ae3c494eaf3f945be1d0ae2b /src/client.cpp | |
parent | e258675eabc874d31bc9c6cf49e4bbc1f7f3f417 (diff) | |
download | minetest-86a6cca3cf641fc2c88184ad26d2be3d7e7460f7.tar.gz minetest-86a6cca3cf641fc2c88184ad26d2be3d7e7460f7.tar.bz2 minetest-86a6cca3cf641fc2c88184ad26d2be3d7e7460f7.zip |
Add player:set_sky() with simple skybox support
Diffstat (limited to 'src/client.cpp')
-rw-r--r-- | src/client.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/client.cpp b/src/client.cpp index cc1ec2a98..48b00377f 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -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 " |