From a9663669dc1037a04e37ae30efe18c0650547ac5 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 1 Jun 2019 07:55:09 -0400 Subject: Common/CommonFuncs: Remove now-unneccessary ArraySize function Since C++17, non-member std::size() is present in the standard library which also operates on regular C arrays. Given that, we can just replace usages of ArraySize with that where applicable. In many cases, we can just change the actual C array ArraySize() was called on into a std::array and just use its .size() member function instead. In some other cases, we can collapse the loops they were used in, into a ranged-for loop, eliminating the need for en explicit bounds query. --- Source/Core/VideoCommon/PixelShaderManager.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Source/Core/VideoCommon/PixelShaderManager.cpp') diff --git a/Source/Core/VideoCommon/PixelShaderManager.cpp b/Source/Core/VideoCommon/PixelShaderManager.cpp index 50b58b3c9e..5afa56cd27 100644 --- a/Source/Core/VideoCommon/PixelShaderManager.cpp +++ b/Source/Core/VideoCommon/PixelShaderManager.cpp @@ -2,12 +2,12 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. -#include -#include +#include "VideoCommon/PixelShaderManager.h" + +#include #include "Common/ChunkFile.h" #include "Common/CommonTypes.h" -#include "VideoCommon/PixelShaderManager.h" #include "VideoCommon/RenderBase.h" #include "VideoCommon/VideoCommon.h" #include "VideoCommon/VideoConfig.h" @@ -114,7 +114,7 @@ void PixelShaderManager::SetConstants() constants.fogf[3] = static_cast(g_renderer->EFBToScaledX(static_cast(2.0f * xfmem.viewport.wd))); - for (size_t i = 0, vec_index = 0; i < ArraySize(bpmem.fogRange.K); i++) + for (size_t i = 0, vec_index = 0; i < std::size(bpmem.fogRange.K); i++) { constexpr float scale = 4.0f; constants.fogrange[vec_index / 4][vec_index % 4] = bpmem.fogRange.K[i].GetValue(0) * scale; -- cgit v1.2.3