Code cleanup to use array.data() rather than &array[0]

(Now without the build errors)
This commit is contained in:
Brecht Van Lommel
2016-08-17 23:49:55 +02:00
parent 7baf93c711
commit e8b5e66db1
5 changed files with 19 additions and 19 deletions

View File

@@ -57,7 +57,7 @@ void EdgeDice::reserve(int num_verts)
Attribute *attr_vN = mesh->attributes.add(ATTR_STD_VERTEX_NORMAL);
mesh_P = &mesh->verts[0];
mesh_P = mesh->verts.data();
mesh_N = attr_vN->data_float3();
}

View File

@@ -214,7 +214,7 @@ void PackedPatchTable::pack(Far::PatchTable* patch_table, int offset)
}
table.resize(total_size());
uint* data = &table[0];
uint* data = table.data();
uint* array = data;
uint* index = array + num_arrays * PATCH_ARRAY_SIZE;
@@ -259,7 +259,7 @@ void PackedPatchTable::pack(Far::PatchTable* patch_table, int offset)
void PackedPatchTable::copy_adjusting_offsets(uint* dest, int doffset)
{
uint* src = &table[0];
uint* src = table.data();
/* arrays */
for(int i = 0; i < num_arrays; i++) {

View File

@@ -43,7 +43,7 @@ namespace Far { struct PatchTable; }
#define PATCH_NODE_SIZE 1
struct PackedPatchTable {
vector<uint> table;
array<uint> table;
size_t num_arrays;
size_t num_indices;