From 807a0d313ba667356ee8af8ef5ae82b6c4881d15 Mon Sep 17 00:00:00 2001 From: Kahrl Date: Tue, 13 Mar 2012 18:56:12 +0100 Subject: MapBlockMesh, mesh animation system, urgent mesh updates, athmospheric light, removed footprints --- src/mapnode.cpp | 112 -------------------------------------------------------- 1 file changed, 112 deletions(-) (limited to 'src/mapnode.cpp') diff --git a/src/mapnode.cpp b/src/mapnode.cpp index 6cb9671b5..54be5d1d6 100644 --- a/src/mapnode.cpp +++ b/src/mapnode.cpp @@ -353,115 +353,3 @@ void MapNode::deSerialize_pre22(u8 *source, u8 version) // Translate to our known version *this = mapnode_translate_to_internal(*this, version); } - - -#ifndef SERVER - -/* - Nodes make a face if contents differ and solidness differs. - Return value: - 0: No face - 1: Face uses m1's content - 2: Face uses m2's content - equivalent: Whether the blocks share the same face (eg. water and glass) - - TODO: Add 3: Both faces drawn with backface culling, remove equivalent -*/ -u8 face_contents(content_t m1, content_t m2, bool *equivalent, - INodeDefManager *nodemgr) -{ - *equivalent = false; - - if(m1 == CONTENT_IGNORE || m2 == CONTENT_IGNORE) - return 0; - - bool contents_differ = (m1 != m2); - - const ContentFeatures &f1 = nodemgr->get(m1); - const ContentFeatures &f2 = nodemgr->get(m2); - - // Contents don't differ for different forms of same liquid - if(f1.sameLiquid(f2)) - contents_differ = false; - - u8 c1 = f1.solidness; - u8 c2 = f2.solidness; - - bool solidness_differs = (c1 != c2); - bool makes_face = contents_differ && solidness_differs; - - if(makes_face == false) - return 0; - - if(c1 == 0) - c1 = f1.visual_solidness; - if(c2 == 0) - c2 = f2.visual_solidness; - - if(c1 == c2){ - *equivalent = true; - // If same solidness, liquid takes precense - if(f1.isLiquid()) - return 1; - if(f2.isLiquid()) - return 2; - } - - if(c1 > c2) - return 1; - else - return 2; -} - -/* - Gets lighting value at face of node - - Parameters must consist of air and !air. - Order doesn't matter. - - If either of the nodes doesn't exist, light is 0. - - parameters: - daynight_ratio: 0...1000 - n: getNode(p) (uses only the lighting value) - n2: getNode(p + face_dir) (uses only the lighting value) - face_dir: axis oriented unit vector from p to p2 - - returns encoded light value. -*/ -u8 getFaceLight(u32 daynight_ratio, MapNode n, MapNode n2, - v3s16 face_dir, INodeDefManager *nodemgr) -{ - try{ - u8 light; - u8 l1 = n.getLightBlend(daynight_ratio, nodemgr); - u8 l2 = n2.getLightBlend(daynight_ratio, nodemgr); - if(l1 > l2) - light = l1; - else - light = l2; - - // Make some nice difference to different sides - - // This makes light come from a corner - /*if(face_dir.X == 1 || face_dir.Z == 1 || face_dir.Y == -1) - light = diminish_light(diminish_light(light)); - else if(face_dir.X == -1 || face_dir.Z == -1) - light = diminish_light(light);*/ - - // All neighboring faces have different shade (like in minecraft) - if(face_dir.X == 1 || face_dir.X == -1 || face_dir.Y == -1) - light = diminish_light(diminish_light(light)); - else if(face_dir.Z == 1 || face_dir.Z == -1) - light = diminish_light(light); - - return light; - } - catch(InvalidPositionException &e) - { - return 0; - } -} - -#endif - -- cgit v1.2.3