mirror of
https://github.com/microsoft/DirectXTex.git
synced 2025-07-09 19:50:13 +02:00
DDSTextureLoader/WICTextureLoader /analyze fixes
This commit is contained in:
parent
87880558bb
commit
3cc014ec76
@ -1394,7 +1394,8 @@ HRESULT DirectX::CreateDDSTextureFromMemoryEx( ID3D11Device* d3dDevice,
|
||||
ddsData + offset, ddsDataSize - offset, maxsize,
|
||||
usage, bindFlags, cpuAccessFlags, miscFlags, forceSRGB,
|
||||
texture, textureView );
|
||||
|
||||
if ( SUCCEEDED(hr) )
|
||||
{
|
||||
if (texture != 0 && *texture != 0)
|
||||
{
|
||||
SetDebugObjectName(*texture, "DDSTextureLoader");
|
||||
@ -1404,6 +1405,7 @@ HRESULT DirectX::CreateDDSTextureFromMemoryEx( ID3D11Device* d3dDevice,
|
||||
{
|
||||
SetDebugObjectName(*textureView, "DDSTextureLoader");
|
||||
}
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
@ -1469,10 +1471,12 @@ HRESULT DirectX::CreateDDSTextureFromFileEx( ID3D11Device* d3dDevice,
|
||||
texture, textureView );
|
||||
|
||||
#if defined(_DEBUG) || defined(PROFILE)
|
||||
if ( SUCCEEDED(hr) )
|
||||
{
|
||||
if (texture != 0 || textureView != 0)
|
||||
{
|
||||
CHAR strFileA[MAX_PATH];
|
||||
WideCharToMultiByte( CP_ACP,
|
||||
int result = WideCharToMultiByte( CP_ACP,
|
||||
WC_NO_BEST_FIT_CHARS,
|
||||
fileName,
|
||||
-1,
|
||||
@ -1481,6 +1485,8 @@ HRESULT DirectX::CreateDDSTextureFromFileEx( ID3D11Device* d3dDevice,
|
||||
nullptr,
|
||||
FALSE
|
||||
);
|
||||
if ( result > 0 )
|
||||
{
|
||||
const CHAR* pstrName = strrchr( strFileA, '\\' );
|
||||
if (!pstrName)
|
||||
{
|
||||
@ -1507,6 +1513,8 @@ HRESULT DirectX::CreateDDSTextureFromFileEx( ID3D11Device* d3dDevice,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return hr;
|
||||
|
@ -859,14 +859,14 @@ HRESULT DirectX::CreateWICTextureFromFileEx( ID3D11Device* d3dDevice,
|
||||
hr = CreateTextureFromWIC( d3dDevice, d3dContext, frame.Get(), maxsize,
|
||||
usage, bindFlags, cpuAccessFlags, miscFlags, forceSRGB,
|
||||
texture, textureView );
|
||||
if ( FAILED(hr))
|
||||
return hr;
|
||||
|
||||
#if defined(_DEBUG) || defined(PROFILE)
|
||||
if ( SUCCEEDED(hr) )
|
||||
{
|
||||
if (texture != 0 || textureView != 0)
|
||||
{
|
||||
CHAR strFileA[MAX_PATH];
|
||||
WideCharToMultiByte( CP_ACP,
|
||||
int result = WideCharToMultiByte( CP_ACP,
|
||||
WC_NO_BEST_FIT_CHARS,
|
||||
fileName,
|
||||
-1,
|
||||
@ -875,6 +875,8 @@ HRESULT DirectX::CreateWICTextureFromFileEx( ID3D11Device* d3dDevice,
|
||||
nullptr,
|
||||
FALSE
|
||||
);
|
||||
if ( result > 0 )
|
||||
{
|
||||
const CHAR* pstrName = strrchr( strFileA, '\\' );
|
||||
if (!pstrName)
|
||||
{
|
||||
@ -901,6 +903,8 @@ HRESULT DirectX::CreateWICTextureFromFileEx( ID3D11Device* d3dDevice,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return hr;
|
||||
|
Loading…
x
Reference in New Issue
Block a user