g_settings.setDefault("wanted_fps", "30");
g_settings.setDefault("fps_max", "60");
g_settings.setDefault("viewing_range_nodes_max", "300");
- g_settings.setDefault("viewing_range_nodes_min", "28");
+ g_settings.setDefault("viewing_range_nodes_min", "25");
g_settings.setDefault("screenW", "800");
g_settings.setDefault("screenH", "600");
g_settings.setDefault("address", "");
m_seed(seed),
m_camera_pos(0,0),
m_time(0),
- m_client(client)
+ m_client(client),
+ m_render_range(20*MAP_BLOCKSIZE)
{
dstream<<__FUNCTION_NAME<<std::endl;
//const s16 grid_radius_i = 12;
//const float grid_size = BS*50;
- const s16 grid_radius_i = 20;
+ const s16 grid_radius_i = m_render_range/MAP_BLOCKSIZE;
const float grid_size = BS*MAP_BLOCKSIZE;
const v2f grid_speed(-BS*0, 0);
video::EVT_STANDARD, scene::EPT_TRIANGLES, video::EIT_16BIT);
// Add some trees if appropriate
- if(tree_amount_avg >= 0.005 && steepness < 1.0
+ if(tree_amount_avg >= 0.0065 && steepness < 1.4
&& ground_is_mud == true)
{
driver->setMaterial(m_materials[1]);
{
video::S3DVertex(p0.X,noise[0],p0.Y,
0,0,0, c, 0,1),
- video::S3DVertex(p0.X,noise[1]+BS*MAP_BLOCKSIZE,p0.Y,
+ video::S3DVertex(p0.X,noise[0]+BS*MAP_BLOCKSIZE,p0.Y,
0,0,0, c, 0,0),
video::S3DVertex(p1.X,noise[2]+BS*MAP_BLOCKSIZE,p1.Y,
0,0,0, c, 1,0),
- video::S3DVertex(p1.X,noise[3],p1.Y,
+ video::S3DVertex(p1.X,noise[2],p1.Y,
0,0,0, c, 1,1),
};
u16 indices[] = {0,1,2,2,3,0};
{
video::S3DVertex vertices[4] =
{
- video::S3DVertex(p1.X,noise[0],p0.Y,
+ video::S3DVertex(p1.X,noise[3],p0.Y,
0,0,0, c, 0,1),
- video::S3DVertex(p1.X,noise[1]+BS*MAP_BLOCKSIZE,p0.Y,
+ video::S3DVertex(p1.X,noise[3]+BS*MAP_BLOCKSIZE,p0.Y,
0,0,0, c, 0,0),
- video::S3DVertex(p0.X,noise[2]+BS*MAP_BLOCKSIZE,p1.Y,
+ video::S3DVertex(p0.X,noise[1]+BS*MAP_BLOCKSIZE,p1.Y,
0,0,0, c, 1,0),
- video::S3DVertex(p0.X,noise[3],p1.Y,
+ video::S3DVertex(p0.X,noise[1],p1.Y,
0,0,0, c, 1,1),
};
u16 indices[] = {0,1,2,2,3,0};
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 = render_range;
}
core::list<float> frametime_log;
float damage_flash_timer = 0;
+ s16 farmesh_range = 20*MAP_BLOCKSIZE;
bool invert_mouse = g_settings.getBool("invert_mouse");
}
/*
- Update farmesh (TODO: Remove from here)
+ Update 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->update(v2f(player_position.X, player_position.Z),
- 0.05+brightness*0.95);
+ 0.05+brightness*0.95, farmesh_range);
}
// Store brightness value
f32 range;
if(farmesh)
{
- range = BS*MAP_BLOCKSIZE*20;
+ range = BS*farmesh_range;
}
else
{
beginscenetime = timer.stop(true);
}
- /*
- Draw farmesh before everything else
- */
- {
- //farmesh->render();
- }
-
//timer3.stop();
//std::cout<<DTIME<<"smgr->drawAll()"<<std::endl;