]> git.lizzy.rs Git - minetest.git/blobdiff - src/mapnode.h
Decoration: Change divlen to sidelen
[minetest.git] / src / mapnode.h
index fe656fa5cd53f4c41c49a201f51462ba07995cc6..1c8c5c49c0d55596c8c313cefd84c8e2f3fd211d 100644 (file)
@@ -1,6 +1,6 @@
 /*
-Minetest-c55
-Copyright (C) 2010-2011 celeron55, Perttu Ahola <celeron55@gmail.com>
+Minetest
+Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU Lesser General Public License as published by
@@ -33,10 +33,6 @@ class INodeDefManager;
        - Material = irrlicht's Material class
        - Content = (content_t) content of a node
        - Tile = TileSpec at some side of a node of some content type
-
-       Content ranges:
-         0x000...0x07f: param2 is fully usable
-         0x800...0xfff: param2 lower 4 bits are free
 */
 typedef u16 content_t;
 #define MAX_CONTENT 0xfff
@@ -71,10 +67,15 @@ enum LightBank
 #define LIQUID_LEVEL_MASK 0x07
 #define LIQUID_FLOW_DOWN_MASK 0x08
 
+//#define LIQUID_LEVEL_MASK 0x3f // better finite water
+//#define LIQUID_FLOW_DOWN_MASK 0x40 // not used when finite water
+
 /* maximum amount of liquid in a block */
 #define LIQUID_LEVEL_MAX LIQUID_LEVEL_MASK
 #define LIQUID_LEVEL_SOURCE (LIQUID_LEVEL_MAX+1)
 
+#define LIQUID_INFINITY_MASK 0x80 //0b10000000
+
 /*
        This is the stuff what the whole world consists of.
 */
@@ -84,8 +85,6 @@ struct MapNode
 {
        /*
                Main content
-               0x00-0x7f: Short content type
-               0x80-0xff: Long content type
        */
        u16 param0;
 
@@ -169,6 +168,16 @@ struct MapNode
                return blend_light(daylight_factor, lightday, lightnight);
        }
 
+       // 0.0 <= daylight_factor <= 1.0
+       // 0 <= return value <= LIGHT_SUN
+       u8 getLightBlendF1(float daylight_factor, INodeDefManager *nodemgr) const
+       {
+               u8 lightday = 0;
+               u8 lightnight = 0;
+               getLightBanks(lightday, lightnight, nodemgr);
+               return blend_light_f1(daylight_factor, lightday, lightnight);
+       }
+
        u8 getFaceDir(INodeDefManager *nodemgr) const;
        u8 getWallMounted(INodeDefManager *nodemgr) const;
        v3s16 getWallMountedDir(INodeDefManager *nodemgr) const;
@@ -208,7 +217,6 @@ struct MapNode
 
 private:
        // Deprecated serialization methods
-       void serialize_pre22(u8 *dest, u8 version);
        void deSerialize_pre22(u8 *source, u8 version);
 };