1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Fixed farmesh to such that it was a long time ago.

This commit is contained in:
Perttu Ahola 2011-08-03 13:03:30 +03:00
parent 97d659c9fd
commit 5f8809e425
4 changed files with 15 additions and 12 deletions

View file

@ -70,7 +70,6 @@ FarMesh::FarMesh(
m_box = core::aabbox3d<f32>(-BS*1000000,-BS*31000,-BS*1000000,
BS*1000000,BS*31000,BS*1000000);
trees = g_settings.getBool("farmesh_trees");
}
FarMesh::~FarMesh()
@ -314,11 +313,12 @@ void FarMesh::render()
}
else
{
// Trees if there are over 0.01 trees per MapNode
if(trees && tree_amount_avg > 0.01)
/*// Trees if there are over 0.01 trees per MapNode
if(tree_amount_avg > 0.01)
c = video::SColor(255,50,128,50);
else
c = video::SColor(255,107,134,51);
c = video::SColor(255,107,134,51);*/
c = video::SColor(255,107,134,51);
ground_is_mud = true;
}
}
@ -351,7 +351,7 @@ void FarMesh::render()
video::EVT_STANDARD, scene::EPT_TRIANGLES, video::EIT_16BIT);
// Add some trees if appropriate
if(trees && tree_amount_avg >= 0.0065 && steepness < 1.4
if(tree_amount_avg >= 0.0065 && steepness < 1.4
&& ground_is_mud == true)
{
driver->setMaterial(m_materials[1]);
@ -404,11 +404,11 @@ void FarMesh::step(float dtime)
m_time += dtime;
}
void FarMesh::update(v2f camera_p, float brightness)
void FarMesh::update(v2f camera_p, float brightness, s16 render_range)
{
m_camera_pos = camera_p;
m_brightness = brightness;
m_render_range = g_settings.getS16("farmesh_distance")*10;
m_render_range = render_range;
}