]> git.lizzy.rs Git - dragonfireclient.git/blob - src/cavegen.h
Fix inverted conditions in shader.cpp
[dragonfireclient.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 MGV5_LAVA_DEPTH -256
25 #define MGV7_LAVA_DEPTH -256
26
27 class MapgenV5;
28 class MapgenV6;
29 class MapgenV7;
30
31 class CaveV5 {
32 public:
33         Mapgen *mg;
34         MMVManip *vm;
35         INodeDefManager *ndef;
36
37         NoiseParams *np_caveliquids;
38
39         s16 min_tunnel_diameter;
40         s16 max_tunnel_diameter;
41         u16 tunnel_routepoints;
42         int dswitchint;
43         int part_max_length_rs;
44
45         bool large_cave_is_flat;
46         bool flooded;
47
48         s16 max_stone_y;
49         v3s16 node_min;
50         v3s16 node_max;
51
52         v3f orp;  // starting point, relative to caved space
53         v3s16 of; // absolute coordinates of caved space
54         v3s16 ar; // allowed route area
55         s16 rs;   // tunnel radius size
56         v3f main_direction;
57
58         s16 route_y_min;
59         s16 route_y_max;
60
61         PseudoRandom *ps;
62
63         content_t c_water_source;
64         content_t c_lava_source;
65         content_t c_ice;
66
67         int water_level;
68         int ystride;
69
70         CaveV5() {}
71         CaveV5(Mapgen *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 #endif