diff options
author | kwolekr <kwolekr@minetest.net> | 2015-01-05 02:42:27 -0500 |
---|---|---|
committer | kwolekr <kwolekr@minetest.net> | 2015-01-05 02:42:27 -0500 |
commit | 2d849b0a19af03913e564e2b6dbc36eecdd5ae0c (patch) | |
tree | 4f1cfff6586c305c419562173b73c9ab9410c401 /src/treegen.cpp | |
parent | 7289d61e99625b46eb2c4d6b90a2a5de42f207e6 (diff) | |
download | minetest-2d849b0a19af03913e564e2b6dbc36eecdd5ae0c.tar.gz minetest-2d849b0a19af03913e564e2b6dbc36eecdd5ae0c.tar.bz2 minetest-2d849b0a19af03913e564e2b6dbc36eecdd5ae0c.zip |
Shorten ManualMapVoxelManipulator to MMVManip
Diffstat (limited to 'src/treegen.cpp')
-rw-r--r-- | src/treegen.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/treegen.cpp b/src/treegen.cpp index bd4a2f2c9..5c95b250e 100644 --- a/src/treegen.cpp +++ b/src/treegen.cpp @@ -30,7 +30,7 @@ with this program; if not, write to the Free Software Foundation, Inc., namespace treegen { -void make_tree(ManualMapVoxelManipulator &vmanip, v3s16 p0, +void make_tree(MMVManip &vmanip, v3s16 p0, bool is_apple_tree, INodeDefManager *ndef, int seed) { /* @@ -122,7 +122,7 @@ treegen::error spawn_ltree(ServerEnvironment *env, v3s16 p0, INodeDefManager *nd { ServerMap *map = &env->getServerMap(); std::map<v3s16, MapBlock*> modified_blocks; - ManualMapVoxelManipulator vmanip(map); + MMVManip vmanip(map); v3s16 tree_blockp = getNodeBlockPos(p0); treegen::error e; @@ -151,7 +151,7 @@ treegen::error spawn_ltree(ServerEnvironment *env, v3s16 p0, INodeDefManager *nd } //L-System tree generator -treegen::error make_ltree(ManualMapVoxelManipulator &vmanip, v3s16 p0, INodeDefManager *ndef, +treegen::error make_ltree(MMVManip &vmanip, v3s16 p0, INodeDefManager *ndef, TreeDef tree_definition) { MapNode dirtnode(ndef->getId("mapgen_dirt")); @@ -414,7 +414,7 @@ treegen::error make_ltree(ManualMapVoxelManipulator &vmanip, v3s16 p0, INodeDefM return SUCCESS; } -void tree_node_placement(ManualMapVoxelManipulator &vmanip, v3f p0, +void tree_node_placement(MMVManip &vmanip, v3f p0, MapNode node) { v3s16 p1 = v3s16(myround(p0.X),myround(p0.Y),myround(p0.Z)); @@ -427,7 +427,7 @@ void tree_node_placement(ManualMapVoxelManipulator &vmanip, v3f p0, vmanip.m_data[vmanip.m_area.index(p1)] = node; } -void tree_trunk_placement(ManualMapVoxelManipulator &vmanip, v3f p0, +void tree_trunk_placement(MMVManip &vmanip, v3f p0, TreeDef &tree_definition) { v3s16 p1 = v3s16(myround(p0.X),myround(p0.Y),myround(p0.Z)); @@ -440,7 +440,7 @@ void tree_trunk_placement(ManualMapVoxelManipulator &vmanip, v3f p0, vmanip.m_data[vmanip.m_area.index(p1)] = tree_definition.trunknode; } -void tree_leaves_placement(ManualMapVoxelManipulator &vmanip, v3f p0, +void tree_leaves_placement(MMVManip &vmanip, v3f p0, PseudoRandom ps ,TreeDef &tree_definition) { MapNode leavesnode=tree_definition.leavesnode; @@ -452,7 +452,7 @@ void tree_leaves_placement(ManualMapVoxelManipulator &vmanip, v3f p0, u32 vi = vmanip.m_area.index(p1); if(vmanip.m_data[vi].getContent() != CONTENT_AIR && vmanip.m_data[vi].getContent() != CONTENT_IGNORE) - return; + return; if (tree_definition.fruit_chance>0) { if (ps.range(1,100) > 100-tree_definition.fruit_chance) @@ -464,7 +464,7 @@ void tree_leaves_placement(ManualMapVoxelManipulator &vmanip, v3f p0, vmanip.m_data[vmanip.m_area.index(p1)] = leavesnode; } -void tree_single_leaves_placement(ManualMapVoxelManipulator &vmanip, v3f p0, +void tree_single_leaves_placement(MMVManip &vmanip, v3f p0, PseudoRandom ps, TreeDef &tree_definition) { MapNode leavesnode=tree_definition.leavesnode; @@ -480,7 +480,7 @@ void tree_single_leaves_placement(ManualMapVoxelManipulator &vmanip, v3f p0, vmanip.m_data[vmanip.m_area.index(p1)] = leavesnode; } -void tree_fruit_placement(ManualMapVoxelManipulator &vmanip, v3f p0, +void tree_fruit_placement(MMVManip &vmanip, v3f p0, TreeDef &tree_definition) { v3s16 p1 = v3s16(myround(p0.X),myround(p0.Y),myround(p0.Z)); @@ -560,7 +560,7 @@ void make_jungletree(VoxelManipulator &vmanip, v3s16 p0, v3s16 p2 = p0 + v3s16(x,-1,z); u32 vi1 = vmanip.m_area.index(p1); u32 vi2 = vmanip.m_area.index(p2); - + if (vmanip.m_area.contains(p2) && vmanip.m_data[vi2].getContent() == CONTENT_AIR) vmanip.m_data[vi2] = treenode; |