summaryrefslogtreecommitdiff
path: root/src/mapblock.h
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2010-12-11 18:11:03 +0200
committerPerttu Ahola <celeron55@gmail.com>2010-12-11 18:11:03 +0200
commit2a0d1a059e556afaeb7f5b72205b26447e23286f (patch)
tree2e30313c2c40b59239a062fdb69d66e9abf153c4 /src/mapblock.h
parent5e0c284f3a8debdd9ebb080f80e36dceb7bc4ce2 (diff)
downloadminetest-2a0d1a059e556afaeb7f5b72205b26447e23286f.tar.gz
minetest-2a0d1a059e556afaeb7f5b72205b26447e23286f.tar.bz2
minetest-2a0d1a059e556afaeb7f5b72205b26447e23286f.zip
commit before some radicallish changes to water behavior
Diffstat (limited to 'src/mapblock.h')
-rw-r--r--src/mapblock.h68
1 files changed, 40 insertions, 28 deletions
diff --git a/src/mapblock.h b/src/mapblock.h
index 2c04343de..c18bbb2b4 100644
--- a/src/mapblock.h
+++ b/src/mapblock.h
@@ -30,6 +30,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "serialization.h"
#include "constants.h"
#include "mapblockobject.h"
+#include "voxel.h"
#define MAP_BLOCKSIZE 16
@@ -69,31 +70,6 @@ public:
class MapBlock : public NodeContainer
{
-private:
-
- NodeContainer *m_parent;
- // Position in blocks on parent
- v3s16 m_pos;
- /*
- If NULL, block is a dummy block.
- Dummy blocks are used for caching not-found-on-disk blocks.
- */
- MapNode * data;
- /*
- - On the client, this is used for checking whether to
- recalculate the face cache. (Is it anymore?)
- - On the server, this is used for telling whether the
- block has been changed from the one on disk.
- */
- bool changed;
- /*
- Used for some initial lighting stuff.
- At least /has been/ used. 8)
- */
- bool is_underground;
-
- MapBlockObjectList m_objects;
-
public:
/*
@@ -333,10 +309,12 @@ public:
bool propagateSunlight(core::map<v3s16, bool> & light_sources);
- // Doesn't write version by itself
- void serialize(std::ostream &os, u8 version);
+ // Copies data to VoxelManipulator to getPosRelative()
+ void copyTo(VoxelManipulator &dst);
- void deSerialize(std::istream &is, u8 version);
+ /*
+ Object stuff
+ */
void serializeObjects(std::ostream &os, u8 version)
{
@@ -403,6 +381,15 @@ public:
return m_objects.getCount();
}
+ /*
+ Serialization
+ */
+
+ // Doesn't write version by itself
+ void serialize(std::ostream &os, u8 version);
+
+ void deSerialize(std::istream &is, u8 version);
+
private:
/*
@@ -420,6 +407,31 @@ private:
{
return getNodeRef(p.X, p.Y, p.Z);
}
+
+
+ NodeContainer *m_parent;
+ // Position in blocks on parent
+ v3s16 m_pos;
+ /*
+ If NULL, block is a dummy block.
+ Dummy blocks are used for caching not-found-on-disk blocks.
+ */
+ MapNode * data;
+ /*
+ - On the client, this is used for checking whether to
+ recalculate the face cache. (Is it anymore?)
+ - On the server, this is used for telling whether the
+ block has been changed from the one on disk.
+ */
+ bool changed;
+ /*
+ Used for some initial lighting stuff.
+ At least /has been/ used. 8)
+ */
+ bool is_underground;
+
+ MapBlockObjectList m_objects;
+
};
inline bool blockpos_over_limit(v3s16 p)