if(ntop.getContent() == c_flowing || ntop.getContent() == c_source)
top_is_same_liquid = true;
- u16 l = getInteriorLight(n, 0, data);
+ u16 l = getInteriorLight(n, 0, nodedef);
video::SColor c = MapBlock_LightColor(f.alpha, l, decode_light(f.light_source));
/*
}
// Use the light of the node on top if possible
else if(nodedef->get(ntop).param_type == CPT_LIGHT)
- l = getInteriorLight(ntop, 0, data);
+ l = getInteriorLight(ntop, 0, nodedef);
// Otherwise use the light of this node (the liquid)
else
- l = getInteriorLight(n, 0, data);
+ l = getInteriorLight(n, 0, nodedef);
video::SColor c = MapBlock_LightColor(f.alpha, l, decode_light(f.light_source));
u8 range = rangelim(nodedef->get(c_flowing).liquid_range, 1, 8);
{
TileSpec tile = getNodeTile(n, p, v3s16(0,0,0), data);
- u16 l = getInteriorLight(n, 1, data);
+ u16 l = getInteriorLight(n, 1, nodedef);
video::SColor c = MapBlock_LightColor(255, l, decode_light(f.light_source));
for(u32 j=0; j<6; j++)
TileSpec tiles[2];
tiles[0] = getNodeTile(n, p, dirs[0], data);
tiles[1] = getNodeTile(n, p, dirs[1], data);
- u16 l = getInteriorLight(n, 1, data);
+ u16 l = getInteriorLight(n, 1, nodedef);
video::SColor c = MapBlock_LightColor(255, l, decode_light(f.light_source));
v3f pos = intToFloat(p, BS);
static const float a=BS/2;
TileSpec tile_leaves = getNodeTile(n, p,
v3s16(0,0,0), data);
- u16 l = getInteriorLight(n, 1, data);
+ u16 l = getInteriorLight(n, 1, nodedef);
video::SColor c = MapBlock_LightColor(255, l, decode_light(f.light_source));
v3f pos = intToFloat(p, BS);
tile.material_flags &= ~MATERIAL_FLAG_BACKFACE_CULLING;
tile.material_flags |= MATERIAL_FLAG_CRACK_OVERLAY;
- u16 l = getInteriorLight(n, 1, data);
+ u16 l = getInteriorLight(n, 1, nodedef);
video::SColor c = MapBlock_LightColor(255, l, decode_light(f.light_source));
float s = BS/2*f.visual_scale;
tile.material_flags &= ~MATERIAL_FLAG_BACKFACE_CULLING;
tile.material_flags |= MATERIAL_FLAG_CRACK_OVERLAY;
- u16 l = getInteriorLight(n, 0, data);
+ u16 l = getInteriorLight(n, 0, nodedef);
video::SColor c = MapBlock_LightColor(255, l, decode_light(f.light_source));
float d = (float)BS/16;
TileSpec tile = getNodeTileN(n, p, 0, data);
tile.material_flags |= MATERIAL_FLAG_CRACK_OVERLAY;
- u16 l = getInteriorLight(n, 1, data);
+ u16 l = getInteriorLight(n, 1, nodedef);
video::SColor c = MapBlock_LightColor(255, l, decode_light(f.light_source));
float s = BS/2*f.visual_scale;
texturestring_rot,
&tile_rot.texture_id);
- u16 l = getInteriorLight(n, 1, data);
+ u16 l = getInteriorLight(n, 1, nodedef);
video::SColor c = MapBlock_LightColor(255, l, decode_light(f.light_source));
const f32 post_rad=(f32)BS/8;
tile.material_flags &= ~MATERIAL_FLAG_BACKFACE_CULLING;
tile.material_flags |= MATERIAL_FLAG_CRACK_OVERLAY;
- u16 l = getInteriorLight(n, 0, data);
+ u16 l = getInteriorLight(n, 0, nodedef);
video::SColor c = MapBlock_LightColor(255, l, decode_light(f.light_source));
float d = (float)BS/64;
};
TileSpec tiles[6];
- u16 l = getInteriorLight(n, 0, data);
+ u16 l = getInteriorLight(n, 0, nodedef);
video::SColor c = MapBlock_LightColor(255, l, decode_light(f.light_source));
v3f pos = intToFloat(p, BS);
Single light bank.
*/
static u8 getInteriorLight(enum LightBank bank, MapNode n, s32 increment,
- MeshMakeData *data)
+ INodeDefManager *ndef)
{
- INodeDefManager *ndef = data->m_gamedef->ndef();
u8 light = n.getLight(bank, ndef);
while(increment > 0)
Calculate non-smooth lighting at interior of node.
Both light banks.
*/
-u16 getInteriorLight(MapNode n, s32 increment, MeshMakeData *data)
+u16 getInteriorLight(MapNode n, s32 increment, INodeDefManager *ndef)
{
- u16 day = getInteriorLight(LIGHTBANK_DAY, n, increment, data);
- u16 night = getInteriorLight(LIGHTBANK_NIGHT, n, increment, data);
+ u16 day = getInteriorLight(LIGHTBANK_DAY, n, increment, ndef);
+ u16 night = getInteriorLight(LIGHTBANK_NIGHT, n, increment, ndef);
return day | (night << 8);
}
Single light bank.
*/
static u8 getFaceLight(enum LightBank bank, MapNode n, MapNode n2,
- v3s16 face_dir, MeshMakeData *data)
+ v3s16 face_dir, INodeDefManager *ndef)
{
- INodeDefManager *ndef = data->m_gamedef->ndef();
-
u8 light;
u8 l1 = n.getLight(bank, ndef);
u8 l2 = n2.getLight(bank, ndef);
Calculate non-smooth lighting at face of node.
Both light banks.
*/
-u16 getFaceLight(MapNode n, MapNode n2, v3s16 face_dir, MeshMakeData *data)
+u16 getFaceLight(MapNode n, MapNode n2, v3s16 face_dir, INodeDefManager *ndef)
{
- u16 day = getFaceLight(LIGHTBANK_DAY, n, n2, face_dir, data);
- u16 night = getFaceLight(LIGHTBANK_NIGHT, n, n2, face_dir, data);
+ u16 day = getFaceLight(LIGHTBANK_DAY, n, n2, face_dir, ndef);
+ u16 night = getFaceLight(LIGHTBANK_NIGHT, n, n2, face_dir, ndef);
return day | (night << 8);
}
if(data->m_smooth_lighting == false)
{
lights[0] = lights[1] = lights[2] = lights[3] =
- getFaceLight(n0, n1, face_dir, data);
+ getFaceLight(n0, n1, face_dir, ndef);
}
else
{