From 21372749f5700632a0f136f1b1db29bd424bc448 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Fri, 11 Feb 2011 20:37:54 +0200 Subject: [PATCH] now it works nicely --- src/client.cpp | 2 +- src/defaultsettings.cpp | 2 +- src/map.cpp | 64 ++++++++++++++++++++++++++++++++--------- src/map.h | 3 +- src/mapblock.cpp | 14 ++++----- 5 files changed, 62 insertions(+), 23 deletions(-) diff --git a/src/client.cpp b/src/client.cpp index 4febdd4f7..21c911ec6 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -989,7 +989,7 @@ void Client::ProcessData(u8 *data, u32 datasize, u16 sender_peer_id) s32 t = (((m_time_of_day.get())%24000)/(24000/d)); u32 dr; if(t < nightlength/2 || t >= d - nightlength/2) - dr = 400; + dr = 300; else if(t >= d/2 - daytimelength/2 && t < d/2 + daytimelength/2) dr = 1000; else diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index de825ff0a..63163add9 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -39,7 +39,7 @@ void set_default_settings() g_settings.setDefault("random_input", "false"); g_settings.setDefault("client_delete_unused_sectors_timeout", "1200"); g_settings.setDefault("enable_fog", "true"); - g_settings.setDefault("new_style_water", "true"); + g_settings.setDefault("new_style_water", "false"); g_settings.setDefault("new_style_leaves", "true"); g_settings.setDefault("frametime_graph", "false"); diff --git a/src/map.cpp b/src/map.cpp index ba958d148..8ac5352a4 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -2077,13 +2077,15 @@ double base_rock_level_2d(u64 seed, v2s16 p) */ MapChunk* ServerMap::generateChunkRaw(v2s16 chunkpos, - core::map &changed_blocks) + core::map &changed_blocks, + bool force) { DSTACK(__FUNCTION_NAME); /* Don't generate if already fully generated */ + if(force == false) { MapChunk *chunk = getChunk(chunkpos); if(chunk != NULL && chunk->getGenLevel() == GENERATED_FULLY) @@ -2427,7 +2429,7 @@ MapChunk* ServerMap::generateChunkRaw(v2s16 chunkpos, /* Make dungeons */ - u32 dungeons_count = relative_volume / 400000; + u32 dungeons_count = relative_volume / 600000; u32 bruises_count = relative_volume * stone_surface_max_y / 40000000; if(stone_surface_max_y < WATER_LEVEL) bruises_count = 0; @@ -2648,7 +2650,7 @@ MapChunk* ServerMap::generateChunkRaw(v2s16 chunkpos, /* Make ore veins */ - for(u32 jj=0; jjserialize(o, version); @@ -4938,10 +4973,10 @@ MapSector* ServerMap::loadSectorMeta(std::string dirname) v2s16 p2d = getSectorPos(dirname); std::string dir = m_savedir + "/sectors/" + dirname; - std::string fullpath = dir + "/heightmap"; + std::string fullpath = dir + "/meta"; std::ifstream is(fullpath.c_str(), std::ios_base::binary); if(is.good() == false) - throw FileNotGoodException("Cannot open sector heightmap"); + throw FileNotGoodException("Cannot open sector metafile"); ServerMapSector *sector = ServerMapSector::deSerialize (is, this, p2d, m_sectors); @@ -4975,7 +5010,10 @@ bool ServerMap::loadSectorFull(v2s16 p2d) { return false; } - + + /* + Load blocks + */ std::vector list2 = fs::GetDirListing (m_savedir+"/sectors/"+sectorsubdir); std::vector::iterator i2; diff --git a/src/map.h b/src/map.h index fb0555824..e93ba2cd3 100644 --- a/src/map.h +++ b/src/map.h @@ -364,7 +364,8 @@ public: All chunks touching this one can be altered also. */ MapChunk* generateChunkRaw(v2s16 chunkpos, - core::map &changed_blocks); + core::map &changed_blocks, + bool force=false); /* Generate a chunk and its neighbors so that it won't be touched diff --git a/src/mapblock.cpp b/src/mapblock.cpp index bff366add..c5ede565a 100644 --- a/src/mapblock.cpp +++ b/src/mapblock.cpp @@ -661,7 +661,7 @@ void MapBlock::updateMesh(u32 daynight_ratio) float node_water_level = 1.0; if(new_style_water) - node_water_level = 0.9; + node_water_level = 0.85; /* We are including the faces of the trailing edges of the block. @@ -1157,13 +1157,13 @@ void MapBlock::updateMesh(u32 daynight_ratio) video::S3DVertex(BS/2,0,-BS/2, 0,0,0, c, 1,1), video::S3DVertex(BS/2,0,BS/2, 0,0,0, c, 1,0), video::S3DVertex(-BS/2,0,BS/2, 0,0,0, c, 0,0),*/ - video::S3DVertex(-BS/2,0,-BS/2, 0,0,0, c, - pa_water1.x0(), pa_water1.y1()), - video::S3DVertex(BS/2,0,-BS/2, 0,0,0, c, - pa_water1.x1(), pa_water1.y1()), - video::S3DVertex(BS/2,0,BS/2, 0,0,0, c, - pa_water1.x1(), pa_water1.y0()), video::S3DVertex(-BS/2,0,BS/2, 0,0,0, c, + pa_water1.x0(), pa_water1.y1()), + video::S3DVertex(BS/2,0,BS/2, 0,0,0, c, + pa_water1.x1(), pa_water1.y1()), + video::S3DVertex(BS/2,0,-BS/2, 0,0,0, c, + pa_water1.x1(), pa_water1.y0()), + video::S3DVertex(-BS/2,0,-BS/2, 0,0,0, c, pa_water1.x0(), pa_water1.y0()), };