From 929dc59ddeb71f913bf94d09272b97e24e59b9b0 Mon Sep 17 00:00:00 2001 From: darkrose Date: Mon, 4 May 2015 22:17:07 +1000 Subject: [PATCH] correct some face directions --- src/content_mapblock.cpp | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/content_mapblock.cpp b/src/content_mapblock.cpp index d772071..820fef4 100644 --- a/src/content_mapblock.cpp +++ b/src/content_mapblock.cpp @@ -4112,6 +4112,14 @@ void meshgen_slablike(MeshMakeData *data, v3s16 p, MapNode &n, bool selected) v3s16( 0, 0, 1), v3s16( 0, 0,-1), }; + static v3s16 ufaces[6] = { + v3s16( 0,-1, 0), + v3s16( 0, 1, 0), + v3s16(-1, 0, 0), + v3s16( 1, 0, 0), + v3s16( 0, 0, 1), + v3s16( 0, 0,-1), + }; TileSpec tiles[6]; NodeMetadata *meta = data->m_env->getMap().getNodeMetadata(p+data->m_blockpos_nodes); @@ -4212,7 +4220,7 @@ void meshgen_slablike(MeshMakeData *data, v3s16 p, MapNode &n, bool selected) if (selected) { meshgen_selected_lights(colours,255,4); }else{ - meshgen_lights(data,n,p,colours,255,faces[5-i],4,vertices[i]); + meshgen_lights(data,n,p,colours,255,ufaces[i],4,vertices[i]); } for (int j=0; j<4; j++) { @@ -4611,7 +4619,7 @@ void meshgen_trunklike(MeshMakeData *data, v3s16 p, MapNode &n, bool selected) for (u16 i=0; i<3; i++) { f[i] = faces[i]; f[i].rotateXYBy(90); - f[i].rotateYZBy(rots[j]); + f[i].rotateYZBy(180+rots[j]); } meshgen_lights(data,n,p,colours,255,f[0],2,v); meshgen_lights(data,n,p,colours,255,f[1],1,&v[2]); @@ -4693,7 +4701,7 @@ void meshgen_trunklike(MeshMakeData *data, v3s16 p, MapNode &n, bool selected) for (u16 i=0; i<3; i++) { f[i] = faces[i]; f[i].rotateYZBy(90); - f[i].rotateXYBy(rots[j]); + f[i].rotateXYBy(180+rots[j]); } meshgen_lights(data,n,p,colours,255,f[0],2,v); meshgen_lights(data,n,p,colours,255,f[1],1,&v[2]); @@ -4729,7 +4737,7 @@ void meshgen_trunklike(MeshMakeData *data, v3s16 p, MapNode &n, bool selected) for (u16 i=0; i<3; i++) { f[i] = faces[i]; f[i].rotateYZBy(90); - f[i].rotateXYBy(rots[j]); + f[i].rotateXYBy(180+rots[j]); } meshgen_lights(data,n,p,colours,255,f[0],2,v); meshgen_lights(data,n,p,colours,255,f[1],1,&v[2]); @@ -4764,7 +4772,7 @@ void meshgen_trunklike(MeshMakeData *data, v3s16 p, MapNode &n, bool selected) for (u16 i=0; i<3; i++) { f[i] = faces[i]; f[i].rotateYZBy(90); - f[i].rotateXYBy(rots[j]); + f[i].rotateXYBy(180+rots[j]); } meshgen_lights(data,n,p,colours,255,f[0],2,v); meshgen_lights(data,n,p,colours,255,f[1],1,&v[2]); @@ -4847,7 +4855,7 @@ void meshgen_trunklike(MeshMakeData *data, v3s16 p, MapNode &n, bool selected) for (u16 i=0; i<3; i++) { f[i] = faces[i]; f[i].rotateXYBy(90); - f[i].rotateYZBy(rots[j]); + f[i].rotateYZBy(180+rots[j]); } meshgen_lights(data,n,p,colours,255,f[0],2,v); meshgen_lights(data,n,p,colours,255,f[1],1,&v[2]); @@ -4882,7 +4890,7 @@ void meshgen_trunklike(MeshMakeData *data, v3s16 p, MapNode &n, bool selected) for (u16 i=0; i<3; i++) { f[i] = faces[i]; f[i].rotateXYBy(90); - f[i].rotateYZBy(rots[j]); + f[i].rotateYZBy(180+rots[j]); } meshgen_lights(data,n,p,colours,255,f[0],2,v); meshgen_lights(data,n,p,colours,255,f[1],1,&v[2]);