diff options
author | Wuzzy <wuzzy2@mail.ru> | 2021-10-20 19:50:16 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-20 21:50:16 +0200 |
commit | 86b44ecd8280d8304aa26a600fc004d40a970020 (patch) | |
tree | c355bd74f3dd0321094bc03b80b2c010386d916a /src/nodedef.cpp | |
parent | c82ec8b210f613fcd5bb386a14f0a8f88591253a (diff) | |
download | minetest-86b44ecd8280d8304aa26a600fc004d40a970020.tar.xz |
Add no_texture.png as fallback for unspecified textures
Diffstat (limited to 'src/nodedef.cpp')
-rw-r--r-- | src/nodedef.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/nodedef.cpp b/src/nodedef.cpp index 703df4dee..f0e0024be 100644 --- a/src/nodedef.cpp +++ b/src/nodedef.cpp @@ -796,8 +796,10 @@ void ContentFeatures::updateTextures(ITextureSource *tsrc, IShaderSource *shdsrc TileDef tdef[6]; for (u32 j = 0; j < 6; j++) { tdef[j] = tiledef[j]; - if (tdef[j].name.empty()) - tdef[j].name = "unknown_node.png"; + if (tdef[j].name.empty()) { + tdef[j].name = "no_texture.png"; + tdef[j].backface_culling = false; + } } // also the overlay tiles TileDef tdef_overlay[6]; @@ -805,8 +807,13 @@ void ContentFeatures::updateTextures(ITextureSource *tsrc, IShaderSource *shdsrc tdef_overlay[j] = tiledef_overlay[j]; // also the special tiles TileDef tdef_spec[6]; - for (u32 j = 0; j < CF_SPECIAL_COUNT; j++) + for (u32 j = 0; j < CF_SPECIAL_COUNT; j++) { tdef_spec[j] = tiledef_special[j]; + if (tdef_spec[j].name.empty()) { + tdef_spec[j].name = "no_texture.png"; + tdef_spec[j].backface_culling = false; + } + } bool is_liquid = false; @@ -1052,6 +1059,10 @@ void NodeDefManager::clear() { ContentFeatures f; f.name = "unknown"; + TileDef unknownTile; + unknownTile.name = "unknown_node.png"; + for (int t = 0; t < 6; t++) + f.tiledef[t] = unknownTile; // Insert directly into containers content_t c = CONTENT_UNKNOWN; m_content_features[c] = f; |