diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-09-26 15:10:02 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-09-26 15:10:02 +0300 |
commit | 061d4b420206c67fb346d75fb6bcaf4aa8147ca8 (patch) | |
tree | 3f17c19e529baf3a6ae13479b7805fbe5cdf46ba /src/environment.cpp | |
parent | b9e680d06cf56b7c8b41a6b5626a3b94304adf42 (diff) | |
parent | 2ecd53ce09d8f20a06b057c24924a010fa2eefde (diff) | |
download | minetest-061d4b420206c67fb346d75fb6bcaf4aa8147ca8.tar.gz minetest-061d4b420206c67fb346d75fb6bcaf4aa8147ca8.tar.bz2 minetest-061d4b420206c67fb346d75fb6bcaf4aa8147ca8.zip |
Merge branch 'view_bobbing_and_vielded_tool'
Diffstat (limited to 'src/environment.cpp')
-rw-r--r-- | src/environment.cpp | 44 |
1 files changed, 11 insertions, 33 deletions
diff --git a/src/environment.cpp b/src/environment.cpp index 07c535b70..ff570554d 100644 --- a/src/environment.cpp +++ b/src/environment.cpp @@ -1687,18 +1687,19 @@ void ClientEnvironment::step(float dtime) // Move player->move(dtime, *m_map, 100*BS); - // Update lighting on remote players on client - u8 light = LIGHT_MAX; - try{ - // Get node at head - v3s16 p = player->getLightPosition(); - MapNode n = m_map->getNode(p); - light = n.getLightBlend(getDayNightRatio()); - } - catch(InvalidPositionException &e) {} - player->updateLight(light); } + // Update lighting on all players on client + u8 light = LIGHT_MAX; + try{ + // Get node at head + v3s16 p = player->getLightPosition(); + MapNode n = m_map->getNode(p); + light = n.getLightBlend(getDayNightRatio()); + } + catch(InvalidPositionException &e) {} + player->updateLight(light); + /* Add footsteps to grass */ @@ -1941,29 +1942,6 @@ ClientEnvEvent ClientEnvironment::getClientEvent() return m_client_event_queue.pop_front(); } -void ClientEnvironment::drawPostFx(video::IVideoDriver* driver, v3f camera_pos) -{ - /*LocalPlayer *player = getLocalPlayer(); - assert(player); - v3f pos_f = player->getPosition() + v3f(0,BS*1.625,0);*/ - v3f pos_f = camera_pos; - v3s16 p_nodes = floatToInt(pos_f, BS); - MapNode n = m_map->getNodeNoEx(p_nodes); - if(n.getContent() == CONTENT_WATER || n.getContent() == CONTENT_WATERSOURCE) - { - v2u32 ss = driver->getScreenSize(); - core::rect<s32> rect(0,0, ss.X, ss.Y); - driver->draw2DRectangle(video::SColor(64, 100, 100, 200), rect); - } - else if(content_features(n).solidness == 2 && - g_settings.getBool("free_move") == false) - { - v2u32 ss = driver->getScreenSize(); - core::rect<s32> rect(0,0, ss.X, ss.Y); - driver->draw2DRectangle(video::SColor(255, 0, 0, 0), rect); - } -} - #endif // #ifndef SERVER |