From 47a593b5197393d8f8cdfe18b1aa46b8bc1f3fb6 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Sun, 12 Dec 2010 14:33:13 +0200 Subject: starting to separate "material" to "content" and "tile" --- src/map.cpp | 81 +++++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 49 insertions(+), 32 deletions(-) (limited to 'src/map.cpp') diff --git a/src/map.cpp b/src/map.cpp index 88cb0f3f7..1a7cd9bb9 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -1819,7 +1819,8 @@ MapBlock * ServerMap::emergeBlock( // If under water level, it's water if(real_y < WATER_LEVEL) { - n.d = MATERIAL_WATER; + //n.d = MATERIAL_WATER; + n.d = MATERIAL_OCEAN; n.setLight(diminish_light(LIGHT_SUN, WATER_LEVEL-real_y+1)); } // else air @@ -2731,34 +2732,6 @@ void ClientMap::renderMap(video::IVideoDriver* driver, DSTACK(__FUNCTION_NAME); bool is_transparent_pass = pass == scene::ESNRP_TRANSPARENT; -#if 0 - /* - Draw master heightmap mesh - */ - - { - JMutexAutoLock lock(mesh_mutex); - if(mesh != NULL) - { - u32 c = mesh->getMeshBufferCount(); - - for(u32 i=0; igetMeshBuffer(i); - const video::SMaterial& material = buf->getMaterial(); - video::IMaterialRenderer* rnd = - driver->getMaterialRenderer(material.MaterialType); - bool transparent = (rnd && rnd->isTransparent()); - // Render transparent on transparent pass and likewise. - if(transparent == is_transparent_pass) - { - driver->setMaterial(buf->getMaterial()); - driver->drawMeshBuffer(buf); - } - } - } - } -#endif /* Get time for measuring timeout. @@ -3162,7 +3135,8 @@ MapVoxelManipulator::~MapVoxelManipulator() <getBlockNoCreate(p); if(block->isDummy()) @@ -3221,6 +3198,43 @@ void MapVoxelManipulator::emerge(VoxelArea a) //dstream<<"emerge done"<getNode(a.MinEdge + p); + m_data[i] = n; + m_flags[i] = 0; + } + catch(InvalidPositionException &e) + { + m_flags[i] = VOXELFLAG_INEXISTENT; + } + } +} +#endif + /* TODO: Add an option to only update eg. water and air nodes. @@ -3230,6 +3244,9 @@ void MapVoxelManipulator::emerge(VoxelArea a) void MapVoxelManipulator::blitBack (core::map & modified_blocks) { + if(m_area.getExtent() == v3s16(0,0,0)) + return; + TimeTaker timer1("blitBack", g_device); /* -- cgit v1.2.3