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

@ -8,7 +8,7 @@ plugins = []
stubs = []
winstubs = []
Export('SCons', 'sys', 'os', 'glob', 'resources',
Export('SCons', 'sys', 'os', 'glob', 'resources',
'plugins', 'stubs', 'winstubs')
# Configure the build framework
@ -25,7 +25,7 @@ if sys.platform == 'win32':
def build(scriptFile, exports = [], duplicate = 0):
dirname = '/'.join(os.path.dirname(scriptFile).split('/')[1:])
return SConscript(scriptFile, exports,
return SConscript(scriptFile, exports,
variant_dir=os.path.join(env['BUILDDIR'], dirname), duplicate=duplicate)
# ===== Build the support libraries ====
@ -59,7 +59,7 @@ env['SHLIBPREFIX']=''
Export('env')
# Utilities
# Utilities
build('src/utils/SConscript')
# Surface scattering models
build('src/bsdfs/SConscript')

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);
}
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, 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][0] * 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, (float) m_colors[i][2] * 255.0f + 0.5f));
}
}
Assert(ptr-vertexStorage == vertexStorageSize);