]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/clientmap.cpp
Clean up EmergeManager, do initial work on Mapgen configuration
[dragonfireclient.git] / src / clientmap.cpp
index 64d5656d46135a263a4719d14d349e58cb829ed2..800549a3b88e0065b75011604015e5920a4e248b 100644 (file)
@@ -352,13 +352,17 @@ void ClientMap::updateDrawList(video::IVideoDriver* driver)
                if(sector_blocks_drawn != 0)
                        m_last_drawn_sectors[sp] = true;
        }
-       
+
+       m_control.blocks_would_have_drawn = blocks_would_have_drawn;
+       m_control.blocks_drawn = blocks_drawn;
+
        g_profiler->avg("CM: blocks in range", blocks_in_range);
        g_profiler->avg("CM: blocks occlusion culled", blocks_occlusion_culled);
        if(blocks_in_range != 0)
                g_profiler->avg("CM: blocks in range without mesh (frac)",
                                (float)blocks_in_range_without_mesh/blocks_in_range);
        g_profiler->avg("CM: blocks drawn", blocks_drawn);
+       g_profiler->avg("CM: wanted max blocks", m_control.wanted_max_blocks);
 }
 
 struct MeshBufList
@@ -413,6 +417,10 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass)
                m_last_drawn_sectors.clear();
        }
 
+       bool use_trilinear_filter = g_settings->getBool("trilinear_filter");
+       bool use_bilinear_filter = g_settings->getBool("bilinear_filter");
+       bool use_anisotropic_filter = g_settings->getBool("anisotropic_filter");
+
        /*
                Get time for measuring timeout.
                
@@ -463,9 +471,6 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass)
        u32 mesh_animate_count = 0;
        u32 mesh_animate_count_far = 0;
        
-       // Blocks that had mesh that would have been drawn according to
-       // rendering range (if max blocks limit didn't kick in)
-       u32 blocks_would_have_drawn = 0;
        // Blocks that were drawn and had a mesh
        u32 blocks_drawn = 0;
        // Blocks which had a corresponding meshbuffer for this pass
@@ -544,6 +549,11 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass)
                        for(u32 i=0; i<c; i++)
                        {
                                scene::IMeshBuffer *buf = mesh->getMeshBuffer(i);
+
+                               buf->getMaterial().setFlag(video::EMF_TRILINEAR_FILTER, use_trilinear_filter);
+                               buf->getMaterial().setFlag(video::EMF_BILINEAR_FILTER, use_bilinear_filter);
+                               buf->getMaterial().setFlag(video::EMF_ANISOTROPIC_FILTER, use_anisotropic_filter);
+
                                const video::SMaterial& material = buf->getMaterial();
                                video::IMaterialRenderer* rnd =
                                                driver->getMaterialRenderer(material.MaterialType);
@@ -656,9 +666,6 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass)
                g_profiler->avg(prefix+"empty blocks (frac)",
                                (float)blocks_without_stuff / blocks_drawn);
 
-       m_control.blocks_drawn = blocks_drawn;
-       m_control.blocks_would_have_drawn = blocks_would_have_drawn;
-
        /*infostream<<"renderMap(): is_transparent_pass="<<is_transparent_pass
                        <<", rendered "<<vertex_count<<" vertices."<<std::endl;*/
 }