summaryrefslogtreecommitdiff
path: root/src/itemdef.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-12-02 14:24:58 +0200
committerPerttu Ahola <celeron55@gmail.com>2012-12-02 14:24:58 +0200
commitcd1f604ffe6130fd7d3a8358a8cebd7f821f9a11 (patch)
tree01077b87b747e9c72d40656c274d4781542a755e /src/itemdef.cpp
parent566f7f638a00a698a25b73adc2e619fe63e1a802 (diff)
downloadminetest-cd1f604ffe6130fd7d3a8358a8cebd7f821f9a11.tar.gz
minetest-cd1f604ffe6130fd7d3a8358a8cebd7f821f9a11.tar.bz2
minetest-cd1f604ffe6130fd7d3a8358a8cebd7f821f9a11.zip
Handle day-night transition in shader and make light sources brighter when shaders are used
Diffstat (limited to 'src/itemdef.cpp')
-rw-r--r--src/itemdef.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/itemdef.cpp b/src/itemdef.cpp
index 9ce064ea4..260baadc0 100644
--- a/src/itemdef.cpp
+++ b/src/itemdef.cpp
@@ -30,6 +30,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "tile.h"
#endif
#include "log.h"
+#include "main.h" // g_settings
+#include "settings.h"
#include "util/serialize.h"
#include "util/container.h"
#include "util/thread.h"
@@ -356,7 +358,10 @@ public:
scene::IMesh *node_mesh = mapblock_mesh.getMesh();
assert(node_mesh);
- setMeshColor(node_mesh, video::SColor(255, 255, 255, 255));
+ video::SColor c(255, 255, 255, 255);
+ if(g_settings->getS32("enable_shaders") != 0)
+ c = MapBlock_LightColor(255, 0xffff, decode_light(f.light_source));
+ setMeshColor(node_mesh, c);
/*
Scale and translate the mesh so it's a unit cube