commit 9ca2eec0e51fa9ca84698dc0ac6ad49c48259ac1
parent 5b97f0b772be8a17980f25ba323d36f2d82d4776
Author: Michael Savage <mikejsavage@gmail.com>
Date: Tue, 21 Nov 2017 20:35:06 +0200
Make clipmap cross arms 1 longer
Diffstat:
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/clipmap.cc b/clipmap.cc
@@ -380,11 +380,11 @@ GAME_INIT( game_init ) {
{
MEMARENA_SCOPED_CHECKPOINT( &mem->persistent_arena );
- array< v3 > vertices = alloc_array< v3 >( &mem->persistent_arena, PATCH_RESOLUTION * 8 + 4 );
+ array< v3 > vertices = alloc_array< v3 >( &mem->persistent_arena, PATCH_VERT_RESOLUTION * 8 );
size_t n = 0;
// horizontal vertices
- for( u32 i = 0; i < PATCH_RESOLUTION * 2 + 1; i++ ) {
+ for( u32 i = 0; i < PATCH_VERT_RESOLUTION * 2; i++ ) {
vertices[ n++ ] = v3( i - float( PATCH_RESOLUTION ), 0, 0 );
vertices[ n++ ] = v3( i - float( PATCH_RESOLUTION ), 1, 0 );
}
@@ -392,18 +392,18 @@ GAME_INIT( game_init ) {
size_t start_of_vertical = n;
// vertical vertices
- for( u32 i = 0; i < PATCH_RESOLUTION * 2 + 1; i++ ) {
+ for( u32 i = 0; i < PATCH_VERT_RESOLUTION * 2; i++ ) {
vertices[ n++ ] = v3( 0, i - float( PATCH_RESOLUTION ), 0 );
vertices[ n++ ] = v3( 1, i - float( PATCH_RESOLUTION ), 0 );
}
ASSERT( n == vertices.n );
- array< u32 > indices = alloc_array< u32 >( &mem->persistent_arena, PATCH_RESOLUTION * 24 - 6 );
+ array< u32 > indices = alloc_array< u32 >( &mem->persistent_arena, PATCH_RESOLUTION * 24 + 6 );
n = 0;
// horizontal indices
- for( u32 i = 0; i < PATCH_RESOLUTION * 2; i++ ) {
+ for( u32 i = 0; i < PATCH_RESOLUTION * 2 + 1; i++ ) {
u32 bl = i * 2 + 0;
u32 br = i * 2 + 1;
u32 tl = i * 2 + 2;
@@ -418,7 +418,7 @@ GAME_INIT( game_init ) {
}
// vertical indices
- for( u32 i = 0; i < PATCH_RESOLUTION * 2; i++ ) {
+ for( u32 i = 0; i < PATCH_RESOLUTION * 2 + 1; i++ ) {
if( i == PATCH_RESOLUTION )
continue;