Skip to content

Commit

Permalink
[le_mesh] rename read_attribute_info_into
Browse files Browse the repository at this point in the history
rename read_attribute_info_into -> read_attribute_infos_into, as this
means a plural, we don't have a method for single attribute infos
+ update examples to use new name for method
  • Loading branch information
tgfrerer committed May 31, 2024
1 parent 7111af2 commit 0201456
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ static exr_decode_example_app_o* exr_decode_example_app_create() {
le_mesh_api::attribute_info_t attribute_info[ 4 ] = {};
size_t num_attributes = sizeof( attribute_info ) / sizeof( attribute_info[ 0 ] );

le_mesh::le_mesh_i.read_attribute_info_into( app->mesh, attribute_info, &num_attributes );
le_mesh::le_mesh_i.read_attribute_infos_into( app->mesh, attribute_info, &num_attributes );

auto get_num_bytes = [ & ]( le_mesh_api::attribute_name_t name ) -> size_t {
for ( auto& e : attribute_info ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ static multi_window_example_app_o* app_create() {
std::vector<le_mesh_api::attribute_info_t> attribute_infos( 5 );

size_t num_attribute_infos = attribute_infos.size();
meshImporter.readAttributeInfoInto( attribute_infos.data(), &num_attribute_infos );
meshImporter.readAttributeInfosInto( attribute_infos.data(), &num_attribute_infos );
attribute_infos.resize( num_attribute_infos );

size_t num_vertices = meshImporter.getVertexCount();
Expand Down
4 changes: 2 additions & 2 deletions modules/le_mesh/le_mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ static size_t le_mesh_get_index_count( le_mesh_o* self, uint32_t* num_bytes_per_

// ----------------------------------------------------------------------
// read attribute info into a given array of data
static void le_mesh_read_attribute_info_into( le_mesh_o* self, le_mesh_api::attribute_info_t* target, size_t* num_attributes_in_target ) {
static void le_mesh_read_attribute_infos_into( le_mesh_o* self, le_mesh_api::attribute_info_t* target, size_t* num_attributes_in_target ) {

if ( nullptr == num_attributes_in_target ) {
return;
Expand Down Expand Up @@ -317,7 +317,7 @@ LE_MODULE_REGISTER_IMPL( le_mesh, api ) {
le_mesh_i.get_vertex_count = le_mesh_get_vertex_count;

le_mesh_i.get_index_count = le_mesh_get_index_count;
le_mesh_i.read_attribute_info_into = le_mesh_read_attribute_info_into;
le_mesh_i.read_attribute_infos_into = le_mesh_read_attribute_infos_into;
le_mesh_i.read_index_data_into = le_mesh_read_index_data_into;

le_mesh_i.clear = le_mesh_clear;
Expand Down
6 changes: 3 additions & 3 deletions modules/le_mesh/le_mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ struct le_mesh_api {
///
/// @param `target` : (optional) pointer (or c-array) where to write data to.
/// @param `num_attributes_in_target` : (required) memory available in target, given as a multiple of `sizeof(attribute_info_t)`, returns total number of attributes available in mesh.
void (*read_attribute_info_into)(le_mesh_o*self, attribute_info_t* target, size_t *num_attributes_in_target);
void (*read_attribute_infos_into)(le_mesh_o*self, attribute_info_t* target, size_t *num_attributes_in_target);

// PLY import

Expand Down Expand Up @@ -141,8 +141,8 @@ class LeMesh : NoCopy, NoMove {
return this_i.get_vertex_count( self );
}

void readAttributeInfoInto( le_mesh_api::attribute_info_t* target, size_t* num_attributes_in_target ) {
this_i.read_attribute_info_into( self, target, num_attributes_in_target );
void readAttributeInfosInto( le_mesh_api::attribute_info_t* target, size_t* num_attributes_in_target ) {
this_i.read_attribute_infos_into( self, target, num_attributes_in_target );
}

void readAttributeDataInto( void* target, size_t target_capacity_num_bytes, le_mesh_api::attribute_name_t attribute_name, uint32_t* num_bytes_per_vertex = nullptr, size_t* num_vertices = nullptr, size_t first_vertex = 0, uint32_t stride = 0 ) const {
Expand Down

0 comments on commit 0201456

Please sign in to comment.