mirror of
https://github.com/microsoft/DirectXTex.git
synced 2026-02-05 20:56:13 +01:00
General code cleanuP
This commit is contained in:
@@ -839,11 +839,7 @@ HRESULT DirectX::SaveDDSTextureToFile( ID3D12CommandQueue* pCommandQ,
|
||||
return hr;
|
||||
|
||||
// Create file
|
||||
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
|
||||
ScopedHandle hFile( safe_handle( CreateFile2( fileName, GENERIC_WRITE, 0, CREATE_ALWAYS, 0 ) ) );
|
||||
#else
|
||||
ScopedHandle hFile( safe_handle( CreateFileW( fileName, GENERIC_WRITE, 0, 0, CREATE_ALWAYS, 0, 0 ) ) );
|
||||
#endif
|
||||
ScopedHandle hFile( safe_handle( CreateFile2( fileName, GENERIC_WRITE, 0, CREATE_ALWAYS, nullptr ) ) );
|
||||
if ( !hFile )
|
||||
return HRESULT_FROM_WIN32( GetLastError() );
|
||||
|
||||
@@ -972,13 +968,13 @@ HRESULT DirectX::SaveDDSTextureToFile( ID3D12CommandQueue* pCommandQ,
|
||||
|
||||
// Write header & pixels
|
||||
DWORD bytesWritten;
|
||||
if ( !WriteFile( hFile.get(), fileHeader, static_cast<DWORD>( headerSize ), &bytesWritten, 0 ) )
|
||||
if ( !WriteFile( hFile.get(), fileHeader, static_cast<DWORD>( headerSize ), &bytesWritten, nullptr ) )
|
||||
return HRESULT_FROM_WIN32( GetLastError() );
|
||||
|
||||
if ( bytesWritten != headerSize )
|
||||
return E_FAIL;
|
||||
|
||||
if ( !WriteFile( hFile.get(), pixels.get(), static_cast<DWORD>( slicePitch ), &bytesWritten, 0 ) )
|
||||
if ( !WriteFile( hFile.get(), pixels.get(), static_cast<DWORD>( slicePitch ), &bytesWritten, nullptr ) )
|
||||
return HRESULT_FROM_WIN32( GetLastError() );
|
||||
|
||||
if ( bytesWritten != slicePitch )
|
||||
|
||||
Reference in New Issue
Block a user