Added back the const to regularVertexData.

This commit is contained in:
Relintai 2019-09-05 01:15:04 +02:00
parent c47c74aea3
commit 23480a8bee
4 changed files with 11 additions and 11 deletions

View File

@ -76,7 +76,7 @@ const RegularCellData regularCellData[16] = {
{ 0xC4, { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 } }, { 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, 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, { 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 } }, { 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 } }, { 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 } } { 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. // 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, // 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. // 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, 0x5102, 0x3304 },
{ 0x6201, 0x2315, 0x4113 }, { 0x6201, 0x2315, 0x4113 },

View File

@ -73,7 +73,7 @@ struct TransitionCellData {
extern const unsigned char regularCellClass[256]; extern const unsigned char regularCellClass[256];
extern const RegularCellData regularCellData[16]; 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 unsigned char transitionCellClass[512];
extern const TransitionCellData transitionCellData[56]; extern const TransitionCellData transitionCellData[56];
extern const unsigned char transitionCornerData[13]; extern const unsigned char transitionCornerData[13];

View File

@ -19,12 +19,12 @@ int VoxelMesherTransvoxel::get_regular_vertex_data(int index1, int index2) const
return regularVertexData[index1][index2]; return regularVertexData[index1][index2];
} }
void VoxelMesherTransvoxel::set_regular_vertex_data(int index1, int index2, int value) { //void VoxelMesherTransvoxel::set_regular_vertex_data(int index1, int index2, int value) {
ERR_FAIL_INDEX(index1, 256); // ERR_FAIL_INDEX(index1, 256);
ERR_FAIL_INDEX(index2, 12); // 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 VoxelMesherTransvoxel::get_regular_vertex_data_first_vertex(int index1, int index2) const {
int vert1 = regularVertexData[index1][index2] & 0x000F; 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_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_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("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_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_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); ClassDB::bind_method(D_METHOD("get_regular_vertex_first_position", "index1", "index2"), &VoxelMesherTransvoxel::get_regular_vertex_first_position);

View File

@ -49,7 +49,7 @@ public:
Ref<TransvoxelCellData> get_regular_cell_data(int index) const; Ref<TransvoxelCellData> get_regular_cell_data(int index) const;
int get_regular_vertex_data(int index10, int index2) 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_first_vertex(int index1, int index2) const;
int get_regular_vertex_data_second_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; Vector3 get_regular_vertex_first_position(int index1, int index2) const;