mirror of https://github.com/AxioDL/metaforce.git
Cleaner SGameFileSlot save blob initializer
This commit is contained in:
parent
9639ac75cc
commit
c92223301c
|
@ -103,6 +103,12 @@ CMemoryCardDriver::SGameFileSlot::SGameFileSlot()
|
||||||
InitializeFromGameState();
|
InitializeFromGameState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CMemoryCardDriver::SGameFileSlot::SGameFileSlot(CMemoryInStream& in)
|
||||||
|
{
|
||||||
|
in.readBytesToBuf(x0_saveBuffer, 940);
|
||||||
|
x944_fileInfo = CGameState::LoadGameFileState(x0_saveBuffer);
|
||||||
|
}
|
||||||
|
|
||||||
void CMemoryCardDriver::SGameFileSlot::InitializeFromGameState()
|
void CMemoryCardDriver::SGameFileSlot::InitializeFromGameState()
|
||||||
{
|
{
|
||||||
CBitStreamWriter w(x0_saveBuffer, 940);
|
CBitStreamWriter w(x0_saveBuffer, 940);
|
||||||
|
@ -202,10 +208,7 @@ CMemoryCardDriver::SSaveHeader CMemoryCardDriver::LoadSaveHeader(CMemoryInStream
|
||||||
|
|
||||||
std::unique_ptr<CMemoryCardDriver::SGameFileSlot> CMemoryCardDriver::LoadSaveFile(CMemoryInStream& in)
|
std::unique_ptr<CMemoryCardDriver::SGameFileSlot> CMemoryCardDriver::LoadSaveFile(CMemoryInStream& in)
|
||||||
{
|
{
|
||||||
auto ret = std::make_unique<CMemoryCardDriver::SGameFileSlot>();
|
return std::make_unique<CMemoryCardDriver::SGameFileSlot>(in);
|
||||||
in.readBytesToBuf(ret->x0_saveBuffer, 940);
|
|
||||||
ret->x944_fileInfo = CGameState::LoadGameFileState(ret->x0_saveBuffer);
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMemoryCardDriver::ReadFinished()
|
void CMemoryCardDriver::ReadFinished()
|
||||||
|
|
|
@ -91,6 +91,7 @@ private:
|
||||||
u8 x0_saveBuffer[940] = {};
|
u8 x0_saveBuffer[940] = {};
|
||||||
CGameState::GameFileStateInfo x944_fileInfo;
|
CGameState::GameFileStateInfo x944_fileInfo;
|
||||||
SGameFileSlot();
|
SGameFileSlot();
|
||||||
|
SGameFileSlot(CMemoryInStream& in);
|
||||||
void InitializeFromGameState();
|
void InitializeFromGameState();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue