From 87e47ffca7c35553896382269fadd76fc547169d Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Mon, 18 Jan 2021 14:25:37 -0800 Subject: [PATCH] Minor code cleanup --- UVAtlasTool/Mesh.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/UVAtlasTool/Mesh.cpp b/UVAtlasTool/Mesh.cpp index d9337f8..d2d27de 100644 --- a/UVAtlasTool/Mesh.cpp +++ b/UVAtlasTool/Mesh.cpp @@ -1187,9 +1187,11 @@ HRESULT Mesh::ExportToVBO(const wchar_t* szFileName) const noexcept // Write header and data #if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) - ScopedHandle hFile(safe_handle(CreateFile2(szFileName, GENERIC_WRITE, 0, CREATE_ALWAYS, nullptr))); + ScopedHandle hFile(safe_handle(CreateFile2(szFileName, + GENERIC_WRITE, 0, CREATE_ALWAYS, nullptr))); #else - ScopedHandle hFile(safe_handle(CreateFileW(szFileName, GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, 0, nullptr))); + ScopedHandle hFile(safe_handle(CreateFileW(szFileName, + GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr))); #endif if (!hFile) return HRESULT_FROM_WIN32(GetLastError()); @@ -1592,9 +1594,11 @@ HRESULT Mesh::ExportToCMO(const wchar_t* szFileName, size_t nMaterials, const Ma // Create CMO file #if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) - ScopedHandle hFile(safe_handle(CreateFile2(szFileName, GENERIC_WRITE, 0, CREATE_ALWAYS, nullptr))); + ScopedHandle hFile(safe_handle(CreateFile2(szFileName, + GENERIC_WRITE, 0, CREATE_ALWAYS, nullptr))); #else - ScopedHandle hFile(safe_handle(CreateFileW(szFileName, GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, 0, nullptr))); + ScopedHandle hFile(safe_handle(CreateFileW(szFileName, + GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr))); #endif if (!hFile) return HRESULT_FROM_WIN32(GetLastError()); @@ -2374,9 +2378,11 @@ HRESULT Mesh::ExportToSDKMESH(const wchar_t* szFileName, // Create file #if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) - ScopedHandle hFile(safe_handle(CreateFile2(szFileName, GENERIC_WRITE, 0, CREATE_ALWAYS, nullptr))); + ScopedHandle hFile(safe_handle(CreateFile2(szFileName, + GENERIC_WRITE, 0, CREATE_ALWAYS, nullptr))); #else - ScopedHandle hFile(safe_handle(CreateFileW(szFileName, GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, 0, nullptr))); + ScopedHandle hFile(safe_handle(CreateFileW(szFileName, + GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr))); #endif if (!hFile) return HRESULT_FROM_WIN32(GetLastError());