mirror of https://github.com/AxioDL/metaforce.git
CGameState: Make use of std::array where applicable
This commit is contained in:
parent
24fe7ec499
commit
45ea19040d
|
@ -143,8 +143,9 @@ CGameState::CGameState(CBitStreamReader& stream, u32 saveIdx) : x20c_saveFileIdx
|
|||
x9c_transManager = std::make_shared<CWorldTransManager>();
|
||||
x228_25_initPowerupsAtFirstSpawn = true;
|
||||
|
||||
for (u32 i = 0; i < 128; i++)
|
||||
x0_[i] = stream.ReadEncoded(8);
|
||||
for (bool& value : x0_) {
|
||||
value = stream.ReadEncoded(8) != 0;
|
||||
}
|
||||
stream.ReadEncoded(32);
|
||||
|
||||
x228_24_hardMode = stream.ReadEncoded(1);
|
||||
|
@ -206,8 +207,9 @@ void CGameState::WriteBackupBuf() {
|
|||
}
|
||||
|
||||
void CGameState::PutTo(CBitStreamWriter& writer) {
|
||||
for (u32 i = 0; i < 128; i++)
|
||||
writer.WriteEncoded(x0_[i], 8);
|
||||
for (const bool value : x0_) {
|
||||
writer.WriteEncoded(u32(value), 8);
|
||||
}
|
||||
|
||||
writer.WriteEncoded(CBasics::ToWiiTime(std::chrono::system_clock::now()) / CBasics::TICKS_PER_SECOND, 32);
|
||||
writer.WriteEncoded(x228_24_hardMode, 1);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
|
@ -67,7 +68,7 @@ public:
|
|||
class CGameState {
|
||||
friend class CStateManager;
|
||||
|
||||
bool x0_[128] = {};
|
||||
std::array<bool, 128> x0_{};
|
||||
u32 x80_;
|
||||
CAssetId x84_mlvlId;
|
||||
std::vector<CWorldState> x88_worldStates;
|
||||
|
|
Loading…
Reference in New Issue