mirror of
https://github.com/microsoft/DirectXTex
synced 2024-11-21 12:00:06 +00:00
Minor code cleanup
This commit is contained in:
parent
152b44d1ec
commit
fa75757c5f
@ -2208,9 +2208,11 @@ HRESULT DirectX::SaveToDDSFile(
|
||||
// Create file and write header
|
||||
#ifdef WIN32
|
||||
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
|
||||
ScopedHandle hFile(safe_handle(CreateFile2(szFile, GENERIC_WRITE | DELETE, 0, CREATE_ALWAYS, nullptr)));
|
||||
ScopedHandle hFile(safe_handle(CreateFile2(szFile,
|
||||
GENERIC_WRITE | DELETE, 0, CREATE_ALWAYS, nullptr)));
|
||||
#else
|
||||
ScopedHandle hFile(safe_handle(CreateFileW(szFile, GENERIC_WRITE | DELETE, 0, nullptr, CREATE_ALWAYS, 0, nullptr)));
|
||||
ScopedHandle hFile(safe_handle(CreateFileW(szFile,
|
||||
GENERIC_WRITE | DELETE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr)));
|
||||
#endif
|
||||
if (!hFile)
|
||||
{
|
||||
|
@ -1127,9 +1127,11 @@ HRESULT DirectX::SaveToHDRFile(const Image& image, const wchar_t* szFile) noexce
|
||||
// Create file and write header
|
||||
#ifdef WIN32
|
||||
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
|
||||
ScopedHandle hFile(safe_handle(CreateFile2(szFile, GENERIC_WRITE, 0, CREATE_ALWAYS, nullptr)));
|
||||
ScopedHandle hFile(safe_handle(CreateFile2(szFile,
|
||||
GENERIC_WRITE, 0, CREATE_ALWAYS, nullptr)));
|
||||
#else
|
||||
ScopedHandle hFile(safe_handle(CreateFileW(szFile, GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, 0, nullptr)));
|
||||
ScopedHandle hFile(safe_handle(CreateFileW(szFile,
|
||||
GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr)));
|
||||
#endif
|
||||
if (!hFile)
|
||||
{
|
||||
|
@ -2182,9 +2182,11 @@ HRESULT DirectX::SaveToTGAFile(
|
||||
// Create file and write header
|
||||
#ifdef WIN32
|
||||
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
|
||||
ScopedHandle hFile(safe_handle(CreateFile2(szFile, GENERIC_WRITE, 0, CREATE_ALWAYS, nullptr)));
|
||||
ScopedHandle hFile(safe_handle(CreateFile2(szFile, GENERIC_WRITE, 0,
|
||||
CREATE_ALWAYS, nullptr)));
|
||||
#else
|
||||
ScopedHandle hFile(safe_handle(CreateFileW(szFile, GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, 0, nullptr)));
|
||||
ScopedHandle hFile(safe_handle(CreateFileW(szFile,
|
||||
GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr)));
|
||||
#endif
|
||||
if (!hFile)
|
||||
{
|
||||
|
@ -792,9 +792,11 @@ HRESULT DirectX::SaveDDSTextureToFile(
|
||||
|
||||
// Create file
|
||||
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
|
||||
ScopedHandle hFile(safe_handle(CreateFile2(fileName, GENERIC_WRITE | DELETE, 0, CREATE_ALWAYS, nullptr)));
|
||||
ScopedHandle hFile(safe_handle(CreateFile2(fileName,
|
||||
GENERIC_WRITE | DELETE, 0, CREATE_ALWAYS, nullptr)));
|
||||
#else
|
||||
ScopedHandle hFile(safe_handle(CreateFileW(fileName, GENERIC_WRITE | DELETE, 0, nullptr, CREATE_ALWAYS, 0, nullptr)));
|
||||
ScopedHandle hFile(safe_handle(CreateFileW(fileName,
|
||||
GENERIC_WRITE | DELETE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr)));
|
||||
#endif
|
||||
if (!hFile)
|
||||
return HRESULT_FROM_WIN32(GetLastError());
|
||||
|
@ -581,9 +581,11 @@ HRESULT DirectX::SaveDDSTextureToFile(
|
||||
|
||||
// Create file
|
||||
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
|
||||
ScopedHandle hFile(safe_handle(CreateFile2(fileName, GENERIC_WRITE | DELETE, 0, CREATE_ALWAYS, nullptr)));
|
||||
ScopedHandle hFile(safe_handle(CreateFile2(fileName,
|
||||
GENERIC_WRITE | DELETE, 0, CREATE_ALWAYS, nullptr)));
|
||||
#else
|
||||
ScopedHandle hFile(safe_handle(CreateFileW(fileName, GENERIC_WRITE | DELETE, 0, nullptr, CREATE_ALWAYS, 0, nullptr)));
|
||||
ScopedHandle hFile(safe_handle(CreateFileW(fileName,
|
||||
GENERIC_WRITE | DELETE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr)));
|
||||
#endif
|
||||
if (!hFile)
|
||||
return HRESULT_FROM_WIN32(GetLastError());
|
||||
|
@ -379,9 +379,11 @@ HRESULT __cdecl SaveToPortablePixMap(
|
||||
}
|
||||
|
||||
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
|
||||
ScopedHandle hFile(safe_handle(CreateFile2(szFile, GENERIC_WRITE, 0, CREATE_ALWAYS, nullptr)));
|
||||
ScopedHandle hFile(safe_handle(CreateFile2(szFile,
|
||||
GENERIC_WRITE, 0, CREATE_ALWAYS, nullptr)));
|
||||
#else
|
||||
ScopedHandle hFile(safe_handle(CreateFileW(szFile, GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, 0, nullptr)));
|
||||
ScopedHandle hFile(safe_handle(CreateFileW(szFile,
|
||||
GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr)));
|
||||
#endif
|
||||
if (!hFile)
|
||||
return HRESULT_FROM_WIN32(GetLastError());
|
||||
@ -660,9 +662,11 @@ HRESULT __cdecl SaveToPortablePixMapHDR(
|
||||
tmpImage.Release();
|
||||
|
||||
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
|
||||
ScopedHandle hFile(safe_handle(CreateFile2(szFile, GENERIC_WRITE, 0, CREATE_ALWAYS, nullptr)));
|
||||
ScopedHandle hFile(safe_handle(CreateFile2(szFile,
|
||||
GENERIC_WRITE, 0, CREATE_ALWAYS, nullptr)));
|
||||
#else
|
||||
ScopedHandle hFile(safe_handle(CreateFileW(szFile, GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, 0, nullptr)));
|
||||
ScopedHandle hFile(safe_handle(CreateFileW(szFile,
|
||||
GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr)));
|
||||
#endif
|
||||
if (!hFile)
|
||||
return HRESULT_FROM_WIN32(GetLastError());
|
||||
|
Loading…
Reference in New Issue
Block a user