X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fcontent_mapnode.h;h=b928e4407707e89ea4863b1a18f6c1eae5082c79;hb=ceaf8edaded4c9e8f2e6fa285d9765e7095df332;hp=e314807f94dc7c92a37c8871a068a1f1b0b2187c;hpb=7538b4c6201675c566c98b21c8ecddb798a14943;p=dragonfireclient.git diff --git a/src/content_mapnode.h b/src/content_mapnode.h index e314807f9..b928e4407 100644 --- a/src/content_mapnode.h +++ b/src/content_mapnode.h @@ -20,36 +20,32 @@ with this program; if not, write to the Free Software Foundation, Inc., #ifndef CONTENT_MAPNODE_HEADER #define CONTENT_MAPNODE_HEADER -void content_mapnode_init(); +#include "mapnode.h" /* - Node content type IDs + Legacy node definitions */ -#define CONTENT_STONE 0 -#define CONTENT_GRASS 1 -#define CONTENT_WATER 2 -#define CONTENT_TORCH 3 -#define CONTENT_TREE 4 -#define CONTENT_LEAVES 5 -#define CONTENT_GRASS_FOOTSTEPS 6 -#define CONTENT_MESE 7 -#define CONTENT_MUD 8 -#define CONTENT_WATERSOURCE 9 -// Pretty much useless, clouds won't be drawn this way -#define CONTENT_CLOUD 10 -#define CONTENT_COALSTONE 11 -#define CONTENT_WOOD 12 -#define CONTENT_SAND 13 -#define CONTENT_SIGN_WALL 14 -#define CONTENT_CHEST 15 -#define CONTENT_FURNACE 16 -//#define CONTENT_WORKBENCH 17 -#define CONTENT_COBBLE 18 -#define CONTENT_STEEL 19 -#define CONTENT_GLASS 20 -#define CONTENT_FENCE 21 -#define CONTENT_MOSSYCOBBLE 22 -#define CONTENT_GRAVEL 23 + +class IWritableNodeDefManager; + +// Initialize legacy node definitions +// Not used used anywhere else than in test.cpp (and SHALL NOT BE) +void content_mapnode_init(IWritableNodeDefManager *nodemgr); + +// Backwards compatibility for non-extended content types in v19 +extern content_t trans_table_19[21][2]; +MapNode mapnode_translate_from_internal(MapNode n_from, u8 version); +MapNode mapnode_translate_to_internal(MapNode n_from, u8 version); + +// Get legacy node name mapping for loading old blocks +class NameIdMapping; +void content_mapnode_get_name_id_mapping(NameIdMapping *nimap); + +// Convert "CONTENT_STONE"-style names to dynamic ids +std::string content_mapnode_get_new_name(const std::string &oldname); +class INodeDefManager; +content_t legacy_get_id(const std::string &oldname, INodeDefManager *ndef); +#define LEGN(ndef, oldname) legacy_get_id(oldname, ndef) #endif