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

Optimise MapBlockMesh related functions

Directely or indirectly optimises the following functions:

* MapBlockMesh::MapBlockMesh
* MapBlockMesh::getTileInfo
* MapBlockMesh::makeFastFace
* MapBlockMesh::getSmoothLightCombined
This commit is contained in:
gregorycu 2015-02-23 23:20:06 +10:00 committed by Craig Robbins
parent 3b6480c5b0
commit 577701cabd
5 changed files with 35 additions and 12 deletions

View file

@ -413,10 +413,21 @@ public:
}
// Stuff explodes if non-emerged area is touched with this.
// Emerge first, and check VOXELFLAG_NO_DATA if appropriate.
MapNode & getNodeRefUnsafe(v3s16 p)
MapNode & getNodeRefUnsafe(const v3s16 &p)
{
return m_data[m_area.index(p)];
}
const MapNode & getNodeRefUnsafeCheckFlags(const v3s16 &p)
{
s32 index = m_area.index(p);
if (m_flags[index] & VOXELFLAG_NO_DATA)
return ContentIgnoreNode;
return m_data[index];
}
u8 & getFlagsRefUnsafe(v3s16 p)
{
return m_flags[m_area.index(p)];
@ -569,6 +580,8 @@ public:
*/
u8 *m_flags;
static const MapNode ContentIgnoreNode;
//TODO: Use these or remove them
//TODO: Would these make any speed improvement?
//bool m_pressure_route_valid;