From 3f5bad938a3fcb601ad41924a4707476b8b87241 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Tue, 21 Dec 2010 18:08:24 +0200 Subject: organizing stuff. --- src/voxel.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'src/voxel.cpp') diff --git a/src/voxel.cpp b/src/voxel.cpp index 29f79992b..282ff5e7c 100644 --- a/src/voxel.cpp +++ b/src/voxel.cpp @@ -21,8 +21,8 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "map.h" // For TimeTaker -#include "main.h" #include "utility.h" +#include "gettime.h" /* Debug stuff @@ -138,7 +138,7 @@ void VoxelManipulator::addArea(VoxelArea area) if(m_area.contains(area)) return; - TimeTaker timer("addArea", g_irrlicht, &addarea_time); + TimeTaker timer("addArea", &addarea_time); // Calculate new area VoxelArea new_area; @@ -290,7 +290,7 @@ void VoxelManipulator::interpolate(VoxelArea area) void VoxelManipulator::clearFlag(u8 flags) { // 0-1ms on moderate area - TimeTaker timer("clearFlag", g_irrlicht, &clearflag_time); + TimeTaker timer("clearFlag", &clearflag_time); v3s16 s = m_area.getExtent(); @@ -539,8 +539,7 @@ void VoxelManipulator::updateAreaWaterPressure(VoxelArea a, core::map &active_nodes, bool checked3_is_clear) { - TimeTaker timer("updateAreaWaterPressure", g_irrlicht, - &updateareawaterpressure_time); + TimeTaker timer("updateAreaWaterPressure", &updateareawaterpressure_time); emerge(a, 3); @@ -653,7 +652,7 @@ bool VoxelManipulator::flowWater(v3s16 removed_pos, //dstream<<"s1="<getTime(); + u32 timenow = getTimeMs(); if(timenow >= stoptime || (stoptime < 0x80000000 && timenow > 0x80000000)) { @@ -876,10 +875,7 @@ void VoxelManipulator::flowWater( u32 stoptime = 0; - if(g_irrlicht != NULL) - { - stoptime = g_irrlicht->getTime() + timelimit; - } + stoptime = getTimeMs() + timelimit; // Count of handled active nodes u32 handled_count = 0; -- cgit v1.2.3