diff --git a/SConstruct b/SConstruct index 2538ea12..5a999b70 100644 --- a/SConstruct +++ b/SConstruct @@ -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') diff --git a/src/librender/trimesh.cpp b/src/librender/trimesh.cpp index c3ee4aef..921ca9f6 100644 --- a/src/librender/trimesh.cpp +++ b/src/librender/trimesh.cpp @@ -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);