mirror of
https://github.com/microsoft/DirectXTex.git
synced 2026-02-05 04:36:13 +01:00
Minor code review feedback
This commit is contained in:
@@ -149,14 +149,14 @@ namespace
|
||||
|
||||
IWICImagingFactory2* factory = nullptr;
|
||||
(void)InitOnceExecuteOnce(&s_initOnce,
|
||||
[](PINIT_ONCE, PVOID, PVOID *factory) -> BOOL
|
||||
[](PINIT_ONCE, PVOID, PVOID *ifactory) -> BOOL
|
||||
{
|
||||
return SUCCEEDED( CoCreateInstance(
|
||||
CLSID_WICImagingFactory2,
|
||||
nullptr,
|
||||
CLSCTX_INPROC_SERVER,
|
||||
__uuidof(IWICImagingFactory2),
|
||||
factory) ) ? TRUE : FALSE;
|
||||
ifactory) ) ? TRUE : FALSE;
|
||||
}, nullptr, reinterpret_cast<LPVOID*>(&factory));
|
||||
|
||||
return factory;
|
||||
@@ -399,7 +399,7 @@ namespace
|
||||
&& theight == height)
|
||||
{
|
||||
// No format conversion or resize needed
|
||||
hr = frame->CopyPixels(0, static_cast<UINT>(rowPitch), static_cast<UINT>(imageSize), decodedData.get());
|
||||
hr = frame->CopyPixels(nullptr, static_cast<UINT>(rowPitch), static_cast<UINT>(imageSize), decodedData.get());
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
}
|
||||
@@ -427,7 +427,7 @@ namespace
|
||||
if (memcmp(&convertGUID, &pfScaler, sizeof(GUID)) == 0)
|
||||
{
|
||||
// No format conversion needed
|
||||
hr = scaler->CopyPixels(0, static_cast<UINT>(rowPitch), static_cast<UINT>(imageSize), decodedData.get());
|
||||
hr = scaler->CopyPixels(nullptr, static_cast<UINT>(rowPitch), static_cast<UINT>(imageSize), decodedData.get());
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
}
|
||||
@@ -449,7 +449,7 @@ namespace
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
||||
hr = FC->CopyPixels(0, static_cast<UINT>(rowPitch), static_cast<UINT>(imageSize), decodedData.get());
|
||||
hr = FC->CopyPixels(nullptr, static_cast<UINT>(rowPitch), static_cast<UINT>(imageSize), decodedData.get());
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
}
|
||||
@@ -477,7 +477,7 @@ namespace
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
||||
hr = FC->CopyPixels(0, static_cast<UINT>(rowPitch), static_cast<UINT>(imageSize), decodedData.get());
|
||||
hr = FC->CopyPixels(nullptr, static_cast<UINT>(rowPitch), static_cast<UINT>(imageSize), decodedData.get());
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
}
|
||||
@@ -592,7 +592,7 @@ HRESULT DirectX::LoadWICTextureFromMemoryEx(
|
||||
|
||||
// Initialize WIC
|
||||
ComPtr<IWICBitmapDecoder> decoder;
|
||||
hr = pWIC->CreateDecoderFromStream( stream.Get(), 0, WICDecodeMetadataCacheOnDemand, decoder.GetAddressOf() );
|
||||
hr = pWIC->CreateDecoderFromStream( stream.Get(), nullptr, WICDecodeMetadataCacheOnDemand, decoder.GetAddressOf() );
|
||||
if ( FAILED(hr) )
|
||||
return hr;
|
||||
|
||||
@@ -663,7 +663,7 @@ HRESULT DirectX::LoadWICTextureFromFileEx(
|
||||
|
||||
// Initialize WIC
|
||||
ComPtr<IWICBitmapDecoder> decoder;
|
||||
HRESULT hr = pWIC->CreateDecoderFromFilename( fileName, 0, GENERIC_READ, WICDecodeMetadataCacheOnDemand, decoder.GetAddressOf() );
|
||||
HRESULT hr = pWIC->CreateDecoderFromFilename( fileName, nullptr, GENERIC_READ, WICDecodeMetadataCacheOnDemand, decoder.GetAddressOf() );
|
||||
if ( FAILED(hr) )
|
||||
return hr;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user