forked from Cubitect/cubiomes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
layers.h
593 lines (512 loc) · 20.8 KB
/
layers.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
#ifndef LAYER_H_
#define LAYER_H_
#include "javarnd.h"
#define __STDC_FORMAT_MACROS 1
#include <stdlib.h>
#include <stdint.h>
#include <inttypes.h>
#ifndef NULL
#define NULL ((void*)0)
#endif
#define SIMD_NOTIFY 0
#if defined USE_SIMD && __AVX2__
#include <emmintrin.h>
#include <smmintrin.h>
#include <immintrin.h>
#if SIMD_NOTIFY
#warning "Using AVX2 extensions."
#endif
#elif defined USE_SIMD && defined __SSE4_2__
#include <emmintrin.h>
#include <smmintrin.h>
#if SIMD_NOTIFY
#warning "Using SSE4.2 extensions."
#endif
#else
//#warning "Using no SIMD extensions."
#endif
#define STRUCT(S) typedef struct S S; struct S
#define OPT_O2 __attribute__((optimize("O2")))
enum BiomeID
{
none = -1,
// 0
ocean = 0,
plains,
desert,
mountains, extremeHills = mountains,
forest,
taiga,
swamp, swampland = swamp,
river,
nether_wastes, hell = nether_wastes,
the_end, sky = the_end,
// 10
frozen_ocean, frozenOcean = frozen_ocean,
frozen_river, frozenRiver = frozen_river,
snowy_tundra, icePlains = snowy_tundra,
snowy_mountains, iceMountains = snowy_mountains,
mushroom_fields, mushroomIsland = mushroom_fields,
mushroom_field_shore, mushroomIslandShore = mushroom_field_shore,
beach,
desert_hills, desertHills = desert_hills,
wooded_hills, forestHills = wooded_hills,
taiga_hills, taigaHills = taiga_hills,
// 20
mountain_edge, extremeHillsEdge = mountain_edge,
jungle,
jungle_hills, jungleHills = jungle_hills,
jungle_edge, jungleEdge = jungle_edge,
deep_ocean, deepOcean = deep_ocean,
stone_shore, stoneBeach = stone_shore,
snowy_beach, coldBeach = snowy_beach,
birch_forest, birchForest = birch_forest,
birch_forest_hills, birchForestHills = birch_forest_hills,
dark_forest, roofedForest = dark_forest,
// 30
snowy_taiga, coldTaiga = snowy_taiga,
snowy_taiga_hills, coldTaigaHills = snowy_taiga_hills,
giant_tree_taiga, megaTaiga = giant_tree_taiga,
giant_tree_taiga_hills, megaTaigaHills = giant_tree_taiga_hills,
wooded_mountains, extremeHillsPlus = wooded_mountains,
savanna,
savanna_plateau, savannaPlateau = savanna_plateau,
badlands, mesa = badlands,
wooded_badlands_plateau, mesaPlateau_F = wooded_badlands_plateau,
badlands_plateau, mesaPlateau = badlands_plateau,
// 40 -- 1.13
small_end_islands,
end_midlands,
end_highlands,
end_barrens,
warm_ocean, warmOcean = warm_ocean,
lukewarm_ocean, lukewarmOcean = lukewarm_ocean,
cold_ocean, coldOcean = cold_ocean,
deep_warm_ocean, warmDeepOcean = deep_warm_ocean,
deep_lukewarm_ocean, lukewarmDeepOcean = deep_lukewarm_ocean,
deep_cold_ocean, coldDeepOcean = deep_cold_ocean,
// 50
deep_frozen_ocean, frozenDeepOcean = deep_frozen_ocean,
BIOME_NUM,
the_void = 127,
// mutated variants
sunflower_plains = plains+128,
desert_lakes = desert+128,
gravelly_mountains = mountains+128,
flower_forest = forest+128,
taiga_mountains = taiga+128,
swamp_hills = swamp+128,
ice_spikes = snowy_tundra+128,
modified_jungle = jungle+128,
modified_jungle_edge = jungle_edge+128,
tall_birch_forest = birch_forest+128,
tall_birch_hills = birch_forest_hills+128,
dark_forest_hills = dark_forest+128,
snowy_taiga_mountains = snowy_taiga+128,
giant_spruce_taiga = giant_tree_taiga+128,
giant_spruce_taiga_hills = giant_tree_taiga_hills+128,
modified_gravelly_mountains = wooded_mountains+128,
shattered_savanna = savanna+128,
shattered_savanna_plateau = savanna_plateau+128,
eroded_badlands = badlands+128,
modified_wooded_badlands_plateau = wooded_badlands_plateau+128,
modified_badlands_plateau = badlands_plateau+128,
// 1.14
bamboo_jungle = 168,
bamboo_jungle_hills = 169,
// 1.16
soul_sand_valley = 170,
crimson_forest = 171,
warped_forest = 172,
basalt_deltas = 173,
};
enum BiomeType
{
Void = -1,
Ocean, Plains, Desert, Hills, Forest, Taiga, Swamp, River, Nether, Sky, Snow, MushroomIsland, Beach, Jungle, StoneBeach, Savanna, Mesa,
BTYPE_NUM
};
enum BiomeTempCategory
{
Oceanic, Warm, Lush, Cold, Freezing, Special
};
STRUCT(Biome)
{
int id;
int type;
double height;
double temp;
int tempCat;
int mutated;
};
STRUCT(OceanRnd)
{
int d[512];
double a, b, c;
};
STRUCT(Layer)
{
int64_t baseSeed; // Generator seed (depends only on layer hierarchy)
int64_t worldSeed; // based on the seed of the world
int64_t chunkSeed; // randomiser seed
OceanRnd *oceanRnd; // world seed dependent data for ocean temperatures
int scale; // map scale of this layer (map entry = scale x scale blocks)
void (*getMap)(Layer *layer, int *out, int x, int z, int w, int h);
Layer *p, *p2; // parent layers
};
#ifdef __cplusplus
extern "C"
{
#endif
//==============================================================================
// Essentials
//==============================================================================
extern Biome biomes[256];
/* initBiomes() has to be called before any of the generators can be used */
void initBiomes();
/* Applies the given world seed to the layer and all dependent layers. */
void setWorldSeed(Layer *layer, int64_t seed);
//==============================================================================
// Static Helpers
//==============================================================================
static inline int getBiomeType(int id)
{
return (id & (~0xff)) ? Void : biomes[id].type;
}
static inline int biomeExists(int id)
{
return !(id & (~0xff)) && !(biomes[id].id & (~0xff));
}
static inline int getTempCategory(int id)
{
return (id & (~0xff)) ? Void : biomes[id].tempCat;
}
static inline int areSimilar(int id1, int id2)
{
if (id1 == id2) return 1;
if (id1 == wooded_badlands_plateau || id1 == badlands_plateau)
return id2 == wooded_badlands_plateau || id2 == badlands_plateau;
if (!biomeExists(id1) || !biomeExists(id2)) return 0;
// adjust for asymmetric equality (workaround to simulate a bug in the MC java code)
if (id1 >= 128 || id2 >= 128) {
// skip biomes that did not overload the isEqualTo() method
if (id2 == 130 || id2 == 133 || id2 == 134 || id2 == 149 || id2 == 151 || id2 == 155 ||
id2 == 156 || id2 == 157 || id2 == 158 || id2 == 163 || id2 == 164) return 0;
}
return getBiomeType(id1) == getBiomeType(id2);
}
static inline int areSimilar113(int id1, int id2)
{
if (id1 == id2) return 1;
if (id1 == wooded_badlands_plateau || id1 == badlands_plateau)
return id2 == wooded_badlands_plateau || id2 == badlands_plateau;
if (!biomeExists(id1) || !biomeExists(id2)) return 0;
return getBiomeType(id1) == getBiomeType(id2);
}
static inline int isShallowOcean(int id)
{
const uint64_t shallow_bits =
(1ULL << ocean) |
(1ULL << frozen_ocean) |
(1ULL << warm_ocean) |
(1ULL << lukewarm_ocean) |
(1ULL << cold_ocean);
return id < 64 && ((1ULL << id) & shallow_bits);
}
static inline int isDeepOcean(int id)
{
const uint64_t deep_bits =
(1ULL << deep_ocean) |
(1ULL << deep_warm_ocean) |
(1ULL << deep_lukewarm_ocean) |
(1ULL << deep_cold_ocean) |
(1ULL << deep_frozen_ocean);
return id < 64 && ((1ULL << id) & deep_bits);
}
static inline int isOceanic(int id)
{
const uint64_t ocean_bits =
(1ULL << ocean) |
(1ULL << frozen_ocean) |
(1ULL << warm_ocean) |
(1ULL << lukewarm_ocean) |
(1ULL << cold_ocean) |
(1ULL << deep_ocean) |
(1ULL << deep_warm_ocean) |
(1ULL << deep_lukewarm_ocean) |
(1ULL << deep_cold_ocean) |
(1ULL << deep_frozen_ocean);
return id < 64 && ((1ULL << id) & ocean_bits);
}
static inline int isBiomeSnowy(int id)
{
return biomeExists(id) && biomes[id].temp < 0.1;
}
static inline int mcNextInt(Layer *layer, int mod)
{
int ret = (int)((layer->chunkSeed >> 24) % (int64_t)mod);
if (ret < 0)
{
ret += mod;
}
layer->chunkSeed *= layer->chunkSeed * 6364136223846793005LL + 1442695040888963407LL;
layer->chunkSeed += layer->worldSeed;
return ret;
}
static inline int64_t processWorldSeed(register int64_t ws, const int64_t bs)
{
ws *= ws * 6364136223846793005LL + 1442695040888963407LL;
ws += bs;
ws *= ws * 6364136223846793005LL + 1442695040888963407LL;
ws += bs;
ws *= ws * 6364136223846793005LL + 1442695040888963407LL;
ws += bs;
ws *= ws * 6364136223846793005LL + 1442695040888963407LL;
return ws;
}
static inline int64_t getChunkSeed(register int64_t ss, const int64_t x, const int64_t z)
{
ss += x;
ss *= ss * 6364136223846793005LL + 1442695040888963407LL;
ss += z;
ss *= ss * 6364136223846793005LL + 1442695040888963407LL;
ss += x;
ss *= ss * 6364136223846793005LL + 1442695040888963407LL;
ss += z;
return ss;
}
static inline void setChunkSeed(Layer *layer, int64_t chunkX, int64_t chunkZ)
{
layer->chunkSeed = layer->worldSeed;
layer->chunkSeed *= layer->chunkSeed * 6364136223846793005LL + 1442695040888963407LL;
layer->chunkSeed += chunkX;
layer->chunkSeed *= layer->chunkSeed * 6364136223846793005LL + 1442695040888963407LL;
layer->chunkSeed += chunkZ;
layer->chunkSeed *= layer->chunkSeed * 6364136223846793005LL + 1442695040888963407LL;
layer->chunkSeed += chunkX;
layer->chunkSeed *= layer->chunkSeed * 6364136223846793005LL + 1442695040888963407LL;
layer->chunkSeed += chunkZ;
}
static inline void setBaseSeed(Layer *layer, int64_t seed)
{
layer->baseSeed = seed;
layer->baseSeed *= layer->baseSeed * 6364136223846793005LL + 1442695040888963407LL;
layer->baseSeed += seed;
layer->baseSeed *= layer->baseSeed * 6364136223846793005LL + 1442695040888963407LL;
layer->baseSeed += seed;
layer->baseSeed *= layer->baseSeed * 6364136223846793005LL + 1442695040888963407LL;
layer->baseSeed += seed;
layer->p = NULL;
layer->worldSeed = 0;
layer->chunkSeed = 0;
}
#if defined USE_SIMD && __AVX2__
static inline __m256i set8ChunkSeeds(int ws, __m256i xs, __m256i zs)
{
__m256i out = _mm256_set1_epi32(ws);
__m256i mul = _mm256_set1_epi32(1284865837);
__m256i add = _mm256_set1_epi32(4150755663);
out = _mm256_add_epi32(xs, _mm256_mullo_epi32(out, _mm256_add_epi32(add, _mm256_mullo_epi32(out, mul))));
out = _mm256_add_epi32(zs, _mm256_mullo_epi32(out, _mm256_add_epi32(add, _mm256_mullo_epi32(out, mul))));
out = _mm256_add_epi32(xs, _mm256_mullo_epi32(out, _mm256_add_epi32(add, _mm256_mullo_epi32(out, mul))));
return _mm256_add_epi32(zs, _mm256_mullo_epi32(out, _mm256_add_epi32(add, _mm256_mullo_epi32(out, mul))));
}
static inline __m256i mc8NextInt(__m256i* cs, int ws, int mask)
{
__m256i andm = _mm256_set1_epi32(mask);
__m256i ret = _mm256_and_si256(andm, _mm256_srli_epi32(*cs, 24));
*cs = _mm256_add_epi32(_mm256_set1_epi32(ws), _mm256_mullo_epi32(*cs, _mm256_add_epi32(_mm256_set1_epi32(4150755663), _mm256_mullo_epi32(*cs, _mm256_set1_epi32(1284865837)))));
return _mm256_add_epi32(ret, _mm256_and_si256(andm, _mm256_cmpgt_epi32(_mm256_set1_epi32(0), ret)));
}
static inline __m256i select8Random2(__m256i* cs, int ws, __m256i a1, __m256i a2)
{
__m256i cmp = _mm256_cmpeq_epi32(_mm256_set1_epi32(0), mc8NextInt(cs, ws, 0x1));
return _mm256_or_si256(_mm256_and_si256(cmp, a1), _mm256_andnot_si256(cmp, a2));
}
static inline __m256i select8Random4(__m256i* cs, int ws, __m256i a1, __m256i a2, __m256i a3, __m256i a4)
{
__m256i val = mc8NextInt(cs, ws, 0x3);
__m256i v2 = _mm256_set1_epi32(2);
__m256i cmp1 = _mm256_cmpeq_epi32(val, _mm256_set1_epi32(0));
__m256i cmp2 = _mm256_cmpeq_epi32(v2, val);
__m256i cmp3 = _mm256_cmpgt_epi32(v2, val);
return _mm256_or_si256(
_mm256_and_si256(cmp3, _mm256_or_si256(_mm256_and_si256(cmp1, a1), _mm256_andnot_si256(cmp1, a2))),
_mm256_andnot_si256(cmp3, _mm256_or_si256(_mm256_and_si256(cmp2, a3), _mm256_andnot_si256(cmp2, a4)))
);
}
static inline __m256i select8ModeOrRandom(__m256i* cs, int ws, __m256i a1, __m256i a2, __m256i a3, __m256i a4)
{
__m256i cmp1 = _mm256_cmpeq_epi32(a1, a2);
__m256i cmp2 = _mm256_cmpeq_epi32(a1, a3);
__m256i cmp3 = _mm256_cmpeq_epi32(a1, a4);
__m256i cmp4 = _mm256_cmpeq_epi32(a2, a3);
__m256i cmp5 = _mm256_cmpeq_epi32(a2, a4);
__m256i cmp6 = _mm256_cmpeq_epi32(a3, a4);
__m256i isa1 = _mm256_or_si256(
_mm256_andnot_si256(cmp6, cmp1),
_mm256_or_si256 (
_mm256_andnot_si256(cmp5, cmp2),
_mm256_andnot_si256(cmp4, cmp3)
)
);
__m256i isa2 = _mm256_or_si256(
_mm256_andnot_si256(cmp3, cmp4),
_mm256_andnot_si256(cmp2, cmp5)
);
__m256i isa3 = _mm256_andnot_si256(cmp1, cmp6);
return _mm256_or_si256(
_mm256_andnot_si256(
_mm256_or_si256(
isa1,
_mm256_or_si256(isa2, isa3)
),
select8Random4(cs, ws, a1, a2, a3, a4)
),
_mm256_or_si256(
_mm256_and_si256(isa1, a1),
_mm256_or_si256(
_mm256_and_si256(isa2, a2),
_mm256_and_si256(isa3, a3)
)
)
);
}
#elif defined USE_SIMD && defined __SSE4_2__
static inline __m128i set4ChunkSeeds(int ws, __m128i xs, __m128i zs)
{
__m128i out = _mm_set1_epi32(ws);
__m128i mul = _mm_set1_epi32(1284865837);
__m128i add = _mm_set1_epi32(4150755663);
out = _mm_add_epi32(xs, _mm_mullo_epi32(out, _mm_add_epi32(add, _mm_mullo_epi32(out, mul))));
out = _mm_add_epi32(zs, _mm_mullo_epi32(out, _mm_add_epi32(add, _mm_mullo_epi32(out, mul))));
out = _mm_add_epi32(xs, _mm_mullo_epi32(out, _mm_add_epi32(add, _mm_mullo_epi32(out, mul))));
return _mm_add_epi32(zs, _mm_mullo_epi32(out, _mm_add_epi32(add, _mm_mullo_epi32(out, mul))));
}
static inline __m128i mc4NextInt(__m128i* cs, int ws, int mask)
{
__m128i andm = _mm_set1_epi32(mask);
__m128i ret = _mm_and_si128(andm, _mm_srli_epi32(*cs, 24));
*cs = _mm_add_epi32( _mm_set1_epi32(ws), _mm_mullo_epi32(*cs, _mm_add_epi32(_mm_set1_epi32(4150755663), _mm_mullo_epi32(*cs, _mm_set1_epi32(1284865837)))));
return _mm_add_epi32(ret, _mm_and_si128(andm, _mm_cmplt_epi32(ret, _mm_set1_epi32(0))));
}
static inline __m128i select4Random2(__m128i* cs, int ws, __m128i a1, __m128i a2)
{
__m128i cmp = _mm_cmpeq_epi32(_mm_set1_epi32(0), mc4NextInt(cs, ws, 0x1));
return _mm_or_si128(_mm_and_si128(cmp, a1), _mm_andnot_si128(cmp, a2));
}
static inline __m128i select4Random4(__m128i* cs, int ws, __m128i a1, __m128i a2, __m128i a3, __m128i a4)
{
__m128i val = mc4NextInt(cs, ws, 0x3);
__m128i v2 = _mm_set1_epi32(2);
__m128i cmp1 = _mm_cmpeq_epi32(val, _mm_set1_epi32(0));
__m128i cmp2 = _mm_cmpeq_epi32(val, v2);
__m128i cmp3 = _mm_cmplt_epi32(val, v2);
return _mm_or_si128(
_mm_and_si128(cmp3, _mm_or_si128(_mm_and_si128(cmp1, a1), _mm_andnot_si128(cmp1, a2))),
_mm_andnot_si128(cmp3, _mm_or_si128(_mm_and_si128(cmp2, a3), _mm_andnot_si128(cmp2, a4)))
);
}
static inline __m128i select4ModeOrRandom(__m128i* cs, int ws, __m128i a1, __m128i a2, __m128i a3, __m128i a4)
{
//((a == b)&(c != d) | (a == c)&(b != d) | (a == d)&(b != c))&a | ((b == c)&(a != d) | (b == d)&(a != c))&b | ((c == d)&(a != b))&c
__m128i cmp1 = _mm_cmpeq_epi32(a1, a2);
__m128i cmp2 = _mm_cmpeq_epi32(a1, a3);
__m128i cmp3 = _mm_cmpeq_epi32(a1, a4);
__m128i cmp4 = _mm_cmpeq_epi32(a2, a3);
__m128i cmp5 = _mm_cmpeq_epi32(a2, a4);
__m128i cmp6 = _mm_cmpeq_epi32(a3, a4);
__m128i isa1 = _mm_or_si128(
_mm_andnot_si128(cmp6, cmp1),
_mm_or_si128 (
_mm_andnot_si128(cmp5, cmp2),
_mm_andnot_si128(cmp4, cmp3)
)
);
__m128i isa2 = _mm_or_si128(
_mm_andnot_si128(cmp3, cmp4),
_mm_andnot_si128(cmp2, cmp5)
);
__m128i isa3 = _mm_andnot_si128(cmp1, cmp6);
return _mm_or_si128(
_mm_andnot_si128(
_mm_or_si128(
isa1,
_mm_or_si128(isa2, isa3)
),
select4Random4(cs, ws, a1, a2, a3, a4)
),
_mm_or_si128(
_mm_and_si128(isa1, a1),
_mm_or_si128(
_mm_and_si128(isa2, a2),
_mm_and_si128(isa3, a3)
)
)
);
}
#else
static inline int selectRandom2(Layer *l, int a1, int a2)
{
int i = mcNextInt(l, 2);
return i == 0 ? a1 : a2;
}
static inline int selectRandom4(Layer *l, int a1, int a2, int a3, int a4)
{
int i = mcNextInt(l, 4);
return i == 0 ? a1 : i == 1 ? a2 : i == 2 ? a3 : a4;
}
static inline int selectModeOrRandom(Layer *l, int a1, int a2, int a3, int a4)
{
int rndarg = selectRandom4(l, a1, a2, a3, a4);
if (a2 == a3 && a3 == a4) return a2;
if (a1 == a2 && a1 == a3) return a1;
if (a1 == a2 && a1 == a4) return a1;
if (a1 == a3 && a1 == a4) return a1;
if (a1 == a2 && a3 != a4) return a1;
if (a1 == a3 && a2 != a4) return a1;
if (a1 == a4 && a2 != a3) return a1;
if (a2 == a3 && a1 != a4) return a2;
if (a2 == a4 && a1 != a3) return a2;
if (a3 == a4 && a1 != a2) return a3;
return rndarg;
}
#endif
//==============================================================================
// Layers
//==============================================================================
// A null layer does nothing, and can be used to apply a layer to existing data.
void mapNull(Layer *l, int * __restrict out, int x, int z, int w, int h);
// A skip layer simply calls its first parent without modification.
// This can be used as an easy way to skip a layer in a generator.
void mapSkip(Layer *l, int * __restrict out, int x, int z, int w, int h);
void mapIsland(Layer *l, int * __restrict out, int x, int z, int w, int h);
void mapZoom(Layer *l, int * __restrict out, int x, int z, int w, int h);
void mapAddIsland(Layer *l, int * __restrict out, int x, int z, int w, int h);
void mapRemoveTooMuchOcean(Layer *l, int * __restrict out, int x, int z, int w, int h);
void mapAddSnow(Layer *l, int * __restrict out, int x, int z, int w, int h);
void mapCoolWarm(Layer *l, int * __restrict out, int x, int z, int w, int h);
void mapHeatIce(Layer *l, int * __restrict out, int x, int z, int w, int h);
void mapSpecial(Layer *l, int * __restrict out, int x, int z, int w, int h);
void mapAddMushroomIsland(Layer *l, int * __restrict out, int x, int z, int w, int h);
void mapDeepOcean(Layer *l, int * __restrict out, int x, int z, int w, int h);
void mapBiome(Layer *l, int * __restrict out, int x, int z, int w, int h);
void mapBiomeBE(Layer *l, int * __restrict out, int x, int z, int w, int h);
void mapAddBamboo(Layer *l, int * __restrict out, int x, int z, int w, int h);
void mapRiverInit(Layer *l, int * __restrict out, int x, int z, int w, int h);
void mapBiomeEdge(Layer *l, int * __restrict out, int x, int z, int w, int h);
void mapHills(Layer *l, int * __restrict out, int x, int z, int w, int h);
void mapRiver(Layer *l, int * __restrict out, int x, int z, int w, int h);
void mapSmooth(Layer *l, int * __restrict out, int x, int z, int w, int h);
void mapRareBiome(Layer *l, int * __restrict out, int x, int z, int w, int h);
void mapShore(Layer *l, int * __restrict out, int x, int z, int w, int h);
void mapRiverMix(Layer *l, int * __restrict out, int x, int z, int w, int h);
// 1.13 layers
void mapHills113(Layer *l, int * __restrict out, int x, int z, int w, int h);
void mapOceanTemp(Layer *l, int * __restrict out, int areaX, int areaZ, int areaWidth, int areaHeight);
void mapOceanMix(Layer *l, int * __restrict out, int areaX, int areaZ, int areaWidth, int areaHeight);
void mapVoronoiZoom(Layer *l, int * __restrict out, int x, int z, int w, int h);
#ifdef __cplusplus
}
#endif
#endif /* LAYER_H_ */