aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2014-07-06 21:57:12 +0300
committerPerttu Ahola <celeron55@gmail.com>2014-07-06 22:01:03 +0300
commit9b44bbd0a6236019b0c4f32156baa513f9674431 (patch)
tree4d3b9d9e0f9f4c5a7dc5882a2e95c50d99bde282 /src
parenteadde1e74113ee175708795fc24f8f5d1c746c1d (diff)
downloadminetest-9b44bbd0a6236019b0c4f32156baa513f9674431.tar.gz
minetest-9b44bbd0a6236019b0c4f32156baa513f9674431.tar.bz2
minetest-9b44bbd0a6236019b0c4f32156baa513f9674431.zip
Fix non-smooth non-shader node shading (Fixes #1436, regression by commit a0f78659f31abd)
Diffstat (limited to 'src')
-rw-r--r--src/mapblock_mesh.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mapblock_mesh.cpp b/src/mapblock_mesh.cpp
index 21d431cd1..22b56a15c 100644
--- a/src/mapblock_mesh.cpp
+++ b/src/mapblock_mesh.cpp
@@ -1293,6 +1293,7 @@ bool MapBlockMesh::animate(bool faraway, float time, int crack, u32 daynight_rat
bool enable_shaders = g_settings->getBool("enable_shaders");
bool enable_bumpmapping = g_settings->getBool("enable_bumpmapping");
bool enable_parallax_occlusion = g_settings->getBool("enable_parallax_occlusion");
+ bool smooth_lighting = g_settings->getBool("smooth_lighting");
if(!m_has_animation)
{
@@ -1406,6 +1407,9 @@ bool MapBlockMesh::animate(bool faraway, float time, int crack, u32 daynight_rat
u8 night = j->second.second;
finalColorBlend(vertices[vertexIndex].Color,
day, night, daynight_ratio);
+ // If no smooth lighting, shading is already correct
+ if(!smooth_lighting)
+ continue;
// Make sides and bottom darker than the top
video::SColor &vc = vertices[vertexIndex].Color;
if(vertices[vertexIndex].Normal.Y > 0.5) {