diff options
author | est31 <MTest31@outlook.com> | 2015-08-10 22:24:47 +0200 |
---|---|---|
committer | est31 <MTest31@outlook.com> | 2015-08-13 07:56:07 +0200 |
commit | a8e238ed06ee8285ed4459e9deda3117419837f6 (patch) | |
tree | 9d2d9caee1f9d1a3944d1ba078e7df6e9f13d7c3 /src/mapsector.h | |
parent | 2b04ab874d75711bc021a0cd8dc7fca68f4e6929 (diff) | |
download | minetest-a8e238ed06ee8285ed4459e9deda3117419837f6.tar.gz minetest-a8e238ed06ee8285ed4459e9deda3117419837f6.tar.bz2 minetest-a8e238ed06ee8285ed4459e9deda3117419837f6.zip |
Add count based unload limit for mapblocks
Diffstat (limited to 'src/mapsector.h')
-rw-r--r-- | src/mapsector.h | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/mapsector.h b/src/mapsector.h index e89247a92..4c1ce86a3 100644 --- a/src/mapsector.h +++ b/src/mapsector.h @@ -40,7 +40,7 @@ class IGameDef; class MapSector { public: - + MapSector(Map *parent, v2s16 pos, IGameDef *gamedef); virtual ~MapSector(); @@ -58,16 +58,18 @@ public: MapBlock * createBlankBlock(s16 y); void insertBlock(MapBlock *block); - + void deleteBlock(MapBlock *block); - + void getBlocks(MapBlockVect &dest); - + + bool empty(); + // Always false at the moment, because sector contains no metadata. bool differs_from_disk; protected: - + // The pile of MapBlocks std::map<s16, MapBlock*> m_blocks; @@ -76,12 +78,12 @@ protected: v2s16 m_pos; IGameDef *m_gamedef; - + // Last-used block is cached here for quicker access. - // Be sure to set this to NULL when the cached block is deleted + // Be sure to set this to NULL when the cached block is deleted MapBlock *m_block_cache; s16 m_block_cache_y; - + /* Private methods */ @@ -94,7 +96,7 @@ class ServerMapSector : public MapSector public: ServerMapSector(Map *parent, v2s16 pos, IGameDef *gamedef); ~ServerMapSector(); - + u32 getId() const { return MAPSECTOR_SERVER; @@ -106,7 +108,7 @@ public: */ void serialize(std::ostream &os, u8 version); - + static ServerMapSector* deSerialize( std::istream &is, Map *parent, @@ -114,7 +116,7 @@ public: std::map<v2s16, MapSector*> & sectors, IGameDef *gamedef ); - + private: }; @@ -124,7 +126,7 @@ class ClientMapSector : public MapSector public: ClientMapSector(Map *parent, v2s16 pos, IGameDef *gamedef); ~ClientMapSector(); - + u32 getId() const { return MAPSECTOR_CLIENT; @@ -133,6 +135,6 @@ public: private: }; #endif - + #endif |