Add DISABLE_CLASS_COPY macro (and use it)
[oweals/minetest.git] / src / cavegen.h
1 /*
2 Minetest
3 Copyright (C) 2010-2013 kwolekr, Ryan Kwolek <kwolekr@minetest.net>
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 CAVEGEN_HEADER
21 #define CAVEGEN_HEADER
22
23 #define VMANIP_FLAG_CAVE VOXELFLAG_CHECKED1
24 #define MGV7_LAVA_DEPTH -256
25 #define MGFRACTAL_LAVA_DEPTH -256
26
27 class MapgenV5;
28 class MapgenV6;
29 class MapgenV7;
30 class MapgenFractal;
31
32 class CaveV5 {
33 public:
34         MapgenV5 *mg;
35         MMVManip *vm;
36         INodeDefManager *ndef;
37
38         NoiseParams *np_caveliquids;
39
40         s16 min_tunnel_diameter;
41         s16 max_tunnel_diameter;
42         u16 tunnel_routepoints;
43         int dswitchint;
44         int part_max_length_rs;
45
46         bool large_cave_is_flat;
47         bool flooded;
48
49         s16 max_stone_y;
50         v3s16 node_min;
51         v3s16 node_max;
52
53         v3f orp;  // starting point, relative to caved space
54         v3s16 of; // absolute coordinates of caved space
55         v3s16 ar; // allowed route area
56         s16 rs;   // tunnel radius size
57         v3f main_direction;
58
59         s16 route_y_min;
60         s16 route_y_max;
61
62         PseudoRandom *ps;
63
64         content_t c_water_source;
65         content_t c_lava_source;
66         content_t c_ice;
67
68         int water_level;
69
70         CaveV5() {}
71         CaveV5(MapgenV5 *mg, PseudoRandom *ps);
72         void makeCave(v3s16 nmin, v3s16 nmax, int max_stone_height);
73         void makeTunnel(bool dirswitch);
74         void carveRoute(v3f vec, float f, bool randomize_xz);
75 };
76
77 class CaveV6 {
78 public:
79         MapgenV6 *mg;
80         MMVManip *vm;
81         INodeDefManager *ndef;
82
83         s16 min_tunnel_diameter;
84         s16 max_tunnel_diameter;
85         u16 tunnel_routepoints;
86         int dswitchint;
87         int part_max_length_rs;
88
89         bool large_cave;
90         bool large_cave_is_flat;
91         bool flooded;
92
93         s16 max_stone_y;
94         v3s16 node_min;
95         v3s16 node_max;
96
97         v3f orp;  // starting point, relative to caved space
98         v3s16 of; // absolute coordinates of caved space
99         v3s16 ar; // allowed route area
100         s16 rs;   // tunnel radius size
101         v3f main_direction;
102
103         s16 route_y_min;
104         s16 route_y_max;
105
106         PseudoRandom *ps;
107         PseudoRandom *ps2;
108
109         content_t c_water_source;
110         content_t c_lava_source;
111
112         int water_level;
113
114         CaveV6() {}
115         CaveV6(MapgenV6 *mg, PseudoRandom *ps, PseudoRandom *ps2, bool large_cave);
116         void makeCave(v3s16 nmin, v3s16 nmax, int max_stone_height);
117         void makeTunnel(bool dirswitch);
118         void carveRoute(v3f vec, float f, bool randomize_xz, bool tunnel_above_ground);
119 };
120
121 class CaveV7 {
122 public:
123         MapgenV7 *mg;
124         MMVManip *vm;
125         INodeDefManager *ndef;
126
127         NoiseParams *np_caveliquids;
128
129         s16 min_tunnel_diameter;
130         s16 max_tunnel_diameter;
131         u16 tunnel_routepoints;
132         int dswitchint;
133         int part_max_length_rs;
134
135         bool large_cave_is_flat;
136         bool flooded;
137
138         s16 max_stone_y;
139         v3s16 node_min;
140         v3s16 node_max;
141
142         v3f orp;  // starting point, relative to caved space
143         v3s16 of; // absolute coordinates of caved space
144         v3s16 ar; // allowed route area
145         s16 rs;   // tunnel radius size
146         v3f main_direction;
147
148         s16 route_y_min;
149         s16 route_y_max;
150
151         PseudoRandom *ps;
152
153         content_t c_water_source;
154         content_t c_lava_source;
155         content_t c_ice;
156
157         int water_level;
158
159         CaveV7() {}
160         CaveV7(MapgenV7 *mg, PseudoRandom *ps);
161         void makeCave(v3s16 nmin, v3s16 nmax, int max_stone_height);
162         void makeTunnel(bool dirswitch);
163         void carveRoute(v3f vec, float f, bool randomize_xz);
164 };
165
166 class CaveFractal {
167 public:
168         MapgenFractal *mg;
169         MMVManip *vm;
170         INodeDefManager *ndef;
171
172         NoiseParams *np_caveliquids;
173
174         s16 min_tunnel_diameter;
175         s16 max_tunnel_diameter;
176         u16 tunnel_routepoints;
177         int dswitchint;
178         int part_max_length_rs;
179
180         bool large_cave_is_flat;
181         bool flooded;
182
183         s16 max_stone_y;
184         v3s16 node_min;
185         v3s16 node_max;
186
187         v3f orp;  // starting point, relative to caved space
188         v3s16 of; // absolute coordinates of caved space
189         v3s16 ar; // allowed route area
190         s16 rs;   // tunnel radius size
191         v3f main_direction;
192
193         s16 route_y_min;
194         s16 route_y_max;
195
196         PseudoRandom *ps;
197
198         content_t c_water_source;
199         content_t c_lava_source;
200         content_t c_ice;
201
202         int water_level;
203
204         CaveFractal() {}
205         CaveFractal(MapgenFractal *mg, PseudoRandom *ps);
206         void makeCave(v3s16 nmin, v3s16 nmax, int max_stone_height);
207         void makeTunnel(bool dirswitch);
208         void carveRoute(v3f vec, float f, bool randomize_xz);
209 };
210
211 #endif