aboutsummaryrefslogtreecommitdiff
path: root/src/content_mapblock.cpp
diff options
context:
space:
mode:
authorRealBadAngel <maciej.kasatkin@o2.pl>2014-08-21 23:28:01 +0200
committerRealBadAngel <maciej.kasatkin@o2.pl>2014-08-21 23:28:01 +0200
commitd9df592da824629149bf744726beba33f604dc2d (patch)
tree2950e26912e7662616c38d382520ebb8cd820328 /src/content_mapblock.cpp
parent2a5c88bde167c69b178d6c5ed4d702cadc211ded (diff)
downloadminetest-d9df592da824629149bf744726beba33f604dc2d.tar.gz
minetest-d9df592da824629149bf744726beba33f604dc2d.tar.bz2
minetest-d9df592da824629149bf744726beba33f604dc2d.zip
Pass light sources in blue channel of vertex color instead of decoded light for all special drawtypes.
Plus some style fixes and optimizations.
Diffstat (limited to 'src/content_mapblock.cpp')
-rw-r--r--src/content_mapblock.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/content_mapblock.cpp b/src/content_mapblock.cpp
index f5b49c662..baa97a987 100644
--- a/src/content_mapblock.cpp
+++ b/src/content_mapblock.cpp
@@ -220,7 +220,7 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
top_is_same_liquid = true;
u16 l = getInteriorLight(n, 0, nodedef);
- video::SColor c = MapBlock_LightColor(f.alpha, l, decode_light(f.light_source));
+ video::SColor c = MapBlock_LightColor(f.alpha, l, f.light_source);
/*
Generate sides
@@ -383,7 +383,6 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
// it at what it emits, for an increased effect
u8 light_source = nodedef->get(n).light_source;
if(light_source != 0){
- //l = decode_light(undiminish_light(light_source));
l = decode_light(light_source);
l = l | (l<<8);
}
@@ -393,7 +392,7 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
// Otherwise use the light of this node (the liquid)
else
l = getInteriorLight(n, 0, nodedef);
- video::SColor c = MapBlock_LightColor(f.alpha, l, decode_light(f.light_source));
+ video::SColor c = MapBlock_LightColor(f.alpha, l, f.light_source);
u8 range = rangelim(nodedef->get(c_flowing).liquid_range, 1, 8);
@@ -697,7 +696,7 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
TileSpec tile = getNodeTile(n, p, v3s16(0,0,0), data);
u16 l = getInteriorLight(n, 1, nodedef);
- video::SColor c = MapBlock_LightColor(255, l, decode_light(f.light_source));
+ video::SColor c = MapBlock_LightColor(255, l, f.light_source);
for(u32 j=0; j<6; j++)
{
@@ -780,7 +779,7 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
param2 = param2 & 63;
u16 l = getInteriorLight(n, 1, nodedef);
- video::SColor c = MapBlock_LightColor(255, l, decode_light(f.light_source));
+ video::SColor c = MapBlock_LightColor(255, l, f.light_source);
v3f pos = intToFloat(p, BS);
static const float a = BS / 2;
static const float g = a - 0.003;
@@ -985,7 +984,7 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
v3s16(0,0,0), data);
u16 l = getInteriorLight(n, 1, nodedef);
- video::SColor c = MapBlock_LightColor(255, l, decode_light(f.light_source));
+ video::SColor c = MapBlock_LightColor(255, l, f.light_source);
v3f pos = intToFloat(p, BS);
aabb3f box(-BS/2,-BS/2,-BS/2,BS/2,BS/2,BS/2);
@@ -1018,7 +1017,7 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
tile.material_flags |= MATERIAL_FLAG_CRACK_OVERLAY;
u16 l = getInteriorLight(n, 1, nodedef);
- video::SColor c = MapBlock_LightColor(255, l, decode_light(f.light_source));
+ video::SColor c = MapBlock_LightColor(255, l, f.light_source);
float s = BS/2*f.visual_scale;
// Wall at X+ of node
@@ -1059,7 +1058,7 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
tile.material_flags |= MATERIAL_FLAG_CRACK_OVERLAY;
u16 l = getInteriorLight(n, 0, nodedef);
- video::SColor c = MapBlock_LightColor(255, l, decode_light(f.light_source));
+ video::SColor c = MapBlock_LightColor(255, l, f.light_source);
float d = (float)BS/16;
float s = BS/2*f.visual_scale;
@@ -1102,7 +1101,7 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
tile.material_flags |= MATERIAL_FLAG_CRACK_OVERLAY;
u16 l = getInteriorLight(n, 1, nodedef);
- video::SColor c = MapBlock_LightColor(255, l, decode_light(f.light_source));
+ video::SColor c = MapBlock_LightColor(255, l, f.light_source);
float s = BS/2*f.visual_scale;
@@ -1149,7 +1148,7 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
tile_rot.rotation = 1;
u16 l = getInteriorLight(n, 1, nodedef);
- video::SColor c = MapBlock_LightColor(255, l, decode_light(f.light_source));
+ video::SColor c = MapBlock_LightColor(255, l, f.light_source);
const f32 post_rad=(f32)BS/8;
const f32 bar_rad=(f32)BS/16;
@@ -1398,7 +1397,7 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
tile.material_flags |= MATERIAL_FLAG_CRACK_OVERLAY;
u16 l = getInteriorLight(n, 0, nodedef);
- video::SColor c = MapBlock_LightColor(255, l, decode_light(f.light_source));
+ video::SColor c = MapBlock_LightColor(255, l, f.light_source);
float d = (float)BS/64;
@@ -1436,8 +1435,8 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
};
TileSpec tiles[6];
- u16 l = getInteriorLight(n, 0, nodedef);
- video::SColor c = MapBlock_LightColor(255, l, decode_light(f.light_source));
+ u16 l = getInteriorLight(n, 1, nodedef);
+ video::SColor c = MapBlock_LightColor(255, l, f.light_source);
v3f pos = intToFloat(p, BS);