diff options
author | LogicParrot <LogicParrot@users.noreply.github.com> | 2016-02-05 22:45:45 +0100 |
---|---|---|
committer | LogicParrot <LogicParrot@users.noreply.github.com> | 2016-02-05 22:50:18 +0100 |
commit | ca6ef58b1ee8521e4b940ee4883dee714960e413 (patch) | |
tree | 8532add455224b07c07a759e3d906f50c0695888 /src/Generating/GridStructGen.h | |
parent | Merge pull request #2972 from marvinkopf/PlayerAutoComplete (diff) | |
download | cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.gz cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.bz2 cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.lz cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.xz cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.zst cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Generating/GridStructGen.h | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/src/Generating/GridStructGen.h b/src/Generating/GridStructGen.h index b27f218f4..30cb9d670 100644 --- a/src/Generating/GridStructGen.h +++ b/src/Generating/GridStructGen.h @@ -51,11 +51,11 @@ public: public: /** The grid point for which the structure is generated. */ int m_GridX, m_GridZ; - + /** The origin (the coords for which the structure is generated) */ int m_OriginX, m_OriginZ; - - + + /** Creates a structure that has its origin set at the specified coords. */ cStructure (int a_GridX, int a_GridZ, int a_OriginX, int a_OriginZ) : m_GridX(a_GridX), @@ -64,20 +64,20 @@ public: m_OriginZ(a_OriginZ) { } - + // Force a virtual destructor in descendants: virtual ~cStructure() {} - + /** Draws self into the specified chunk */ virtual void DrawIntoChunk(cChunkDesc & a_ChunkDesc) = 0; - + /** Returns the cost of keeping this structure in the cache */ virtual size_t GetCacheCost(void) const { return 1; } } ; typedef SharedPtr<cStructure> cStructurePtr; typedef std::list<cStructurePtr> cStructurePtrs; - - + + cGridStructGen( int a_Seed, int a_GridSizeX, int a_GridSizeZ, @@ -96,7 +96,7 @@ public: // cFinishGen override: virtual void GenFinish(cChunkDesc & a_ChunkDesc) override; - + protected: /** Base seed of the world for which the generator generates chunk. */ int m_BaseSeed; @@ -104,43 +104,43 @@ protected: /** Seed for generating grid offsets and also available for descendants. Calculated from m_BaseSeed by adding the SeedOffset parameter loaded from the cubeset file (if applicable); otherwise the same as m_BaseSeed. */ int m_Seed; - + /** The noise used for generating grid offsets. */ cNoise m_Noise; - + /** The size of each grid's cell in the X axis */ int m_GridSizeX; - + /** The size of each grid's cell in the Z axis */ int m_GridSizeZ; - + /** The maximum offset of the structure's origin from the grid midpoint, in X coord. */ int m_MaxOffsetX; - + /** The maximum offset of the structure's origin from the grid midpoint, in Z coord. */ int m_MaxOffsetZ; - + /** Maximum theoretical size of the structure in the X axis. This limits the structures considered for a single chunk, so the lesser the number, the better performance. Structures large than this may get cropped. */ int m_MaxStructureSizeX; - + /** Maximum theoretical size of the structure in the Z axis. This limits the structures considered for a single chunk, so the lesser the number, the better performance. Structures large than this may get cropped. */ int m_MaxStructureSizeZ; - + /** Maximum allowed sum of costs for items in the cache. Items that are over this cost are removed from the cache, oldest-first */ size_t m_MaxCacheSize; - + /** Cache for the most recently generated structures, ordered by the recentness. */ cStructurePtrs m_Cache; - - + + /** Clears everything from the cache */ void ClearCache(void); - + /** Returns all structures that may intersect the given chunk. The structures are considered as intersecting iff their bounding box (defined by m_MaxStructureSize) around their gridpoint intersects the chunk. */ |