Skip to content

Commit f689bbd

Browse files
committed
demo: Fix integer truncation warnings on MSVC
1 parent a2ace64 commit f689bbd

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎demo/main.cpp‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -804,10 +804,10 @@ void encodeMeshlets(const Mesh& mesh, size_t max_vertices, size_t max_triangles,
804804
size_t mbs = meshopt_encodeMeshlet(&cbuf[0], cbuf.size(), &meshlet_vertices[meshlet.vertex_offset], meshlet.vertex_count, &meshlet_triangles[meshlet.triangle_offset], meshlet.triangle_count);
805805
assert(mbs > 0);
806806

807-
packed.push_back(meshlet.vertex_count);
808-
packed.push_back(meshlet.triangle_count);
809-
packed.push_back(mbs & 0xff);
810-
packed.push_back((mbs >> 8) & 0xff);
807+
packed.push_back((unsigned char)meshlet.vertex_count);
808+
packed.push_back((unsigned char)meshlet.triangle_count);
809+
packed.push_back((unsigned char)(mbs & 0xff));
810+
packed.push_back((unsigned char)((mbs >> 8) & 0xff));
811811
packed.insert(packed.end(), &cbuf[0], &cbuf[mbs]);
812812

813813
unsigned int rv[256];

0 commit comments

Comments
 (0)