mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-28 07:55:38 -04:00
Optimise Notchy.CreateHeightmap
This commit is contained in:
parent
0748f54f87
commit
8f44f43ef2
@ -62,10 +62,13 @@ namespace ClassicalSharp.Generator {
|
|||||||
for (int z = 0; z < Length; z++) {
|
for (int z = 0; z < Length; z++) {
|
||||||
CurrentProgress = (float)z / Length;
|
CurrentProgress = (float)z / Length;
|
||||||
for (int x = 0; x < Width; x++) {
|
for (int x = 0; x < Width; x++) {
|
||||||
double hLow = n1.Compute(x * 1.3f, z * 1.3f) / 6 - 4;
|
double hLow = n1.Compute(x * 1.3f, z * 1.3f) / 6 - 4, height = hLow;
|
||||||
double hHigh = n2.Compute(x * 1.3f, z * 1.3f) / 5 + 6;
|
|
||||||
|
if (n3.Compute(x, z) <= 0) {
|
||||||
|
double hHigh = n2.Compute(x * 1.3f, z * 1.3f) / 5 + 6;
|
||||||
|
height = Math.Max(hLow, hHigh);
|
||||||
|
}
|
||||||
|
|
||||||
double height = n3.Compute(x, z) > 0 ? hLow : Math.Max(hLow, hHigh);
|
|
||||||
height *= 0.5;
|
height *= 0.5;
|
||||||
if (height < 0) height *= 0.8f;
|
if (height < 0) height *= 0.8f;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user