metadata
Wenzel Jakob 2012-04-08 20:11:01 -04:00
commit 5733876bbb
2 changed files with 28 additions and 15 deletions

View File

@ -43,6 +43,16 @@
</lookAt> </lookAt>
</xsl:template> </xsl:template>
<!-- The vertical component of OBJ texture coordinates is now
flipped, which seems to be the standard behavior. Undo
this change for consistency in old scenes. -->
<xsl:template match="shape[@type='obj']">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
<boolean name="flipTexCoords" value="false"/>
</xsl:copy>
</xsl:template>
<!-- There are no more 'diffuseAmount' or 'specularAmount' parameters in <!-- There are no more 'diffuseAmount' or 'specularAmount' parameters in
the microfacet/phong/ward plugins, and the default values have changed --> the microfacet/phong/ward plugins, and the default values have changed -->
<xsl:template match="bsdf[@type='microfacet' or @type='phong' or @type='ward']"> <xsl:template match="bsdf[@type='microfacet' or @type='phong' or @type='ward']">

View File

@ -7,7 +7,7 @@
MTS_NAMESPACE_BEGIN MTS_NAMESPACE_BEGIN
MemoryMappedFile::MemoryMappedFile(const fs::path &filename) : m_filename(filename) { MemoryMappedFile::MemoryMappedFile(const fs::path &filename) : m_filename(filename), m_data(NULL) {
if (!fs::exists(filename)) if (!fs::exists(filename))
Log(EError, "The file \"%s\" does not exist!", filename.file_string().c_str()); Log(EError, "The file \"%s\" does not exist!", filename.file_string().c_str());
m_size = (size_t) fs::file_size(filename); m_size = (size_t) fs::file_size(filename);
@ -41,20 +41,23 @@ MemoryMappedFile::MemoryMappedFile(const fs::path &filename) : m_filename(filena
} }
MemoryMappedFile::~MemoryMappedFile() { MemoryMappedFile::~MemoryMappedFile() {
#if defined(__LINUX__) || defined(__OSX__) if (m_data) {
Log(ETrace, "Unmapping \"%s\" from memory", Log(ETrace, "Unmapping \"%s\" from memory",
m_filename.file_string().c_str()); m_filename.file_string().c_str());
int retval = munmap(m_data, m_size);
if (retval != 0) #if defined(__LINUX__) || defined(__OSX__)
Log(EError, "munmap(): unable to unmap memory!"); int retval = munmap(m_data, m_size);
#elif defined(WIN32) if (retval != 0)
if (!UnmapViewOfFile(m_data)) Log(EError, "munmap(): unable to unmap memory!");
Log(EError, "UnmapViewOfFile(): unable to unmap memory: %s", lastErrorText().c_str()); #elif defined(WIN32)
if (!CloseHandle(m_fileMapping)) if (!UnmapViewOfFile(m_data))
Log(EError, "CloseHandle(): unable to close file mapping: %s", lastErrorText().c_str()); Log(EError, "UnmapViewOfFile(): unable to unmap memory: %s", lastErrorText().c_str());
if (!CloseHandle(m_file)) if (!CloseHandle(m_fileMapping))
Log(EError, "CloseHandle(): unable to close file: %s", lastErrorText().c_str()); Log(EError, "CloseHandle(): unable to close file mapping: %s", lastErrorText().c_str());
#endif if (!CloseHandle(m_file))
Log(EError, "CloseHandle(): unable to close file: %s", lastErrorText().c_str());
#endif
}
} }
MTS_IMPLEMENT_CLASS(MemoryMappedFile, false, Object) MTS_IMPLEMENT_CLASS(MemoryMappedFile, false, Object)