medfall

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit ff5706bf6b3eddf373065d033b46d6566756c7db
parent 1c077d31972cb0cb1471282e175c2040edca5eeb
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Fri Dec  9 20:31:23 +0200

Zero out quadtree memory before building

Diffstat:
heightmap.cc | 1+
1 file changed, 1 insertion(+), 0 deletions(-)
diff --git a/heightmap.cc b/heightmap.cc @@ -256,6 +256,7 @@ HeightmapQuadTree heightmap_build_quadtree( const Heightmap * hm ) { qt.dim = hm->width - 1; qt.nodes_memory = ( HeightmapQuadTreeNode * ) malloc( num_nodes * sizeof( HeightmapQuadTreeNode ) ); qt.nodes = array< HeightmapQuadTreeNode >( qt.nodes_memory, num_nodes ); + memset( qt.nodes.ptr(), 0, qt.nodes.num_bytes() ); AABBu32 aabb( v3u32( 0, 0, 0 ), v3u32( qt.dim, qt.dim, 255 ) ); heightmap_build_quadtree_node( &qt, 0, aabb );