aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCiaran Gultnieks <ciaran@ciarang.com>2011-05-31 10:12:51 +0100
committerCiaran Gultnieks <ciaran@ciarang.com>2011-05-31 10:12:51 +0100
commit06427e355a7ebedfef5c487d33b584ca78f3ef79 (patch)
tree672f1cbde6a895f6c0fbada0217a1d8f649e0ed8
parent10cf6c3f6dba46a4cea0ed33ec5c9019d746bba9 (diff)
downloadminetest-06427e355a7ebedfef5c487d33b584ca78f3ef79.tar.gz
minetest-06427e355a7ebedfef5c487d33b584ca78f3ef79.tar.bz2
minetest-06427e355a7ebedfef5c487d33b584ca78f3ef79.zip
Slightly better texture coordinates for fences
-rw-r--r--src/mapblock.cpp34
1 files changed, 24 insertions, 10 deletions
diff --git a/src/mapblock.cpp b/src/mapblock.cpp
index 4feeb9aef..7adb8c2df 100644
--- a/src/mapblock.cpp
+++ b/src/mapblock.cpp
@@ -1597,12 +1597,12 @@ scene::SMesh* makeMapBlockMesh(MeshMakeData *data)
// The post - always present
v3f pos = intToFloat(p+blockpos_nodes, BS);
f32 postuv[24]={
- 0,0,1,1,
- 0,0,1,1,
- 0,0,1,1,
- 0,0,1,1,
- 0,0,1,1,
- 0,0,1,1};
+ 0.4,0.4,0.6,0.6,
+ 0.35,0,0.65,1,
+ 0.35,0,0.65,1,
+ 0.35,0,0.65,1,
+ 0.35,0,0.65,1,
+ 0.4,0.4,0.6,0.6};
makeCuboid(material_wood, &collector,
&pa_wood, c, pos,
post_rad,BS/2,post_rad, postuv);
@@ -1616,14 +1616,21 @@ scene::SMesh* makeMapBlockMesh(MeshMakeData *data)
pos = intToFloat(p+blockpos_nodes, BS);
pos.X += BS/2;
pos.Y += BS/4;
+ f32 xrailuv[24]={
+ 0,0.4,1,0.6,
+ 0,0.4,1,0.6,
+ 0,0.4,1,0.6,
+ 0,0.4,1,0.6,
+ 0,0.4,1,0.6,
+ 0,0.4,1,0.6};
makeCuboid(material_wood, &collector,
&pa_wood, c, pos,
- bar_len,bar_rad,bar_rad, NULL);
+ bar_len,bar_rad,bar_rad, xrailuv);
pos.Y -= BS/2;
makeCuboid(material_wood, &collector,
&pa_wood, c, pos,
- bar_len,bar_rad,bar_rad, NULL);
+ bar_len,bar_rad,bar_rad, xrailuv);
}
// Now a section of fence, +Z, if there's a post there
@@ -1635,13 +1642,20 @@ scene::SMesh* makeMapBlockMesh(MeshMakeData *data)
pos = intToFloat(p+blockpos_nodes, BS);
pos.Z += BS/2;
pos.Y += BS/4;
+ f32 zrailuv[24]={
+ 0,0.4,1,0.6,
+ 0,0.4,1,0.6,
+ 0,0.4,1,0.6,
+ 0,0.4,1,0.6,
+ 0,0.4,1,0.6,
+ 0,0.4,1,0.6};
makeCuboid(material_wood, &collector,
&pa_wood, c, pos,
- bar_rad,bar_rad,bar_len, NULL);
+ bar_rad,bar_rad,bar_len, zrailuv);
pos.Y -= BS/2;
makeCuboid(material_wood, &collector,
&pa_wood, c, pos,
- bar_rad,bar_rad,bar_len, NULL);
+ bar_rad,bar_rad,bar_len, zrailuv);
}