From eba3270c145d143975d9e93196db2037e9043faa Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 12 Apr 2020 10:55:22 -0400 Subject: [PATCH] CMFGame: Make use of std::array where applicable --- Runtime/MP1/CMFGame.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Runtime/MP1/CMFGame.cpp b/Runtime/MP1/CMFGame.cpp index 1691b80f7..81d422198 100644 --- a/Runtime/MP1/CMFGame.cpp +++ b/Runtime/MP1/CMFGame.cpp @@ -1,5 +1,7 @@ #include "Runtime/MP1/CMFGame.hpp" +#include + #include "Runtime/CArchitectureQueue.hpp" #include "Runtime/MP1/CSamusHud.hpp" #include "Runtime/MP1/MP1.hpp" @@ -286,16 +288,18 @@ CMFGameLoader::CMFGameLoader() CMFGameLoader::~CMFGameLoader() = default; -static const char* LoadDepPAKs[] = {"TestAnim", "SamusGun", "SamGunFx", nullptr}; - void CMFGameLoader::MakeLoadDependencyList() { + static constexpr std::array loadDepPAKs{"TestAnim", "SamusGun", "SamGunFx"}; + std::vector tags; - for (int i = 0; LoadDepPAKs[i]; ++i) - g_ResFactory->GetTagListForFile(LoadDepPAKs[i], tags); + for (const auto pak : loadDepPAKs) { + g_ResFactory->GetTagListForFile(pak, tags); + } x1c_loadList.reserve(tags.size()); - for (const SObjectTag& tag : tags) + for (const SObjectTag& tag : tags) { x1c_loadList.push_back(g_SimplePool->GetObj(tag)); + } } CIOWin::EMessageReturn CMFGameLoader::OnMessage(const CArchitectureMessage& msg, CArchitectureQueue& queue) {