From 2f2392f7834e355bfa57ef9f2fbd3f645be6ca6d Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Tue, 15 Nov 2011 21:36:46 +0200 Subject: [PATCH] Improve glass --- data/mods/default/textures/glass.png | Bin 1309 -> 978 bytes src/content_mapblock.cpp | 82 +++++++++++---------------- 2 files changed, 33 insertions(+), 49 deletions(-) diff --git a/data/mods/default/textures/glass.png b/data/mods/default/textures/glass.png index 8598ce670f502802f166eb4b8d07a871b564d263..ade0196fe64e00c80496c9bfc914645d5b472bd2 100644 GIT binary patch delta 146 zcmbQsb%}j~3KwH>kh>GZx^prwHyZLWOE55&1o;IsI6S+N#=yY9nB?v5!qCAg>oM7r zMLwRJUsy$~;gH@{pp>1bi(`ny<>Uvf%xrNI2@g^o7;mt)DCPvt5McHZ)pzP6;qdp?hob?3=9w6Fjq_EPH+U8#Ng@b=d#Wzp$PyU=_>>P literal 1309 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJOS+@4BLl<6e(pbstPBjy3;{kN zu0Zi+OHM9Za&G0alPi{;S+(Nq;>A}MExNj7@s+h}Z*ARrcgK!uU~(E|NiU8k3YYD{r&Uj-@kwV zfrgKQ(GVESArKNB#>2qC$WRjG7yN%@1BT%5?5e=H;wm_vmanip.getNodeNoEx(n2p); + // Don't make face if neighbor is of same type + if(n2.getContent() == n.getContent()) + continue; + + // The face at Z+ video::S3DVertex vertices[4] = { video::S3DVertex(-BS/2,-BS/2,BS/2, 0,0,0, c, @@ -540,40 +548,28 @@ void mapblock_mesh_generate_special(MeshMakeData *data, video::S3DVertex(-BS/2,BS/2,BS/2, 0,0,0, c, pa_glass.x0(), pa_glass.y0()), }; - - if(j == 0) - { + + // Rotations in the g_6dirs format + if(j == 0) // Z+ for(u16 i=0; i<4; i++) vertices[i].Pos.rotateXZBy(0); - } - else if(j == 1) - { + else if(j == 1) // Y+ for(u16 i=0; i<4; i++) - vertices[i].Pos.rotateXZBy(180); - } - else if(j == 2) - { + vertices[i].Pos.rotateYZBy(-90); + else if(j == 2) // X+ for(u16 i=0; i<4; i++) vertices[i].Pos.rotateXZBy(-90); - } - else if(j == 3) - { - for(u16 i=0; i<4; i++) - vertices[i].Pos.rotateXZBy(90); - } - else if(j == 4) - { + else if(j == 3) // Z- for(u16 i=0; i<4; i++) - vertices[i].Pos.rotateYZBy(-90); - } - else if(j == 5) - { + vertices[i].Pos.rotateXZBy(180); + else if(j == 4) // Y- for(u16 i=0; i<4; i++) vertices[i].Pos.rotateYZBy(90); - } + else if(j == 5) // X- + for(u16 i=0; i<4; i++) + vertices[i].Pos.rotateXZBy(90); - for(u16 i=0; i<4; i++) - { + for(u16 i=0; i<4; i++){ vertices[i].Pos += intToFloat(p + blockpos_nodes, BS); } @@ -609,39 +605,27 @@ void mapblock_mesh_generate_special(MeshMakeData *data, pa_leaves1.x0(), pa_leaves1.y0()), }; - if(j == 0) - { + // Rotations in the g_6dirs format + if(j == 0) // Z+ for(u16 i=0; i<4; i++) vertices[i].Pos.rotateXZBy(0); - } - else if(j == 1) - { + else if(j == 1) // Y+ for(u16 i=0; i<4; i++) - vertices[i].Pos.rotateXZBy(180); - } - else if(j == 2) - { + vertices[i].Pos.rotateYZBy(-90); + else if(j == 2) // X+ for(u16 i=0; i<4; i++) vertices[i].Pos.rotateXZBy(-90); - } - else if(j == 3) - { + else if(j == 3) // Z- for(u16 i=0; i<4; i++) - vertices[i].Pos.rotateXZBy(90); - } - else if(j == 4) - { - for(u16 i=0; i<4; i++) - vertices[i].Pos.rotateYZBy(-90); - } - else if(j == 5) - { + vertices[i].Pos.rotateXZBy(180); + else if(j == 4) // Y- for(u16 i=0; i<4; i++) vertices[i].Pos.rotateYZBy(90); - } + else if(j == 5) // X- + for(u16 i=0; i<4; i++) + vertices[i].Pos.rotateXZBy(90); - for(u16 i=0; i<4; i++) - { + for(u16 i=0; i<4; i++){ vertices[i].Pos += intToFloat(p + blockpos_nodes, BS); } -- 2.30.2