Skip to content

Commit 64b4fef

Browse files
author
nitrocaster
committed
Replace min/max -> std::min/max.
1 parent b1b5611 commit 64b4fef

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

src/Layers/xrRenderPC_R2/r2_R_sun.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ void CRender::render_sun ()
722722
// calculate view-frustum bounds in world space
723723
Fmatrix ex_project, ex_full, ex_full_inverse;
724724
{
725-
float _far_ = min(OLES_SUN_LIMIT_27_01_07, g_pGamePersistent->Environment().CurrentEnv->far_plane);
725+
float _far_ = std::min(OLES_SUN_LIMIT_27_01_07, g_pGamePersistent->Environment().CurrentEnv->far_plane);
726726
//ex_project.build_projection (deg2rad(Device.fFOV/* *Device.fASPECT*/),Device.fASPECT,ps_r2_sun_near,_far_);
727727
ex_project.build_projection (deg2rad(Device.fFOV/* *Device.fASPECT*/),Device.fASPECT,VIEWPORT_NEAR,_far_);
728728
ex_full.mul (ex_project,Device.mView);
@@ -891,8 +891,8 @@ void CRender::render_sun ()
891891
// all shadow casters are in front of the near plane.
892892
D3DXVECTOR2 depthbounds = BuildTSMProjectionMatrix_caster_depth_bounds (lightSpaceBasis);
893893

894-
float min_z = min( depthbounds.x, frustumBox.minPt.z );
895-
float max_z = max( depthbounds.y, frustumBox.maxPt.z );
894+
float min_z = std::min( depthbounds.x, frustumBox.minPt.z );
895+
float max_z = std::max( depthbounds.y, frustumBox.maxPt.z );
896896

897897
if ( min_z <= 1.f ) //?
898898
{
@@ -950,8 +950,8 @@ void CRender::render_sun ()
950950

951951
BoundingBox frustumAABB2D( frustumPnts, sizeof(frustumPnts)/sizeof(D3DXVECTOR3) );
952952

953-
float x_scale = max( _abs(frustumAABB2D.maxPt.x), _abs(frustumAABB2D.minPt.x) );
954-
float y_scale = max( _abs(frustumAABB2D.maxPt.y), _abs(frustumAABB2D.minPt.y) );
953+
float x_scale = std::max( _abs(frustumAABB2D.maxPt.x), _abs(frustumAABB2D.minPt.x) );
954+
float y_scale = std::max( _abs(frustumAABB2D.maxPt.y), _abs(frustumAABB2D.minPt.y) );
955955
x_scale = 1.f/x_scale;
956956
y_scale = 1.f/y_scale;
957957

@@ -989,8 +989,8 @@ void CRender::render_sun ()
989989
float x_dist = tmp.x - projectionPtQ.x;
990990
if ( !(ALMOST_ZERO(tmp.y) || ALMOST_ZERO(x_dist)))
991991
{
992-
max_slope = max(max_slope, tmp.y/x_dist);
993-
min_slope = min(min_slope, tmp.y/x_dist);
992+
max_slope = std::max(max_slope, tmp.y/x_dist);
993+
min_slope = std::min(min_slope, tmp.y/x_dist);
994994
}
995995
}
996996

src/Layers/xrRenderPC_R3/r2_R_sun.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ void CRender::render_sun ()
307307
// calculate view-frustum bounds in world space
308308
Fmatrix ex_project, ex_full, ex_full_inverse;
309309
{
310-
float _far_ = min(OLES_SUN_LIMIT_27_01_07, g_pGamePersistent->Environment().CurrentEnv->far_plane);
310+
float _far_ = std::min(OLES_SUN_LIMIT_27_01_07, g_pGamePersistent->Environment().CurrentEnv->far_plane);
311311
//ex_project.build_projection (deg2rad(Device.fFOV/* *Device.fASPECT*/),Device.fASPECT,ps_r2_sun_near,_far_);
312312
ex_project.build_projection (deg2rad(Device.fFOV/* *Device.fASPECT*/),Device.fASPECT,VIEWPORT_NEAR,_far_);
313313
//VIEWPORT_NEAR
@@ -477,8 +477,8 @@ void CRender::render_sun ()
477477
// all shadow casters are in front of the near plane.
478478
D3DXVECTOR2 depthbounds = BuildTSMProjectionMatrix_caster_depth_bounds (lightSpaceBasis);
479479

480-
float min_z = min( depthbounds.x, frustumBox.minPt.z );
481-
float max_z = max( depthbounds.y, frustumBox.maxPt.z );
480+
float min_z = std::min( depthbounds.x, frustumBox.minPt.z );
481+
float max_z = std::max( depthbounds.y, frustumBox.maxPt.z );
482482

483483
if ( min_z <= 1.f ) //?
484484
{
@@ -536,8 +536,8 @@ void CRender::render_sun ()
536536

537537
BoundingBox frustumAABB2D( frustumPnts, sizeof(frustumPnts)/sizeof(D3DXVECTOR3) );
538538

539-
float x_scale = max( _abs(frustumAABB2D.maxPt.x), _abs(frustumAABB2D.minPt.x) );
540-
float y_scale = max( _abs(frustumAABB2D.maxPt.y), _abs(frustumAABB2D.minPt.y) );
539+
float x_scale = std::max( _abs(frustumAABB2D.maxPt.x), _abs(frustumAABB2D.minPt.x) );
540+
float y_scale = std::max( _abs(frustumAABB2D.maxPt.y), _abs(frustumAABB2D.minPt.y) );
541541
x_scale = 1.f/x_scale;
542542
y_scale = 1.f/y_scale;
543543

@@ -575,8 +575,8 @@ void CRender::render_sun ()
575575
float x_dist = tmp.x - projectionPtQ.x;
576576
if ( !(ALMOST_ZERO(tmp.y) || ALMOST_ZERO(x_dist)))
577577
{
578-
max_slope = max(max_slope, tmp.y/x_dist);
579-
min_slope = min(min_slope, tmp.y/x_dist);
578+
max_slope = std::max(max_slope, tmp.y/x_dist);
579+
min_slope = std::min(min_slope, tmp.y/x_dist);
580580
}
581581
}
582582

src/Layers/xrRenderPC_R4/r2_R_sun.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ void CRender::render_sun ()
308308
// calculate view-frustum bounds in world space
309309
Fmatrix ex_project, ex_full, ex_full_inverse;
310310
{
311-
float _far_ = min(OLES_SUN_LIMIT_27_01_07, g_pGamePersistent->Environment().CurrentEnv->far_plane);
311+
float _far_ = std::min(OLES_SUN_LIMIT_27_01_07, g_pGamePersistent->Environment().CurrentEnv->far_plane);
312312
//ex_project.build_projection (deg2rad(Device.fFOV/* *Device.fASPECT*/),Device.fASPECT,ps_r2_sun_near,_far_);
313313
ex_project.build_projection (deg2rad(Device.fFOV/* *Device.fASPECT*/),Device.fASPECT,VIEWPORT_NEAR,_far_);
314314
//VIEWPORT_NEAR
@@ -478,8 +478,8 @@ void CRender::render_sun ()
478478
// all shadow casters are in front of the near plane.
479479
D3DXVECTOR2 depthbounds = BuildTSMProjectionMatrix_caster_depth_bounds (lightSpaceBasis);
480480

481-
float min_z = min( depthbounds.x, frustumBox.minPt.z );
482-
float max_z = max( depthbounds.y, frustumBox.maxPt.z );
481+
float min_z = std::min( depthbounds.x, frustumBox.minPt.z );
482+
float max_z = std::max( depthbounds.y, frustumBox.maxPt.z );
483483

484484
if ( min_z <= 1.f ) //?
485485
{
@@ -537,8 +537,8 @@ void CRender::render_sun ()
537537

538538
BoundingBox frustumAABB2D( frustumPnts, sizeof(frustumPnts)/sizeof(D3DXVECTOR3) );
539539

540-
float x_scale = max( _abs(frustumAABB2D.maxPt.x), _abs(frustumAABB2D.minPt.x) );
541-
float y_scale = max( _abs(frustumAABB2D.maxPt.y), _abs(frustumAABB2D.minPt.y) );
540+
float x_scale = std::max( _abs(frustumAABB2D.maxPt.x), _abs(frustumAABB2D.minPt.x) );
541+
float y_scale = std::max( _abs(frustumAABB2D.maxPt.y), _abs(frustumAABB2D.minPt.y) );
542542
x_scale = 1.f/x_scale;
543543
y_scale = 1.f/y_scale;
544544

@@ -576,8 +576,8 @@ void CRender::render_sun ()
576576
float x_dist = tmp.x - projectionPtQ.x;
577577
if ( !(ALMOST_ZERO(tmp.y) || ALMOST_ZERO(x_dist)))
578578
{
579-
max_slope = max(max_slope, tmp.y/x_dist);
580-
min_slope = min(min_slope, tmp.y/x_dist);
579+
max_slope = std::max(max_slope, tmp.y/x_dist);
580+
min_slope = std::min(min_slope, tmp.y/x_dist);
581581
}
582582
}
583583

0 commit comments

Comments
 (0)