summaryrefslogtreecommitdiff
path: root/src/mapblock.h
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2010-12-18 13:10:37 +0200
committerPerttu Ahola <celeron55@gmail.com>2010-12-18 13:10:37 +0200
commit15a43c5ed02130f1b1e07a0385530da197b0c846 (patch)
tree94851572e9e711dd5c5f5d6ef2e84680166de35b /src/mapblock.h
parent385dd9917fd4ced23a704f0566779d58f5a6b727 (diff)
downloadminetest-15a43c5ed02130f1b1e07a0385530da197b0c846.tar.gz
minetest-15a43c5ed02130f1b1e07a0385530da197b0c846.tar.bz2
minetest-15a43c5ed02130f1b1e07a0385530da197b0c846.zip
before adding day/night lighting
--HG-- rename : data/light.png => data/cloud.png
Diffstat (limited to 'src/mapblock.h')
-rw-r--r--src/mapblock.h44
1 files changed, 41 insertions, 3 deletions
diff --git a/src/mapblock.h b/src/mapblock.h
index 608249383..ebc2b52ff 100644
--- a/src/mapblock.h
+++ b/src/mapblock.h
@@ -46,10 +46,27 @@ enum{
struct FastFace
{
- u16 tile;
+ TileSpec tile;
video::S3DVertex vertices[4]; // Precalculated vertices
};
+enum NodeModType
+{
+ NODEMOD_NONE,
+ NODEMOD_CHANGECONTENT, //param is content id
+ NODEMOD_CRACK // param is crack progression
+};
+
+struct NodeMod
+{
+ NodeMod()
+ {
+ type = NODEMOD_NONE;
+ }
+ enum NodeModType type;
+ u16 param;
+};
+
enum
{
NODECONTAINER_ID_MAPBLOCK,
@@ -283,12 +300,12 @@ public:
setNode(x0+x, y0+y, z0+z, node);
}
- static FastFace * makeFastFace(u16 tile, u8 light, v3f p,
+ static FastFace * makeFastFace(TileSpec tile, u8 light, v3f p,
v3s16 dir, v3f scale, v3f posRelative_f);
u8 getFaceLight(v3s16 p, v3s16 face_dir);
- u16 getNodeTile(v3s16 p, v3s16 face_dir);
+ TileSpec getNodeTile(v3s16 p, v3s16 face_dir);
u8 getNodeContent(v3s16 p);
/*
@@ -380,6 +397,24 @@ public:
{
return m_objects.getCount();
}
+
+ /*
+ Methods for setting temporary modifications to nodes for
+ drawing
+ */
+ void setTempMod(v3s16 p, NodeMod mod)
+ {
+ m_temp_mods[p] = mod;
+ }
+ void clearTempMod(v3s16 p)
+ {
+ if(m_temp_mods.find(p))
+ m_temp_mods.remove(p);
+ }
+ void clearTempMods()
+ {
+ m_temp_mods.clear();
+ }
/*
Serialization
@@ -432,6 +467,9 @@ private:
MapBlockObjectList m_objects;
+ // Temporary modifications to nodes
+ // These are only used when drawing
+ core::map<v3s16, NodeMod> m_temp_mods;
};
inline bool blockpos_over_limit(v3s16 p)