merge
commit
5733876bbb
|
@ -43,6 +43,16 @@
|
|||
</lookAt>
|
||||
</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
|
||||
the microfacet/phong/ward plugins, and the default values have changed -->
|
||||
<xsl:template match="bsdf[@type='microfacet' or @type='phong' or @type='ward']">
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
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))
|
||||
Log(EError, "The file \"%s\" does not exist!", filename.file_string().c_str());
|
||||
m_size = (size_t) fs::file_size(filename);
|
||||
|
@ -41,20 +41,23 @@ MemoryMappedFile::MemoryMappedFile(const fs::path &filename) : m_filename(filena
|
|||
}
|
||||
|
||||
MemoryMappedFile::~MemoryMappedFile() {
|
||||
#if defined(__LINUX__) || defined(__OSX__)
|
||||
Log(ETrace, "Unmapping \"%s\" from memory",
|
||||
m_filename.file_string().c_str());
|
||||
int retval = munmap(m_data, m_size);
|
||||
if (retval != 0)
|
||||
Log(EError, "munmap(): unable to unmap memory!");
|
||||
#elif defined(WIN32)
|
||||
if (!UnmapViewOfFile(m_data))
|
||||
Log(EError, "UnmapViewOfFile(): unable to unmap memory: %s", lastErrorText().c_str());
|
||||
if (!CloseHandle(m_fileMapping))
|
||||
Log(EError, "CloseHandle(): unable to close file mapping: %s", lastErrorText().c_str());
|
||||
if (!CloseHandle(m_file))
|
||||
Log(EError, "CloseHandle(): unable to close file: %s", lastErrorText().c_str());
|
||||
#endif
|
||||
if (m_data) {
|
||||
Log(ETrace, "Unmapping \"%s\" from memory",
|
||||
m_filename.file_string().c_str());
|
||||
|
||||
#if defined(__LINUX__) || defined(__OSX__)
|
||||
int retval = munmap(m_data, m_size);
|
||||
if (retval != 0)
|
||||
Log(EError, "munmap(): unable to unmap memory!");
|
||||
#elif defined(WIN32)
|
||||
if (!UnmapViewOfFile(m_data))
|
||||
Log(EError, "UnmapViewOfFile(): unable to unmap memory: %s", lastErrorText().c_str());
|
||||
if (!CloseHandle(m_fileMapping))
|
||||
Log(EError, "CloseHandle(): unable to close file mapping: %s", lastErrorText().c_str());
|
||||
if (!CloseHandle(m_file))
|
||||
Log(EError, "CloseHandle(): unable to close file: %s", lastErrorText().c_str());
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
MTS_IMPLEMENT_CLASS(MemoryMappedFile, false, Object)
|
||||
|
|
Loading…
Reference in New Issue