From 2330267d2207208799ad347ea0d129c0b4551d61 Mon Sep 17 00:00:00 2001 From: RealBadAngel Date: Tue, 3 Dec 2013 17:21:40 +0100 Subject: Shaders rework. --- src/nodedef.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/nodedef.cpp') diff --git a/src/nodedef.cpp b/src/nodedef.cpp index d13d0653d..2b6de0461 100644 --- a/src/nodedef.cpp +++ b/src/nodedef.cpp @@ -225,6 +225,7 @@ void ContentFeatures::reset() damage_per_second = 0; node_box = NodeBox(); selection_box = NodeBox(); + waving = 0; legacy_facedir_simple = false; legacy_wallmounted = false; sound_footstep = SimpleSoundSpec(); @@ -292,6 +293,7 @@ void ContentFeatures::serialize(std::ostream &os, u16 protocol_version) writeU8(os, liquid_range); // Stuff below should be moved to correct place in a version that otherwise changes // the protocol version + writeU8(os, waving); } void ContentFeatures::deSerialize(std::istream &is) @@ -359,6 +361,7 @@ void ContentFeatures::deSerialize(std::istream &is) try{ // Stuff below should be moved to correct place in a version that // otherwise changes the protocol version + waving = readU8(is); }catch(SerializationError &e) {}; } @@ -618,6 +621,9 @@ public: } bool is_liquid = false; + u8 material_type; + material_type = (f->alpha == 255) ? TILE_MATERIAL_BASIC : TILE_MATERIAL_ALPHA; + switch(f->drawtype){ default: case NDT_NORMAL: @@ -669,10 +675,14 @@ public: tiledef[i].name += std::string("^[noalpha"); } } + if (f->waving == 1) + material_type = TILE_MATERIAL_LEAVES; break; case NDT_PLANTLIKE: f->solidness = 0; f->backface_culling = false; + if (f->waving == 1) + material_type = TILE_MATERIAL_PLANTS; break; case NDT_TORCHLIKE: case NDT_SIGNLIKE: @@ -683,11 +693,8 @@ public: break; } - u8 material_type; if (is_liquid) material_type = (f->alpha == 255) ? TILE_MATERIAL_LIQUID_OPAQUE : TILE_MATERIAL_LIQUID_TRANSPARENT; - else - material_type = (f->alpha == 255) ? TILE_MATERIAL_BASIC : TILE_MATERIAL_ALPHA; // Tiles (fill in f->tiles[]) for(u16 j=0; j<6; j++){ -- cgit v1.2.3