diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-11-03 23:06:57 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-11-03 23:06:57 +0200 |
commit | d0fdfd44c593eb3d7df4e2ef0a6c48d1c51d7138 (patch) | |
tree | 5f1d5968f12c4a52b0dff7cdc2addf1adeec58d9 /src/content_mapnode.cpp | |
parent | f5995337e887b4d36fc0c6f6d4459332e92178b6 (diff) | |
download | minetest-d0fdfd44c593eb3d7df4e2ef0a6c48d1c51d7138.tar.gz minetest-d0fdfd44c593eb3d7df4e2ef0a6c48d1c51d7138.tar.bz2 minetest-d0fdfd44c593eb3d7df4e2ef0a6c48d1c51d7138.zip |
Add option to set water opaque (mainly for stylistic choice)
Diffstat (limited to 'src/content_mapnode.cpp')
-rw-r--r-- | src/content_mapnode.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/content_mapnode.cpp b/src/content_mapnode.cpp index ec0a7df05..bb6d7caa7 100644 --- a/src/content_mapnode.cpp +++ b/src/content_mapnode.cpp @@ -107,6 +107,7 @@ void content_mapnode_init() bool new_style_water = g_settings->getBool("new_style_water"); bool new_style_leaves = g_settings->getBool("new_style_leaves"); bool invisible_stone = g_settings->getBool("invisible_stone"); + bool opaque_water = g_settings->getBool("opaque_water"); content_t i; ContentFeatures *f = NULL; @@ -398,7 +399,8 @@ void content_mapnode_init() f->liquid_alternative_source = CONTENT_WATERSOURCE; f->liquid_viscosity = WATER_VISC; #ifndef SERVER - f->vertex_alpha = WATER_ALPHA; + if(!opaque_water) + f->vertex_alpha = WATER_ALPHA; f->post_effect_color = video::SColor(64, 100, 100, 200); if(f->special_material == NULL && g_texturesource) { @@ -408,7 +410,8 @@ void content_mapnode_init() f->special_material->setFlag(video::EMF_BACK_FACE_CULLING, false); 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_VERTEX_ALPHA; + if(!opaque_water) + f->special_material->MaterialType = video::EMT_TRANSPARENT_VERTEX_ALPHA; AtlasPointer *pa_water1 = new AtlasPointer(g_texturesource->getTexture( g_texturesource->getTextureId("water.png"))); f->special_material->setTexture(0, pa_water1->atlas); @@ -432,8 +435,10 @@ void content_mapnode_init() if(g_texturesource) t.texture = g_texturesource->getTexture("water.png"); - t.alpha = WATER_ALPHA; - t.material_type = MATERIAL_ALPHA_VERTEX; + if(!opaque_water){ + t.alpha = WATER_ALPHA; + t.material_type = MATERIAL_ALPHA_VERTEX; + } t.material_flags &= ~MATERIAL_FLAG_BACKFACE_CULLING; f->setAllTiles(t); #endif @@ -450,7 +455,8 @@ void content_mapnode_init() f->liquid_alternative_source = CONTENT_WATERSOURCE; f->liquid_viscosity = WATER_VISC; #ifndef SERVER - f->vertex_alpha = WATER_ALPHA; + if(!opaque_water) + f->vertex_alpha = WATER_ALPHA; f->post_effect_color = video::SColor(64, 100, 100, 200); if(f->special_material == NULL && g_texturesource) { |