1
0
Fork 0
Commit Graph

22 Commits

Author SHA1 Message Date
Mattes D 46398f4671 Replaced cpp14::make_unique<> with std::make_unique<>. 2020-08-01 20:04:31 +01:00
peterbell10 aac592f985
Manage block entity lifetime with unique_ptr (#4080) 2020-04-03 23:23:38 +02:00
peterbell10 7d512f2191 Limit the size of cListAllocationPool's free list 2019-02-20 09:07:44 +00:00
peterbell10 4727ed2084 Add a formatting function for Vector3 (#4282)
* Vector3: Add custom fmt compatible formatter.

* cLuaState: Add fmt version of ApiParamError

* Use vector formatting in manual bindings

* Always log vectors with FLOG
2018-09-24 21:33:39 +01:00
peterbell10 950aeffff8
CheckBasicStyle: Check number of empty lines between functions (#4267)
Add check for number of empty lines between functions and fix the corresponding failures
2018-07-26 22:24:36 +01:00
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 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
Mattes D 9329c2c2cb Merge pull request #1945 from Woazboat/CodeCleanup_refactored
Small code cleanup - clean version
2015-05-08 21:52:41 +02:00
Woazboat 8a50918d2a Tracer::signum function now returns int
convert c style casts to c++ static casts

Changed fabs() to std::abs()
2015-05-08 15:12:32 +02:00
worktycho ee939cf8c8 Revert "Small code cleanup" 2015-05-05 22:08:40 +01:00
Woazboat 4e8b4981d8 convert c style casts to c++ static casts 2015-04-28 02:26:25 +02:00
Woazboat e240cab523 Removed redundant temp iterator. std::list.erase already returns
iterator to next valid list element
2015-04-27 21:54:36 +02:00
Woazboat 6caf08da99 cSetChunkData constructor explicitly requires std::move() instead of
unsafely stealing data
2015-04-27 21:18:56 +02:00
Kirill Kirilenko 41f30edcf7 Fixed CppCheck: (performance) Prefer prefix ++/-- operators for non-primitive types. 2015-01-17 16:00:12 +03:00
Tiger Wang a26541a7c3 En masse NULL -> nullptr replace 2014-10-22 20:12:49 -07:00
Mattes D 4230eb3d92 Fixed loading empty chunks.
Reported on the Dropper map in #1307.
2014-09-05 22:55:39 +02:00
worktycho 3e7332c70c Delete the entity before removing from the list
Old code was calling dereference on invalid iterator
2014-08-31 20:28:41 +01: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
Mattes D 4358421cd4 cSetChunkData: Added missing initializers. 2014-08-21 21:58:08 +02:00
madmaxoft c0b62ef139 Added a queue for setting chunk data.
Fixes #1196.
2014-07-24 18:32:05 +02:00