1
0
Fork 0
Commit Graph

9 Commits

Author SHA1 Message Date
peterbell10 31a11a6df4
Optimise chunk set (#4260)
Closes #1244

Initially I was just going to add the cChunkData to cSetChunkData but profiling revealed 
that the copying wasn't even the biggest slowdown. Much more time was being spent in 
cChunk::CreateBlockEntities and cChunk::WakeUpSimulators than was in memcpy so I've made 
those significantly faster as well.

Optimisations performed:
 * cSetChunkData now stores blocks in a cChunkData object
 * cChunkData objects can now perform moves even if they are using different pools
 * cChunk::CreateBlockEntities now iterates in the correct order and only over present chunk sections
 * Similarly for cChunk::WakeUpSimulators
 * cSetChunkData::CalculateHeightMap now shortcuts to the highest present chunk section before checking blocks directly
2018-07-23 19:12:51 +01:00
Tiger Wang 4ef47aed62 Changed entity ownership model to use smart pointers 2017-08-07 19:24:16 +01:00
peterbell10 a56cfd1f42 Remove smart pointer macros 2017-07-21 14:41:51 +01:00
peterbell10 8a890cf945 Store cChunk::m_BlockEntities in a map (#3717)
* Store block entities in a map from block index
* Cleanup ForEachBlockEntity
* Cleanup DoWithBlockEntityAt
2017-05-22 22:27:55 +02:00
LogicParrot ca6ef58b1e Bulk clearing of whitespace 2016-02-05 23:50:18 +02:00
Woazboat 6caf08da99 cSetChunkData constructor explicitly requires std::move() instead of
unsafely stealing data
2015-04-27 21:18:56 +02:00
Tiger Wang a26541a7c3 En masse NULL -> nullptr replace 2014-10-22 20:12:49 -07:00
Mattes D 22e3bbd0db Rewritten block entity loading.
Block entities are now loaded based on the blocktype at the coords they specify; before loading, their type ("id" NBT tag) is checked.
The chunk now expects that all block entities given to it via cChunk::SetAllData() have their valid blocktype; asserts if they don't.
Fixes #1354.
2014-08-29 19:19:47 +03:00
madmaxoft c0b62ef139 Added a queue for setting chunk data.
Fixes #1196.
2014-07-24 18:32:05 +02:00