From a48a0e77eb48a0afe8b2d66f3f5ea75e39b9d504 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Tue, 15 Nov 2011 15:32:09 +0200 Subject: Prepare more for node definition serialization --- src/nodedef.h | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) (limited to 'src/nodedef.h') diff --git a/src/nodedef.h b/src/nodedef.h index 5e4e3378c..f5662967b 100644 --- a/src/nodedef.h +++ b/src/nodedef.h @@ -100,6 +100,19 @@ struct NodeBox struct MapNode; class NodeMetadata; +struct MaterialSpec +{ + std::string tname; + bool backface_culling; + + MaterialSpec(const std::string &tname_="", bool backface_culling_=true): + tname(tname_), + backface_culling(backface_culling_) + {} +}; + +#define CF_SPECIAL_COUNT 2 + struct ContentFeatures { #ifndef SERVER @@ -114,15 +127,14 @@ struct ContentFeatures // Special material/texture // - Currently used for flowing liquids - video::SMaterial *special_material; - video::SMaterial *special_material2; - AtlasPointer *special_atlas; + video::SMaterial *special_materials[CF_SPECIAL_COUNT]; + AtlasPointer *special_aps[CF_SPECIAL_COUNT]; #endif - // Texture names + // Visual definition std::string tname_tiles[6]; std::string tname_inventory; - std::string tname_special; + MaterialSpec mspec_special[CF_SPECIAL_COUNT]; u8 alpha; bool backface_culling; @@ -202,14 +214,16 @@ struct ContentFeatures inventory_texture = NULL; post_effect_color = video::SColor(0, 0, 0, 0); - special_material = NULL; - special_material2 = NULL; - special_atlas = NULL; + for(u16 j=0; j