From ba762bcd49c9f3ffa3cc4ecac73b13365c2047ec Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Tue, 15 Nov 2011 21:00:39 +0200 Subject: Clean mapnode.h and fix other files accordingly --- src/mapnode.cpp | 56 +------------------------------------------------------- 1 file changed, 1 insertion(+), 55 deletions(-) (limited to 'src/mapnode.cpp') diff --git a/src/mapnode.cpp b/src/mapnode.cpp index 1e8915b03..2fbc81dd2 100644 --- a/src/mapnode.cpp +++ b/src/mapnode.cpp @@ -25,6 +25,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "main.h" // For g_settings #include "nodedef.h" #include "content_mapnode.h" // For mapnode_translate_*_internal +#include "serialization.h" // For ser_ver_supported #ifndef SERVER /* @@ -208,61 +209,6 @@ u8 MapNode::getLightBanksWithSource(INodeDefManager *nodemgr) const return (lightday&0x0f) | ((lightnight<<4)&0xf0); } -#ifndef SERVER -TileSpec MapNode::getTile(v3s16 dir, ITextureSource *tsrc, - INodeDefManager *nodemgr) const -{ - if(nodemgr->get(*this).param_type == CPT_FACEDIR_SIMPLE) - dir = facedir_rotate(param1, dir); - - TileSpec spec; - - s32 dir_i = -1; - - if(dir == v3s16(0,0,0)) - dir_i = -1; - else if(dir == v3s16(0,1,0)) - dir_i = 0; - else if(dir == v3s16(0,-1,0)) - dir_i = 1; - else if(dir == v3s16(1,0,0)) - dir_i = 2; - else if(dir == v3s16(-1,0,0)) - dir_i = 3; - else if(dir == v3s16(0,0,1)) - dir_i = 4; - else if(dir == v3s16(0,0,-1)) - dir_i = 5; - - if(dir_i == -1) - // Non-directional - spec = nodemgr->get(*this).tiles[0]; - else - spec = nodemgr->get(*this).tiles[dir_i]; - - /* - If it contains some mineral, change texture id - */ - if(nodemgr->get(*this).param_type == CPT_MINERAL && tsrc) - { - u8 mineral = getMineral(nodemgr); - std::string mineral_texture_name = mineral_block_texture(mineral); - if(mineral_texture_name != "") - { - u32 orig_id = spec.texture.id; - std::string texture_name = tsrc->getTextureName(orig_id); - //texture_name += "^blit:"; - texture_name += "^"; - texture_name += mineral_texture_name; - u32 new_id = tsrc->getTextureId(texture_name); - spec.texture = tsrc->getTexture(new_id); - } - } - - return spec; -} -#endif - u8 MapNode::getMineral(INodeDefManager *nodemgr) const { if(nodemgr->get(*this).param_type == CPT_MINERAL) -- cgit v1.2.3