Eliminated memory leaks of the save state code and put it in a namespace. It is prettier than before, but it could be better (less global usage). Other minor stuff.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7366 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Jordan Woyak
2011-03-17 10:17:45 +00:00
parent e4141c331e
commit 78d9f927e1
14 changed files with 264 additions and 392 deletions

View File

@ -885,20 +885,20 @@ void CFrame::OnKeyDown(wxKeyEvent& event)
{
int slot_number = event.GetKeyCode() - WXK_F1 + 1;
if (event.GetModifiers() == wxMOD_NONE)
State_Load(slot_number);
State::Load(slot_number);
else if (event.GetModifiers() == wxMOD_SHIFT)
State_Save(slot_number);
State::Save(slot_number);
else
event.Skip();
}*/
else if (event.GetKeyCode() == WXK_F11 && event.GetModifiers() == wxMOD_NONE)
State_LoadLastSaved();
State::LoadLastSaved();
else if (event.GetKeyCode() == WXK_F12)
{
if (event.GetModifiers() == wxMOD_NONE)
State_UndoSaveState();
State::UndoSaveState();
else if (event.GetModifiers() == wxMOD_SHIFT)
State_UndoLoadState();
State::UndoLoadState();
else
event.Skip();
}

View File

@ -1401,8 +1401,8 @@ void CFrame::OnLoadStateFromFile(wxCommandEvent& WXUNUSED (event))
wxFD_OPEN | wxFD_PREVIEW | wxFD_FILE_MUST_EXIST,
this);
if(!path.IsEmpty())
State_LoadAs((const char*)path.mb_str());
if (!path.IsEmpty())
State::LoadAs((const char*)path.mb_str());
}
void CFrame::OnSaveStateToFile(wxCommandEvent& WXUNUSED (event))
@ -1415,23 +1415,23 @@ void CFrame::OnSaveStateToFile(wxCommandEvent& WXUNUSED (event))
wxFD_SAVE,
this);
if(! path.IsEmpty())
State_SaveAs((const char*)path.mb_str());
if (!path.IsEmpty())
State::SaveAs((const char*)path.mb_str());
}
void CFrame::OnLoadLastState(wxCommandEvent& WXUNUSED (event))
{
State_LoadLastSaved();
State::LoadLastSaved();
}
void CFrame::OnUndoLoadState(wxCommandEvent& WXUNUSED (event))
{
State_UndoLoadState();
State::UndoLoadState();
}
void CFrame::OnUndoSaveState(wxCommandEvent& WXUNUSED (event))
{
State_UndoSaveState();
State::UndoSaveState();
}
@ -1439,14 +1439,14 @@ void CFrame::OnLoadState(wxCommandEvent& event)
{
int id = event.GetId();
int slot = id - IDM_LOADSLOT1 + 1;
State_Load(slot);
State::Load(slot);
}
void CFrame::OnSaveState(wxCommandEvent& event)
{
int id = event.GetId();
int slot = id - IDM_SAVESLOT1 + 1;
State_Save(slot);
State::Save(slot);
}
void CFrame::OnFrameSkip(wxCommandEvent& event)

View File

@ -214,20 +214,20 @@ void X11_MainLoop()
{
int slot_number = key - XK_F1 + 1;
if (event.xkey.state & ShiftMask)
State_Save(slot_number);
State::Save(slot_number);
else
State_Load(slot_number);
State::Load(slot_number);
}
else if (key == XK_F9)
Core::SaveScreenShot();
else if (key == XK_F11)
State_LoadLastSaved();
State::LoadLastSaved();
else if (key == XK_F12)
{
if (event.xkey.state & ShiftMask)
State_UndoLoadState();
State::UndoLoadState();
else
State_UndoSaveState();
State::UndoSaveState();
}
break;
case FocusIn:

View File

@ -270,7 +270,6 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con
// - EFB
// EFB scale
wxBoxSizer* const efb_scale_szr = new wxBoxSizer(wxHORIZONTAL);
// TODO: give this a label (?)
const wxString efbscale_choices[] = { _("Fractional"), _("Integral [recommended]"),
wxT("1x"), wxT("2x"), wxT("3x"), wxT("0.75x"), wxT("0.5x"), wxT("0.375x") };