summaryrefslogtreecommitdiff
path: root/src/mapblock_mesh.h
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/mapblock_mesh.h
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/mapblock_mesh.h')
-rw-r--r--src/mapblock_mesh.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mapblock_mesh.h b/src/mapblock_mesh.h
index 82268efd2..c23b6cc5a 100644
--- a/src/mapblock_mesh.h
+++ b/src/mapblock_mesh.h
@@ -160,9 +160,10 @@ struct MeshCollector
// alpha in the A channel of the returned SColor
// day light (0-255) in the R channel of the returned SColor
// night light (0-255) in the G channel of the returned SColor
-inline video::SColor MapBlock_LightColor(u8 alpha, u16 light)
+// light source (0-255) in the B channel of the returned SColor
+inline video::SColor MapBlock_LightColor(u8 alpha, u16 light, u8 light_source=0)
{
- return video::SColor(alpha, (light & 0xff), (light >> 8), 0);
+ return video::SColor(alpha, (light & 0xff), (light >> 8), light_source);
}
// Compute light at node