diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-04-03 19:50:54 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-04-03 19:50:54 +0300 |
commit | e0f7bd4d57bf0c9b497c4d0bb73f7bd4d5cc0643 (patch) | |
tree | 756f4451eac9a1446a4b1acd8f5cda3f625eabb3 /src/voxel.h | |
parent | 01c2b003e1efb839ad246eb939af7fa8336b9ad5 (diff) | |
download | hax-minetest-server-e0f7bd4d57bf0c9b497c4d0bb73f7bd4d5cc0643.tar.gz hax-minetest-server-e0f7bd4d57bf0c9b497c4d0bb73f7bd4d5cc0643.zip |
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.
Diffstat (limited to 'src/voxel.h')
-rw-r--r-- | src/voxel.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/voxel.h b/src/voxel.h index eced43ed5..5d45ab183 100644 --- a/src/voxel.h +++ b/src/voxel.h @@ -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); |