summaryrefslogtreecommitdiff
path: root/src/content_mapnode.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-11-08 16:17:38 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-11-08 16:17:38 +0200
commit045e32b6ecb99432beac3363685fb622e9ec3457 (patch)
tree8cd881ec22499a5848e8682061a4cf10ae8bd91c /src/content_mapnode.cpp
parentfea55a9b87b47eb7cac19587923c5debde8336b7 (diff)
downloadminetest-045e32b6ecb99432beac3363685fb622e9ec3457.tar.gz
minetest-045e32b6ecb99432beac3363685fb622e9ec3457.tar.bz2
minetest-045e32b6ecb99432beac3363685fb622e9ec3457.zip
Fix water-glass and water-lava surfaces
Diffstat (limited to 'src/content_mapnode.cpp')
-rw-r--r--src/content_mapnode.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/content_mapnode.cpp b/src/content_mapnode.cpp
index bb6d7caa7..f10b941ba 100644
--- a/src/content_mapnode.cpp
+++ b/src/content_mapnode.cpp
@@ -415,6 +415,12 @@ void content_mapnode_init()
AtlasPointer *pa_water1 = new AtlasPointer(g_texturesource->getTexture(
g_texturesource->getTextureId("water.png")));
f->special_material->setTexture(0, pa_water1->atlas);
+
+ // Flowing water material, backface culled
+ f->special_material2 = new video::SMaterial;
+ *f->special_material2 = *f->special_material;
+ f->special_material2->setFlag(video::EMF_BACK_FACE_CULLING, true);
+
f->special_atlas = pa_water1;
}
#endif
@@ -460,7 +466,7 @@ void content_mapnode_init()
f->post_effect_color = video::SColor(64, 100, 100, 200);
if(f->special_material == NULL && g_texturesource)
{
- // Flowing water material
+ // New-style water source material (mostly unused)
f->special_material = new video::SMaterial;
f->special_material->setFlag(video::EMF_LIGHTING, false);
f->special_material->setFlag(video::EMF_BACK_FACE_CULLING, false);
@@ -482,7 +488,7 @@ void content_mapnode_init()
f->light_propagates = false;
f->light_source = LIGHT_MAX-1;
f->solidness = 0; // Drawn separately, makes no faces
- f->visual_solidness = 2;
+ f->visual_solidness = 1; // Does not completely cover block boundaries
f->walkable = false;
f->pointable = false;
f->diggable = false;
@@ -503,10 +509,17 @@ void content_mapnode_init()
f->special_material->setFlag(video::EMF_BILINEAR_FILTER, false);
f->special_material->setFlag(video::EMF_FOG_ENABLE, true);
f->special_material->MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF;
+
AtlasPointer *pa_lava1 = new AtlasPointer(
g_texturesource->getTexture(
g_texturesource->getTextureId("lava.png")));
f->special_material->setTexture(0, pa_lava1->atlas);
+
+ // Flowing lava material, backface culled
+ f->special_material2 = new video::SMaterial;
+ *f->special_material2 = *f->special_material;
+ f->special_material2->setFlag(video::EMF_BACK_FACE_CULLING, true);
+
f->special_atlas = pa_lava1;
}
#endif
@@ -550,7 +563,7 @@ void content_mapnode_init()
f->post_effect_color = video::SColor(192, 255, 64, 0);
if(f->special_material == NULL && g_texturesource)
{
- // Flowing lava material
+ // New-style lava source material (mostly unused)
f->special_material = new video::SMaterial;
f->special_material->setFlag(video::EMF_LIGHTING, false);
f->special_material->setFlag(video::EMF_BACK_FACE_CULLING, false);
@@ -561,6 +574,7 @@ void content_mapnode_init()
g_texturesource->getTexture(
g_texturesource->getTextureId("lava.png")));
f->special_material->setTexture(0, pa_lava1->atlas);
+
f->special_atlas = pa_lava1;
}
#endif