From 23480a8beec415a4c30bfa77c7d4c2131dbc2d34 Mon Sep 17 00:00:00 2001 From: Relintai Date: Thu, 5 Sep 2019 01:15:04 +0200 Subject: [PATCH] Added back the const to regularVertexData. --- meshers/transvoxel_tables.cpp | 6 +++--- meshers/transvoxel_tables.h | 2 +- meshers/voxel_mesher_transvoxel.cpp | 12 ++++++------ meshers/voxel_mesher_transvoxel.h | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/meshers/transvoxel_tables.cpp b/meshers/transvoxel_tables.cpp index ab9fb05..b75707f 100644 --- a/meshers/transvoxel_tables.cpp +++ b/meshers/transvoxel_tables.cpp @@ -76,7 +76,7 @@ const RegularCellData regularCellData[16] = { { 0xC4, { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 } }, { 0xC4, { 0, 4, 5, 6, 7, 8, 9, 10, 11, 1, 2, 3 } }, //A { 0x64, { 0, 4, 5, 0, 1, 4, 1, 3, 4, 1, 2, 3 } }, { 0xC4, { 0, 5, 4, 6, 8, 7, 9, 11, 10, 1, 3, 2 } }, //B { 0x64, { 0, 5, 4, 0, 4, 1, 1, 4, 3, 1, 3, 2 } }, - { 0xC4, { 6, 9, 5, 0, 10, 11, 0, 1, 3, 7, 2, 8, } }, //{ 0x64, { 0, 4, 5, 0, 3, 4, 0, 1, 3, 1, 2, 3, } }, //C 2 0,4 -> 6,9 | 1,3->7,8 copy 0-5, del 2, then copy 3-4 to the end + { 0xC4, { 6, 9, 5, 4, 10, 11, 0, 1, 3, 7, 2, 8, } }, //C { 0x64, { 0, 4, 5, 0, 3, 4, 0, 1, 3, 1, 2, 3, } }, //C 2 0,4 -> 6,9 | 1,3->7,8 copy 0-5, del 2, then copy 3-4 to the end then 0 { 0x64, { 0, 1, 2, 0, 2, 3, 0, 3, 4, 0, 4, 5 } }, { 0x75, { 0, 1, 2, 0, 2, 3, 0, 3, 4, 0, 4, 5, 0, 5, 6 } }, { 0x95, { 0, 4, 5, 0, 3, 4, 0, 1, 3, 1, 2, 3, 6, 7, 8 } } @@ -87,8 +87,8 @@ const RegularCellData regularCellData[16] = { // about whether a vertex can be reused from a neighboring cell. See Section 3.3 for details. // The low byte contains the indexes for the two endpoints of the edge on which the vertex lies, // as numbered in Figure 3.7. The high byte contains the vertex reuse data shown in Figure 3.8. -//TODO add back const -unsigned short regularVertexData[256][12] = { + +const unsigned short regularVertexData[256][12] = { {}, { 0x6201, 0x5102, 0x3304 }, { 0x6201, 0x2315, 0x4113 }, diff --git a/meshers/transvoxel_tables.h b/meshers/transvoxel_tables.h index a495c61..b58fc61 100644 --- a/meshers/transvoxel_tables.h +++ b/meshers/transvoxel_tables.h @@ -73,7 +73,7 @@ struct TransitionCellData { extern const unsigned char regularCellClass[256]; extern const RegularCellData regularCellData[16]; -extern unsigned short regularVertexData[256][12]; +extern const unsigned short regularVertexData[256][12]; extern const unsigned char transitionCellClass[512]; extern const TransitionCellData transitionCellData[56]; extern const unsigned char transitionCornerData[13]; diff --git a/meshers/voxel_mesher_transvoxel.cpp b/meshers/voxel_mesher_transvoxel.cpp index b0ace2a..4b46371 100644 --- a/meshers/voxel_mesher_transvoxel.cpp +++ b/meshers/voxel_mesher_transvoxel.cpp @@ -19,12 +19,12 @@ int VoxelMesherTransvoxel::get_regular_vertex_data(int index1, int index2) const return regularVertexData[index1][index2]; } -void VoxelMesherTransvoxel::set_regular_vertex_data(int index1, int index2, int value) { - ERR_FAIL_INDEX(index1, 256); - ERR_FAIL_INDEX(index2, 12); +//void VoxelMesherTransvoxel::set_regular_vertex_data(int index1, int index2, int value) { + // ERR_FAIL_INDEX(index1, 256); +// ERR_FAIL_INDEX(index2, 13); - regularVertexData[index1][index2] = value; -} +// regularVertexData[index1][index2] = value; +//} int VoxelMesherTransvoxel::get_regular_vertex_data_first_vertex(int index1, int index2) const { int vert1 = regularVertexData[index1][index2] & 0x000F; @@ -130,7 +130,7 @@ void VoxelMesherTransvoxel::_bind_methods() { ClassDB::bind_method(D_METHOD("get_regular_cell_class", "index"), &VoxelMesherTransvoxel::get_regular_cell_class); ClassDB::bind_method(D_METHOD("get_regular_cell_data", "index"), &VoxelMesherTransvoxel::get_regular_cell_data); ClassDB::bind_method(D_METHOD("get_regular_vertex_data", "index1", "index2"), &VoxelMesherTransvoxel::get_regular_vertex_data); - ClassDB::bind_method(D_METHOD("set_regular_vertex_data", "index1", "index2", "value"), &VoxelMesherTransvoxel::set_regular_vertex_data); + // ClassDB::bind_method(D_METHOD("set_regular_vertex_data", "index1", "index2", "value"), &VoxelMesherTransvoxel::set_regular_vertex_data); ClassDB::bind_method(D_METHOD("get_regular_vertex_data_first_vertex", "index1", "index2"), &VoxelMesherTransvoxel::get_regular_vertex_data_first_vertex); ClassDB::bind_method(D_METHOD("get_regular_vertex_data_second_vertex", "index1", "index2"), &VoxelMesherTransvoxel::get_regular_vertex_data_second_vertex); ClassDB::bind_method(D_METHOD("get_regular_vertex_first_position", "index1", "index2"), &VoxelMesherTransvoxel::get_regular_vertex_first_position); diff --git a/meshers/voxel_mesher_transvoxel.h b/meshers/voxel_mesher_transvoxel.h index c698b38..acd4d4e 100644 --- a/meshers/voxel_mesher_transvoxel.h +++ b/meshers/voxel_mesher_transvoxel.h @@ -49,7 +49,7 @@ public: Ref get_regular_cell_data(int index) const; int get_regular_vertex_data(int index10, int index2) const; - void set_regular_vertex_data(int index1, int index2, int value); + // void set_regular_vertex_data(int index1, int index2, int value); int get_regular_vertex_data_first_vertex(int index1, int index2) const; int get_regular_vertex_data_second_vertex(int index1, int index2) const; Vector3 get_regular_vertex_first_position(int index1, int index2) const;