double precision compilation fix

metadata
Wenzel Jakob 2014-10-05 03:31:40 +02:00
parent 08623fafdc
commit b13e41f8f9
2 changed files with 6 additions and 6 deletions

View File

@ -1109,9 +1109,9 @@ void TriMesh::writePLY(const fs::path &path) const {
Vector2f uv(m_texcoords[i]); memcpy(ptr, &uv, sizeof(Vector2f)); ptr += sizeof(Vector2f); Vector2f uv(m_texcoords[i]); memcpy(ptr, &uv, sizeof(Vector2f)); ptr += sizeof(Vector2f);
} }
if (m_colors) { if (m_colors) {
*ptr += (uint8_t) std::max(0.0f, std::min(255.0f, m_colors[i][0] * 255.0f + 0.5f)); *ptr += (uint8_t) std::max(0.0f, std::min(255.0f, (float) m_colors[i][0] * 255.0f + 0.5f));
*ptr += (uint8_t) std::max(0.0f, std::min(255.0f, m_colors[i][1] * 255.0f + 0.5f)); *ptr += (uint8_t) std::max(0.0f, std::min(255.0f, (float) m_colors[i][1] * 255.0f + 0.5f));
*ptr += (uint8_t) std::max(0.0f, std::min(255.0f, m_colors[i][2] * 255.0f + 0.5f)); *ptr += (uint8_t) std::max(0.0f, std::min(255.0f, (float) m_colors[i][2] * 255.0f + 0.5f));
} }
} }
Assert(ptr-vertexStorage == vertexStorageSize); Assert(ptr-vertexStorage == vertexStorageSize);