Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
illuna-minetest
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Illuna-Minetest
illuna-minetest
Commits
874109c5
Commit
874109c5
authored
10 years ago
by
SmallJoker
Committed by
Zeno-
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add option 'eased' to NoiseParams
Signed-off-by:
Craig Robbins
<
kde.psych@gmail.com
>
parent
b57478b9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
doc/lua_api.txt
+13
-0
13 additions, 0 deletions
doc/lua_api.txt
src/noise.h
+3
-1
3 additions, 1 deletion
src/noise.h
src/script/common/c_content.cpp
+1
-0
1 addition, 0 deletions
src/script/common/c_content.cpp
src/script/lua_api/l_noise.cpp
+2
-2
2 additions, 2 deletions
src/script/lua_api/l_noise.cpp
with
19 additions
and
3 deletions
doc/lua_api.txt
+
13
−
0
View file @
874109c5
...
...
@@ -2796,3 +2796,16 @@ ParticleSpawner definition (add_particlespawner)
playername = "singleplayer"
^ Playername is optional, if specified spawns particle only on the player's client
}
NoiseParams definition (PerlinNoiseMap)
{
offset = 0,
scale = 0,
spread = 0,
seed = 0,
octaves = 0,
^ A higher value will result in more details, this means more operations
persist = 0,
eased = false
^ Whether it should create curves in 3D perlin maps
}
This diff is collapsed.
Click to expand it.
src/noise.h
+
3
−
1
View file @
874109c5
...
...
@@ -73,11 +73,12 @@ struct NoiseParams {
int
seed
;
int
octaves
;
float
persist
;
bool
eased
;
NoiseParams
()
{}
NoiseParams
(
float
offset_
,
float
scale_
,
v3f
spread_
,
int
seed_
,
int
octaves_
,
float
persist_
)
int
seed_
,
int
octaves_
,
float
persist_
,
bool
eased_
=
false
)
{
offset
=
offset_
;
scale
=
scale_
;
...
...
@@ -85,6 +86,7 @@ struct NoiseParams {
seed
=
seed_
;
octaves
=
octaves_
;
persist
=
persist_
;
eased
=
eased_
;
}
};
...
...
This diff is collapsed.
Click to expand it.
src/script/common/c_content.cpp
+
1
−
0
View file @
874109c5
...
...
@@ -1000,6 +1000,7 @@ bool read_noiseparams_nc(lua_State *L, int index, NoiseParams *np)
np
->
persist
=
getfloatfield_default
(
L
,
index
,
"persist"
,
0.0
);
np
->
seed
=
getintfield_default
(
L
,
index
,
"seed"
,
0
);
np
->
octaves
=
getintfield_default
(
L
,
index
,
"octaves"
,
0
);
np
->
eased
=
getboolfield_default
(
L
,
index
,
"eased"
,
false
);
lua_getfield
(
L
,
index
,
"spread"
);
np
->
spread
=
read_v3f
(
L
,
-
1
);
...
...
This diff is collapsed.
Click to expand it.
src/script/lua_api/l_noise.cpp
+
2
−
2
View file @
874109c5
...
...
@@ -190,7 +190,7 @@ int LuaPerlinNoiseMap::l_get3dMap(lua_State *L)
v3f
p
=
read_v3f
(
L
,
2
);
Noise
*
n
=
o
->
noise
;
n
->
perlinMap3D
(
p
.
X
,
p
.
Y
,
p
.
Z
);
n
->
perlinMap3D
(
p
.
X
,
p
.
Y
,
p
.
Z
,
n
->
np
->
eased
);
lua_newtable
(
L
);
for
(
int
z
=
0
;
z
!=
n
->
sz
;
z
++
)
{
...
...
@@ -216,7 +216,7 @@ int LuaPerlinNoiseMap::l_get3dMap_flat(lua_State *L)
v3f
p
=
read_v3f
(
L
,
2
);
Noise
*
n
=
o
->
noise
;
n
->
perlinMap3D
(
p
.
X
,
p
.
Y
,
p
.
Z
);
n
->
perlinMap3D
(
p
.
X
,
p
.
Y
,
p
.
Z
,
n
->
np
->
eased
);
int
maplen
=
n
->
sx
*
n
->
sy
*
n
->
sz
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment