From 0fa0e0752a28eeb43195f2288c018d5c0b24520b Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Mon, 17 Jan 2011 14:57:37 +0200 Subject: old water removed, some fixes here and there --- src/map.h | 141 ++++++++++++-------------------------------------------------- 1 file changed, 26 insertions(+), 115 deletions(-) (limited to 'src/map.h') diff --git a/src/map.h b/src/map.h index d858a9907..5cee3b7c0 100644 --- a/src/map.h +++ b/src/map.h @@ -41,110 +41,14 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "constants.h" #include "voxel.h" -class CacheLock -{ -public: - CacheLock() - { - m_count = 0; - m_count_mutex.Init(); - m_cache_mutex.Init(); - m_waitcache_mutex.Init(); - } - - void cacheCreated() - { - //dstream<<"cacheCreated() begin"< 0); - - m_count--; - - // If this is the last one, release the cache lock - if(m_count == 0) - m_cache_mutex.Unlock(); - - //dstream<<"cacheRemoved() end"< m_sectors; - JMutex m_sector_mutex; - - v3f m_camera_position; - v3f m_camera_direction; - JMutex m_camera_mutex; - - // Be sure to set this to NULL when the cached sector is deleted - MapSector *m_sector_cache; - v2s16 m_sector_cache_p; - - WrapperHeightmap m_hwrapper; - public: - v3s16 drawoffset; // for drawbox() - - /* - Used by MapBlockPointerCache. - - waitCaches() can be called to remove all caches before continuing - - TODO: Remove this, MapBlockPointerCache doesn't exist anymore, - because it doesn't give any speed benefits - */ - CacheLock m_blockcachelock; - Map(std::ostream &dout); virtual ~Map(); @@ -170,23 +74,6 @@ public: m_camera_direction = dir; } - /*void StartUpdater() - { - updater.Start(); - } - - void StopUpdater() - { - updater.setRun(false); - while(updater.IsRunning()) - sleep_s(1); - } - - bool UpdaterIsRunning() - { - return updater.IsRunning(); - }*/ - static core::aabbox3d getNodeBox(v3s16 p) { return core::aabbox3d( @@ -349,6 +236,30 @@ public: // For debug printing virtual void PrintInfo(std::ostream &out); + + /* + Variables + */ + +protected: + + std::ostream &m_dout; + + core::map m_sectors; + JMutex m_sector_mutex; + + v3f m_camera_position; + v3f m_camera_direction; + JMutex m_camera_mutex; + + // Be sure to set this to NULL when the cached sector is deleted + MapSector *m_sector_cache; + v2s16 m_sector_cache_p; + + WrapperHeightmap m_hwrapper; + + // Queued transforming water nodes + UniqueQueue m_transforming_liquid; }; // Master heightmap parameters @@ -572,8 +483,8 @@ public: drawing. Return value is position of changed block. */ - v3s16 setTempMod(v3s16 p, NodeMod mod); - v3s16 clearTempMod(v3s16 p); + v3s16 setTempMod(v3s16 p, NodeMod mod, bool *changed=NULL); + v3s16 clearTempMod(v3s16 p, bool *changed=NULL); // Efficient implementation needs a cache of TempMods //void clearTempMods(); -- cgit v1.2.3