summaryrefslogtreecommitdiff
path: root/src/map.h
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2010-12-11 18:11:03 +0200
committerPerttu Ahola <celeron55@gmail.com>2010-12-11 18:11:03 +0200
commit2a0d1a059e556afaeb7f5b72205b26447e23286f (patch)
tree2e30313c2c40b59239a062fdb69d66e9abf153c4 /src/map.h
parent5e0c284f3a8debdd9ebb080f80e36dceb7bc4ce2 (diff)
downloadminetest-2a0d1a059e556afaeb7f5b72205b26447e23286f.tar.gz
minetest-2a0d1a059e556afaeb7f5b72205b26447e23286f.tar.bz2
minetest-2a0d1a059e556afaeb7f5b72205b26447e23286f.zip
commit before some radicallish changes to water behavior
Diffstat (limited to 'src/map.h')
-rw-r--r--src/map.h34
1 files changed, 30 insertions, 4 deletions
diff --git a/src/map.h b/src/map.h
index 7f791ffad..62d1f8aee 100644
--- a/src/map.h
+++ b/src/map.h
@@ -40,6 +40,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "mapblock.h"
#include "mapsector.h"
#include "constants.h"
+#include "voxel.h"
class Map;
@@ -49,6 +50,7 @@ class Map;
NOTE: This doesn't really make anything more efficient
NOTE: Use VoxelManipulator, if possible
TODO: Get rid of this?
+ NOTE: CONFIRMED: THIS CACHE DOESN'T MAKE ANYTHING ANY FASTER
*/
class MapBlockPointerCache : public NodeContainer
{
@@ -121,7 +123,7 @@ public:
void cacheCreated()
{
- dstream<<"cacheCreated() begin"<<std::endl;
+ //dstream<<"cacheCreated() begin"<<std::endl;
JMutexAutoLock waitcachelock(m_waitcache_mutex);
JMutexAutoLock countlock(m_count_mutex);
@@ -131,12 +133,12 @@ public:
m_count++;
- dstream<<"cacheCreated() end"<<std::endl;
+ //dstream<<"cacheCreated() end"<<std::endl;
}
void cacheRemoved()
{
- dstream<<"cacheRemoved() begin"<<std::endl;
+ //dstream<<"cacheRemoved() begin"<<std::endl;
JMutexAutoLock countlock(m_count_mutex);
assert(m_count > 0);
@@ -147,7 +149,7 @@ public:
if(m_count == 0)
m_cache_mutex.Unlock();
- dstream<<"cacheRemoved() end"<<std::endl;
+ //dstream<<"cacheRemoved() end"<<std::endl;
}
/*
@@ -589,5 +591,29 @@ private:
JMutex mesh_mutex;
};
+class MapVoxelManipulator : public VoxelManipulator
+{
+public:
+ MapVoxelManipulator(Map *map);
+ virtual ~MapVoxelManipulator();
+
+ virtual void clear()
+ {
+ VoxelManipulator::clear();
+ m_loaded_blocks.clear();
+ }
+
+ virtual void emerge(VoxelArea a);
+
+ void blitBack(core::map<v3s16, MapBlock*> & modified_blocks);
+
+private:
+ Map *m_map;
+ // bool is dummy value
+ // SUGG: How 'bout an another VoxelManipulator for storing the
+ // information about which block is loaded?
+ core::map<v3s16, bool> m_loaded_blocks;
+};
+
#endif