X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fmaterials.cpp;h=e3a24b9e34f8d16d58b5da7396e70ceabf3472cc;hb=30c34cc23e9a060ef964854038a314a94ad5cbae;hp=dc080ba2304cf130fc0ba4f75020e1de48e43a41;hpb=3fe377be4e860f4ec9664688489e4e22090fc29d;p=dragonfireclient.git diff --git a/src/materials.cpp b/src/materials.cpp index dc080ba23..e3a24b9e3 100644 --- a/src/materials.cpp +++ b/src/materials.cpp @@ -1,87 +1,20 @@ #include "materials.h" +#include "mapnode.h" -#define MATERIAL_PROPERTIES_COUNT 256 +// NOTE: DEPRECATED -// These correspond to the CONTENT_* constants -MaterialProperties g_material_properties[MATERIAL_PROPERTIES_COUNT]; - -bool g_material_properties_initialized = false; - -void setStoneLikeDiggingProperties(u8 material, float toughness) -{ - g_material_properties[material].setDiggingProperties("", - DiggingProperties(true, 15.0*toughness, 0)); - - g_material_properties[material].setDiggingProperties("WPick", - DiggingProperties(true, 2.0*toughness, 65535./20.*toughness)); - g_material_properties[material].setDiggingProperties("STPick", - DiggingProperties(true, 1.0*toughness, 65535./50.*toughness)); - - /*g_material_properties[material].setDiggingProperties("MesePick", - DiggingProperties(true, 0.0*toughness, 65535./20.*toughness));*/ -} - -void initializeMaterialProperties() -{ - /* - Now, the g_material_properties array is already initialized - by the constructors to such that no digging is possible. - - Add some digging properties to them. - */ - - setStoneLikeDiggingProperties(CONTENT_STONE, 1.0); - - g_material_properties[CONTENT_GRASS].setDiggingProperties("", - DiggingProperties(true, 0.5, 0)); - - g_material_properties[CONTENT_TORCH].setDiggingProperties("", - DiggingProperties(true, 0.0, 0)); - - g_material_properties[CONTENT_TREE].setDiggingProperties("", - DiggingProperties(true, 1.5, 0)); - - g_material_properties[CONTENT_LEAVES].setDiggingProperties("", - DiggingProperties(true, 0.5, 0)); - - g_material_properties[CONTENT_GRASS_FOOTSTEPS].setDiggingProperties("", - DiggingProperties(true, 0.5, 0)); - - setStoneLikeDiggingProperties(CONTENT_MESE, 0.5); - - g_material_properties[CONTENT_MUD].setDiggingProperties("", - DiggingProperties(true, 0.5, 0)); - - setStoneLikeDiggingProperties(CONTENT_COALSTONE, 1.5); - - g_material_properties[CONTENT_WOOD].setDiggingProperties("", - DiggingProperties(true, 1.0, 0)); - - /* - Add MesePick to everything - */ - for(u16 i=0; igetDiggingProperties(tool); + return mprop->get(tool); }