aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKodexky <kodexky@gmail.com>2014-11-20 15:40:26 +1000
committerCraig Robbins <kde.psych@gmail.com>2014-11-20 15:41:59 +1000
commitb9bc8dadb2ebdfdc05b1e3709c6173571de21efc (patch)
tree2cf2937f739662b639c68b6f5c554047e6d49201
parentb1965ac20922e3722392114bd63a22b403dcbe98 (diff)
downloadminetest-b9bc8dadb2ebdfdc05b1e3709c6173571de21efc.tar.gz
minetest-b9bc8dadb2ebdfdc05b1e3709c6173571de21efc.tar.bz2
minetest-b9bc8dadb2ebdfdc05b1e3709c6173571de21efc.zip
Fix raillike bug (currently manifests itself on Android), and minor improvement to readability.
NB: Minor edits to patch made by Zeno- (int to short and minor formatting)
-rw-r--r--src/content_mapblock.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/content_mapblock.cpp b/src/content_mapblock.cpp
index 2584c0779..378a344a4 100644
--- a/src/content_mapblock.cpp
+++ b/src/content_mapblock.cpp
@@ -1621,17 +1621,18 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
video::SColor c = MapBlock_LightColor(255, l, f.light_source);
float d = (float)BS/64;
-
- char g=-1;
+ float s = BS/2;
+
+ short g = -1;
if (is_rail_x_plus_y[0] || is_rail_x_plus_y[1] || is_rail_z_plus_y[0] || is_rail_z_plus_y[1])
- g=1; //Object is at a slope
+ g = 1; //Object is at a slope
video::S3DVertex vertices[4] =
{
- video::S3DVertex(-BS/2,-BS/2+d,-BS/2, 0,0,0, c, 0,1),
- video::S3DVertex(BS/2,-BS/2+d,-BS/2, 0,0,0, c, 1,1),
- video::S3DVertex(BS/2,g*BS/2+d,BS/2, 0,0,0, c, 1,0),
- video::S3DVertex(-BS/2,g*BS/2+d,BS/2, 0,0,0, c, 0,0),
+ video::S3DVertex(-s, -s+d,-s, 0,0,0, c,0,1),
+ video::S3DVertex( s, -s+d,-s, 0,0,0, c,1,1),
+ video::S3DVertex( s, g*s+d, s, 0,0,0, c,1,0),
+ video::S3DVertex(-s, g*s+d, s, 0,0,0, c,0,0),
};
for(s32 i=0; i<4; i++)