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
70e2df4f
Commit
70e2df4f
authored
8 years ago
by
paramat
Browse files
Options
Downloads
Patches
Plain Diff
Lua voxelmanip: Add optional buffer param for 'get param2 data'
Update lua_api.txt.
parent
380a4b6d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
doc/lua_api.txt
+3
-1
3 additions, 1 deletion
doc/lua_api.txt
src/script/lua_api/l_vmanip.cpp
+7
-1
7 additions, 1 deletion
src/script/lua_api/l_vmanip.cpp
with
10 additions
and
2 deletions
doc/lua_api.txt
+
3
−
1
View file @
70e2df4f
...
...
@@ -3263,7 +3263,9 @@ will place the schematic inside of the VoxelManip.
* `set_light_data(light_data)`: Sets the `param1` (light) contents of each node
in the `VoxelManip`
* expects lighting data in the same format that `get_light_data()` returns
* `get_param2_data()`: Gets the raw `param2` data read into the `VoxelManip` object
* `get_param2_data([buffer])`: Gets the raw `param2` data read into the `VoxelManip` object
* Returns an array (indices 1 to volume) of integers ranging from `0` to `255`
* If the param `buffer` is present, this table will be used to store the result instead
* `set_param2_data(param2_data)`: Sets the `param2` contents of each node in the `VoxelManip`
* `calc_lighting([p1, p2], [propagate_shadow])`: Calculate lighting within the `VoxelManip`
* To be used only by a `VoxelManip` object from `minetest.get_mapgen_object`
...
...
This diff is collapsed.
Click to expand it.
src/script/lua_api/l_vmanip.cpp
+
7
−
1
View file @
70e2df4f
...
...
@@ -277,11 +277,17 @@ int LuaVoxelManip::l_get_param2_data(lua_State *L)
NO_MAP_LOCK_REQUIRED
;
LuaVoxelManip
*
o
=
checkobject
(
L
,
1
);
bool
use_buffer
=
lua_istable
(
L
,
2
);
MMVManip
*
vm
=
o
->
vm
;
u32
volume
=
vm
->
m_area
.
getVolume
();
lua_newtable
(
L
);
if
(
use_buffer
)
lua_pushvalue
(
L
,
2
);
else
lua_newtable
(
L
);
for
(
u32
i
=
0
;
i
!=
volume
;
i
++
)
{
lua_Integer
param2
=
vm
->
m_data
[
i
].
param2
;
lua_pushinteger
(
L
,
param2
);
...
...
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