1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Mapgen: Performance improvement and fixes for updateLiquid (#4065)

- Adds only ~100 nodes per chunk to trans_liquid with similar processing time
- Adds liquid nodes themselves instead of potential solid nodes below them
- CONTENT_IGNORE nodes are interpreted as if they continue their neighborhood
- This allows liquid columns to span multiple chunks without being interrupted
- NOTE: Expects an one-node border in generation chunk without liquid changes
This commit is contained in:
MillersMan 2016-06-05 01:30:36 +02:00 committed by kwolekr
parent 109c7e3349
commit 7841f1c509
2 changed files with 75 additions and 12 deletions

View file

@ -199,6 +199,10 @@ public:
virtual int getSpawnLevelAtPoint(v2s16 p) { return 0; }
private:
// isLiquidHorizontallyFlowable() is a helper function for updateLiquid()
// that checks whether there are floodable nodes without liquid beneath
// the node at index vi.
inline bool isLiquidHorizontallyFlowable(u32 vi, v3s16 em);
DISABLE_CLASS_COPY(Mapgen);
};