mirror of
https://github.com/microsoft/DirectXTex.git
synced 2025-07-09 19:50:13 +02:00
Minor code review and reformatting
This commit is contained in:
parent
cadc01f3af
commit
f4954ce11b
@ -934,7 +934,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
HRESULT hr = hr = CoInitializeEx(nullptr, COINIT_MULTITHREADED);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L"Failed to initialize COM (%08X)\n", hr);
|
||||
wprintf(L"Failed to initialize COM (%08X)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -1259,7 +1259,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = LoadAnimatedGif(conversion.front().szSrc, loadedImages, (dwOptions & (1 << OPT_GIF_BGCOLOR)) != 0);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED (%x)\n", hr);
|
||||
wprintf(L" FAILED (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@ -1320,7 +1320,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = LoadFromDDSFile(pConv->szSrc, DDS_FLAGS_NONE, &info, *image);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED (%x)\n", hr);
|
||||
wprintf(L" FAILED (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -1347,7 +1347,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = LoadFromDDSFile(pConv->szSrc, DDS_FLAGS_NONE, &info, *image);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED (%x)\n", hr);
|
||||
wprintf(L" FAILED (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -1370,7 +1370,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = LoadFromDDSFile(pConv->szSrc, DDS_FLAGS_NONE, &info, *image);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED (%x)\n", hr);
|
||||
wprintf(L" FAILED (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -1387,7 +1387,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = LoadFromTGAFile(pConv->szSrc, &info, *image);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED (%x)\n", hr);
|
||||
wprintf(L" FAILED (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@ -1396,7 +1396,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = LoadFromHDRFile(pConv->szSrc, &info, *image);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED (%x)\n", hr);
|
||||
wprintf(L" FAILED (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@ -1406,7 +1406,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = LoadFromEXRFile(pConv->szSrc, &info, *image);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED (%x)\n", hr);
|
||||
wprintf(L" FAILED (%x)\n", static_cast<unsigned int>(hr));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@ -1424,7 +1424,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = LoadFromWICFile(pConv->szSrc, dwFilter | WIC_FLAGS_ALL_FRAMES, &info, *image);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED (%x)\n", hr);
|
||||
wprintf(L" FAILED (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@ -1453,7 +1453,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = ConvertToSinglePlane(img, nimg, info, *timage);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED [converttosingleplane] (%x)\n", hr);
|
||||
wprintf(L" FAILED [converttosingleplane] (%x)\n", static_cast<unsigned int>(hr));
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -1489,7 +1489,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = Decompress(img, nimg, info, DXGI_FORMAT_UNKNOWN /* picks good default */, *timage.get());
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED [decompress] (%x)\n", hr);
|
||||
wprintf(L" FAILED [decompress] (%x)\n", static_cast<unsigned int>(hr));
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -1537,7 +1537,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = PremultiplyAlpha(img, nimg, info, TEX_PMALPHA_REVERSE | dwSRGB, *timage);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED [demultiply alpha] (%x)\n", hr);
|
||||
wprintf(L" FAILED [demultiply alpha] (%x)\n", static_cast<unsigned int>(hr));
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -1577,7 +1577,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = Resize(image->GetImages(), image->GetImageCount(), image->GetMetadata(), width, height, dwFilter | dwFilterOpts, *timage.get());
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED [resize] (%x)\n", hr);
|
||||
wprintf(L" FAILED [resize] (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -1627,7 +1627,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
});
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED [tonemap maxlum] (%x)\n", hr);
|
||||
wprintf(L" FAILED [tonemap maxlum] (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -1656,7 +1656,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
}, *timage);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED [tonemap apply] (%x)\n", hr);
|
||||
wprintf(L" FAILED [tonemap apply] (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -1694,7 +1694,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
dwFilter | dwFilterOpts | dwSRGB, TEX_THRESHOLD_DEFAULT, *timage.get());
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED [convert] (%x)\n", hr);
|
||||
wprintf(L" FAILED [convert] (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -1801,7 +1801,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = result.Initialize2D(format, twidth, theight, 1, 1);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L"FAILED setting up result image (%x)\n", hr);
|
||||
wprintf(L"FAILED setting up result image (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -1872,7 +1872,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = CopyRectangle(*img, rect, *dest, dwFilter | dwFilterOpts, offsetx, offsety);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L"FAILED building result image (%x)\n", hr);
|
||||
wprintf(L"FAILED building result image (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@ -1895,7 +1895,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = SaveImageFile(*dest, fileType, szOutputFile);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED (%x)\n", hr);
|
||||
wprintf(L" FAILED (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
@ -1908,7 +1908,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = alphaImage.Initialize2D(DXGI_FORMAT_R32_FLOAT, width, height, 1, 1);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L"FAILED setting up alpha image (%x)\n", hr);
|
||||
wprintf(L"FAILED setting up alpha image (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -1930,7 +1930,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
});
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED [reading alpha image] (%x)\n", hr);
|
||||
wprintf(L" FAILED [reading alpha image] (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -1955,7 +1955,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
}, result);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED [merge image] (%x)\n", hr);
|
||||
wprintf(L" FAILED [merge image] (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -1977,7 +1977,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = SaveImageFile(*result.GetImage(0, 0, 0), fileType, szOutputFile);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED (%x)\n", hr);
|
||||
wprintf(L" FAILED (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
@ -1992,7 +1992,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = result.Initialize2D(format, twidth, theight, 1, 1);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L"FAILED setting up result image (%x)\n", hr);
|
||||
wprintf(L"FAILED setting up result image (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -2020,7 +2020,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = CopyRectangle(*img, rect, *dest, dwFilter | dwFilterOpts, offsetx, offsety);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L"FAILED building result image (%x)\n", hr);
|
||||
wprintf(L"FAILED building result image (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@ -2043,7 +2043,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = SaveImageFile(*dest, fileType, szOutputFile);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED (%x)\n", hr);
|
||||
wprintf(L" FAILED (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
@ -2088,7 +2088,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L"FAILED building result image (%x)\n", hr);
|
||||
wprintf(L"FAILED building result image (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -2112,7 +2112,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
szOutputFile);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L"\nFAILED (%x)\n", hr);
|
||||
wprintf(L"\nFAILED (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
|
@ -133,7 +133,6 @@ struct SValue
|
||||
DWORD dwValue;
|
||||
};
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
@ -472,7 +471,6 @@ namespace
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
const wchar_t* LookupByValue(DWORD pValue, const SValue *pArray)
|
||||
{
|
||||
while (pArray->pName)
|
||||
@ -486,7 +484,6 @@ namespace
|
||||
return L"";
|
||||
}
|
||||
|
||||
|
||||
void SearchForFiles(const wchar_t* path, std::list<SConversion>& files, bool recursive)
|
||||
{
|
||||
// Process files
|
||||
@ -561,7 +558,6 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void PrintFormat(DXGI_FORMAT Format)
|
||||
{
|
||||
for (const SValue *pFormat = g_pFormats; pFormat->pName; pFormat++)
|
||||
@ -585,7 +581,6 @@ namespace
|
||||
wprintf(L"*UNKNOWN*");
|
||||
}
|
||||
|
||||
|
||||
void PrintInfo(const TexMetadata& info)
|
||||
{
|
||||
wprintf(L" (%zux%zu", info.width, info.height);
|
||||
@ -645,7 +640,6 @@ namespace
|
||||
wprintf(L")");
|
||||
}
|
||||
|
||||
|
||||
void PrintList(size_t cch, const SValue *pValue)
|
||||
{
|
||||
while (pValue->pName)
|
||||
@ -666,7 +660,6 @@ namespace
|
||||
wprintf(L"\n");
|
||||
}
|
||||
|
||||
|
||||
void PrintLogo()
|
||||
{
|
||||
wprintf(L"Microsoft (R) DirectX Texture Converter (DirectXTex version)\n");
|
||||
@ -677,7 +670,6 @@ namespace
|
||||
wprintf(L"\n");
|
||||
}
|
||||
|
||||
|
||||
_Success_(return != false)
|
||||
bool GetDXGIFactory(_Outptr_ IDXGIFactory1** pFactory)
|
||||
{
|
||||
@ -704,7 +696,6 @@ namespace
|
||||
return SUCCEEDED(s_CreateDXGIFactory1(IID_PPV_ARGS(pFactory)));
|
||||
}
|
||||
|
||||
|
||||
void PrintUsage()
|
||||
{
|
||||
PrintLogo();
|
||||
@ -804,7 +795,6 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
_Success_(return != false)
|
||||
bool CreateDevice(int adapter, _Outptr_ ID3D11Device** pDevice)
|
||||
{
|
||||
@ -902,7 +892,6 @@ namespace
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void FitPowerOf2(size_t origx, size_t origy, size_t& targetx, size_t& targety, size_t maxsize)
|
||||
{
|
||||
float origAR = float(origx) / float(origy);
|
||||
@ -981,7 +970,6 @@ namespace
|
||||
return normalizedLinear;
|
||||
}
|
||||
|
||||
|
||||
HRESULT ReadData(_In_z_ const wchar_t* szFile, std::unique_ptr<uint8_t[]>& blob, size_t& bmpSize)
|
||||
{
|
||||
blob.reset();
|
||||
@ -1104,7 +1092,6 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Entry-point
|
||||
//--------------------------------------------------------------------------------------
|
||||
@ -1148,7 +1135,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
HRESULT hr = CoInitializeEx(nullptr, COINIT_MULTITHREADED);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L"Failed to initialize COM (%08X)\n", hr);
|
||||
wprintf(L"Failed to initialize COM (%08X)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -1677,7 +1664,6 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
qpcFreq.QuadPart = 0;
|
||||
}
|
||||
|
||||
|
||||
LARGE_INTEGER qpcStart;
|
||||
if (!QueryPerformanceCounter(&qpcStart))
|
||||
{
|
||||
@ -1725,7 +1711,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = LoadFromDDSFile(pConv->szSrc, ddsFlags, &info, *image);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED (%x)\n", hr);
|
||||
wprintf(L" FAILED (%x)\n", static_cast<unsigned int>(hr));
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -1767,7 +1753,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
}
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED (%x)\n", hr);
|
||||
wprintf(L" FAILED (%x)\n", static_cast<unsigned int>(hr));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@ -1776,7 +1762,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = LoadFromTGAFile(pConv->szSrc, &info, *image);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED (%x)\n", hr);
|
||||
wprintf(L" FAILED (%x)\n", static_cast<unsigned int>(hr));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@ -1785,7 +1771,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = LoadFromHDRFile(pConv->szSrc, &info, *image);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED (%x)\n", hr);
|
||||
wprintf(L" FAILED (%x)\n", static_cast<unsigned int>(hr));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@ -1795,7 +1781,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = LoadFromEXRFile(pConv->szSrc, &info, *image);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED (%x)\n", hr);
|
||||
wprintf(L" FAILED (%x)\n", static_cast<unsigned int>(hr));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@ -1817,7 +1803,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = LoadFromWICFile(pConv->szSrc, wicFlags, &info, *image);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED (%x)\n", hr);
|
||||
wprintf(L" FAILED (%x)\n", static_cast<unsigned int>(hr));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@ -1877,7 +1863,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = ConvertToSinglePlane(img, nimg, info, *timage);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED [converttosingleplane] (%x)\n", hr);
|
||||
wprintf(L" FAILED [converttosingleplane] (%x)\n", static_cast<unsigned int>(hr));
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -1916,7 +1902,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = Decompress(img, nimg, info, DXGI_FORMAT_UNKNOWN /* picks good default */, *timage);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED [decompress] (%x)\n", hr);
|
||||
wprintf(L" FAILED [decompress] (%x)\n", static_cast<unsigned int>(hr));
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -1973,7 +1959,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = PremultiplyAlpha(img, nimg, info, TEX_PMALPHA_REVERSE | dwSRGB, *timage);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED [demultiply alpha] (%x)\n", hr);
|
||||
wprintf(L" FAILED [demultiply alpha] (%x)\n", static_cast<unsigned int>(hr));
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -2016,7 +2002,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = FlipRotate(image->GetImages(), image->GetImageCount(), image->GetMetadata(), dwFlags, *timage);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED [fliprotate] (%x)\n", hr);
|
||||
wprintf(L" FAILED [fliprotate] (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -2051,7 +2037,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = Resize(image->GetImages(), image->GetImageCount(), image->GetMetadata(), twidth, theight, dwFilter | dwFilterOpts, *timage);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED [resize] (%x)\n", hr);
|
||||
wprintf(L" FAILED [resize] (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -2088,7 +2074,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
dwFilter | dwFilterOpts | dwSRGB | dwConvert, TEX_THRESHOLD_DEFAULT, *timage);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED [convert] (%x)\n", hr);
|
||||
wprintf(L" FAILED [convert] (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -2282,7 +2268,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
}
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED [rotate color apply] (%x)\n", hr);
|
||||
wprintf(L" FAILED [rotate color apply] (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -2333,7 +2319,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
});
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED [tonemap maxlum] (%x)\n", hr);
|
||||
wprintf(L" FAILED [tonemap maxlum] (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -2362,7 +2348,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
}, *timage);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED [tonemap apply] (%x)\n", hr);
|
||||
wprintf(L" FAILED [tonemap apply] (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -2402,7 +2388,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = ComputeNormalMap(image->GetImages(), image->GetImageCount(), image->GetMetadata(), dwNormalMap, nmapAmplitude, nmfmt, *timage);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED [normalmap] (%x)\n", hr);
|
||||
wprintf(L" FAILED [normalmap] (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -2435,7 +2421,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
dwFilter | dwFilterOpts | dwSRGB | dwConvert, TEX_THRESHOLD_DEFAULT, *timage);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED [convert] (%x)\n", hr);
|
||||
wprintf(L" FAILED [convert] (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -2494,7 +2480,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
}, *timage);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED [colorkey] (%x)\n", hr);
|
||||
wprintf(L" FAILED [colorkey] (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -2543,7 +2529,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
}, *timage);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED [inverty] (%x)\n", hr);
|
||||
wprintf(L" FAILED [inverty] (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -2603,7 +2589,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = timage->Initialize(mdata);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED [copy to single level] (%x)\n", hr);
|
||||
wprintf(L" FAILED [copy to single level] (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -2615,7 +2601,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
*timage->GetImage(0, 0, d), TEX_FILTER_DEFAULT, 0, 0);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED [copy to single level] (%x)\n", hr);
|
||||
wprintf(L" FAILED [copy to single level] (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@ -2628,7 +2614,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
*timage->GetImage(0, i, 0), TEX_FILTER_DEFAULT, 0, 0);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED [copy to single level] (%x)\n", hr);
|
||||
wprintf(L" FAILED [copy to single level] (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@ -2645,7 +2631,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = timage->Initialize(mdata);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED [copy compressed to single level] (%x)\n", hr);
|
||||
wprintf(L" FAILED [copy compressed to single level] (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -2697,7 +2683,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
}
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED [mipmaps] (%x)\n", hr);
|
||||
wprintf(L" FAILED [mipmaps] (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -2729,7 +2715,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = timage->Initialize(image->GetMetadata());
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED [keepcoverage] (%x)\n", hr);
|
||||
wprintf(L" FAILED [keepcoverage] (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -2742,7 +2728,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = ScaleMipMapsAlphaForCoverage(img, info.mipLevels, info, item, preserveAlphaCoverageRef, *timage);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED [keepcoverage] (%x)\n", hr);
|
||||
wprintf(L" FAILED [keepcoverage] (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@ -2788,7 +2774,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = PremultiplyAlpha(img, nimg, info, dwSRGB, *timage);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED [premultiply alpha] (%x)\n", hr);
|
||||
wprintf(L" FAILED [premultiply alpha] (%x)\n", static_cast<unsigned int>(hr));
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -2905,7 +2891,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
}
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED [compress] (%x)\n", hr);
|
||||
wprintf(L" FAILED [compress] (%x)\n", static_cast<unsigned int>(hr));
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -3089,7 +3075,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED (%x)\n", hr);
|
||||
wprintf(L" FAILED (%x)\n", static_cast<unsigned int>(hr));
|
||||
continue;
|
||||
}
|
||||
wprintf(L"\n");
|
||||
|
@ -3039,7 +3039,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
HRESULT hr = hr = CoInitializeEx(nullptr, COINIT_MULTITHREADED);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L"Failed to initialize COM (%08X)\n", hr);
|
||||
wprintf(L"Failed to initialize COM (%08X)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -3310,7 +3310,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = LoadImage(pImage1->szSrc, dwOptions, dwFilter, info1, image1);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED (%x)\n", hr);
|
||||
wprintf(L" FAILED (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -3325,7 +3325,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = LoadImage(pImage2->szSrc, dwOptions, dwFilter, info2, image2);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED (%x)\n", hr);
|
||||
wprintf(L" FAILED (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -3362,7 +3362,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = Difference(*image1->GetImage(0, 0, 0), *image2->GetImage(0, 0, 0), dwFilter, diffFormat, diffImage);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L"Failed diffing images (%08X)\n", hr);
|
||||
wprintf(L"Failed diffing images (%08X)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -3378,7 +3378,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = SaveImage(diffImage.GetImage(0, 0, 0), szOutputFile, fileType);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED (%x)\n", hr);
|
||||
wprintf(L" FAILED (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -3400,7 +3400,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = ComputeMSE(*image1->GetImage(0, 0, 0), *image2->GetImage(0, 0, 0), mse, mseV);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L"Failed comparing images (%08X)\n", hr);
|
||||
wprintf(L"Failed comparing images (%08X)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -3447,7 +3447,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = ComputeMSE(*img1, *img2, mse, mseV);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L"Failed comparing images at slice %3Iu, mip %3Iu (%08X)\n", slice, mip, hr);
|
||||
wprintf(L"Failed comparing images at slice %3Iu, mip %3Iu (%08X)\n", slice, mip, static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -3498,7 +3498,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = ComputeMSE(*img1, *img2, mse, mseV);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L"Failed comparing images at item %3Iu, mip %3Iu (%08X)\n", item, mip, hr);
|
||||
wprintf(L"Failed comparing images at item %3Iu, mip %3Iu (%08X)\n", item, mip, static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -3558,7 +3558,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = LoadImage(pConv->szSrc, dwOptions, dwFilter, info, image);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED (%x)\n", hr);
|
||||
wprintf(L" FAILED (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -3672,7 +3672,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = SaveImage(img, szOutputFile, fileType);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED (%x)\n", hr);
|
||||
wprintf(L" FAILED (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@ -3715,7 +3715,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = SaveImage(img, szOutputFile, fileType);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED (%x)\n", hr);
|
||||
wprintf(L" FAILED (%x)\n", static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@ -3768,7 +3768,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = DumpBCImage(*img, pixelx, pixely);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L"ERROR: Failed dumping image at slice %3Iu, mip %3Iu (%08X)\n", slice, mip, hr);
|
||||
wprintf(L"ERROR: Failed dumping image at slice %3Iu, mip %3Iu (%08X)\n", slice, mip, static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@ -3811,7 +3811,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = DumpBCImage(*img, tpixelx, tpixely);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L"ERROR: Failed dumping image at item %3Iu, mip %3Iu (%08X)\n", item, mip, hr);
|
||||
wprintf(L"ERROR: Failed dumping image at item %3Iu, mip %3Iu (%08X)\n", item, mip, static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@ -3844,7 +3844,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = ConvertToSinglePlane(img, nimg, info, *timage);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L" FAILED [converttosingleplane] (%x)\n", hr);
|
||||
wprintf(L" FAILED [converttosingleplane] (%x)\n", static_cast<unsigned int>(hr));
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -3885,7 +3885,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = Analyze(*img, data);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L"ERROR: Failed analyzing image at slice %3Iu, mip %3Iu (%08X)\n", slice, mip, hr);
|
||||
wprintf(L"ERROR: Failed analyzing image at slice %3Iu, mip %3Iu (%08X)\n", slice, mip, static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -3899,7 +3899,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = AnalyzeBC(*img, data);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L"ERROR: Failed analyzing BC image at slice %3Iu, mip %3Iu (%08X)\n", slice, mip, hr);
|
||||
wprintf(L"ERROR: Failed analyzing BC image at slice %3Iu, mip %3Iu (%08X)\n", slice, mip, static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -3933,7 +3933,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = Analyze(*img, data);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L"ERROR: Failed analyzing image at item %3Iu, mip %3Iu (%08X)\n", item, mip, hr);
|
||||
wprintf(L"ERROR: Failed analyzing image at item %3Iu, mip %3Iu (%08X)\n", item, mip, static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -3950,7 +3950,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
|
||||
hr = AnalyzeBC(*img, data);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
wprintf(L"ERROR: Failed analyzing BC image at item %3Iu, mip %3Iu (%08X)\n", item, mip, hr);
|
||||
wprintf(L"ERROR: Failed analyzing BC image at item %3Iu, mip %3Iu (%08X)\n", item, mip, static_cast<unsigned int>(hr));
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user