|
1 | 1 | //-------------------------------------------------------------------------------------- |
2 | 2 | // File: DebugDraw.cpp |
3 | 3 | // |
4 | | -// Copyright (c) Microsoft Corporation. All rights reserved. |
| 4 | +// Copyright (c) Microsoft Corporation. |
5 | 5 | // Licensed under the MIT License. |
6 | 6 | //------------------------------------------------------------------------------------- |
7 | 7 |
|
8 | 8 | #include "pch.h" |
9 | 9 | #include "DebugDraw.h" |
10 | 10 |
|
| 11 | +#include <algorithm> |
| 12 | + |
11 | 13 | using namespace DirectX; |
12 | 14 |
|
13 | 15 | namespace |
@@ -52,7 +54,7 @@ namespace |
52 | 54 | XMStoreFloat4(&verts[i].color, color); |
53 | 55 | } |
54 | 56 |
|
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); |
56 | 58 | } |
57 | 59 | } |
58 | 60 |
|
@@ -132,12 +134,12 @@ void XM_CALLCONV DX::Draw(PrimitiveBatch<VertexPositionColor>* batch, |
132 | 134 | verts[22].position = corners[7]; |
133 | 135 | verts[23].position = corners[4]; |
134 | 136 |
|
135 | | - for (size_t j = 0; j < _countof(verts); ++j) |
| 137 | + for (size_t j = 0; j < std::size(verts); ++j) |
136 | 138 | { |
137 | 139 | XMStoreFloat4(&verts[j].color, color); |
138 | 140 | } |
139 | 141 |
|
140 | | - batch->Draw(D3D_PRIMITIVE_TOPOLOGY_LINELIST, verts, _countof(verts)); |
| 142 | + batch->Draw(D3D_PRIMITIVE_TOPOLOGY_LINELIST, verts, static_cast<UINT>(std::size(verts))); |
141 | 143 | } |
142 | 144 |
|
143 | 145 | void XM_CALLCONV DX::DrawGrid(PrimitiveBatch<VertexPositionColor>* batch, |
|
0 commit comments