Another fix of admesh on big endian architectures, fixes #2879

This commit is contained in:
bubnikv 2019-09-19 08:56:47 +02:00
parent 83b6b82188
commit 94212fa2a9

View file

@ -151,8 +151,8 @@ bool stl_write_binary(stl_file *stl, const char *file, const char *label)
memcpy(buffer, &stl->stats.number_of_facets, 4);
stl_internal_reverse_quads(buffer, 4);
fwrite(buffer, 4, 1, fp);
for (size_t i = 0; i < stl->stats.number_of_facets; ++ i) {
memcpy(buffer, stl->facet_start + i, 50);
for (const stl_facet &facet : stl->facet_start) {
memcpy(buffer, &facet, 50);
// Convert to little endian.
stl_internal_reverse_quads(buffer, 48);
fwrite(buffer, SIZEOF_STL_FACET, 1, fp);