aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/content_mapblock.cpp4
-rw-r--r--src/defaultsettings.cpp1
-rw-r--r--src/nodedef.cpp10
-rw-r--r--src/nodedef.h4
-rw-r--r--src/script/cpp_api/s_node.cpp1
-rw-r--r--src/shader.cpp3
6 files changed, 21 insertions, 2 deletions
diff --git a/src/content_mapblock.cpp b/src/content_mapblock.cpp
index 6d7a69bb8..c84e75ac0 100644
--- a/src/content_mapblock.cpp
+++ b/src/content_mapblock.cpp
@@ -794,6 +794,10 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
collector.append(tile, vertices, 4, indices, 6);
}
break;}
+ case NDT_GLASSLIKE_FRAMED_OPTIONAL:
+ // This is always pre-converted to something else
+ assert(0);
+ break;
case NDT_GLASSLIKE_FRAMED:
{
static const v3s16 dirs[6] = {
diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp
index ccde6b577..dc4a59be3 100644
--- a/src/defaultsettings.cpp
+++ b/src/defaultsettings.cpp
@@ -100,6 +100,7 @@ void set_default_settings(Settings *settings)
settings->setDefault("view_bobbing", "true");
settings->setDefault("new_style_water", "false");
settings->setDefault("new_style_leaves", "true");
+ settings->setDefault("connected_glass", "false");
settings->setDefault("smooth_lighting", "true");
settings->setDefault("texture_path", "");
settings->setDefault("shader_path", "");
diff --git a/src/nodedef.cpp b/src/nodedef.cpp
index 31156ce68..8a5cff3bf 100644
--- a/src/nodedef.cpp
+++ b/src/nodedef.cpp
@@ -607,6 +607,7 @@ public:
bool new_style_water = g_settings->getBool("new_style_water");
bool new_style_leaves = g_settings->getBool("new_style_leaves");
+ bool connected_glass = g_settings->getBool("connected_glass");
bool opaque_water = g_settings->getBool("opaque_water");
bool enable_shaders = g_settings->getBool("enable_shaders");
bool enable_bumpmapping = g_settings->getBool("enable_bumpmapping");
@@ -666,6 +667,15 @@ public:
f->solidness = 0;
f->visual_solidness = 1;
break;
+ case NDT_GLASSLIKE_FRAMED_OPTIONAL:
+ f->solidness = 0;
+ f->visual_solidness = 1;
+ if (connected_glass) {
+ f->drawtype = NDT_GLASSLIKE_FRAMED;
+ } else {
+ f->drawtype = NDT_GLASSLIKE;
+ }
+ break;
case NDT_ALLFACES:
f->solidness = 0;
f->visual_solidness = 1;
diff --git a/src/nodedef.h b/src/nodedef.h
index 262f4bc4e..b737e0237 100644
--- a/src/nodedef.h
+++ b/src/nodedef.h
@@ -149,7 +149,9 @@ enum NodeDrawType
NDT_GLASSLIKE_FRAMED, // Glass-like, draw connected frames and all all
// visible faces
// uses 2 textures, one for frames, second for faces
- NDT_FIRELIKE, // Draw faces slightly rotated and only on connecting nodes
+ NDT_FIRELIKE, // Draw faces slightly rotated and only on connecting nodes,
+ NDT_GLASSLIKE_FRAMED_OPTIONAL, // enabled -> connected, disabled -> Glass-like
+ // uses 2 textures, one for frames, second for faces
};
#define CF_SPECIAL_COUNT 6
diff --git a/src/script/cpp_api/s_node.cpp b/src/script/cpp_api/s_node.cpp
index 2b8d02d74..8c9b46c2a 100644
--- a/src/script/cpp_api/s_node.cpp
+++ b/src/script/cpp_api/s_node.cpp
@@ -35,6 +35,7 @@ struct EnumString ScriptApiNode::es_DrawType[] =
{NDT_FLOWINGLIQUID, "flowingliquid"},
{NDT_GLASSLIKE, "glasslike"},
{NDT_GLASSLIKE_FRAMED, "glasslike_framed"},
+ {NDT_GLASSLIKE_FRAMED_OPTIONAL, "glasslike_framed_optional"},
{NDT_ALLFACES, "allfaces"},
{NDT_ALLFACES_OPTIONAL, "allfaces_optional"},
{NDT_TORCHLIKE, "torchlike"},
diff --git a/src/shader.cpp b/src/shader.cpp
index cf3bbd761..167045804 100644
--- a/src/shader.cpp
+++ b/src/shader.cpp
@@ -645,7 +645,8 @@ ShaderInfo generate_shader(std::string name, u8 material_type, u8 drawtype,
"NDT_RAILLIKE",
"NDT_NODEBOX",
"NDT_GLASSLIKE_FRAMED",
- "NDT_FIRELIKE"
+ "NDT_FIRELIKE",
+ "NDT_GLASSLIKE_FRAMED_OPTIONAL"
};
for (int i = 0; i < 14; i++){