mirror of
https://github.com/microsoft/DirectXTex.git
synced 2025-07-09 19:50:13 +02: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
|
// Create file and write header
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
|
#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
|
#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
|
#endif
|
||||||
if (!hFile)
|
if (!hFile)
|
||||||
{
|
{
|
||||||
|
@ -1127,9 +1127,11 @@ HRESULT DirectX::SaveToHDRFile(const Image& image, const wchar_t* szFile) noexce
|
|||||||
// Create file and write header
|
// Create file and write header
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
|
#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
|
#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
|
#endif
|
||||||
if (!hFile)
|
if (!hFile)
|
||||||
{
|
{
|
||||||
|
@ -2182,9 +2182,11 @@ HRESULT DirectX::SaveToTGAFile(
|
|||||||
// Create file and write header
|
// Create file and write header
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
|
#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
|
#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
|
#endif
|
||||||
if (!hFile)
|
if (!hFile)
|
||||||
{
|
{
|
||||||
|
@ -792,9 +792,11 @@ HRESULT DirectX::SaveDDSTextureToFile(
|
|||||||
|
|
||||||
// Create file
|
// Create file
|
||||||
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
|
#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
|
#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
|
#endif
|
||||||
if (!hFile)
|
if (!hFile)
|
||||||
return HRESULT_FROM_WIN32(GetLastError());
|
return HRESULT_FROM_WIN32(GetLastError());
|
||||||
|
@ -581,9 +581,11 @@ HRESULT DirectX::SaveDDSTextureToFile(
|
|||||||
|
|
||||||
// Create file
|
// Create file
|
||||||
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
|
#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
|
#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
|
#endif
|
||||||
if (!hFile)
|
if (!hFile)
|
||||||
return HRESULT_FROM_WIN32(GetLastError());
|
return HRESULT_FROM_WIN32(GetLastError());
|
||||||
|
@ -379,9 +379,11 @@ HRESULT __cdecl SaveToPortablePixMap(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
|
#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
|
#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
|
#endif
|
||||||
if (!hFile)
|
if (!hFile)
|
||||||
return HRESULT_FROM_WIN32(GetLastError());
|
return HRESULT_FROM_WIN32(GetLastError());
|
||||||
@ -660,9 +662,11 @@ HRESULT __cdecl SaveToPortablePixMapHDR(
|
|||||||
tmpImage.Release();
|
tmpImage.Release();
|
||||||
|
|
||||||
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
|
#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
|
#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
|
#endif
|
||||||
if (!hFile)
|
if (!hFile)
|
||||||
return HRESULT_FROM_WIN32(GetLastError());
|
return HRESULT_FROM_WIN32(GetLastError());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user