]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/mapnode.h
Remove stuff made obsolete by making players more ActiveObject-like and raise protoco...
[dragonfireclient.git] / src / mapnode.h
index 7fe2054631fb31d1b8b1cd5449386bb2399ad5e6..65fc3b3e29566394a31c58fa75d3be6bde212f7e 100644 (file)
@@ -20,14 +20,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #ifndef MAPNODE_HEADER
 #define MAPNODE_HEADER
 
-#include <iostream>
 #include "irrlichttypes.h"
 #include "light.h"
-#include "exceptions.h"
-#include "serialization.h"
-#ifndef SERVER
-#include "tile.h"
-#endif
 
 class INodeDefManager;
 
@@ -153,6 +147,11 @@ struct MapNode
                // because this needs to override part of param2
                setContent(content);
        }
+       
+       // Create directly from a nodename
+       // If name is unknown, sets CONTENT_IGNORE
+       MapNode(INodeDefManager *ndef, const std::string &name,
+                       u8 a_param1=0, u8 a_param2=0);
 
        bool operator==(const MapNode &other)
        {
@@ -184,6 +183,30 @@ struct MapNode
                        param2 |= (c&0x0f)<<4;
                }
        }
+       u8 getParam1() const
+       {
+               return param1;
+       }
+       void setParam1(u8 p)
+       {
+               param1 = p;
+       }
+       u8 getParam2() const
+       {
+               if(param0 < 0x80)
+                       return param2;
+               else
+                       return param2 & 0x0f;
+       }
+       void setParam2(u8 p)
+       {
+               if(param0 < 0x80)
+                       param2 = p;
+               else{
+                       param2 &= 0xf0;
+                       param2 |= (p&0x0f);
+               }
+       }
        
        void setLight(enum LightBank bank, u8 a_light, INodeDefManager *nodemgr);
        u8 getLight(enum LightBank bank, INodeDefManager *nodemgr) const;
@@ -215,18 +238,6 @@ struct MapNode
                return mix;
        }*/
 
-       // In mapnode.cpp
-#ifndef SERVER
-       /*
-               Get tile of a face of the node.
-               dir: direction of face
-               Returns: TileSpec. Can contain miscellaneous texture coordinates,
-                        which must be obeyed so that the texture atlas can be used.
-       */
-       TileSpec getTile(v3s16 dir, ITextureSource *tsrc,
-                       INodeDefManager *nodemgr) const;
-#endif
-       
        /*
                Gets mineral content of node, if there is any.
                MINERAL_NONE if doesn't contain or isn't able to contain mineral.
@@ -239,7 +250,7 @@ struct MapNode
 
        static u32 serializedLength(u8 version);
        void serialize(u8 *dest, u8 version);
-       void deSerialize(u8 *source, u8 version, INodeDefManager *nodemgr);
+       void deSerialize(u8 *source, u8 version);
        
 };