summaryrefslogtreecommitdiffstats
path: root/src/Noise
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-11-28 22:46:58 +0100
committerMattes D <github@xoft.cz>2014-11-28 22:46:58 +0100
commit883230abbcc20a4a27e1d8909894be63dee75d43 (patch)
treeecbdc082281e820fc98a302add93400ba467dbd7 /src/Noise
parentCMake: Fixed linux builds. (diff)
parentChunk: Fixed same-name iterators. (diff)
downloadcuberite-883230abbcc20a4a27e1d8909894be63dee75d43.tar
cuberite-883230abbcc20a4a27e1d8909894be63dee75d43.tar.gz
cuberite-883230abbcc20a4a27e1d8909894be63dee75d43.tar.bz2
cuberite-883230abbcc20a4a27e1d8909894be63dee75d43.tar.lz
cuberite-883230abbcc20a4a27e1d8909894be63dee75d43.tar.xz
cuberite-883230abbcc20a4a27e1d8909894be63dee75d43.tar.zst
cuberite-883230abbcc20a4a27e1d8909894be63dee75d43.zip
Diffstat (limited to 'src/Noise')
-rw-r--r--src/Noise/OctavedNoise.h42
-rw-r--r--src/Noise/RidgedNoise.h4
2 files changed, 25 insertions, 21 deletions
diff --git a/src/Noise/OctavedNoise.h b/src/Noise/OctavedNoise.h
index 855117289..efb9a0167 100644
--- a/src/Noise/OctavedNoise.h
+++ b/src/Noise/OctavedNoise.h
@@ -66,17 +66,19 @@ public:
}
// Generate the first octave directly into array:
- const cOctave & FirstOctave = m_Octaves.front();
int ArrayCount = a_SizeX * a_SizeY;
- FirstOctave.m_Noise.Generate2D(
- a_Workspace, a_SizeX, a_SizeY,
- a_StartX * FirstOctave.m_Frequency, a_EndX * FirstOctave.m_Frequency,
- a_StartY * FirstOctave.m_Frequency, a_EndY * FirstOctave.m_Frequency
- );
- NOISE_DATATYPE Amplitude = FirstOctave.m_Amplitude;
- for (int i = 0; i < ArrayCount; i++)
{
- a_Array[i] = a_Workspace[i] * Amplitude;
+ const cOctave & FirstOctave = m_Octaves.front();
+ FirstOctave.m_Noise.Generate2D(
+ a_Workspace, a_SizeX, a_SizeY,
+ a_StartX * FirstOctave.m_Frequency, a_EndX * FirstOctave.m_Frequency,
+ a_StartY * FirstOctave.m_Frequency, a_EndY * FirstOctave.m_Frequency
+ );
+ NOISE_DATATYPE Amplitude = FirstOctave.m_Amplitude;
+ for (int i = 0; i < ArrayCount; i++)
+ {
+ a_Array[i] = a_Workspace[i] * Amplitude;
+ }
}
// Add each octave:
@@ -124,18 +126,20 @@ public:
}
// Generate the first octave directly into array:
- const cOctave & FirstOctave = m_Octaves.front();
int ArrayCount = a_SizeX * a_SizeY * a_SizeZ;
- FirstOctave.m_Noise.Generate3D(
- a_Workspace, a_SizeX, a_SizeY, a_SizeZ,
- a_StartX * FirstOctave.m_Frequency, a_EndX * FirstOctave.m_Frequency,
- a_StartY * FirstOctave.m_Frequency, a_EndY * FirstOctave.m_Frequency,
- a_StartZ * FirstOctave.m_Frequency, a_EndZ * FirstOctave.m_Frequency
- );
- NOISE_DATATYPE Amplitude = FirstOctave.m_Amplitude;
- for (int i = 0; i < ArrayCount; i++)
{
- a_Array[i] = a_Workspace[i] * Amplitude;
+ const cOctave & FirstOctave = m_Octaves.front();
+ FirstOctave.m_Noise.Generate3D(
+ a_Workspace, a_SizeX, a_SizeY, a_SizeZ,
+ a_StartX * FirstOctave.m_Frequency, a_EndX * FirstOctave.m_Frequency,
+ a_StartY * FirstOctave.m_Frequency, a_EndY * FirstOctave.m_Frequency,
+ a_StartZ * FirstOctave.m_Frequency, a_EndZ * FirstOctave.m_Frequency
+ );
+ NOISE_DATATYPE Amplitude = FirstOctave.m_Amplitude;
+ for (int i = 0; i < ArrayCount; i++)
+ {
+ a_Array[i] = a_Workspace[i] * Amplitude;
+ }
}
// Add each octave:
diff --git a/src/Noise/RidgedNoise.h b/src/Noise/RidgedNoise.h
index 69b480f60..f59a0512f 100644
--- a/src/Noise/RidgedNoise.h
+++ b/src/Noise/RidgedNoise.h
@@ -54,7 +54,7 @@ public:
);
for (int i = 0; i < ArrayCount; i++)
{
- a_Array[i] = fabs(a_Array[i]);
+ a_Array[i] = std::abs(a_Array[i]);
}
}
@@ -77,7 +77,7 @@ public:
);
for (int i = 0; i < ArrayCount; i++)
{
- a_Array[i] = fabs(a_Array[i]);
+ a_Array[i] = std::abs(a_Array[i]);
}
}