Skip to content

Commit 7eabfa1

Browse files
committed
Replaced _min and _max with std::min and std::max
1 parent afa9869 commit 7eabfa1

Some content is hidden

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

43 files changed

+126
-126
lines changed

src/Layers/xrRender/r__dsgraph_render_lods.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ void D3DXRenderBase::r_dsgraph_render_lods(bool _setup_zb, bool _clear)
3939

4040
for (u32 i = 0; i < lstLODs.size(); i++)
4141
{
42-
const u32 iBatchSize = _min(lstLODs.size() - i, uiImpostersFit);
42+
const u32 iBatchSize = std::min(lstLODs.size() - i, uiImpostersFit);
4343
int cur_count = 0;
4444
u32 vOffset;
4545
FLOD::_hw* V =

src/Layers/xrRenderDX10/StateManager/dx10ShaderResourceStateCache.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ void dx10ShaderResourceStateCache::SetPSResource(u32 uiSlot, ID3DShaderResourceV
102102
m_PSViews[uiSlot] = pRes;
103103
if (m_bUpdatePSViews)
104104
{
105-
m_uiMinPSView = _min(m_uiMinPSView, uiSlot);
106-
m_uiMaxPSView = _max(m_uiMaxPSView, uiSlot);
105+
m_uiMinPSView = std::min(m_uiMinPSView, uiSlot);
106+
m_uiMaxPSView = std::max(m_uiMaxPSView, uiSlot);
107107
}
108108
else
109109
{
@@ -123,8 +123,8 @@ void dx10ShaderResourceStateCache::SetGSResource(u32 uiSlot, ID3DShaderResourceV
123123
m_GSViews[uiSlot] = pRes;
124124
if (m_bUpdateGSViews)
125125
{
126-
m_uiMinGSView = _min(m_uiMinGSView, uiSlot);
127-
m_uiMaxGSView = _max(m_uiMaxGSView, uiSlot);
126+
m_uiMinGSView = std::min(m_uiMinGSView, uiSlot);
127+
m_uiMaxGSView = std::max(m_uiMaxGSView, uiSlot);
128128
}
129129
else
130130
{
@@ -144,8 +144,8 @@ void dx10ShaderResourceStateCache::SetVSResource(u32 uiSlot, ID3DShaderResourceV
144144
m_VSViews[uiSlot] = pRes;
145145
if (m_bUpdateVSViews)
146146
{
147-
m_uiMinVSView = _min(m_uiMinVSView, uiSlot);
148-
m_uiMaxVSView = _max(m_uiMaxVSView, uiSlot);
147+
m_uiMinVSView = std::min(m_uiMinVSView, uiSlot);
148+
m_uiMaxVSView = std::max(m_uiMaxVSView, uiSlot);
149149
}
150150
else
151151
{

src/Layers/xrRenderPC_R1/LightShadows.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ void CLightShadows::calculate()
236236
float p_near = p_dist - p_R - eps;
237237
// float p_nearR = C.C.distance_to(L.source->position) + p_R*0.85f + eps;
238238
// p_nearR = p_near;
239-
float p_far = _min(Lrange, _max(p_dist + S_fade, p_dist + p_R));
239+
float p_far = std::min(Lrange, std::max(p_dist + S_fade, p_dist + p_R));
240240
if (p_near < eps)
241241
continue;
242242
if (p_far < (p_near + eps))

src/Layers/xrRenderPC_R2/Light_Render_Direct_ComputeXFS.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ void CLight_Compute_XFORM_and_VIS::compute_xf_spot(light* L)
8888

8989
// _min(L->cone + deg2rad(4.5f), PI*0.98f) - Here, it is needed to enlarge the shadow map frustum to include also
9090
// displaced pixels and the pixels neighbor to the examining one.
91-
L->X.S.project.build_projection(_min(L->cone + deg2rad(5.f), PI * 0.98f), 1.f, SMAP_near_plane, L->range + EPS_S);
91+
L->X.S.project.build_projection(std::min(L->cone + deg2rad(5.f), PI * 0.98f), 1.f, SMAP_near_plane, L->range + EPS_S);
9292

9393
L->X.S.combine.mul(L->X.S.project, L->X.S.view);
9494
}

src/Layers/xrRenderPC_R2/r2_R_sun.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ struct BoundingBox
7171
void Centroid(D3DXVECTOR3* vec) const { *vec = 0.5f * (minPt + maxPt); }
7272
void Merge(const D3DXVECTOR3* vec)
7373
{
74-
minPt.x = _min(minPt.x, vec->x);
75-
minPt.y = _min(minPt.y, vec->y);
76-
minPt.z = _min(minPt.z, vec->z);
77-
maxPt.x = _max(maxPt.x, vec->x);
78-
maxPt.y = _max(maxPt.y, vec->y);
79-
maxPt.z = _max(maxPt.z, vec->z);
74+
minPt.x = std::min(minPt.x, vec->x);
75+
minPt.y = std::min(minPt.y, vec->y);
76+
minPt.z = std::min(minPt.z, vec->z);
77+
maxPt.x = std::max(maxPt.x, vec->x);
78+
maxPt.y = std::max(maxPt.y, vec->y);
79+
maxPt.z = std::max(maxPt.z, vec->z);
8080
}
8181
D3DXVECTOR3 Point(int i) const
8282
{
@@ -286,7 +286,7 @@ class FixedConvexVolume
286286
Fvector tmp_point = view_frustum_rays[i].P;
287287

288288
tmp_dist = light_cuboid_polys[align_planes[p]].plane.classify(tmp_point);
289-
min_dist = _min(tmp_dist, min_dist);
289+
min_dist = std::min(tmp_dist, min_dist);
290290
}
291291

292292
Fvector shift = light_cuboid_polys[align_planes[p]].plane.n;
@@ -747,8 +747,8 @@ D3DXVECTOR2 BuildTSMProjectionMatrix_caster_depth_bounds(D3DXMATRIX& lightSpaceB
747747
{
748748
s_casters[c].getpoint(e, pt);
749749
pt = wform(minmax_xform, pt);
750-
min_z = _min(min_z, pt.z);
751-
max_z = _max(max_z, pt.z);
750+
min_z = std::min(min_z, pt.z);
751+
max_z = std::max(max_z, pt.z);
752752
}
753753
}
754754
return D3DXVECTOR2(min_z, max_z);

src/Layers/xrRenderPC_R3/Light_Render_Direct_ComputeXFS.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,6 @@ void CLight_Compute_XFORM_and_VIS::compute_xf_spot(light* L)
8888

8989
// _min(L->cone + deg2rad(4.5f), PI*0.98f) - Here, it is needed to enlarge the shadow map frustum to include also
9090
// displaced pixels and the pixels neighbor to the examining one.
91-
L->X.S.project.build_projection(_min(L->cone + deg2rad(5.f), PI * 0.98f), 1.f, SMAP_near_plane, L->range + EPS_S);
91+
L->X.S.project.build_projection(std::min(L->cone + deg2rad(5.f), PI * 0.98f), 1.f, SMAP_near_plane, L->range + EPS_S);
9292
L->X.S.combine.mul(L->X.S.project, L->X.S.view);
9393
}

src/Layers/xrRenderPC_R3/r2_R_sun.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ struct BoundingBox
7272
void Centroid(D3DXVECTOR3* vec) const { *vec = 0.5f * (minPt + maxPt); }
7373
void Merge(const D3DXVECTOR3* vec)
7474
{
75-
minPt.x = _min(minPt.x, vec->x);
76-
minPt.y = _min(minPt.y, vec->y);
77-
minPt.z = _min(minPt.z, vec->z);
78-
maxPt.x = _max(maxPt.x, vec->x);
79-
maxPt.y = _max(maxPt.y, vec->y);
80-
maxPt.z = _max(maxPt.z, vec->z);
75+
minPt.x = std::min(minPt.x, vec->x);
76+
minPt.y = std::min(minPt.y, vec->y);
77+
minPt.z = std::min(minPt.z, vec->z);
78+
maxPt.x = std::max(maxPt.x, vec->x);
79+
maxPt.y = std::max(maxPt.y, vec->y);
80+
maxPt.z = std::max(maxPt.z, vec->z);
8181
}
8282
D3DXVECTOR3 Point(int i) const
8383
{
@@ -304,8 +304,8 @@ D3DXVECTOR2 BuildTSMProjectionMatrix_caster_depth_bounds(D3DXMATRIX& lightSpaceB
304304
{
305305
s_casters[c].getpoint(e, pt);
306306
pt = wform(minmax_xform, pt);
307-
min_z = _min(min_z, pt.z);
308-
max_z = _max(max_z, pt.z);
307+
min_z = std::min(min_z, pt.z);
308+
max_z = std::max(max_z, pt.z);
309309
}
310310
}
311311
return D3DXVECTOR2(min_z, max_z);

src/Layers/xrRenderPC_R3/r3_R_sun_support.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class FixedConvexVolume
9696
Fvector tmp_point = view_frustum_rays[i].P;
9797

9898
tmp_dist = light_cuboid_polys[align_planes[p]].plane.classify(tmp_point);
99-
min_dist = _min(tmp_dist, min_dist);
99+
min_dist = std::min(tmp_dist, min_dist);
100100
}
101101

102102
Fvector shift = light_cuboid_polys[align_planes[p]].plane.n;

src/Layers/xrRenderPC_R4/Light_Render_Direct_ComputeXFS.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,6 @@ void CLight_Compute_XFORM_and_VIS::compute_xf_spot(light* L)
8888

8989
// _min(L->cone + deg2rad(4.5f), PI*0.98f) - Here, it is needed to enlarge the shadow map frustum to include also
9090
// displaced pixels and the pixels neighbor to the examining one.
91-
L->X.S.project.build_projection(_min(L->cone + deg2rad(5.f), PI * 0.98f), 1.f, SMAP_near_plane, L->range + EPS_S);
91+
L->X.S.project.build_projection(std::min(L->cone + deg2rad(5.f), PI * 0.98f), 1.f, SMAP_near_plane, L->range + EPS_S);
9292
L->X.S.combine.mul(L->X.S.project, L->X.S.view);
9393
}

src/Layers/xrRenderPC_R4/r2_R_sun.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@ struct BoundingBox
7373
void Centroid(D3DXVECTOR3* vec) const { *vec = 0.5f * (minPt + maxPt); }
7474
void Merge(const D3DXVECTOR3* vec)
7575
{
76-
minPt.x = _min(minPt.x, vec->x);
77-
minPt.y = _min(minPt.y, vec->y);
78-
minPt.z = _min(minPt.z, vec->z);
79-
maxPt.x = _max(maxPt.x, vec->x);
80-
maxPt.y = _max(maxPt.y, vec->y);
81-
maxPt.z = _max(maxPt.z, vec->z);
76+
minPt.x = std::min(minPt.x, vec->x);
77+
minPt.y = std::min(minPt.y, vec->y);
78+
minPt.z = std::min(minPt.z, vec->z);
79+
maxPt.x = std::max(maxPt.x, vec->x);
80+
maxPt.y = std::max(maxPt.y, vec->y);
81+
maxPt.z = std::max(maxPt.z, vec->z);
8282
}
8383
D3DXVECTOR3 Point(int i) const
8484
{
@@ -305,8 +305,8 @@ D3DXVECTOR2 BuildTSMProjectionMatrix_caster_depth_bounds(D3DXMATRIX& lightSpaceB
305305
{
306306
s_casters[c].getpoint(e, pt);
307307
pt = wform(minmax_xform, pt);
308-
min_z = _min(min_z, pt.z);
309-
max_z = _max(max_z, pt.z);
308+
min_z = std::min(min_z, pt.z);
309+
max_z = std::max(max_z, pt.z);
310310
}
311311
}
312312
return D3DXVECTOR2(min_z, max_z);

0 commit comments

Comments
 (0)