aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nodedef.cpp20
-rw-r--r--src/nodedef.h9
-rw-r--r--src/script/common/c_content.cpp5
3 files changed, 4 insertions, 30 deletions
diff --git a/src/nodedef.cpp b/src/nodedef.cpp
index 1740b010a..b2cfd1f87 100644
--- a/src/nodedef.cpp
+++ b/src/nodedef.cpp
@@ -491,21 +491,6 @@ void ContentFeatures::serialize(std::ostream &os, u16 protocol_version) const
writeU8(os, leveled_max);
}
-void ContentFeatures::correctAlpha(TileDef *tiles, int length)
-{
- // alpha == 0 means that the node is using texture alpha
- if (alpha == 0 || alpha == 255)
- return;
-
- for (int i = 0; i < length; i++) {
- if (tiles[i].name.empty())
- continue;
- std::stringstream s;
- s << tiles[i].name << "^[noalpha^[opacity:" << ((int)alpha);
- tiles[i].name = s.str();
- }
-}
-
void ContentFeatures::deSerialize(std::istream &is)
{
// version detection
@@ -874,11 +859,6 @@ void ContentFeatures::updateTextures(ITextureSource *tsrc, IShaderSource *shdsrc
}
if (is_liquid) {
- // Vertex alpha is no longer supported, correct if necessary.
- correctAlpha(tdef, 6);
- correctAlpha(tdef_overlay, 6);
- correctAlpha(tdef_spec, CF_SPECIAL_COUNT);
-
if (waving == 3) {
material_type = (alpha == 255) ? TILE_MATERIAL_WAVING_LIQUID_OPAQUE :
TILE_MATERIAL_WAVING_LIQUID_TRANSPARENT;
diff --git a/src/nodedef.h b/src/nodedef.h
index 66c21cc07..63b9474b9 100644
--- a/src/nodedef.h
+++ b/src/nodedef.h
@@ -418,15 +418,6 @@ struct ContentFeatures
void serialize(std::ostream &os, u16 protocol_version) const;
void deSerialize(std::istream &is);
- /*!
- * Since vertex alpha is no longer supported, this method
- * adds opacity directly to the texture pixels.
- *
- * \param tiles array of the tile definitions.
- * \param length length of tiles
- */
- void correctAlpha(TileDef *tiles, int length);
-
#ifndef SERVER
/*
* Checks if any tile texture has any transparent pixels.
diff --git a/src/script/common/c_content.cpp b/src/script/common/c_content.cpp
index 4316f412d..5d29422af 100644
--- a/src/script/common/c_content.cpp
+++ b/src/script/common/c_content.cpp
@@ -618,7 +618,10 @@ void read_content_features(lua_State *L, ContentFeatures &f, int index)
}
lua_pop(L, 1);
- f.alpha = getintfield_default(L, index, "alpha", 255);
+ warn_if_field_exists(L, index, "alpha",
+ "Obsolete, only limited compatibility provided");
+ if (getintfield_default(L, index, "alpha", 255) != 255)
+ f.alpha = 0;
bool usealpha = getboolfield_default(L, index,
"use_texture_alpha", false);