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();
|
||||
}
|
||||
|
||||
CMemoryCardDriver::SGameFileSlot::SGameFileSlot(CMemoryInStream& in)
|
||||
{
|
||||
in.readBytesToBuf(x0_saveBuffer, 940);
|
||||
x944_fileInfo = CGameState::LoadGameFileState(x0_saveBuffer);
|
||||
}
|
||||
|
||||
void CMemoryCardDriver::SGameFileSlot::InitializeFromGameState()
|
||||
{
|
||||
CBitStreamWriter w(x0_saveBuffer, 940);
|
||||
|
@ -202,10 +208,7 @@ CMemoryCardDriver::SSaveHeader CMemoryCardDriver::LoadSaveHeader(CMemoryInStream
|
|||
|
||||
std::unique_ptr<CMemoryCardDriver::SGameFileSlot> CMemoryCardDriver::LoadSaveFile(CMemoryInStream& in)
|
||||
{
|
||||
auto ret = std::make_unique<CMemoryCardDriver::SGameFileSlot>();
|
||||
in.readBytesToBuf(ret->x0_saveBuffer, 940);
|
||||
ret->x944_fileInfo = CGameState::LoadGameFileState(ret->x0_saveBuffer);
|
||||
return ret;
|
||||
return std::make_unique<CMemoryCardDriver::SGameFileSlot>(in);
|
||||
}
|
||||
|
||||
void CMemoryCardDriver::ReadFinished()
|
||||
|
|
|
@ -91,6 +91,7 @@ private:
|
|||
u8 x0_saveBuffer[940] = {};
|
||||
CGameState::GameFileStateInfo x944_fileInfo;
|
||||
SGameFileSlot();
|
||||
SGameFileSlot(CMemoryInStream& in);
|
||||
void InitializeFromGameState();
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue