summaryrefslogtreecommitdiffstats
path: root/src/Noise.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Noise.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/Noise.cpp b/src/Noise.cpp
index 32922c8f3..efbb128c3 100644
--- a/src/Noise.cpp
+++ b/src/Noise.cpp
@@ -840,12 +840,14 @@ void cPerlinNoise::Generate2D(
}
// Generate the first octave directly into array:
- m_Octaves.front().m_Noise.Generate2D(
+ const cOctave & FirstOctave = m_Octaves.front();
+
+ FirstOctave.m_Noise.Generate2D(
a_Workspace, a_SizeX, a_SizeY,
- a_StartX * m_Octaves.front().m_Frequency, a_EndX * m_Octaves.front().m_Frequency,
- a_StartY * m_Octaves.front().m_Frequency, a_EndY * m_Octaves.front().m_Frequency
+ a_StartX * FirstOctave.m_Frequency, a_EndX * FirstOctave.m_Frequency,
+ a_StartY * FirstOctave.m_Frequency, a_EndY * FirstOctave.m_Frequency
);
- NOISE_DATATYPE Amplitude = m_Octaves.front().m_Amplitude;
+ NOISE_DATATYPE Amplitude = FirstOctave.m_Amplitude;
for (int i = 0; i < ArrayCount; i++)
{
a_Array[i] *= Amplitude;
@@ -902,13 +904,15 @@ void cPerlinNoise::Generate3D(
}
// Generate the first octave directly into array:
- m_Octaves.front().m_Noise.Generate3D(
+ const cOctave & FirstOctave = m_Octaves.front();
+
+ FirstOctave.m_Noise.Generate3D(
a_Workspace, a_SizeX, a_SizeY, a_SizeZ,
- a_StartX * m_Octaves.front().m_Frequency, a_EndX * m_Octaves.front().m_Frequency,
- a_StartY * m_Octaves.front().m_Frequency, a_EndY * m_Octaves.front().m_Frequency,
- a_StartZ * m_Octaves.front().m_Frequency, a_EndZ * m_Octaves.front().m_Frequency
+ 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 = m_Octaves.front().m_Amplitude;
+ NOISE_DATATYPE Amplitude = FirstOctave.m_Amplitude;
for (int i = 0; i < ArrayCount; i++)
{
a_Array[i] = a_Workspace[i] * Amplitude;