summaryrefslogtreecommitdiffstats
path: root/src/Noise.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Noise.cpp')
-rw-r--r--src/Noise.cpp24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/Noise.cpp b/src/Noise.cpp
index a97ea70c6..efbb128c3 100644
--- a/src/Noise.cpp
+++ b/src/Noise.cpp
@@ -425,7 +425,7 @@ void cCubicCell3D::Move(int a_NewFloorX, int a_NewFloorY, int a_NewFloorZ)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// cNoise:
-cNoise::cNoise(unsigned int a_Seed) :
+cNoise::cNoise(int a_Seed) :
m_Seed(a_Seed)
{
}
@@ -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;