Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Global Declarations from Frame #4089

Merged
merged 1 commit into from
Aug 4, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 2 additions & 4 deletions Source/Core/DolphinWX/Frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@
#include "VideoCommon/VertexShaderManager.h"
#include "VideoCommon/VideoConfig.h"

int g_saveSlot = 1;

#if defined(HAVE_X11) && HAVE_X11
// X11Utils nastiness that's only used here
namespace X11Utils
Expand Down Expand Up @@ -1528,11 +1526,11 @@ void CFrame::ParseHotkeys()
}
if (IsHotkey(HK_SAVE_STATE_SLOT_SELECTED))
{
State::Save(g_saveSlot);
State::Save(m_saveSlot);
}
if (IsHotkey(HK_LOAD_STATE_SLOT_SELECTED))
{
State::Load(g_saveSlot);
State::Load(m_saveSlot);
}

if (IsHotkey(HK_TOGGLE_STEREO_SBS))
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/DolphinWX/Frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ class CFrame : public CRenderFrame
bool m_bGameLoading;
bool m_bClosing;
bool m_confirmStop;
int m_saveSlot = 1;

std::vector<std::string> drives;

Expand Down Expand Up @@ -347,4 +348,3 @@ void OnStoppedCallback();
void GCTASManipFunction(GCPadStatus* PadStatus, int controllerID);
void WiiTASManipFunction(u8* data, WiimoteEmu::ReportFeatures rptf, int controllerID, int ext,
const wiimote_key key);
extern int g_saveSlot;
10 changes: 5 additions & 5 deletions Source/Core/DolphinWX/FrameTools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1673,25 +1673,25 @@ void CFrame::OnFrameSkip(wxCommandEvent& event)

void CFrame::OnSelectSlot(wxCommandEvent& event)
{
g_saveSlot = event.GetId() - IDM_SELECT_SLOT_1 + 1;
Core::DisplayMessage(StringFromFormat("Selected slot %d - %s", g_saveSlot,
State::GetInfoStringOfSlot(g_saveSlot).c_str()),
m_saveSlot = event.GetId() - IDM_SELECT_SLOT_1 + 1;
Core::DisplayMessage(StringFromFormat("Selected slot %d - %s", m_saveSlot,
State::GetInfoStringOfSlot(m_saveSlot).c_str()),
2500);
}

void CFrame::OnLoadCurrentSlot(wxCommandEvent& event)
{
if (Core::IsRunningAndStarted())
{
State::Load(g_saveSlot);
State::Load(m_saveSlot);
}
}

void CFrame::OnSaveCurrentSlot(wxCommandEvent& event)
{
if (Core::IsRunningAndStarted())
{
State::Save(g_saveSlot);
State::Save(m_saveSlot);
}
}

Expand Down