Added #define WATER_ALPHA in content_mapnode.cpp
[oweals/minetest.git] / src / mapgen.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 General Public License as published by
7 the Free Software Foundation; either version 2 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 General Public License for more details.
14
15 You should have received a copy of the GNU 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 MAPGEN_HEADER
21 #define MAPGEN_HEADER
22
23 #include "common_irrlicht.h"
24 #include "utility.h" // UniqueQueue
25
26 struct BlockMakeData;
27 class MapBlock;
28 class ManualMapVoxelManipulator;
29
30 namespace mapgen
31 {
32         // Finds precise ground level at any position
33         s16 find_ground_level_from_noise(u64 seed, v2s16 p2d, s16 precision);
34
35         // Find out if block is completely underground
36         bool block_is_underground(u64 seed, v3s16 blockpos);
37
38         // Main map generation routine
39         void make_block(BlockMakeData *data);
40         
41         // Add objects according to block content
42         void add_random_objects(MapBlock *block);
43         
44         /*
45                 These are used by FarMesh
46         */
47         bool get_have_sand(u64 seed, v2s16 p2d);
48         double tree_amount_2d(u64 seed, v2s16 p);
49         
50
51         struct BlockMakeData
52         {
53                 bool no_op;
54                 ManualMapVoxelManipulator *vmanip;
55                 u64 seed;
56                 v3s16 blockpos;
57                 UniqueQueue<v3s16> transforming_liquid;
58
59                 BlockMakeData();
60                 ~BlockMakeData();
61         };
62
63 }; // namespace mapgen
64
65 #endif
66