X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fmap.h;h=e0db2e2627a01c4345df8978d90e895a4a43e784;hb=880c9768a9323800ca8d44cc4b73e92278e58743;hp=4d9847063066075eb575c8a6c929bfd80b63289c;hpb=ffe3c2ae0db6fed0f2b08b71bfa69f3d3df3bb1f;p=dragonfireclient.git diff --git a/src/map.h b/src/map.h index 4d9847063..e0db2e262 100644 --- a/src/map.h +++ b/src/map.h @@ -123,7 +123,7 @@ class Map /*: public NodeContainer*/ { public: - Map(std::ostream &dout, IGameDef *gamedef); + Map(IGameDef *gamedef); virtual ~Map(); DISABLE_CLASS_COPY(Map); @@ -149,8 +149,6 @@ class Map /*: public NodeContainer*/ MapSector * getSectorNoGenerateNoLock(v2s16 p2d); // Same as the above (there exists no lock anymore) MapSector * getSectorNoGenerate(v2s16 p2d); - // Gets an existing sector or creates an empty one - //MapSector * getSectorCreate(v2s16 p2d); /* This is overloaded by ClientMap and ServerMap to allow @@ -162,7 +160,9 @@ class Map /*: public NodeContainer*/ MapBlock * getBlockNoCreate(v3s16 p); // Returns NULL if not found MapBlock * getBlockNoCreateNoEx(v3s16 p); - + + void listAllLoadedBlocks(std::vector &dst); + /* Server overrides */ virtual MapBlock * emergeBlock(v3s16 p, bool create_blank=true) { return getBlockNoCreateNoEx(p); } @@ -268,11 +268,6 @@ class Map /*: public NodeContainer*/ void setNodeTimer(const NodeTimer &t); void removeNodeTimer(v3s16 p); - /* - Misc. - */ - std::map *getSectorsPtr(){return &m_sectors;} - /* Variables */ @@ -283,8 +278,6 @@ class Map /*: public NodeContainer*/ protected: friend class LuaVoxelManip; - std::ostream &m_dout; // A bit deprecated, could be removed - IGameDef *m_gamedef; std::set m_event_receivers; @@ -374,15 +367,6 @@ class ServerMap : public Map */ MapBlock *getBlockOrEmerge(v3s16 p3d); - // Helper for placing objects on ground level - s16 findGroundLevel(v2s16 p2d); - - /* - Misc. helper functions for fiddling with directory and file - names when saving - */ - void createDirs(const std::string &path); - /* Database functions */ @@ -394,12 +378,11 @@ class ServerMap : public Map void save(ModifiedState save_level); void listAllLoadableBlocks(std::vector &dst); - void listAllLoadedBlocks(std::vector &dst); MapgenParams *getMapgenParams(); bool saveBlock(MapBlock *block); - static bool saveBlock(MapBlock *block, MapDatabase *db); + static bool saveBlock(MapBlock *block, MapDatabase *db, int compression_level = -1); MapBlock* loadBlock(v3s16 p); // Database version void loadBlock(std::string *blob, v3s16 p3d, MapSector *sector, bool save_after_load=false); @@ -414,7 +397,6 @@ class ServerMap : public Map bool isSavingEnabled(){ return m_map_saving_enabled; } u64 getSeed(); - s16 getWaterLevel(); /*! * Fixes lighting in one map block. @@ -435,13 +417,9 @@ class ServerMap : public Map std::string m_savedir; bool m_map_saving_enabled; -#if 0 - // Chunk size in MapSectors - // If 0, chunks are disabled. - s16 m_chunksize; - // Chunks - core::map m_chunks; -#endif + int m_map_compression_level; + + std::set m_chunks_in_progress; /* Metadata is re-written on disk only if this is true.