Skip to content

Commit db1e9a0

Browse files
authored
Update for DirectXTex/DirectXTK September 2020 releases (#29)
1 parent 24dc7e8 commit db1e9a0

File tree

910 files changed

+9197
-196010
lines changed

Some content is hidden

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

910 files changed

+9197
-196010
lines changed

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ Durango12
3030
Profile
3131
Release
3232
x64
33-
Kits/DirectXTK/Src/Shaders/Compiled/XboxOne*.*
34-
Kits/DirectXTK12/Src/Shaders/Compiled/XboxOne*.*
33+
Kits/DirectXTK/Src/Shaders/Compiled/
34+
Kits/DirectXTK12/Src/Shaders/Compiled/
35+
Kits/DirectXTex/Shaders/Compiled/
3536
UWPSamples/Graphics/SimplePBR12_UWP/Compiled/
3637
XDKSamples/Graphics/SimplePBR12_Xbox/Compiled/
3738
XDKSamples/Graphics/SimpleDmaDecompression/zlib/lib/

Kits/ATGTK/ControllerFont.h

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -279,28 +279,28 @@ namespace DX
279279
float bsize = XMVectorGetX(butnFont->MeasureString(button));
280280
float offsetX = (bsize * buttonScale / 2.f);
281281

282-
if (outPos.x < result.left)
282+
if (outPos.x < float(result.left))
283283
result.left = long(outPos.x);
284284

285-
if (outPos.y < result.top)
285+
if (outPos.y < float(result.top))
286286
result.top = long(outPos.y);
287287

288288
outPos.x += offsetX;
289289
outPos.y -= offsetY;
290290

291-
if (outPos.x < result.left)
291+
if (outPos.x < float(result.left))
292292
result.left = long(outPos.x);
293293

294-
if (outPos.y < result.top)
294+
if (outPos.y < float(result.top))
295295
result.top = long(outPos.y);
296296

297297
outPos.x += bsize * buttonScale;
298298
outPos.y += offsetY;
299299

300-
if (result.right < outPos.x)
300+
if (float(result.right) < outPos.x)
301301
result.right = long(outPos.x);
302302

303-
if (result.bottom < outPos.y)
303+
if (float(result.bottom) < outPos.y)
304304
result.bottom = long(outPos.y);
305305
}
306306

@@ -320,18 +320,18 @@ namespace DX
320320
case '[':
321321
if (*strBuffer)
322322
{
323-
if (outPos.x < result.left)
323+
if (outPos.x < float(result.left))
324324
result.left = long(outPos.x);
325325

326-
if (outPos.y < result.top)
326+
if (outPos.y < float(result.top))
327327
result.top = long(outPos.y);
328328

329329
outPos.x += XMVectorGetX(textFont->MeasureString(strBuffer)) * scale;
330330

331-
if (result.right < outPos.x)
331+
if (float(result.right) < outPos.x)
332332
result.right = long(outPos.x);
333333

334-
if (result.bottom < outPos.y)
334+
if (float(result.bottom) < outPos.y)
335335
result.bottom = long(outPos.y);
336336

337337
memset(strBuffer, 0, sizeof(strBuffer));
@@ -345,18 +345,18 @@ namespace DX
345345
case '\n':
346346
if (*strBuffer)
347347
{
348-
if (outPos.x < result.left)
348+
if (outPos.x < float(result.left))
349349
result.left = long(outPos.x);
350350

351-
if (outPos.y < result.top)
351+
if (outPos.y < float(result.top))
352352
result.top = long(outPos.y);
353353

354354
outPos.x += XMVectorGetX(textFont->MeasureString(strBuffer)) * scale;
355355

356-
if (result.right < outPos.x)
356+
if (float(result.right) < outPos.x)
357357
result.right = long(outPos.x);
358358

359-
if (result.bottom < outPos.y)
359+
if (float(result.bottom) < outPos.y)
360360
result.bottom = long(outPos.y);
361361

362362
memset(strBuffer, 0, sizeof(strBuffer));
@@ -375,18 +375,18 @@ namespace DX
375375

376376
if (*strBuffer)
377377
{
378-
if (outPos.x < result.left)
378+
if (outPos.x < float(result.left))
379379
result.left = long(outPos.x);
380380

381-
if (outPos.y < result.top)
381+
if (outPos.y < float(result.top))
382382
result.top = long(outPos.y);
383383

384384
outPos.x += XMVectorGetX(textFont->MeasureString(strBuffer)) * scale;
385385

386-
if (result.right < outPos.x)
386+
if (float(result.right) < outPos.x)
387387
result.right = long(outPos.x);
388388

389-
if (result.bottom < outPos.y)
389+
if (float(result.bottom) < outPos.y)
390390
result.bottom = long(outPos.y);
391391
}
392392

Kits/ATGTK/ControllerHelp.cpp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,16 @@
2323

2424
#pragma warning( disable : 4061 )
2525

26+
#ifdef __clang__
27+
#pragma clang diagnostic ignored "-Wcovered-switch-default"
28+
#endif
29+
2630
using namespace DirectX;
2731
using namespace SimpleMath;
2832

2933
namespace
3034
{
31-
#if defined(__d3d12_h__) || defined(__d3d12_x_h__)
35+
#if defined(__d3d12_h__) || defined(__d3d12_x_h__) || defined(__XBOX_D3D12_X__)
3236
enum Descriptors
3337
{
3438
Segoe18 = 0,
@@ -188,7 +192,7 @@ struct ATG::Help::CalloutBox
188192
if (type == CalloutType::LINE_TO_ANCHOR)
189193
{
190194
// callout circle is 12x12 so -6 from x and y to get top left coordinates
191-
#if defined(__d3d12_h__) || defined(__d3d12_x_h__)
195+
#if defined(__d3d12_h__) || defined(__d3d12_x_h__) || defined(__XBOX_D3D12_X__)
192196
batch->Draw(help.m_descriptorHeap->GetGpuHandle(Descriptors::CircleTex), help.m_circleTexSize,
193197
Vector2(calloutLine.x - 6, calloutLine.y - 6));
194198
#elif defined(__d3d11_h__) || defined(__d3d11_x_h__)
@@ -751,7 +755,7 @@ ATG::Help::~Help()
751755
}
752756
}
753757

754-
#if defined(__d3d12_h__) || defined(__d3d12_x_h__)
758+
#if defined(__d3d12_h__) || defined(__d3d12_x_h__) || defined(__XBOX_D3D12_X__)
755759
void ATG::Help::Render(ID3D12GraphicsCommandList* commandList)
756760
{
757761
// Set the descriptor heaps
@@ -864,7 +868,7 @@ void ATG::Help::ReleaseDevice()
864868
m_gamepadTex.Reset();
865869
m_backgroundTex.Reset();
866870

867-
#if defined(__d3d12_h__) || defined(__d3d12_x_h__)
871+
#if defined(__d3d12_h__) || defined(__d3d12_x_h__) || defined(__XBOX_D3D12_X__)
868872
m_descriptorHeap.reset();
869873
#elif defined(__d3d11_h__) || defined(__d3d11_x_h__)
870874
m_states.reset();
@@ -873,10 +877,10 @@ void ATG::Help::ReleaseDevice()
873877
#endif
874878
}
875879

876-
#if defined(__d3d12_h__) || defined(__d3d12_x_h__)
880+
#if defined(__d3d12_h__) || defined(__d3d12_x_h__) || defined(__XBOX_D3D12_X__)
877881
void ATG::Help::RestoreDevice(ID3D12Device* device, ResourceUploadBatch& uploadBatch, const RenderTargetState& rtState)
878882
{
879-
m_descriptorHeap = std::make_unique<DescriptorHeap>(device, D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE, Descriptors::Count);
883+
m_descriptorHeap = std::make_unique<DescriptorHeap>(device, Descriptors::Count);
880884

881885
SpriteBatchPipelineStateDescription sbPsoDesc(rtState, &CommonStates::AlphaBlend);
882886
m_spriteBatch = std::make_unique<SpriteBatch>(device, uploadBatch, sbPsoDesc);
@@ -887,7 +891,7 @@ void ATG::Help::RestoreDevice(ID3D12Device* device, ResourceUploadBatch& uploadB
887891
CommonStates::DepthNone, CommonStates::CullNone, rtState, D3D12_PRIMITIVE_TOPOLOGY_TYPE_LINE);
888892
m_lineEffect = std::make_unique<BasicEffect>(device, EffectFlags::VertexColor, fxPsoDesc);
889893

890-
unsigned int loadFlags = m_linearColors ? DDS_LOADER_FORCE_SRGB : DDS_LOADER_DEFAULT;
894+
DDS_LOADER_FLAGS loadFlags = m_linearColors ? DDS_LOADER_FORCE_SRGB : DDS_LOADER_DEFAULT;
891895

892896
#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)
893897
wchar_t buff[MAX_PATH];

Kits/ATGTK/ControllerHelp.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include "PrimitiveBatch.h"
2121
#include "VertexTypes.h"
2222

23-
#if defined(__d3d12_h__) || defined(__d3d12_x_h__)
23+
#if defined(__d3d12_h__) || defined(__d3d12_x_h__) || defined(__XBOX_D3D12_X__)
2424
#include "DescriptorHeap.h"
2525
#include "ResourceUploadBatch.h"
2626
#elif !defined(__d3d11_h__) && !defined(__d3d11_x_h__)
@@ -76,7 +76,7 @@ namespace ATG
7676

7777
~Help();
7878

79-
#if defined(__d3d12_h__) || defined(__d3d12_x_h__)
79+
#if defined(__d3d12_h__) || defined(__d3d12_x_h__) || defined(__XBOX_D3D12_X__)
8080
void Render(ID3D12GraphicsCommandList* commandList);
8181

8282
void RestoreDevice(ID3D12Device* device, DirectX::ResourceUploadBatch& uploadBatch, const DirectX::RenderTargetState& rtState);
@@ -98,7 +98,7 @@ namespace ATG
9898
std::unique_ptr<DirectX::BasicEffect> m_lineEffect;
9999
std::unique_ptr<DirectX::SpriteFont> m_spriteFonts[3];
100100

101-
#if defined(__d3d12_h__) || defined(__d3d12_x_h__)
101+
#if defined(__d3d12_h__) || defined(__d3d12_x_h__) || defined(__XBOX_D3D12_X__)
102102
std::unique_ptr<DirectX::DescriptorHeap> m_descriptorHeap;
103103

104104
Microsoft::WRL::ComPtr<ID3D12Resource> m_circleTex;

0 commit comments

Comments
 (0)