summaryrefslogtreecommitdiff
path: root/src/voxel.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2010-12-21 18:08:24 +0200
committerPerttu Ahola <celeron55@gmail.com>2010-12-21 18:08:24 +0200
commit3f5bad938a3fcb601ad41924a4707476b8b87241 (patch)
treeddf9d7d49a93c092c31fcbdd6bf1c2ad42e43bc8 /src/voxel.cpp
parent3b0bff2f743a3abf100368f94efafa7c2843a9b7 (diff)
downloadminetest-3f5bad938a3fcb601ad41924a4707476b8b87241.tar.gz
minetest-3f5bad938a3fcb601ad41924a4707476b8b87241.tar.bz2
minetest-3f5bad938a3fcb601ad41924a4707476b8b87241.zip
organizing stuff.
Diffstat (limited to 'src/voxel.cpp')
-rw-r--r--src/voxel.cpp20
1 files changed, 8 insertions, 12 deletions
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<v3s16, u8> &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="<<s1<<", s2="<<s2<<std::endl;
{
- TimeTaker timer1("flowWater pre", g_irrlicht, &flowwater_pre_time);
+ TimeTaker timer1("flowWater pre", &flowwater_pre_time);
// Load neighboring nodes
emerge(VoxelArea(removed_pos - v3s16(1,1,1), removed_pos + v3s16(1,1,1)), 4);
@@ -802,9 +801,9 @@ bool VoxelManipulator::flowWater(v3s16 removed_pos,
debugprint, stoptime);
}
- if(stoptime != 0 && g_irrlicht != NULL)
+ if(stoptime != 0)
{
- u32 timenow = g_irrlicht->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;