mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Use only section-based ini reading.
This commit is contained in:
@ -127,25 +127,29 @@ CMemoryWindow::CMemoryWindow(wxWindow* parent, wxWindowID id,
|
||||
sizerBig->Fit(this);
|
||||
}
|
||||
|
||||
void CMemoryWindow::Save(IniFile& _IniFile) const
|
||||
void CMemoryWindow::Save(IniFile& ini) const
|
||||
{
|
||||
// Prevent these bad values that can happen after a crash or hanging
|
||||
if (GetPosition().x != -32000 && GetPosition().y != -32000)
|
||||
{
|
||||
_IniFile.Set("MemoryWindow", "x", GetPosition().x);
|
||||
_IniFile.Set("MemoryWindow", "y", GetPosition().y);
|
||||
_IniFile.Set("MemoryWindow", "w", GetSize().GetWidth());
|
||||
_IniFile.Set("MemoryWindow", "h", GetSize().GetHeight());
|
||||
IniFile::Section* mem_window = ini.GetOrCreateSection("MemoryWindow");
|
||||
mem_window->Set("x", GetPosition().x);
|
||||
mem_window->Set("y", GetPosition().y);
|
||||
mem_window->Set("w", GetSize().GetWidth());
|
||||
mem_window->Set("h", GetSize().GetHeight());
|
||||
}
|
||||
}
|
||||
|
||||
void CMemoryWindow::Load(IniFile& _IniFile)
|
||||
void CMemoryWindow::Load(IniFile& ini)
|
||||
{
|
||||
int x, y, w, h;
|
||||
_IniFile.Get("MemoryWindow", "x", &x, GetPosition().x);
|
||||
_IniFile.Get("MemoryWindow", "y", &y, GetPosition().y);
|
||||
_IniFile.Get("MemoryWindow", "w", &w, GetSize().GetWidth());
|
||||
_IniFile.Get("MemoryWindow", "h", &h, GetSize().GetHeight());
|
||||
|
||||
IniFile::Section* mem_window = ini.GetOrCreateSection("MemoryWindow");
|
||||
mem_window->Get("x", &x, GetPosition().x);
|
||||
mem_window->Get("y", &y, GetPosition().y);
|
||||
mem_window->Get("w", &w, GetSize().GetWidth());
|
||||
mem_window->Get("h", &h, GetSize().GetHeight());
|
||||
|
||||
SetSize(x, y, w, h);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user