2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-08-08 08:19:07 +00:00

CMFGame: Make use of std::array where applicable

This commit is contained in:
Lioncash 2020-04-12 10:55:22 -04:00
parent c296f0ab8f
commit eba3270c14

View File

@ -1,5 +1,7 @@
#include "Runtime/MP1/CMFGame.hpp" #include "Runtime/MP1/CMFGame.hpp"
#include <array>
#include "Runtime/CArchitectureQueue.hpp" #include "Runtime/CArchitectureQueue.hpp"
#include "Runtime/MP1/CSamusHud.hpp" #include "Runtime/MP1/CSamusHud.hpp"
#include "Runtime/MP1/MP1.hpp" #include "Runtime/MP1/MP1.hpp"
@ -286,16 +288,18 @@ CMFGameLoader::CMFGameLoader()
CMFGameLoader::~CMFGameLoader() = default; CMFGameLoader::~CMFGameLoader() = default;
static const char* LoadDepPAKs[] = {"TestAnim", "SamusGun", "SamGunFx", nullptr};
void CMFGameLoader::MakeLoadDependencyList() { void CMFGameLoader::MakeLoadDependencyList() {
static constexpr std::array loadDepPAKs{"TestAnim", "SamusGun", "SamGunFx"};
std::vector<SObjectTag> tags; std::vector<SObjectTag> tags;
for (int i = 0; LoadDepPAKs[i]; ++i) for (const auto pak : loadDepPAKs) {
g_ResFactory->GetTagListForFile(LoadDepPAKs[i], tags); g_ResFactory->GetTagListForFile(pak, tags);
}
x1c_loadList.reserve(tags.size()); x1c_loadList.reserve(tags.size());
for (const SObjectTag& tag : tags) for (const SObjectTag& tag : tags) {
x1c_loadList.push_back(g_SimplePool->GetObj(tag)); x1c_loadList.push_back(g_SimplePool->GetObj(tag));
}
} }
CIOWin::EMessageReturn CMFGameLoader::OnMessage(const CArchitectureMessage& msg, CArchitectureQueue& queue) { CIOWin::EMessageReturn CMFGameLoader::OnMessage(const CArchitectureMessage& msg, CArchitectureQueue& queue) {