Skip to content

Commit

Permalink
Fix a clang warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Ybalrid committed Jul 8, 2019
1 parent 42a3382 commit 4ee8182
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tiny_obj_loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -2130,16 +2130,17 @@ bool ObjWriter::SaveToString(std::string &obj_text, std::string &mlt_text) {
}

// faces
for (int s = 0; s < shapes_.size(); ++s) {
for (size_t s = 0; s < shapes_.size(); ++s) {
const shape_t &shape = shapes_[s];
const unsigned char face_count = shape.mesh.num_face_vertices.size();
const unsigned char face_count =
static_cast<unsigned char>(shape.mesh.num_face_vertices.size());

size_t index_offset = 0;
for (size_t f = 0; f < face_count; f++) {
obj_text_stream << "f ";
const unsigned char face_vertex_count = shape.mesh.num_face_vertices[f];
for (size_t v = 0; v < face_vertex_count; ++v) {
index_t index = shape.mesh.indices[index_offset + v];
const index_t index = shape.mesh.indices[index_offset + v];
obj_text_stream << index.vertex_index << "/" << index.texcoord_index
<< "/" << index.normal_index << " ";
}
Expand All @@ -2151,6 +2152,7 @@ bool ObjWriter::SaveToString(std::string &obj_text, std::string &mlt_text) {
obj_text = obj_text_stream.str();

// TODO write material
(void)mlt_text;

return true;
}
Expand Down

0 comments on commit 4ee8182

Please sign in to comment.