summaryrefslogtreecommitdiffstats
path: root/src/Noise.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-04-22 13:34:32 +0200
committerMattes D <github@xoft.cz>2014-04-22 13:34:32 +0200
commit6492aa000b322877aecda32573cc55b57abfc5ed (patch)
treef9f0f9211b42aa72729f8d6d444e4f48556e5fb9 /src/Noise.cpp
parentAdded prefab hitboxes. (diff)
parentreverted the revert of the minecart collision detection fix. (diff)
downloadcuberite-6492aa000b322877aecda32573cc55b57abfc5ed.tar
cuberite-6492aa000b322877aecda32573cc55b57abfc5ed.tar.gz
cuberite-6492aa000b322877aecda32573cc55b57abfc5ed.tar.bz2
cuberite-6492aa000b322877aecda32573cc55b57abfc5ed.tar.lz
cuberite-6492aa000b322877aecda32573cc55b57abfc5ed.tar.xz
cuberite-6492aa000b322877aecda32573cc55b57abfc5ed.tar.zst
cuberite-6492aa000b322877aecda32573cc55b57abfc5ed.zip
Diffstat (limited to 'src/Noise.cpp')
-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;