#include "tool.h"
#include "guiChatConsole.h"
#include "config.h"
+#include "version.h"
#include "clouds.h"
#include "particles.h"
#include "camera.h"
-#include "farmesh.h"
#include "mapblock.h"
#include "settings.h"
#include "profiler.h"
services->setPixelShaderConstant("skyBgColor", bgcolorfa, 4);
// Fog distance
- float fog_distance = *m_fog_range;
- if(*m_force_fog_off)
- fog_distance = 10000*BS;
+ float fog_distance = 10000*BS;
+ if(g_settings->getBool("enable_fog") && !*m_force_fog_off)
+ fog_distance = *m_fog_range;
services->setPixelShaderConstant("fogDistance", &fog_distance, 1);
// Day-night ratio
std::string address, // If "", local server is used
u16 port,
std::wstring &error_message,
- std::string configpath,
ChatBackend &chat_backend,
const SubgameSpec &gamespec, // Used for local game,
bool simple_singleplayer_mode
draw_load_screen(text, device, font,0,25);
delete[] text;
infostream<<"Creating server"<<std::endl;
- server = new Server(map_dir, configpath, gamespec,
+ server = new Server(map_dir, gamespec,
simple_singleplayer_mode);
server->start(port);
}
Sky *sky = NULL;
sky = new Sky(smgr->getRootSceneNode(), smgr, -1);
- /*
- FarMesh
- */
-
- FarMesh *farmesh = NULL;
- if(g_settings->getBool("enable_farmesh"))
- {
- farmesh = new FarMesh(smgr->getRootSceneNode(), smgr, -1, client.getMapSeed(), &client);
- }
-
/*
A copy of the local inventory
*/
bool ldown_for_dig = false;
float damage_flash = 0;
- s16 farmesh_range = 20*MAP_BLOCKSIZE;
float jump_timer = 0;
bool reset_jump_timer = false;
Hud hud(driver, guienv, font, text_height,
gamedef, player, &local_inventory);
+ bool use_weather = g_settings->getBool("weather");
+
for(;;)
{
if(device->run() == false || kill == true)
GUIFormSpecMenu *menu =
new GUIFormSpecMenu(device, guiroot, -1,
&g_menumgr,
- &client, gamedef);
+ &client, gamedef, tsrc);
InventoryLocation inventoryloc;
inventoryloc.setCurrentPlayer();
GUIFormSpecMenu *menu =
new GUIFormSpecMenu(device, guiroot, -1,
&g_menumgr,
- &client, gamedef);
+ &client, gamedef, tsrc);
menu->setFormSource(current_formspec);
menu->setTextDest(current_textdest);
menu->drop();
GUIFormSpecMenu *menu =
new GUIFormSpecMenu(device, guiroot, -1,
&g_menumgr,
- &client, gamedef);
+ &client, gamedef, tsrc);
menu->setFormSpec(meta->getString("formspec"),
inventoryloc);
menu->setFormSource(new NodeMetadataFormSource(
Fog range
*/
- if(farmesh)
- {
- fog_range = BS*farmesh_range;
- }
- else
- {
+ if(draw_control.range_all)
+ fog_range = 100000*BS;
+ else {
fog_range = draw_control.wanted_range*BS + 0.0*MAP_BLOCKSIZE*BS;
+ if(use_weather)
+ fog_range *= (1.5 - 1.4*(float)client.getEnv().getClientMap().getHumidity(pos_i)/100);
fog_range = MYMIN(fog_range, (draw_control.farthest_drawn+20)*BS);
fog_range *= 0.9;
- if(draw_control.range_all)
- fog_range = 100000*BS;
}
/*
sky->update(time_of_day_smooth, time_brightness, direct_brightness,
sunlight_seen);
- float brightness = sky->getBrightness();
video::SColor bgcolor = sky->getBgColor();
video::SColor skycolor = sky->getSkyColor();
}
}
- /*
- 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),
- brightness, farmesh_range);
- }
-
/*
Update particles
*/
Fog
*/
- if(g_settings->getBool("enable_fog") == true && !force_fog_off)
+ if(g_settings->getBool("enable_fog") && !force_fog_off)
{
driver->setFog(
bgcolor,
//TimeTaker guiupdatetimer("Gui updating");
- const char program_name_and_version[] =
- "Minetest " VERSION_STRING;
-
if(show_debug)
{
static float drawtime_avg = 0;
std::ostringstream os(std::ios_base::binary);
os<<std::fixed
- <<program_name_and_version
+ <<"Minetest "<<minetest_version_hash
<<" (R: range_all="<<draw_control.range_all<<")"
<<std::setprecision(0)
<<" drawtime = "<<drawtime_avg
}
else if(show_hud || show_chat)
{
- guitext->setText(narrow_to_wide(program_name_and_version).c_str());
+ std::ostringstream os(std::ios_base::binary);
+ os<<"Minetest "<<minetest_version_hash;
+ guitext->setText(narrow_to_wide(os.str()).c_str());
guitext->setVisible(true);
}
else
smgr->drawAll(); // 'smgr->drawAll();' may go here
+ driver->setTransform(video::ETS_WORLD, core::IdentityMatrix);
+
+ if (show_hud)
+ hud.drawSelectionBoxes(hilightboxes);
+
//Right eye...
irr::core::vector3df rightEye;
smgr->drawAll(); // 'smgr->drawAll();' may go here
+ driver->setTransform(video::ETS_WORLD, core::IdentityMatrix);
+
+ if (show_hud)
+ hud.drawSelectionBoxes(hilightboxes);
+
//driver->endScene();
driver->setMaterial(m);
driver->setTransform(video::ETS_WORLD, core::IdentityMatrix);
-
- if (show_hud)
+ if((!g_settings->getBool("anaglyph")) && (show_hud))
+ {
hud.drawSelectionBoxes(hilightboxes);
+ }
+
/*
Wielded tool
*/
*/
{
TimeTaker timer("endScene");
- endSceneX(driver);
+ driver->endScene();
endscenetime = timer.stop(true);
}
infostream << "\t\t" << i << ":" << texture->getName().getPath().c_str()
<< std::endl;
}
+ clearTextureNameCache();
infostream << "\tRemaining materials: "
<< driver-> getMaterialRendererCount ()
<< " (note: irrlicht doesn't support removing renderers)"<< std::endl;