Skip to content

Commit f044c27

Browse files
authored
DirectX Tool Kit, DirectXTex updated for June 2021 (#31)
1 parent 5b20a8e commit f044c27

File tree

312 files changed

+4893
-2545
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

312 files changed

+4893
-2545
lines changed

Kits/ATGTK/CSVReader.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@
33
//
44
// Simple parser for .csv (Comma-Separated Values) files.
55
//
6-
// Copyright (c) Microsoft Corporation. All rights reserved.
6+
// Copyright (c) Microsoft Corporation.
77
// Licensed under the MIT License.
88
//-------------------------------------------------------------------------------------
99

1010
#pragma once
1111

12+
#include <cassert>
13+
#include <cstddef>
14+
#include <cstdint>
1215
#include <exception>
1316
#include <memory>
1417
#include <vector>

Kits/ATGTK/CommandLineHelpers.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//--------------------------------------------------------------------------------------
77
#pragma once
88

9+
#include <cstddef>
910
#include <vector>
1011

1112
namespace ATG
@@ -52,7 +53,7 @@ namespace ATG
5253
{
5354
wprintf(L"Invalid value specified with -%ls (%ls)\n", LookupByValue(option, ::g_Options), name);
5455
wprintf(pleaseUseMsg);
55-
PrintTable(_countof(pleaseUseMsg) - 1, table);
56+
PrintTable(std::size(pleaseUseMsg) - 1, table);
5657
wprintf(L"\n\n");
5758
return false;
5859
}

Kits/ATGTK/ControllerFont.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//
44
// Class for compositing text with Xbox controller font button sprites
55
//
6-
// Copyright (c) Microsoft Corporation. All rights reserved.
6+
// Copyright (c) Microsoft Corporation.
77
// Licensed under the MIT License.
88
//-------------------------------------------------------------------------------------
99

Kits/ATGTK/ControllerHelp.cpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,8 @@ const ATG::Help::CalloutBox ATG::Help::CalloutBox::s_CalloutTemplates[] =
413413
HELP_CALLOUT_COLOR,
414414
ANCHOR_DPAD_ALL,
415415
nullptr,
416-
CALLOUT_LINE_DPAD_ALL
416+
CALLOUT_LINE_DPAD_ALL,
417+
{ 0, 0 }
417418
},
418419
// DPAD_DOWN
419420
{
@@ -427,7 +428,8 @@ const ATG::Help::CalloutBox ATG::Help::CalloutBox::s_CalloutTemplates[] =
427428
HELP_CALLOUT_COLOR,
428429
ANCHOR_DPAD_ALL,
429430
nullptr,
430-
CALLOUT_LINE_DPAD_ALL
431+
CALLOUT_LINE_DPAD_ALL,
432+
{ 0, 0 }
431433
},
432434
// DPAD_LEFT
433435
{
@@ -441,7 +443,8 @@ const ATG::Help::CalloutBox ATG::Help::CalloutBox::s_CalloutTemplates[] =
441443
HELP_CALLOUT_COLOR,
442444
ANCHOR_DPAD_ALL,
443445
nullptr,
444-
CALLOUT_LINE_DPAD_ALL
446+
CALLOUT_LINE_DPAD_ALL,
447+
{ 0, 0 }
445448
},
446449
// DPAD_RIGHT
447450
{
@@ -455,7 +458,8 @@ const ATG::Help::CalloutBox ATG::Help::CalloutBox::s_CalloutTemplates[] =
455458
HELP_CALLOUT_COLOR,
456459
ANCHOR_DPAD_ALL,
457460
nullptr,
458-
CALLOUT_LINE_DPAD_ALL
461+
CALLOUT_LINE_DPAD_ALL,
462+
{ 0, 0 }
459463
},
460464
// DPAD_ALL
461465
{
@@ -763,7 +767,7 @@ void ATG::Help::Render(ID3D12GraphicsCommandList* commandList)
763767
{
764768
m_descriptorHeap->Heap()
765769
};
766-
commandList->SetDescriptorHeaps(_countof(descriptorHeaps), descriptorHeaps);
770+
commandList->SetDescriptorHeaps(static_cast<UINT>(std::size(descriptorHeaps)), descriptorHeaps);
767771

768772
D3D12_VIEWPORT vp1{ 0.0f, 0.0f, static_cast<float>(m_screenSize.right), static_cast<float>(m_screenSize.bottom),
769773
D3D12_MIN_DEPTH, D3D12_MAX_DEPTH };
@@ -859,7 +863,7 @@ void ATG::Help::ReleaseDevice()
859863
m_primBatch.reset();
860864
m_lineEffect.reset();
861865

862-
for (size_t i = 0; i < _countof(m_spriteFonts); ++i)
866+
for (size_t i = 0; i < std::size(m_spriteFonts); ++i)
863867
{
864868
m_spriteFonts[i].reset();
865869
}

Kits/ATGTK/DebugDraw.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
//--------------------------------------------------------------------------------------
22
// File: DebugDraw.cpp
33
//
4-
// Copyright (c) Microsoft Corporation. All rights reserved.
4+
// Copyright (c) Microsoft Corporation.
55
// Licensed under the MIT License.
66
//-------------------------------------------------------------------------------------
77

88
#include "pch.h"
99
#include "DebugDraw.h"
1010

11+
#include <algorithm>
12+
1113
using namespace DirectX;
1214

1315
namespace
@@ -52,7 +54,7 @@ namespace
5254
XMStoreFloat4(&verts[i].color, color);
5355
}
5456

55-
batch->DrawIndexed(D3D_PRIMITIVE_TOPOLOGY_LINELIST, s_indices, _countof(s_indices), verts, 8);
57+
batch->DrawIndexed(D3D_PRIMITIVE_TOPOLOGY_LINELIST, s_indices, static_cast<UINT>(std::size(s_indices)), verts, 8);
5658
}
5759
}
5860

@@ -132,12 +134,12 @@ void XM_CALLCONV DX::Draw(PrimitiveBatch<VertexPositionColor>* batch,
132134
verts[22].position = corners[7];
133135
verts[23].position = corners[4];
134136

135-
for (size_t j = 0; j < _countof(verts); ++j)
137+
for (size_t j = 0; j < std::size(verts); ++j)
136138
{
137139
XMStoreFloat4(&verts[j].color, color);
138140
}
139141

140-
batch->Draw(D3D_PRIMITIVE_TOPOLOGY_LINELIST, verts, _countof(verts));
142+
batch->Draw(D3D_PRIMITIVE_TOPOLOGY_LINELIST, verts, static_cast<UINT>(std::size(verts)));
141143
}
142144

143145
void XM_CALLCONV DX::DrawGrid(PrimitiveBatch<VertexPositionColor>* batch,

Kits/ATGTK/DebugDraw.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//
44
// Helpers for drawing various debug shapes using PrimitiveBatch
55
//
6-
// Copyright (c) Microsoft Corporation. All rights reserved.
6+
// Copyright (c) Microsoft Corporation.
77
// Licensed under the MIT License.
88
//-------------------------------------------------------------------------------------
99

Kits/ATGTK/FileHelpers.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
//--------------------------------------------------------------------------------------
22
// FileHelpers.h
33
//
4-
// Copyright (c) Microsoft Corporation. All rights reserved.
4+
// Copyright (c) Microsoft Corporation.
55
// Licensed under the MIT License.
66
//--------------------------------------------------------------------------------------
77
#pragma once
88

99
#include <fileapi.h>
10-
#include <assert.h>
11-
#include <stdio.h>
10+
11+
#include <cassert>
12+
#include <cstdio>
1213

1314
#include <wrl/client.h>
1415

@@ -74,4 +75,4 @@ namespace DX
7475
Microsoft::WRL::ComPtr<IWICStream>& m_handle;
7576
};
7677
#endif
77-
}
78+
}

Kits/ATGTK/FindMedia.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44
// Helper function to find the location of a media file for Windows desktop apps
55
// since they lack appx packaging support.
66
//
7-
// Copyright (c) Microsoft Corporation. All rights reserved.
7+
// Copyright (c) Microsoft Corporation.
88
// Licensed under the MIT License.
99
//-------------------------------------------------------------------------------------
1010

1111
#pragma once
1212

13+
#include <cstddef>
14+
#include <cstring>
1315
#include <exception>
14-
#include <string.h>
1516

1617

1718
namespace DX
@@ -34,6 +35,8 @@ namespace DX
3435
static const wchar_t* s_defSearchFolders[] =
3536
{
3637
L"Assets",
38+
L"Assets\\Fonts",
39+
L"Assets\\Textures",
3740
L"Media",
3841
L"Media\\Textures",
3942
L"Media\\Fonts",
@@ -103,4 +106,4 @@ namespace DX
103106

104107
throw std::exception("File not found");
105108
}
106-
}
109+
}

Kits/ATGTK/FrontPanel/BufferDescriptor.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
//--------------------------------------------------------------------------------------
77
#pragma once
88

9-
#include <stdint.h>
9+
#include <cstddef>
10+
#include <cstdint>
1011

1112

1213
namespace ATG

Kits/ATGTK/FrontPanel/CPUShapes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//--------------------------------------------------------------------------------------
77
#pragma once
88

9-
#include <stdint.h>
9+
#include <cstdint>
1010

1111

1212
namespace ATG

0 commit comments

Comments
 (0)