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,
|
ddsData + offset, ddsDataSize - offset, maxsize,
|
||||||
usage, bindFlags, cpuAccessFlags, miscFlags, forceSRGB,
|
usage, bindFlags, cpuAccessFlags, miscFlags, forceSRGB,
|
||||||
texture, textureView );
|
texture, textureView );
|
||||||
|
if ( SUCCEEDED(hr) )
|
||||||
|
{
|
||||||
if (texture != 0 && *texture != 0)
|
if (texture != 0 && *texture != 0)
|
||||||
{
|
{
|
||||||
SetDebugObjectName(*texture, "DDSTextureLoader");
|
SetDebugObjectName(*texture, "DDSTextureLoader");
|
||||||
@ -1404,6 +1405,7 @@ HRESULT DirectX::CreateDDSTextureFromMemoryEx( ID3D11Device* d3dDevice,
|
|||||||
{
|
{
|
||||||
SetDebugObjectName(*textureView, "DDSTextureLoader");
|
SetDebugObjectName(*textureView, "DDSTextureLoader");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
@ -1469,10 +1471,12 @@ HRESULT DirectX::CreateDDSTextureFromFileEx( ID3D11Device* d3dDevice,
|
|||||||
texture, textureView );
|
texture, textureView );
|
||||||
|
|
||||||
#if defined(_DEBUG) || defined(PROFILE)
|
#if defined(_DEBUG) || defined(PROFILE)
|
||||||
|
if ( SUCCEEDED(hr) )
|
||||||
|
{
|
||||||
if (texture != 0 || textureView != 0)
|
if (texture != 0 || textureView != 0)
|
||||||
{
|
{
|
||||||
CHAR strFileA[MAX_PATH];
|
CHAR strFileA[MAX_PATH];
|
||||||
WideCharToMultiByte( CP_ACP,
|
int result = WideCharToMultiByte( CP_ACP,
|
||||||
WC_NO_BEST_FIT_CHARS,
|
WC_NO_BEST_FIT_CHARS,
|
||||||
fileName,
|
fileName,
|
||||||
-1,
|
-1,
|
||||||
@ -1481,6 +1485,8 @@ HRESULT DirectX::CreateDDSTextureFromFileEx( ID3D11Device* d3dDevice,
|
|||||||
nullptr,
|
nullptr,
|
||||||
FALSE
|
FALSE
|
||||||
);
|
);
|
||||||
|
if ( result > 0 )
|
||||||
|
{
|
||||||
const CHAR* pstrName = strrchr( strFileA, '\\' );
|
const CHAR* pstrName = strrchr( strFileA, '\\' );
|
||||||
if (!pstrName)
|
if (!pstrName)
|
||||||
{
|
{
|
||||||
@ -1507,6 +1513,8 @@ HRESULT DirectX::CreateDDSTextureFromFileEx( ID3D11Device* d3dDevice,
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return hr;
|
return hr;
|
||||||
|
@ -859,14 +859,14 @@ HRESULT DirectX::CreateWICTextureFromFileEx( ID3D11Device* d3dDevice,
|
|||||||
hr = CreateTextureFromWIC( d3dDevice, d3dContext, frame.Get(), maxsize,
|
hr = CreateTextureFromWIC( d3dDevice, d3dContext, frame.Get(), maxsize,
|
||||||
usage, bindFlags, cpuAccessFlags, miscFlags, forceSRGB,
|
usage, bindFlags, cpuAccessFlags, miscFlags, forceSRGB,
|
||||||
texture, textureView );
|
texture, textureView );
|
||||||
if ( FAILED(hr))
|
|
||||||
return hr;
|
|
||||||
|
|
||||||
#if defined(_DEBUG) || defined(PROFILE)
|
#if defined(_DEBUG) || defined(PROFILE)
|
||||||
|
if ( SUCCEEDED(hr) )
|
||||||
|
{
|
||||||
if (texture != 0 || textureView != 0)
|
if (texture != 0 || textureView != 0)
|
||||||
{
|
{
|
||||||
CHAR strFileA[MAX_PATH];
|
CHAR strFileA[MAX_PATH];
|
||||||
WideCharToMultiByte( CP_ACP,
|
int result = WideCharToMultiByte( CP_ACP,
|
||||||
WC_NO_BEST_FIT_CHARS,
|
WC_NO_BEST_FIT_CHARS,
|
||||||
fileName,
|
fileName,
|
||||||
-1,
|
-1,
|
||||||
@ -875,6 +875,8 @@ HRESULT DirectX::CreateWICTextureFromFileEx( ID3D11Device* d3dDevice,
|
|||||||
nullptr,
|
nullptr,
|
||||||
FALSE
|
FALSE
|
||||||
);
|
);
|
||||||
|
if ( result > 0 )
|
||||||
|
{
|
||||||
const CHAR* pstrName = strrchr( strFileA, '\\' );
|
const CHAR* pstrName = strrchr( strFileA, '\\' );
|
||||||
if (!pstrName)
|
if (!pstrName)
|
||||||
{
|
{
|
||||||
@ -901,6 +903,8 @@ HRESULT DirectX::CreateWICTextureFromFileEx( ID3D11Device* d3dDevice,
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return hr;
|
return hr;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user