64
64
65
65
#include " DirectXTex.h"
66
66
67
- // Uncomment to add support for OpenEXR (.exr)
68
- // #define USE_OPENEXR
69
-
70
67
#ifdef USE_OPENEXR
71
68
// See <https://github.com/Microsoft/DirectXTex/wiki/Adding-OpenEXR> for details
72
69
#include " DirectXTexEXR.h"
@@ -242,7 +239,6 @@ namespace
242
239
#ifdef USE_OPENEXR
243
240
#define CODEC_EXR 0xFFFF0006
244
241
#endif
245
-
246
242
#ifdef USE_LIBJPEG
247
243
#define CODEC_JPEG 0xFFFF0007
248
244
#endif
@@ -537,7 +533,7 @@ namespace
537
533
{
538
534
while (pValue->name )
539
535
{
540
- size_t cchName = wcslen (pValue->name );
536
+ const size_t cchName = wcslen (pValue->name );
541
537
542
538
if (cch + cchName + 2 >= 80 )
543
539
{
@@ -602,7 +598,7 @@ namespace
602
598
603
599
LPWSTR errorText = nullptr ;
604
600
605
- DWORD result = FormatMessageW (FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_ALLOCATE_BUFFER,
601
+ const DWORD result = FormatMessageW (FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_ALLOCATE_BUFFER,
606
602
nullptr , static_cast <DWORD>(hr),
607
603
MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT), reinterpret_cast <LPWSTR>(&errorText), 0 , nullptr );
608
604
@@ -613,14 +609,21 @@ namespace
613
609
swprintf_s (desc, L" : %ls" , errorText);
614
610
615
611
size_t len = wcslen (desc);
616
- if (len >= 2 )
612
+ if (len >= 1 )
617
613
{
618
- desc[len - 2 ] = 0 ;
619
614
desc[len - 1 ] = 0 ;
620
615
}
621
616
622
617
if (errorText)
623
618
LocalFree (errorText);
619
+
620
+ for (wchar_t * ptr = desc; *ptr != 0 ; ++ptr)
621
+ {
622
+ if (*ptr == L' \r ' || *ptr == L' \n ' )
623
+ {
624
+ *ptr = L' ' ;
625
+ }
626
+ }
624
627
}
625
628
626
629
return desc;
@@ -1763,7 +1766,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
1763
1766
}
1764
1767
}
1765
1768
#endif
1766
-
1769
+
1767
1770
else
1768
1771
{
1769
1772
// WIC shares the same filter values for mode and dither
@@ -1961,7 +1964,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
1961
1964
if (info.width > maxWidth)
1962
1965
maxWidth = info.width ;
1963
1966
if (info.height > maxHeight)
1964
- maxHeight = info.height ;
1967
+ maxHeight = info.height ;
1965
1968
}
1966
1969
1967
1970
if (images > 6 )
@@ -2024,7 +2027,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
2024
2027
pContext->RSSetState (stateObjects.CullNone ());
2025
2028
auto linear = stateObjects.LinearClamp ();
2026
2029
2027
- for (size_t face = 0 ; face < 6 ; ++face)
2030
+ for (size_t face = 0 ; face < 6 ; ++face)
2028
2031
{
2029
2032
ComPtr<ID3D11ShaderResourceView> srv;
2030
2033
auto & input = loadedImages[face];
0 commit comments