Fix automagic render distance tuner
authorPerttu Ahola <celeron55@gmail.com>
Thu, 6 Dec 2012 13:48:19 +0000 (15:48 +0200)
committerPerttu Ahola <celeron55@gmail.com>
Thu, 6 Dec 2012 13:49:20 +0000 (15:49 +0200)
src/clientmap.cpp

index 02c9fe9b1db78ecadbbf9518545a2fec7959d40d..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
@@ -467,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
@@ -665,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;*/
 }