summaryrefslogtreecommitdiff
path: root/src/nodedef.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-11-15 22:41:49 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-11-29 19:13:45 +0200
commitcde35d160600bb97c62c48fd1924c98d23a6ac98 (patch)
tree66606110acdfb3d68534ca6a2d4846633555699f /src/nodedef.cpp
parent9fc78cbece4d26307dab814d8073fc0a1db90bf9 (diff)
downloadminetest-cde35d160600bb97c62c48fd1924c98d23a6ac98.tar.gz
minetest-cde35d160600bb97c62c48fd1924c98d23a6ac98.tar.bz2
minetest-cde35d160600bb97c62c48fd1924c98d23a6ac98.zip
Clean nodefeat and content_mapnode a bit
Diffstat (limited to 'src/nodedef.cpp')
-rw-r--r--src/nodedef.cpp34
1 files changed, 32 insertions, 2 deletions
diff --git a/src/nodedef.cpp b/src/nodedef.cpp
index c1aee5df4..4e43369b4 100644
--- a/src/nodedef.cpp
+++ b/src/nodedef.cpp
@@ -27,7 +27,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "log.h"
#include "settings.h"
-void NodeBox::serialize(std::ostream &os)
+/*
+ NodeBox
+*/
+
+void NodeBox::serialize(std::ostream &os) const
{
writeU8(os, 0); // version
writeU8(os, type);
@@ -57,7 +61,11 @@ void NodeBox::deSerialize(std::istream &is)
wall_side.MaxEdge = readV3F1000(is);
}
-void MaterialSpec::serialize(std::ostream &os)
+/*
+ MaterialSpec
+*/
+
+void MaterialSpec::serialize(std::ostream &os) const
{
os<<serializeString(tname);
writeU8(os, backface_culling);
@@ -69,6 +77,10 @@ void MaterialSpec::deSerialize(std::istream &is)
backface_culling = readU8(is);
}
+/*
+ ContentFeatures
+*/
+
ContentFeatures::ContentFeatures()
{
reset();
@@ -248,6 +260,20 @@ void ContentFeatures::setTexture(u16 i, std::string name)
tname_inventory = name;
}
+void ContentFeatures::setAllTextures(std::string name)
+{
+ for(u16 i=0; i<6; i++)
+ setTexture(i, name);
+ // Force inventory texture too
+ setInventoryTexture(name);
+}
+
+void ContentFeatures::setSpecialMaterial(u16 i, const MaterialSpec &mspec)
+{
+ assert(i < CF_SPECIAL_COUNT);
+ mspec_special[i] = mspec;
+}
+
void ContentFeatures::setInventoryTexture(std::string imgname)
{
tname_inventory = imgname + "^[forcesingle";
@@ -270,6 +296,10 @@ void ContentFeatures::setInventoryTextureCube(std::string top,
tname_inventory = imgname_full;
}
+/*
+ CNodeDefManager
+*/
+
class CNodeDefManager: public IWritableNodeDefManager
{
public: