forked from Mirrorlandia_minetest/minetest
Fixed farmesh to such that it was a long time ago.
This commit is contained in:
parent
97d659c9fd
commit
5f8809e425
@ -70,8 +70,6 @@ void set_default_settings()
|
|||||||
g_settings.setDefault("fast_move", "false");
|
g_settings.setDefault("fast_move", "false");
|
||||||
g_settings.setDefault("invert_mouse", "false");
|
g_settings.setDefault("invert_mouse", "false");
|
||||||
g_settings.setDefault("enable_farmesh", "false");
|
g_settings.setDefault("enable_farmesh", "false");
|
||||||
g_settings.setDefault("farmesh_trees", "true");
|
|
||||||
g_settings.setDefault("farmesh_distance", "40");
|
|
||||||
g_settings.setDefault("enable_clouds", "true");
|
g_settings.setDefault("enable_clouds", "true");
|
||||||
g_settings.setDefault("invisible_stone", "false");
|
g_settings.setDefault("invisible_stone", "false");
|
||||||
g_settings.setDefault("screenshot_path", ".");
|
g_settings.setDefault("screenshot_path", ".");
|
||||||
|
@ -70,7 +70,6 @@ FarMesh::FarMesh(
|
|||||||
m_box = core::aabbox3d<f32>(-BS*1000000,-BS*31000,-BS*1000000,
|
m_box = core::aabbox3d<f32>(-BS*1000000,-BS*31000,-BS*1000000,
|
||||||
BS*1000000,BS*31000,BS*1000000);
|
BS*1000000,BS*31000,BS*1000000);
|
||||||
|
|
||||||
trees = g_settings.getBool("farmesh_trees");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FarMesh::~FarMesh()
|
FarMesh::~FarMesh()
|
||||||
@ -314,11 +313,12 @@ void FarMesh::render()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Trees if there are over 0.01 trees per MapNode
|
/*// Trees if there are over 0.01 trees per MapNode
|
||||||
if(trees && tree_amount_avg > 0.01)
|
if(tree_amount_avg > 0.01)
|
||||||
c = video::SColor(255,50,128,50);
|
c = video::SColor(255,50,128,50);
|
||||||
else
|
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;
|
ground_is_mud = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -351,7 +351,7 @@ void FarMesh::render()
|
|||||||
video::EVT_STANDARD, scene::EPT_TRIANGLES, video::EIT_16BIT);
|
video::EVT_STANDARD, scene::EPT_TRIANGLES, video::EIT_16BIT);
|
||||||
|
|
||||||
// Add some trees if appropriate
|
// 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)
|
&& ground_is_mud == true)
|
||||||
{
|
{
|
||||||
driver->setMaterial(m_materials[1]);
|
driver->setMaterial(m_materials[1]);
|
||||||
@ -404,11 +404,11 @@ void FarMesh::step(float dtime)
|
|||||||
m_time += 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_camera_pos = camera_p;
|
||||||
m_brightness = brightness;
|
m_brightness = brightness;
|
||||||
m_render_range = g_settings.getS16("farmesh_distance")*10;
|
m_render_range = render_range;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ public:
|
|||||||
|
|
||||||
void step(float dtime);
|
void step(float dtime);
|
||||||
|
|
||||||
void update(v2f camera_p, float brightness);
|
void update(v2f camera_p, float brightness, s16 render_range);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
video::SMaterial m_materials[FARMESH_MATERIAL_COUNT];
|
video::SMaterial m_materials[FARMESH_MATERIAL_COUNT];
|
||||||
@ -79,7 +79,6 @@ private:
|
|||||||
float m_time;
|
float m_time;
|
||||||
Client *m_client;
|
Client *m_client;
|
||||||
s16 m_render_range;
|
s16 m_render_range;
|
||||||
bool trees;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1955,9 +1955,15 @@ void the_game(
|
|||||||
*/
|
*/
|
||||||
if(farmesh)
|
if(farmesh)
|
||||||
{
|
{
|
||||||
|
farmesh_range = draw_control.wanted_range * 10;
|
||||||
|
if(draw_control.range_all && farmesh_range < 500)
|
||||||
|
farmesh_range = 500;
|
||||||
|
if(farmesh_range > 1000)
|
||||||
|
farmesh_range = 1000;
|
||||||
|
|
||||||
farmesh->step(dtime);
|
farmesh->step(dtime);
|
||||||
farmesh->update(v2f(player_position.X, player_position.Z),
|
farmesh->update(v2f(player_position.X, player_position.Z),
|
||||||
0.05+brightness*0.95);
|
0.05+brightness*0.95, farmesh_range);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Store brightness value
|
// Store brightness value
|
||||||
|
Loading…
Reference in New Issue
Block a user