Switch the license to be LGPLv2/later, with small parts still remaining as GPLv2...
[oweals/minetest.git] / src / content_mapnode.h
1 /*
2 Minetest-c55
3 Copyright (C) 2010-2011 celeron55, Perttu Ahola <celeron55@gmail.com>
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation; either version 2.1 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19
20 #ifndef CONTENT_MAPNODE_HEADER
21 #define CONTENT_MAPNODE_HEADER
22
23 #include "mapnode.h"
24
25 /*
26         Legacy node definitions
27 */
28
29 // Backwards compatibility for non-extended content types in v19
30 extern content_t trans_table_19[21][2];
31 MapNode mapnode_translate_from_internal(MapNode n_from, u8 version);
32 MapNode mapnode_translate_to_internal(MapNode n_from, u8 version);
33
34 // Get legacy node name mapping for loading old blocks
35 class NameIdMapping;
36 void content_mapnode_get_name_id_mapping(NameIdMapping *nimap);
37
38 // Convert "CONTENT_STONE"-style names to dynamic ids
39 std::string content_mapnode_get_new_name(const std::string &oldname);
40 class INodeDefManager;
41 content_t legacy_get_id(const std::string &oldname, INodeDefManager *ndef);
42 #define LEGN(ndef, oldname) legacy_get_id(oldname, ndef)
43
44 #endif
45