2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-10 17:47:42 +00:00

CScriptMazeNode: Make use of std::array where applicable

Same behavior, stronger typing.
This commit is contained in:
Lioncash
2020-04-12 15:23:26 -04:00
parent c84f430852
commit 175502cb0d
2 changed files with 8 additions and 6 deletions

View File

@@ -8,7 +8,7 @@
namespace urde {
atUint32 CScriptMazeNode::sMazeSeeds[300] = {0};
std::array<u32, 300> CScriptMazeNode::sMazeSeeds{};
CScriptMazeNode::CScriptMazeNode(TUniqueId uid, std::string_view name, const CEntityInfo& info,
const zeus::CTransform& xf, bool active, s32 w1, s32 w2, s32 w3,
@@ -29,10 +29,11 @@ void CScriptMazeNode::Accept(IVisitor& visitor) { visitor.Visit(this); }
void CScriptMazeNode::LoadMazeSeeds() {
const SObjectTag* tag = g_ResFactory->GetResourceIdByName("DUMB_MazeSeeds");
u32 resSize = g_ResFactory->ResourceSize(*tag);
std::unique_ptr<u8[]> buf = g_ResFactory->LoadResourceSync(*tag);
const u32 resSize = g_ResFactory->ResourceSize(*tag);
const std::unique_ptr<u8[]> buf = g_ResFactory->LoadResourceSync(*tag);
CMemoryInStream in(buf.get(), resSize);
for (u32 i = 0; i < 300; ++i)
sMazeSeeds[i] = in.readUint32Big();
for (auto& seed : sMazeSeeds) {
seed = in.readUint32Big();
}
}
} // namespace urde