Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Large increase in performance
  • Loading branch information
Zeno- committed Dec 24, 2014
1 parent 03beb59 commit 8621e6d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
15 changes: 7 additions & 8 deletions src/mapnode.h
Expand Up @@ -143,14 +143,13 @@ struct MapNode
{
*this = n;
}

MapNode(content_t content=CONTENT_AIR, u8 a_param1=0, u8 a_param2=0)
{
param0 = content;
param1 = a_param1;
param2 = a_param2;
}


MapNode(content_t content = CONTENT_AIR, u8 a_param1=0, u8 a_param2=0)
: param0(content),
param1(a_param1),
param2(a_param2)
{ }

// Create directly from a nodename
// If name is unknown, sets CONTENT_IGNORE
MapNode(INodeDefManager *ndef, const std::string &name,
Expand Down
4 changes: 3 additions & 1 deletion src/voxel.cpp
Expand Up @@ -180,7 +180,9 @@ void VoxelManipulator::addArea(const VoxelArea &area)
dstream<<std::endl;*/

// Allocate and clear new data
MapNode *new_data = new MapNode[new_size];
// FIXME: UGLY KLUDGE because MapNode default constructor is FUBAR; it
// initialises data that is going to be overwritten anyway
MapNode *new_data = (MapNode*)new char[new_size * sizeof (*new_data)];
assert(new_data);
u8 *new_flags = new u8[new_size];
assert(new_flags);
Expand Down

1 comment on commit 8621e6d

@HybridDog
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How large?

Please sign in to comment.