mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Node definition manager refactor (#7016)
* Rename IWritableNodeDefManager to NodeDefManager * Make INodeDefManager functions const * Use "const *NodeDefManager" instead of "*INodeDefManager" * Remove unused INodeDefManager class * Merge NodeDefManager and CNodeDefManager * Document NodeDefManager
This commit is contained in:
parent
617d94c803
commit
3face01a20
61 changed files with 583 additions and 457 deletions
|
@ -132,6 +132,7 @@ std::string MapBlock::getModifiedReasonString()
|
|||
return reason;
|
||||
}
|
||||
|
||||
|
||||
void MapBlock::copyTo(VoxelManipulator &dst)
|
||||
{
|
||||
v3s16 data_size(MAP_BLOCKSIZE, MAP_BLOCKSIZE, MAP_BLOCKSIZE);
|
||||
|
@ -154,7 +155,7 @@ void MapBlock::copyFrom(VoxelManipulator &dst)
|
|||
|
||||
void MapBlock::actuallyUpdateDayNightDiff()
|
||||
{
|
||||
INodeDefManager *nodemgr = m_gamedef->ndef();
|
||||
const NodeDefManager *nodemgr = m_gamedef->ndef();
|
||||
|
||||
// Running this function un-expires m_day_night_differs
|
||||
m_day_night_differs_expired = false;
|
||||
|
@ -252,7 +253,7 @@ s16 MapBlock::getGroundLevel(v2s16 p2d)
|
|||
// mapblocks.
|
||||
static content_t getBlockNodeIdMapping_mapping[USHRT_MAX + 1];
|
||||
static void getBlockNodeIdMapping(NameIdMapping *nimap, MapNode *nodes,
|
||||
INodeDefManager *nodedef)
|
||||
const NodeDefManager *nodedef)
|
||||
{
|
||||
memset(getBlockNodeIdMapping_mapping, 0xFF, (USHRT_MAX + 1) * sizeof(content_t));
|
||||
|
||||
|
@ -294,7 +295,7 @@ static void getBlockNodeIdMapping(NameIdMapping *nimap, MapNode *nodes,
|
|||
static void correctBlockNodeIds(const NameIdMapping *nimap, MapNode *nodes,
|
||||
IGameDef *gamedef)
|
||||
{
|
||||
INodeDefManager *nodedef = gamedef->ndef();
|
||||
const NodeDefManager *nodedef = gamedef->ndef();
|
||||
// This means the block contains incorrect ids, and we contain
|
||||
// the information to convert those to names.
|
||||
// nodedef contains information to convert our names to globally
|
||||
|
@ -741,7 +742,7 @@ void MapBlock::deSerialize_pre22(std::istream &is, u8 version, bool disk)
|
|||
|
||||
// Legacy data changes
|
||||
// This code has to convert from pre-22 to post-22 format.
|
||||
INodeDefManager *nodedef = m_gamedef->ndef();
|
||||
const NodeDefManager *nodedef = m_gamedef->ndef();
|
||||
for(u32 i=0; i<nodecount; i++)
|
||||
{
|
||||
const ContentFeatures &f = nodedef->get(data[i].getContent());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue