medfall

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

commit 296d2ef944256a47e8e89ea21c8c9b6077aa4230
parent 60e18c07183d7a21bef9f8092875f14bf88e25eb
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Sat Oct 15 00:08:53 +0300

Remove dead code

Diffstat:
gpubtt.cc | 41-----------------------------------------
1 file changed, 0 insertions(+), 41 deletions(-)
diff --git a/gpubtt.cc b/gpubtt.cc @@ -44,47 +44,6 @@ static void gpubtt_build( } } -static float angle( glm::vec3 a, glm::vec3 b ) { - const glm::vec3 d = b - a; - - const float dist_xy = glm::length( glm::vec2( d.x, d.y ) ); - - return d.z / dist_xy; -} - -static void compute_horizons( - MemoryArena * arena, - const Heightmap * hm, float * horizons, - glm::ivec2 start, glm::ivec2 step -) { - MEMARENA_SCOPED_CHECKPOINT( arena ); - - const u32 max_hull_size = 2 * max( hm->width, hm->height ); - - glm::vec3 * hull = memarena_push_many( arena, glm::vec3, max_hull_size ); - u32 hull_size = 1; - - hull[ 0 ] = hm->point( start.x, start.y ); - - start += step; - - while( ( u32 ) start.x < hm->width && ( u32 ) start.y < hm->height && start.x >= 0 && start.y >= 0 ) { - const glm::vec3 p = hm->point( start.x, start.y ); - - while( hull_size > 1 && angle( p, hull[ hull_size - 1 ] ) < angle( hull[ hull_size - 1 ], hull[ hull_size - 2 ] ) ) { - hull_size--; - } - - const float horizon = max( 0.0f, angle( p, hull[ hull_size - 1 ] ) ); - horizons[ start.y * hm->width + start.x ] = horizon; - - hull[ hull_size ] = p; - hull_size++; - - start += step; - } -} - void gpubtt_init( MemoryArena * arena, GPUBTT * gpubtt, BTTs btts, const OffsetHeightmap * ohm, const v3 * normals, const float * horizons,