\r
// Blocks are viewed in this range from the player\r
s16 g_viewing_range_nodes = 60;\r
+//s16 g_viewing_range_nodes = 0;\r
\r
// This is updated by the client's fetchBlocks routine\r
//s16 g_actual_viewing_range_nodes = VIEWING_RANGE_NODES_DEFAULT;\r
g_settings.set("wanted_fps", "30");\r
g_settings.set("fps_max", "60");\r
g_settings.set("viewing_range_nodes_max", "300");\r
- g_settings.set("viewing_range_nodes_min", "50");\r
+ g_settings.set("viewing_range_nodes_min", "35");\r
g_settings.set("screenW", "");\r
g_settings.set("screenH", "");\r
g_settings.set("host_game", "");\r
static bool fraction_is_good = false;\r
\r
float fraction_good_threshold = 0.1;\r
- float fraction_bad_threshold = 0.25;\r
+ //float fraction_bad_threshold = 0.25;\r
+ float fraction_bad_threshold = 0.1;\r
float fraction_limit;\r
// Use high limit if fraction is good AND the fraction would\r
// lower the range. We want to keep the range fairly high.\r
guienv->drawAll();\r
driver->endScene();\r
\r
- /*\r
- Initialize material array\r
- */\r
-\r
- /*//video::SMaterial g_materials[MATERIALS_COUNT];\r
- for(u16 i=0; i<MATERIALS_COUNT; i++)\r
- {\r
- g_materials[i].Lighting = false;\r
- g_materials[i].BackfaceCulling = false;\r
-\r
- const char *filename = g_content_filenames[i];\r
- if(filename != NULL){\r
- video::ITexture *t = driver->getTexture(filename);\r
- if(t == NULL){\r
- std::cout<<DTIME<<"Texture could not be loaded: \""\r
- <<filename<<"\""<<std::endl;\r
- return 1;\r
- }\r
- g_materials[i].setTexture(0, driver->getTexture(filename));\r
- }\r
- //g_materials[i].setFlag(video::EMF_TEXTURE_WRAP, video::ETC_REPEAT);\r
- g_materials[i].setFlag(video::EMF_BILINEAR_FILTER, false);\r
- //g_materials[i].setFlag(video::EMF_ANISOTROPIC_FILTER, false);\r
- //g_materials[i].setFlag(video::EMF_FOG_ENABLE, true);\r
- }\r
-\r
- g_materials[CONTENT_WATER].MaterialType = video::EMT_TRANSPARENT_VERTEX_ALPHA;\r
- //g_materials[CONTENT_WATER].MaterialType = video::EMT_TRANSPARENT_ADD_COLOR;\r
- g_materials[CONTENT_OCEAN].MaterialType = video::EMT_TRANSPARENT_VERTEX_ALPHA;\r
- */\r
-\r
- /*g_mesh_materials[0].setTexture(0, driver->getTexture("../data/water.png"));\r
- g_mesh_materials[1].setTexture(0, driver->getTexture("../data/grass.png"));\r
- g_mesh_materials[2].setTexture(0, driver->getTexture("../data/stone.png"));\r
- for(u32 i=0; i<3; i++)\r
- {\r
- g_mesh_materials[i].Lighting = false;\r
- g_mesh_materials[i].BackfaceCulling = false;\r
- g_mesh_materials[i].setFlag(video::EMF_BILINEAR_FILTER, false);\r
- g_mesh_materials[i].setFlag(video::EMF_FOG_ENABLE, true);\r
- }*/\r
-\r
/*\r
Preload some random textures that are used in threads\r
*/\r
\r
f32 camera_yaw = 0; // "right/left"\r
f32 camera_pitch = 0; // "up/down"\r
+\r
+ /*\r
+ Move into game\r
+ */\r
\r
gui_loadingtext->remove();\r
\r
+ pauseMenu.setVisible(true);\r
+\r
/*\r
Add some gui stuff\r
*/\r
// First line of debug text\r
gui::IGUIStaticText *guitext = guienv->addStaticText(\r
L"Minetest-c55",\r
- core::rect<s32>(5, 5, 5+600, 5+textsize.Y),\r
+ core::rect<s32>(5, 5, 795, 5+textsize.Y),\r
false, false);\r
// Second line of debug text\r
gui::IGUIStaticText *guitext2 = guienv->addStaticText(\r
L"",\r
- core::rect<s32>(5, 5+(textsize.Y+5)*1, 5+600, (5+textsize.Y)*2),\r
+ core::rect<s32>(5, 5+(textsize.Y+5)*1, 795, (5+textsize.Y)*2),\r
false, false);\r
\r
// At the middle of the screen\r
Some statistics are collected in these\r
*/\r
u32 drawtime = 0;\r
+ u32 beginscenetime = 0;\r
u32 scenetime = 0;\r
u32 endscenetime = 0;\r
\r
//std::cout<<DTIME<<"Removing node"<<std::endl;\r
//client.removeNode(nodepos);\r
std::cout<<DTIME<<"Ground left-clicked"<<std::endl;\r
- client.clickGround(0, nodepos, neighbourpos, g_selected_item);\r
+ client.pressGround(0, nodepos, neighbourpos, g_selected_item);\r
}\r
if(g_input->getRightClicked())\r
{\r
//std::cout<<DTIME<<"Placing node"<<std::endl;\r
//client.addNodeFromInventory(neighbourpos, g_selected_item);\r
std::cout<<DTIME<<"Ground right-clicked"<<std::endl;\r
- client.clickGround(1, nodepos, neighbourpos, g_selected_item);\r
+ client.pressGround(1, nodepos, neighbourpos, g_selected_item);\r
}\r
}\r
else{\r
\r
camera->setAspectRatio((f32)screensize.X / (f32)screensize.Y);\r
\r
+ /*f32 range = g_viewing_range_nodes * BS;\r
+ if(g_viewing_range_all)\r
+ range = 100000*BS;\r
+\r
+ driver->setFog(\r
+ skycolor,\r
+ video::EFT_FOG_LINEAR,\r
+ range*0.6,\r
+ range,\r
+ 0.01,\r
+ false, // pixel fog\r
+ false // range fog\r
+ );*/\r
+\r
+\r
/*\r
Update gui stuff (0ms)\r
*/\r
//TimeTaker guiupdatetimer("Gui updating", device);\r
\r
{\r
- wchar_t temptext[100];\r
+ wchar_t temptext[150];\r
\r
static float drawtime_avg = 0;\r
drawtime_avg = drawtime_avg * 0.98 + (float)drawtime*0.02;\r
+ static float beginscenetime_avg = 0;\r
+ beginscenetime_avg = beginscenetime_avg * 0.98 + (float)beginscenetime*0.02;\r
static float scenetime_avg = 0;\r
scenetime_avg = scenetime_avg * 0.98 + (float)scenetime*0.02;\r
static float endscenetime_avg = 0;\r
endscenetime_avg = endscenetime_avg * 0.98 + (float)endscenetime*0.02;\r
\r
- swprintf(temptext, 100, L"Minetest-c55 ("\r
+ swprintf(temptext, 150, L"Minetest-c55 ("\r
L"F: item=%i"\r
L", R: range_all=%i"\r
L")"\r
- L" drawtime=%.0f, scenetime=%.0f, endscenetime=%.0f",\r
+ L" drawtime=%.0f, beginscenetime=%.0f, scenetime=%.0f, endscenetime=%.0f",\r
g_selected_item,\r
g_viewing_range_all,\r
drawtime_avg,\r
+ beginscenetime_avg,\r
scenetime_avg,\r
endscenetime_avg\r
);\r
}\r
\r
{\r
- wchar_t temptext[100];\r
- /*swprintf(temptext, 100,\r
- L"("\r
- L"% .3f < btime_jitter < % .3f"\r
- L", dtime_jitter = % .1f %%"\r
- //L", ftime_ratio = % .3f"\r
- L")",\r
- busytime_jitter1_min_sample,\r
- busytime_jitter1_max_sample,\r
- dtime_jitter1_max_fraction * 100.0\r
- //g_freetime_ratio\r
- );*/\r
- swprintf(temptext, 100,\r
+ wchar_t temptext[150];\r
+ swprintf(temptext, 150,\r
L"(% .1f, % .1f, % .1f)"\r
L" (% .3f < btime_jitter < % .3f"\r
L", dtime_jitter = % .1f %%)",\r
//video::SColor bgcolor = video::SColor(255,90,140,200);\r
video::SColor bgcolor = skycolor;\r
\r
- // 0ms\r
+ {\r
+ TimeTaker timer("beginScene", device);\r
driver->beginScene(true, true, bgcolor);\r
+ beginscenetime = timer.stop(true);\r
+ }\r
\r
//timer3.stop();\r
\r