1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

organizing stuff.

This commit is contained in:
Perttu Ahola 2010-12-21 18:08:24 +02:00
parent 3b0bff2f74
commit 3f5bad938a
23 changed files with 805 additions and 374 deletions

View file

@ -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;