1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-09-30 19:22:14 +00:00

MapBlock::getData be gone (#16292)

* Remove Mapblock::getData and all its uses

* Do not leak ystride, zstride, and nodecount
This commit is contained in:
lhofhansl 2025-06-29 13:36:47 -07:00 committed by GitHub
parent fd0ca20ce9
commit 43aad3711b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 33 additions and 21 deletions

View file

@ -21,6 +21,7 @@ class NodeMetadataList;
class IGameDef;
class MapBlockMesh;
class VoxelManipulator;
class NameIdMapping;
#define BLOCK_TIMESTAMP_UNDEFINED 0xffffffff
@ -80,11 +81,6 @@ public:
raiseModified(MOD_STATE_WRITE_NEEDED, MOD_REASON_REALLOCATE);
}
MapNode* getData()
{
return data;
}
////
//// Modification tracking methods
////
@ -427,18 +423,23 @@ public:
// clearObject and return removed objects count
u32 clearObjects();
private:
static const u32 ystride = MAP_BLOCKSIZE;
static const u32 zstride = MAP_BLOCKSIZE * MAP_BLOCKSIZE;
static const u32 nodecount = MAP_BLOCKSIZE * MAP_BLOCKSIZE * MAP_BLOCKSIZE;
private:
/*
Private methods
*/
void deSerialize_pre22(std::istream &is, u8 version, bool disk);
static void getBlockNodeIdMapping(NameIdMapping *nimap, MapNode *nodes,
const NodeDefManager *nodedef);
static void correctBlockNodeIds(const NameIdMapping *nimap, MapNode *nodes,
IGameDef *gamedef);
/*
* PLEASE NOTE: When adding something here be mindful of position and size
* of member variables! This is also the reason for the weird public-private