From 9fc78cbece4d26307dab814d8073fc0a1db90bf9 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Tue, 15 Nov 2011 22:21:12 +0200 Subject: [PATCH] Fix flowing water being always opaque --- src/game.cpp | 2 +- src/nodedef.cpp | 3 +++ src/nodedef.h | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/game.cpp b/src/game.cpp index 7efce23a..bb199806 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -645,7 +645,7 @@ void the_game( IWritableNodeDefManager *nodedef = createNodeDefManager(); // Fill node feature table with default definitions - content_mapnode_init(nodedef); + //content_mapnode_init(nodedef); /* Create server. diff --git a/src/nodedef.cpp b/src/nodedef.cpp index c86a3aef..c1aee5df 100644 --- a/src/nodedef.cpp +++ b/src/nodedef.cpp @@ -445,6 +445,9 @@ public: f->special_materials[j]->setFlag(video::EMF_BILINEAR_FILTER, false); f->special_materials[j]->setFlag(video::EMF_FOG_ENABLE, true); f->special_materials[j]->setTexture(0, f->special_aps[j]->atlas); + if(f->alpha != 255) + f->special_materials[j]->MaterialType = + video::EMT_TRANSPARENT_VERTEX_ALPHA; } } #endif diff --git a/src/nodedef.h b/src/nodedef.h index b78b09d4..b7cca52d 100644 --- a/src/nodedef.h +++ b/src/nodedef.h @@ -245,11 +245,11 @@ struct ContentFeatures void setTexture(u16 i, std::string name); - void setAllTextures(std::string name, u8 alpha=255) + void setAllTextures(std::string name, u8 alpha_=255) { for(u16 i=0; i<6; i++) setTexture(i, name); - alpha = alpha; + alpha = alpha_; // Force inventory texture too setInventoryTexture(name); } -- 2.30.2