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

Modified block mesh generation to have clearer input and output. Instead of being a messy object oriented cludge, it now is a messy cludge with separate parameters.

This commit is contained in:
Perttu Ahola 2011-04-03 19:50:54 +03:00
parent 01c2b003e1
commit e0f7bd4d57
9 changed files with 240 additions and 83 deletions

View file

@ -373,6 +373,34 @@ public:
return m_data[m_area.index(p)];
}
MapNode getNodeNoEx(v3s16 p)
{
emerge(p);
if(m_flags[m_area.index(p)] & VOXELFLAG_INEXISTENT)
{
return MapNode(CONTENT_IGNORE);
}
return m_data[m_area.index(p)];
}
MapNode & getNodeRef(v3s16 p)
{
emerge(p);
if(m_flags[m_area.index(p)] & VOXELFLAG_INEXISTENT)
{
dstream<<"EXCEPT: VoxelManipulator::getNode(): "
<<"p=("<<p.X<<","<<p.Y<<","<<p.Z<<")"
<<", index="<<m_area.index(p)
<<", flags="<<(int)m_flags[m_area.index(p)]
<<" is inexistent"<<std::endl;
throw InvalidPositionException
("VoxelManipulator: getNode: inexistent");
}
return m_data[m_area.index(p)];
}
void setNode(v3s16 p, MapNode &n)
{
emerge(p);