mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-26 15:49:50 -06:00
Merge branch 'master' into wii-network
Conflicts: Source/Core/Core/Core.vcxproj Source/Core/Core/Core.vcxproj.filters Source/Core/Core/Src/CoreParameter.cpp Source/Core/DolphinWX/Dolphin.vcxproj Source/Core/DolphinWX/Dolphin.vcxproj.filters
This commit is contained in:
@ -170,6 +170,7 @@ if(USE_UPNP)
|
||||
endif()
|
||||
|
||||
if(ANDROID)
|
||||
set(DOLPHIN_EXE main)
|
||||
add_library(${DOLPHIN_EXE} SHARED ${SRCS})
|
||||
target_link_libraries(${DOLPHIN_EXE}
|
||||
log
|
||||
@ -181,9 +182,12 @@ if(ANDROID)
|
||||
if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "mips")
|
||||
set (SO_TARGET "mips")
|
||||
endif()
|
||||
if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "^arm")
|
||||
if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "armv7-a")
|
||||
set (SO_TARGET "armeabi-v7a")
|
||||
endif()
|
||||
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "armv5te")
|
||||
set (SO_TARGET "armeabi")
|
||||
endif()
|
||||
if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "i686")
|
||||
set (SO_TARGET "x86")
|
||||
endif()
|
||||
@ -196,6 +200,9 @@ if(ANDROID)
|
||||
add_custom_command(TARGET ${DOLPHIN_EXE} POST_BUILD
|
||||
COMMAND cp ARGS ${CMAKE_SOURCE_DIR}/Data/Sys/GC/* ${CMAKE_SOURCE_DIR}/Source/Android/assets/
|
||||
)
|
||||
add_custom_command(TARGET ${DOLPHIN_EXE} POST_BUILD
|
||||
COMMAND cp ARGS ${CMAKE_SOURCE_DIR}/Data/Sys/Wii/* ${CMAKE_SOURCE_DIR}/Source/Android/assets/
|
||||
)
|
||||
else()
|
||||
add_executable(${DOLPHIN_EXE} ${SRCS})
|
||||
target_link_libraries(${DOLPHIN_EXE} ${LIBS} ${WXLIBS})
|
||||
|
@ -238,7 +238,6 @@ xcopy "$(SolutionDir)..\Externals\SDL\$(PlatformName)\*.dll" "$(TargetDir)" /e /
|
||||
<ClCompile Include="Src\FrameAui.cpp" />
|
||||
<ClCompile Include="Src\FrameTools.cpp" />
|
||||
<ClCompile Include="Src\GameListCtrl.cpp" />
|
||||
<ClCompile Include="Src\GCMicDlg.cpp" />
|
||||
<ClCompile Include="Src\GeckoCodeDiag.cpp" />
|
||||
<ClCompile Include="Src\HotkeyDlg.cpp" />
|
||||
<ClCompile Include="Src\InputConfigDiag.cpp" />
|
||||
@ -301,7 +300,6 @@ xcopy "$(SolutionDir)..\Externals\SDL\$(PlatformName)\*.dll" "$(TargetDir)" /e /
|
||||
<ClInclude Include="Src\FifoPlayerDlg.h" />
|
||||
<ClInclude Include="Src\Frame.h" />
|
||||
<ClInclude Include="Src\GameListCtrl.h" />
|
||||
<ClInclude Include="Src\GCMicDlg.h" />
|
||||
<ClInclude Include="Src\GeckoCodeDiag.h" />
|
||||
<ClInclude Include="Src\Globals.h" />
|
||||
<ClInclude Include="Src\HotkeyDlg.h" />
|
||||
|
@ -132,9 +132,6 @@
|
||||
<ClCompile Include="Src\TASInputDlg.cpp">
|
||||
<Filter>GUI</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Src\GCMicDlg.cpp">
|
||||
<Filter>GUI</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Src\GLInterface\WGL.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@ -262,9 +259,6 @@
|
||||
<ClInclude Include="Src\TASInputDlg.h">
|
||||
<Filter>GUI</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Src\GCMicDlg.h">
|
||||
<Filter>GUI</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Src\GLInterface.h" />
|
||||
<ClInclude Include="Src\GLInterface\InterfaceBase.h" />
|
||||
<ClInclude Include="Src\GLInterface\WGL.h" />
|
||||
|
@ -28,7 +28,7 @@
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>Dolphin.icns</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.dolphin-emulator.dolphin</string>
|
||||
<string>org.dolphin-emu.dolphin</string>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleLocalizations</key>
|
||||
|
@ -213,9 +213,9 @@ EVT_MENU(IDM_UNDOSAVESTATE, CFrame::OnUndoSaveState)
|
||||
EVT_MENU(IDM_LOADSTATEFILE, CFrame::OnLoadStateFromFile)
|
||||
EVT_MENU(IDM_SAVESTATEFILE, CFrame::OnSaveStateToFile)
|
||||
|
||||
EVT_MENU_RANGE(IDM_LOADSLOT1, IDM_LOADSLOT8, CFrame::OnLoadState)
|
||||
EVT_MENU_RANGE(IDM_LOADSLOT1, IDM_LOADSLOT10, CFrame::OnLoadState)
|
||||
EVT_MENU_RANGE(IDM_LOADLAST1, IDM_LOADLAST8, CFrame::OnLoadLastState)
|
||||
EVT_MENU_RANGE(IDM_SAVESLOT1, IDM_SAVESLOT8, CFrame::OnSaveState)
|
||||
EVT_MENU_RANGE(IDM_SAVESLOT1, IDM_SAVESLOT10, CFrame::OnSaveState)
|
||||
EVT_MENU_RANGE(IDM_FRAMESKIP0, IDM_FRAMESKIP9, CFrame::OnFrameSkip)
|
||||
EVT_MENU_RANGE(IDM_DRIVE1, IDM_DRIVE24, CFrame::OnBootDrive)
|
||||
EVT_MENU_RANGE(IDM_CONNECT_WIIMOTE1, IDM_CONNECT_BALANCEBOARD, CFrame::OnConnectWiimote)
|
||||
@ -756,6 +756,8 @@ int GetCmdForHotkey(unsigned int key)
|
||||
case HK_LOAD_STATE_SLOT_6: return IDM_LOADSLOT6;
|
||||
case HK_LOAD_STATE_SLOT_7: return IDM_LOADSLOT7;
|
||||
case HK_LOAD_STATE_SLOT_8: return IDM_LOADSLOT8;
|
||||
case HK_LOAD_STATE_SLOT_9: return IDM_LOADSLOT9;
|
||||
case HK_LOAD_STATE_SLOT_10: return IDM_LOADSLOT10;
|
||||
|
||||
case HK_SAVE_STATE_SLOT_1: return IDM_SAVESLOT1;
|
||||
case HK_SAVE_STATE_SLOT_2: return IDM_SAVESLOT2;
|
||||
@ -765,6 +767,8 @@ int GetCmdForHotkey(unsigned int key)
|
||||
case HK_SAVE_STATE_SLOT_6: return IDM_SAVESLOT6;
|
||||
case HK_SAVE_STATE_SLOT_7: return IDM_SAVESLOT7;
|
||||
case HK_SAVE_STATE_SLOT_8: return IDM_SAVESLOT8;
|
||||
case HK_SAVE_STATE_SLOT_9: return IDM_SAVESLOT9;
|
||||
case HK_SAVE_STATE_SLOT_10: return IDM_SAVESLOT10;
|
||||
|
||||
case HK_LOAD_LAST_STATE_1: return IDM_LOADLAST1;
|
||||
case HK_LOAD_LAST_STATE_2: return IDM_LOADLAST2;
|
||||
@ -846,6 +850,48 @@ void CFrame::OnKeyDown(wxKeyEvent& event)
|
||||
WiimoteId = 3;
|
||||
else if (IsHotkey(event, HK_BALANCEBOARD_CONNECT))
|
||||
WiimoteId = 4;
|
||||
else if (IsHotkey(event, HK_TOGGLE_IR))
|
||||
{
|
||||
OSDChoice = 1;
|
||||
// Toggle native resolution
|
||||
if (++g_Config.iEFBScale > SCALE_4X)
|
||||
g_Config.iEFBScale = SCALE_AUTO;
|
||||
}
|
||||
else if (IsHotkey(event, HK_TOGGLE_AR))
|
||||
{
|
||||
OSDChoice = 2;
|
||||
// Toggle aspect ratio
|
||||
g_Config.iAspectRatio = (g_Config.iAspectRatio + 1) & 3;
|
||||
}
|
||||
else if (IsHotkey(event, HK_TOGGLE_EFBCOPIES))
|
||||
{
|
||||
OSDChoice = 3;
|
||||
// Toggle EFB copy
|
||||
if (!g_Config.bEFBCopyEnable || g_Config.bCopyEFBToTexture)
|
||||
{
|
||||
g_Config.bEFBCopyEnable ^= true;
|
||||
g_Config.bCopyEFBToTexture = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_Config.bCopyEFBToTexture = !g_Config.bCopyEFBToTexture;
|
||||
}
|
||||
}
|
||||
else if (IsHotkey(event, HK_TOGGLE_FOG))
|
||||
{
|
||||
OSDChoice = 4;
|
||||
g_Config.bDisableFog = !g_Config.bDisableFog;
|
||||
}
|
||||
else if (IsHotkey(event, HK_INCREASE_FRAME_LIMIT))
|
||||
{
|
||||
if (++SConfig::GetInstance().m_Framelimit > 0x19)
|
||||
SConfig::GetInstance().m_Framelimit = 0;
|
||||
}
|
||||
else if (IsHotkey(event, HK_DECREASE_FRAME_LIMIT))
|
||||
{
|
||||
if (--SConfig::GetInstance().m_Framelimit > 0x19)
|
||||
SConfig::GetInstance().m_Framelimit = 0x19;
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned int i = NUM_HOTKEYS;
|
||||
@ -891,43 +937,6 @@ void CFrame::OnKeyDown(wxKeyEvent& event)
|
||||
ConnectWiimote(WiimoteId, connect);
|
||||
}
|
||||
|
||||
if (g_Config.bOSDHotKey && event.GetModifiers() == wxMOD_NONE)
|
||||
{
|
||||
switch (event.GetKeyCode())
|
||||
{
|
||||
case '3':
|
||||
OSDChoice = 1;
|
||||
// Toggle native resolution
|
||||
g_Config.iEFBScale = g_Config.iEFBScale + 1;
|
||||
if (g_Config.iEFBScale > 7) g_Config.iEFBScale = 0;
|
||||
break;
|
||||
case '4':
|
||||
OSDChoice = 2;
|
||||
// Toggle aspect ratio
|
||||
g_Config.iAspectRatio = (g_Config.iAspectRatio + 1) & 3;
|
||||
break;
|
||||
case '5':
|
||||
OSDChoice = 3;
|
||||
// Toggle EFB copy
|
||||
if (!g_Config.bEFBCopyEnable || g_Config.bCopyEFBToTexture)
|
||||
{
|
||||
g_Config.bEFBCopyEnable ^= true;
|
||||
g_Config.bCopyEFBToTexture = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_Config.bCopyEFBToTexture = !g_Config.bCopyEFBToTexture;
|
||||
}
|
||||
break;
|
||||
case '6':
|
||||
OSDChoice = 4;
|
||||
g_Config.bDisableFog = !g_Config.bDisableFog;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (g_Config.bFreeLook && event.GetModifiers() == wxMOD_SHIFT)
|
||||
{
|
||||
static float debugSpeed = 1.0f;
|
||||
|
@ -382,6 +382,8 @@ wxString CFrame::GetMenuLabel(int Id)
|
||||
case HK_LOAD_STATE_SLOT_6:
|
||||
case HK_LOAD_STATE_SLOT_7:
|
||||
case HK_LOAD_STATE_SLOT_8:
|
||||
case HK_LOAD_STATE_SLOT_9:
|
||||
case HK_LOAD_STATE_SLOT_10:
|
||||
Label = wxString::Format(_("Slot %i"),
|
||||
Id - HK_LOAD_STATE_SLOT_1 + 1);
|
||||
break;
|
||||
@ -394,6 +396,8 @@ wxString CFrame::GetMenuLabel(int Id)
|
||||
case HK_SAVE_STATE_SLOT_6:
|
||||
case HK_SAVE_STATE_SLOT_7:
|
||||
case HK_SAVE_STATE_SLOT_8:
|
||||
case HK_SAVE_STATE_SLOT_9:
|
||||
case HK_SAVE_STATE_SLOT_10:
|
||||
Label = wxString::Format(_("Slot %i"),
|
||||
Id - HK_SAVE_STATE_SLOT_1 + 1);
|
||||
break;
|
||||
@ -1006,6 +1010,8 @@ void CFrame::DoPause()
|
||||
// Stop the emulation
|
||||
void CFrame::DoStop()
|
||||
{
|
||||
if (!Core::IsRunningAndStarted())
|
||||
return;
|
||||
if (confirmStop)
|
||||
return;
|
||||
|
||||
@ -1045,6 +1051,7 @@ void CFrame::DoStop()
|
||||
DoRecordingSave();
|
||||
if(Movie::IsPlayingInput() || Movie::IsRecordingInput())
|
||||
Movie::EndPlayInput(false);
|
||||
NetPlay::StopGame();
|
||||
|
||||
wxBeginBusyCursor();
|
||||
BootManager::Stop();
|
||||
@ -1581,7 +1588,11 @@ void CFrame::UpdateGUI()
|
||||
|
||||
// Update Menu Accelerators
|
||||
for (unsigned int i = 0; i < NUM_HOTKEYS; i++)
|
||||
{
|
||||
if (GetCmdForHotkey(i) == -1)
|
||||
continue;
|
||||
GetMenuBar()->FindItem(GetCmdForHotkey(i))->SetItemLabel(GetMenuLabel(i));
|
||||
}
|
||||
|
||||
GetMenuBar()->FindItem(IDM_LOADSTATE)->Enable(Initialized);
|
||||
GetMenuBar()->FindItem(IDM_SAVESTATE)->Enable(Initialized);
|
||||
|
@ -1,274 +0,0 @@
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <wx/notebook.h>
|
||||
|
||||
#include "GCMicDlg.h"
|
||||
#include "ConfigManager.h"
|
||||
|
||||
BEGIN_EVENT_TABLE(GCMicDialog,wxDialog)
|
||||
EVT_COMMAND_RANGE(0, NUM_HOTKEYS - 1,
|
||||
wxEVT_COMMAND_BUTTON_CLICKED, GCMicDialog::OnButtonClick)
|
||||
EVT_TIMER(wxID_ANY, GCMicDialog::OnButtonTimer)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
GCMicDialog::GCMicDialog(wxWindow *parent, wxWindowID id, const wxString &title,
|
||||
const wxPoint &position, const wxSize& size, long style)
|
||||
: wxDialog(parent, id, title, position, size, style)
|
||||
{
|
||||
CreateHotkeyGUIControls();
|
||||
|
||||
#if wxUSE_TIMER
|
||||
m_ButtonMappingTimer = new wxTimer(this, wxID_ANY);
|
||||
g_Pressed = 0;
|
||||
g_Modkey = 0;
|
||||
ClickedButton = NULL;
|
||||
GetButtonWaitingID = 0;
|
||||
GetButtonWaitingTimer = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
GCMicDialog::~GCMicDialog()
|
||||
{
|
||||
delete m_ButtonMappingTimer;
|
||||
}
|
||||
|
||||
// Save keyboard key mapping
|
||||
void GCMicDialog::SaveButtonMapping(int Id, int Key, int Modkey)
|
||||
{
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.iHotkey[Id] = Key;
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.iHotkeyModifier[Id] = Modkey;
|
||||
}
|
||||
|
||||
void GCMicDialog::EndGetButtons(void)
|
||||
{
|
||||
wxTheApp->Unbind(wxEVT_KEY_DOWN, &GCMicDialog::OnKeyDown, this);
|
||||
m_ButtonMappingTimer->Stop();
|
||||
GetButtonWaitingTimer = 0;
|
||||
GetButtonWaitingID = 0;
|
||||
ClickedButton = NULL;
|
||||
SetEscapeId(wxID_ANY);
|
||||
}
|
||||
|
||||
void GCMicDialog::OnKeyDown(wxKeyEvent& event)
|
||||
{
|
||||
if(ClickedButton != NULL)
|
||||
{
|
||||
// Save the key
|
||||
g_Pressed = event.GetKeyCode();
|
||||
g_Modkey = event.GetModifiers();
|
||||
|
||||
// Don't allow modifier keys
|
||||
if (g_Pressed == WXK_CONTROL || g_Pressed == WXK_ALT ||
|
||||
g_Pressed == WXK_SHIFT || g_Pressed == WXK_COMMAND)
|
||||
return;
|
||||
|
||||
// Use the space key to set a blank key
|
||||
if (g_Pressed == WXK_SPACE)
|
||||
{
|
||||
SaveButtonMapping(ClickedButton->GetId(), -1, 0);
|
||||
SetButtonText(ClickedButton->GetId(), wxString());
|
||||
}
|
||||
else
|
||||
{
|
||||
SetButtonText(ClickedButton->GetId(),
|
||||
InputCommon::WXKeyToString(g_Pressed),
|
||||
InputCommon::WXKeymodToString(g_Modkey));
|
||||
SaveButtonMapping(ClickedButton->GetId(), g_Pressed, g_Modkey);
|
||||
}
|
||||
EndGetButtons();
|
||||
}
|
||||
}
|
||||
|
||||
// Update the textbox for the buttons
|
||||
void GCMicDialog::SetButtonText(int id, const wxString &keystr, const wxString &modkeystr)
|
||||
{
|
||||
m_Button_Hotkeys[id]->SetLabel(modkeystr + keystr);
|
||||
}
|
||||
|
||||
void GCMicDialog::DoGetButtons(int _GetId)
|
||||
{
|
||||
// Values used in this function
|
||||
const int Seconds = 4; // Seconds to wait for
|
||||
const int TimesPerSecond = 40; // How often to run the check
|
||||
|
||||
// If the Id has changed or the timer is not running we should start one
|
||||
if( GetButtonWaitingID != _GetId || !m_ButtonMappingTimer->IsRunning() )
|
||||
{
|
||||
if(m_ButtonMappingTimer->IsRunning())
|
||||
m_ButtonMappingTimer->Stop();
|
||||
|
||||
// Save the button Id
|
||||
GetButtonWaitingID = _GetId;
|
||||
GetButtonWaitingTimer = 0;
|
||||
|
||||
// Start the timer
|
||||
#if wxUSE_TIMER
|
||||
m_ButtonMappingTimer->Start(1000 / TimesPerSecond);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Process results
|
||||
// Count each time
|
||||
GetButtonWaitingTimer++;
|
||||
|
||||
// This is run every second
|
||||
if (GetButtonWaitingTimer % TimesPerSecond == 0)
|
||||
{
|
||||
// Current time
|
||||
int TmpTime = Seconds - (GetButtonWaitingTimer / TimesPerSecond);
|
||||
// Update text
|
||||
SetButtonText(_GetId, wxString::Format(wxT("[ %d ]"), TmpTime));
|
||||
}
|
||||
|
||||
// Time's up
|
||||
if (GetButtonWaitingTimer / TimesPerSecond >= Seconds)
|
||||
{
|
||||
// Revert back to old label
|
||||
SetButtonText(_GetId, OldLabel);
|
||||
EndGetButtons();
|
||||
}
|
||||
}
|
||||
|
||||
// Input button clicked
|
||||
void GCMicDialog::OnButtonClick(wxCommandEvent& event)
|
||||
{
|
||||
event.Skip();
|
||||
|
||||
if (m_ButtonMappingTimer->IsRunning())
|
||||
return;
|
||||
|
||||
wxTheApp->Bind(wxEVT_KEY_DOWN, &GCMicDialog::OnKeyDown, this);
|
||||
|
||||
// Get the button
|
||||
ClickedButton = (wxButton *)event.GetEventObject();
|
||||
SetEscapeId(wxID_CANCEL);
|
||||
// Save old label so we can revert back
|
||||
OldLabel = ClickedButton->GetLabel();
|
||||
ClickedButton->SetWindowStyle(wxWANTS_CHARS);
|
||||
ClickedButton->SetLabel(_("<Press Key>"));
|
||||
DoGetButtons(ClickedButton->GetId());
|
||||
}
|
||||
|
||||
#define HOTKEY_NUM_COLUMNS 2
|
||||
|
||||
void GCMicDialog::CreateHotkeyGUIControls(void)
|
||||
{
|
||||
const wxString pageNames[] =
|
||||
{
|
||||
_("General"),
|
||||
_("State Saves")
|
||||
};
|
||||
|
||||
const wxString hkText[] =
|
||||
{
|
||||
_("Open"),
|
||||
_("Change Disc"),
|
||||
_("Refresh List"),
|
||||
|
||||
_("Play/Pause"),
|
||||
_("Stop"),
|
||||
_("Reset"),
|
||||
_("Frame Advance"),
|
||||
|
||||
_("Start Recording"),
|
||||
_("Play Recording"),
|
||||
_("Export Recording"),
|
||||
_("Read-only mode"),
|
||||
|
||||
_("Toggle Fullscreen"),
|
||||
_("Take Screenshot"),
|
||||
|
||||
_("Connect Wiimote 1"),
|
||||
_("Connect Wiimote 2"),
|
||||
_("Connect Wiimote 3"),
|
||||
_("Connect Wiimote 4"),
|
||||
|
||||
_("Load State Slot 1"),
|
||||
_("Load State Slot 2"),
|
||||
_("Load State Slot 3"),
|
||||
_("Load State Slot 4"),
|
||||
_("Load State Slot 5"),
|
||||
_("Load State Slot 6"),
|
||||
_("Load State Slot 7"),
|
||||
_("Load State Slot 8"),
|
||||
|
||||
_("Save State Slot 1"),
|
||||
_("Save State Slot 2"),
|
||||
_("Save State Slot 3"),
|
||||
_("Save State Slot 4"),
|
||||
_("Save State Slot 5"),
|
||||
_("Save State Slot 6"),
|
||||
_("Save State Slot 7"),
|
||||
_("Save State Slot 8")
|
||||
};
|
||||
|
||||
const int page_breaks[3] = {HK_OPEN, HK_LOAD_STATE_SLOT_1, NUM_HOTKEYS};
|
||||
|
||||
// Configuration controls sizes
|
||||
wxSize size(100,20);
|
||||
// A small type font
|
||||
wxFont m_SmallFont(7, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
|
||||
|
||||
wxNotebook *Notebook = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize);
|
||||
|
||||
for (int j = 0; j < 2; j++)
|
||||
{
|
||||
wxPanel *Page = new wxPanel(Notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize);
|
||||
Notebook->AddPage(Page, pageNames[j]);
|
||||
|
||||
wxGridBagSizer *sHotkeys = new wxGridBagSizer();
|
||||
|
||||
// Header line
|
||||
for (int i = 0; i < HOTKEY_NUM_COLUMNS; i++)
|
||||
{
|
||||
wxBoxSizer *HeaderSizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
wxStaticText *StaticTextHeader = new wxStaticText(Page, wxID_ANY, _("Action"));
|
||||
HeaderSizer->Add(StaticTextHeader, 1, wxALL, 2);
|
||||
StaticTextHeader = new wxStaticText(Page, wxID_ANY, _("Key"), wxDefaultPosition, size);
|
||||
HeaderSizer->Add(StaticTextHeader, 0, wxALL, 2);
|
||||
sHotkeys->Add(HeaderSizer, wxGBPosition(0, i), wxDefaultSpan, wxEXPAND | wxLEFT, (i > 0) ? 30 : 1);
|
||||
}
|
||||
|
||||
int column_break = (page_breaks[j+1] + page_breaks[j] + 1) / 2;
|
||||
|
||||
for (int i = page_breaks[j]; i < page_breaks[j+1]; i++)
|
||||
{
|
||||
// Text for the action
|
||||
wxStaticText *stHotkeys = new wxStaticText(Page, wxID_ANY, hkText[i]);
|
||||
|
||||
// Key selection button
|
||||
m_Button_Hotkeys[i] = new wxButton(Page, i, wxEmptyString,
|
||||
wxDefaultPosition, size);
|
||||
m_Button_Hotkeys[i]->SetFont(m_SmallFont);
|
||||
m_Button_Hotkeys[i]->SetToolTip(_("Left click to detect hotkeys.\nEnter space to clear."));
|
||||
SetButtonText(i,
|
||||
InputCommon::WXKeyToString(SConfig::GetInstance().m_LocalCoreStartupParameter.iHotkey[i]),
|
||||
InputCommon::WXKeymodToString(
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.iHotkeyModifier[i]));
|
||||
|
||||
wxBoxSizer *sHotkey = new wxBoxSizer(wxHORIZONTAL);
|
||||
sHotkey->Add(stHotkeys, 1, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 2);
|
||||
sHotkey->Add(m_Button_Hotkeys[i], 0, wxALL, 2);
|
||||
sHotkeys->Add(sHotkey,
|
||||
wxGBPosition((i < column_break) ? i - page_breaks[j] + 1 : i - column_break + 1,
|
||||
(i < column_break) ? 0 : 1),
|
||||
wxDefaultSpan, wxEXPAND | wxLEFT, (i < column_break) ? 1 : 30);
|
||||
}
|
||||
|
||||
wxStaticBoxSizer *sHotkeyBox = new wxStaticBoxSizer(wxVERTICAL, Page, _("Hotkeys"));
|
||||
sHotkeyBox->Add(sHotkeys);
|
||||
|
||||
wxBoxSizer* const sPage = new wxBoxSizer(wxVERTICAL);
|
||||
sPage->Add(sHotkeyBox, 0, wxEXPAND | wxALL, 5);
|
||||
Page->SetSizer(sPage);
|
||||
}
|
||||
|
||||
wxBoxSizer *sMainSizer = new wxBoxSizer(wxVERTICAL);
|
||||
sMainSizer->Add(Notebook, 0, wxEXPAND | wxALL, 5);
|
||||
sMainSizer->Add(CreateButtonSizer(wxOK), 0, wxEXPAND | wxLEFT | wxRIGHT | wxDOWN, 5);
|
||||
SetSizerAndFit(sMainSizer);
|
||||
SetFocus();
|
||||
}
|
||||
|
@ -1,61 +0,0 @@
|
||||
// Copyright 2013 Dolphin Emulator Project
|
||||
// Licensed under GPLv2
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#ifndef __GCMICDIALOG_h__
|
||||
#define __GCMICDIALOG_h__
|
||||
|
||||
#include <wx/wx.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/combobox.h>
|
||||
#include <wx/checkbox.h>
|
||||
#include <wx/gbsizer.h>
|
||||
|
||||
#include "Common.h"
|
||||
#include "CoreParameter.h"
|
||||
#include "WXInputBase.h"
|
||||
|
||||
#if defined(HAVE_X11) && HAVE_X11
|
||||
#include "X11InputBase.h"
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/keysym.h>
|
||||
#endif
|
||||
|
||||
class GCMicDialog : public wxDialog
|
||||
{
|
||||
public:
|
||||
GCMicDialog(wxWindow *parent,
|
||||
wxWindowID id = 1,
|
||||
const wxString &title = _("GCMic Configuration"),
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_DIALOG_STYLE);
|
||||
virtual ~GCMicDialog();
|
||||
|
||||
private:
|
||||
DECLARE_EVENT_TABLE();
|
||||
|
||||
wxString OldLabel;
|
||||
|
||||
wxButton *ClickedButton,
|
||||
*m_Button_Hotkeys[NUM_HOTKEYS];
|
||||
|
||||
wxTimer *m_ButtonMappingTimer;
|
||||
|
||||
void OnButtonTimer(wxTimerEvent& WXUNUSED(event)) { DoGetButtons(GetButtonWaitingID); }
|
||||
void OnButtonClick(wxCommandEvent& event);
|
||||
void OnKeyDown(wxKeyEvent& event);
|
||||
void SaveButtonMapping(int Id, int Key, int Modkey);
|
||||
void CreateHotkeyGUIControls(void);
|
||||
|
||||
void SetButtonText(int id, const wxString &keystr, const wxString &modkeystr = wxString());
|
||||
|
||||
void DoGetButtons(int id);
|
||||
void EndGetButtons(void);
|
||||
|
||||
int GetButtonWaitingID, GetButtonWaitingTimer, g_Pressed, g_Modkey;
|
||||
};
|
||||
#endif
|
||||
|
@ -132,17 +132,6 @@ bool cInterfaceEGL::Create(void *&window_handle)
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (!eglMakeCurrent(GLWin.egl_dpy, GLWin.egl_surf, GLWin.egl_surf, GLWin.egl_ctx)) {
|
||||
|
||||
INFO_LOG(VIDEO, "Error: eglMakeCurrent() failed\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
INFO_LOG(VIDEO, "GL_VENDOR: %s\n", glGetString(GL_VENDOR));
|
||||
INFO_LOG(VIDEO, "GL_RENDERER: %s\n", glGetString(GL_RENDERER));
|
||||
INFO_LOG(VIDEO, "GL_VERSION: %s\n", glGetString(GL_VERSION));
|
||||
INFO_LOG(VIDEO, "GL_EXTENSIONS: %s\n", glGetString(GL_EXTENSIONS));
|
||||
|
||||
Platform.ToggleFullscreen(SConfig::GetInstance().m_LocalCoreStartupParameter.bFullscreen);
|
||||
|
||||
window_handle = (void *)GLWin.native_window;
|
||||
|
@ -38,6 +38,8 @@ enum
|
||||
IDM_SAVESLOT6,
|
||||
IDM_SAVESLOT7,
|
||||
IDM_SAVESLOT8,
|
||||
IDM_SAVESLOT9,
|
||||
IDM_SAVESLOT10,
|
||||
IDM_LOADSLOT1,
|
||||
IDM_LOADSLOT2,
|
||||
IDM_LOADSLOT3,
|
||||
@ -46,6 +48,8 @@ enum
|
||||
IDM_LOADSLOT6,
|
||||
IDM_LOADSLOT7,
|
||||
IDM_LOADSLOT8,
|
||||
IDM_LOADSLOT9,
|
||||
IDM_LOADSLOT10,
|
||||
IDM_LOADLAST1,
|
||||
IDM_LOADLAST2,
|
||||
IDM_LOADLAST3,
|
||||
|
@ -187,6 +187,13 @@ void HotkeyConfigDialog::CreateHotkeyGUIControls(void)
|
||||
_("Connect Wiimote 4"),
|
||||
_("Connect Balance Board"),
|
||||
|
||||
_("Toggle IR"),
|
||||
_("Toggle Aspect Ratio"),
|
||||
_("Toggle EFB Copies"),
|
||||
_("Toggle Fog"),
|
||||
_("Increase Frame limit"),
|
||||
_("Decrease Frame limit"),
|
||||
|
||||
_("Load State Slot 1"),
|
||||
_("Load State Slot 2"),
|
||||
_("Load State Slot 3"),
|
||||
@ -195,6 +202,8 @@ void HotkeyConfigDialog::CreateHotkeyGUIControls(void)
|
||||
_("Load State Slot 6"),
|
||||
_("Load State Slot 7"),
|
||||
_("Load State Slot 8"),
|
||||
_("Load State Slot 9"),
|
||||
_("Load State Slot 10"),
|
||||
|
||||
_("Save State Slot 1"),
|
||||
_("Save State Slot 2"),
|
||||
@ -204,6 +213,8 @@ void HotkeyConfigDialog::CreateHotkeyGUIControls(void)
|
||||
_("Save State Slot 6"),
|
||||
_("Save State Slot 7"),
|
||||
_("Save State Slot 8"),
|
||||
_("Save State Slot 9"),
|
||||
_("Save State Slot 10"),
|
||||
|
||||
_("Load State Last 1"),
|
||||
_("Load State Last 2"),
|
||||
|
@ -263,6 +263,9 @@ bool DolphinApp::OnInit()
|
||||
File::CreateFullPath(File::GetUserPath(D_SCREENSHOTS_IDX));
|
||||
File::CreateFullPath(File::GetUserPath(D_STATESAVES_IDX));
|
||||
File::CreateFullPath(File::GetUserPath(D_MAILLOGS_IDX));
|
||||
File::CreateFullPath(File::GetUserPath(D_GCUSER_IDX) + USA_DIR DIR_SEP);
|
||||
File::CreateFullPath(File::GetUserPath(D_GCUSER_IDX) + EUR_DIR DIR_SEP);
|
||||
File::CreateFullPath(File::GetUserPath(D_GCUSER_IDX) + JAP_DIR DIR_SEP);
|
||||
|
||||
LogManager::Init();
|
||||
SConfig::Init();
|
||||
|
@ -47,6 +47,9 @@
|
||||
#include <android/native_window_jni.h>
|
||||
ANativeWindow* surf;
|
||||
int g_width, g_height;
|
||||
std::string g_filename;
|
||||
static std::thread g_run_thread;
|
||||
|
||||
#define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, "Dolphinemu", __VA_ARGS__))
|
||||
|
||||
void Host_NotifyMapLoaded() {}
|
||||
@ -66,7 +69,10 @@ void* Host_GetRenderHandle()
|
||||
|
||||
void* Host_GetInstance() { return NULL; }
|
||||
|
||||
void Host_UpdateTitle(const char* title){};
|
||||
void Host_UpdateTitle(const char* title)
|
||||
{
|
||||
LOGI(title);
|
||||
};
|
||||
|
||||
void Host_UpdateLogDisplay(){}
|
||||
|
||||
@ -297,12 +303,23 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SetConfig(JN
|
||||
env->ReleaseStringUTFChars(jDefault, Default);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_Run(JNIEnv *env, jobject obj, jstring jFile, jobject _surf, jint _width, jint _height)
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SetFilename(JNIEnv *env, jobject obj, jstring jFile)
|
||||
{
|
||||
const char *File = env->GetStringUTFChars(jFile, NULL);
|
||||
|
||||
g_filename = std::string(File);
|
||||
|
||||
env->ReleaseStringUTFChars(jFile, File);
|
||||
}
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SetDimensions(JNIEnv *env, jobject obj, jint _width, jint _height)
|
||||
{
|
||||
surf = ANativeWindow_fromSurface(env, _surf);
|
||||
g_width = (int)_width;
|
||||
g_height = (int)_height;
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_Run(JNIEnv *env, jobject obj, jobject _surf)
|
||||
{
|
||||
surf = ANativeWindow_fromSurface(env, _surf);
|
||||
// Install our callbacks
|
||||
OSD::AddCallback(OSD::OSD_INIT, OSDCallbacks, 0);
|
||||
OSD::AddCallback(OSD::OSD_SHUTDOWN, OSDCallbacks, 2);
|
||||
@ -322,9 +339,8 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_Run(JNIEnv *
|
||||
if (onscreencontrols)
|
||||
OSD::AddCallback(OSD::OSD_ONFRAME, OSDCallbacks, 1);
|
||||
|
||||
const char *File = env->GetStringUTFChars(jFile, NULL);
|
||||
// No use running the loop when booting fails
|
||||
if ( BootManager::BootCore( File ) )
|
||||
if ( BootManager::BootCore( g_filename.c_str() ) )
|
||||
while (PowerPC::GetState() != PowerPC::CPU_POWERDOWN)
|
||||
updateMainFrameEvent.Wait();
|
||||
|
||||
@ -333,7 +349,8 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_Run(JNIEnv *
|
||||
SConfig::Shutdown();
|
||||
LogManager::Shutdown();
|
||||
}
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -6,21 +6,25 @@
|
||||
#include <IniFile.h>
|
||||
|
||||
#include "WxUtils.h"
|
||||
#include "NetPlay.h"
|
||||
#include "NetPlayClient.h"
|
||||
#include "NetPlayServer.h"
|
||||
#include "NetWindow.h"
|
||||
#include "Frame.h"
|
||||
#include "Core.h"
|
||||
#include "ConfigManager.h"
|
||||
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
#define NETPLAY_TITLEBAR "Dolphin NetPlay"
|
||||
#define INITIAL_PAD_BUFFER_SIZE 20
|
||||
|
||||
BEGIN_EVENT_TABLE(NetPlayDiag, wxFrame)
|
||||
EVT_COMMAND(wxID_ANY, wxEVT_THREAD, NetPlayDiag::OnThread)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
static NetPlay* netplay_ptr = NULL;
|
||||
static NetPlayServer* netplay_server = NULL;
|
||||
static NetPlayClient* netplay_client = NULL;
|
||||
extern CFrame* main_frame;
|
||||
NetPlayDiag *NetPlayDiag::npd = NULL;
|
||||
|
||||
@ -200,6 +204,28 @@ NetPlaySetupDiag::~NetPlaySetupDiag()
|
||||
main_frame->g_NetPlaySetupDiag = NULL;
|
||||
}
|
||||
|
||||
void NetPlaySetupDiag::MakeNetPlayDiag(int port, const std::string &game, bool is_hosting)
|
||||
{
|
||||
NetPlayDiag *&npd = NetPlayDiag::GetInstance();
|
||||
std::string ip;
|
||||
npd = new NetPlayDiag(m_parent, m_game_list, game, is_hosting);
|
||||
if (is_hosting)
|
||||
ip = "127.0.0.1";
|
||||
else
|
||||
ip = WxStrToStr(m_connect_ip_text->GetValue());
|
||||
|
||||
netplay_client = new NetPlayClient(ip, (u16)port, npd, WxStrToStr(m_nickname_text->GetValue()));
|
||||
if (netplay_client->is_connected)
|
||||
{
|
||||
npd->Show();
|
||||
Destroy();
|
||||
}
|
||||
else
|
||||
{
|
||||
npd->Destroy();
|
||||
}
|
||||
}
|
||||
|
||||
void NetPlaySetupDiag::OnHost(wxCommandEvent&)
|
||||
{
|
||||
NetPlayDiag *&npd = NetPlayDiag::GetInstance();
|
||||
@ -217,25 +243,20 @@ void NetPlaySetupDiag::OnHost(wxCommandEvent&)
|
||||
|
||||
std::string game(WxStrToStr(m_game_lbox->GetStringSelection()));
|
||||
|
||||
npd = new NetPlayDiag(m_parent, m_game_list, game, true);
|
||||
unsigned long port = 0;
|
||||
m_host_port_text->GetValue().ToULong(&port);
|
||||
netplay_ptr = new NetPlayServer(u16(port), WxStrToStr(m_nickname_text->GetValue()), npd);
|
||||
netplay_ptr->ChangeGame(game);
|
||||
if (netplay_ptr->is_connected)
|
||||
netplay_server = new NetPlayServer(u16(port));
|
||||
netplay_server->ChangeGame(game);
|
||||
netplay_server->AdjustPadBufferSize(INITIAL_PAD_BUFFER_SIZE);
|
||||
if (netplay_server->is_connected)
|
||||
{
|
||||
#ifdef USE_UPNP
|
||||
if(m_upnp_chk->GetValue())
|
||||
((NetPlayServer*)netplay_ptr)->TryPortmapping(port);
|
||||
netplay_server->TryPortmapping(port);
|
||||
#endif
|
||||
npd->Show();
|
||||
Destroy();
|
||||
}
|
||||
else
|
||||
{
|
||||
PanicAlertT("Failed to Listen!!");
|
||||
npd->Destroy();
|
||||
}
|
||||
|
||||
MakeNetPlayDiag(port, game, true);
|
||||
}
|
||||
|
||||
void NetPlaySetupDiag::OnJoin(wxCommandEvent&)
|
||||
@ -247,20 +268,9 @@ void NetPlaySetupDiag::OnJoin(wxCommandEvent&)
|
||||
return;
|
||||
}
|
||||
|
||||
npd = new NetPlayDiag(m_parent, m_game_list, "");
|
||||
unsigned long port = 0;
|
||||
m_connect_port_text->GetValue().ToULong(&port);
|
||||
netplay_ptr = new NetPlayClient(WxStrToStr(m_connect_ip_text->GetValue())
|
||||
, (u16)port, npd, WxStrToStr(m_nickname_text->GetValue()));
|
||||
if (netplay_ptr->is_connected)
|
||||
{
|
||||
npd->Show();
|
||||
Destroy();
|
||||
}
|
||||
else
|
||||
{
|
||||
npd->Destroy();
|
||||
}
|
||||
MakeNetPlayDiag(port, "", false);
|
||||
}
|
||||
|
||||
void NetPlaySetupDiag::OnQuit(wxCommandEvent&)
|
||||
@ -272,6 +282,7 @@ NetPlayDiag::NetPlayDiag(wxWindow* const parent, const CGameListCtrl* const game
|
||||
const std::string& game, const bool is_hosting)
|
||||
: wxFrame(parent, wxID_ANY, wxT(NETPLAY_TITLEBAR), wxDefaultPosition, wxDefaultSize)
|
||||
, m_selected_game(game)
|
||||
, m_start_btn(NULL)
|
||||
, m_game_list(game_list)
|
||||
{
|
||||
wxPanel* const panel = new wxPanel(this);
|
||||
@ -330,22 +341,19 @@ NetPlayDiag::NetPlayDiag(wxWindow* const parent, const CGameListCtrl* const game
|
||||
wxBoxSizer* const bottom_szr = new wxBoxSizer(wxHORIZONTAL);
|
||||
if (is_hosting)
|
||||
{
|
||||
wxButton* const start_btn = new wxButton(panel, wxID_ANY, _("Start"));
|
||||
start_btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &NetPlayDiag::OnStart, this);
|
||||
bottom_szr->Add(start_btn);
|
||||
wxButton* const stop_btn = new wxButton(panel, wxID_ANY, _("Stop"));
|
||||
stop_btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &NetPlayDiag::OnStop, this);
|
||||
bottom_szr->Add(stop_btn);
|
||||
m_start_btn = new wxButton(panel, wxID_ANY, _("Start"));
|
||||
m_start_btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &NetPlayDiag::OnStart, this);
|
||||
bottom_szr->Add(m_start_btn);
|
||||
|
||||
bottom_szr->Add(new wxStaticText(panel, wxID_ANY, _("Buffer:")), 0, wxLEFT | wxCENTER, 5 );
|
||||
wxSpinCtrl* const padbuf_spin = new wxSpinCtrl(panel, wxID_ANY, wxT("20")
|
||||
, wxDefaultPosition, wxSize(64, -1), wxSP_ARROW_KEYS, 0, 200, 20);
|
||||
, wxDefaultPosition, wxSize(64, -1), wxSP_ARROW_KEYS, 0, 200, INITIAL_PAD_BUFFER_SIZE);
|
||||
padbuf_spin->Bind(wxEVT_COMMAND_SPINCTRL_UPDATED, &NetPlayDiag::OnAdjustBuffer, this);
|
||||
bottom_szr->Add(padbuf_spin, 0, wxCENTER);
|
||||
}
|
||||
|
||||
m_memcard_write = new wxCheckBox(panel, wxID_ANY, _("Write memcards (GC)"));
|
||||
m_memcard_write->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &NetPlayDiag::OnMemcardWriteCheck, this);
|
||||
bottom_szr->Add(m_memcard_write, 0, wxCENTER);
|
||||
m_memcard_write = new wxCheckBox(panel, wxID_ANY, _("Write memcards (GC)"));
|
||||
bottom_szr->Add(m_memcard_write, 0, wxCENTER);
|
||||
}
|
||||
|
||||
bottom_szr->AddStretchSpacer(1);
|
||||
bottom_szr->Add(quit_btn);
|
||||
@ -366,10 +374,15 @@ NetPlayDiag::NetPlayDiag(wxWindow* const parent, const CGameListCtrl* const game
|
||||
|
||||
NetPlayDiag::~NetPlayDiag()
|
||||
{
|
||||
if (netplay_ptr)
|
||||
if (netplay_client)
|
||||
{
|
||||
delete netplay_ptr;
|
||||
netplay_ptr = NULL;
|
||||
delete netplay_client;
|
||||
netplay_client = NULL;
|
||||
}
|
||||
if (netplay_server)
|
||||
{
|
||||
delete netplay_server;
|
||||
netplay_server = NULL;
|
||||
}
|
||||
npd = NULL;
|
||||
}
|
||||
@ -380,37 +393,45 @@ void NetPlayDiag::OnChat(wxCommandEvent&)
|
||||
|
||||
if (s.Length())
|
||||
{
|
||||
netplay_ptr->SendChatMessage(WxStrToStr(s));
|
||||
netplay_client->SendChatMessage(WxStrToStr(s));
|
||||
m_chat_text->AppendText(s.Prepend(wxT(" >> ")).Append(wxT('\n')));
|
||||
m_chat_msg_text->Clear();
|
||||
}
|
||||
}
|
||||
|
||||
void NetPlayDiag::OnStart(wxCommandEvent&)
|
||||
void NetPlayDiag::GetNetSettings(NetSettings &settings)
|
||||
{
|
||||
SConfig &instance = SConfig::GetInstance();
|
||||
settings.m_DSPHLE = instance.m_LocalCoreStartupParameter.bDSPHLE;
|
||||
settings.m_DSPEnableJIT = instance.m_EnableJIT;
|
||||
settings.m_WriteToMemcard = m_memcard_write->GetValue();
|
||||
|
||||
for (unsigned int i = 0; i < 4; ++i)
|
||||
settings.m_Controllers[i] = SConfig::GetInstance().m_SIDevice[i];
|
||||
}
|
||||
|
||||
std::string NetPlayDiag::FindGame()
|
||||
{
|
||||
// find path for selected game, sloppy..
|
||||
for (u32 i = 0 ; auto game = m_game_list->GetISO(i); ++i)
|
||||
{
|
||||
if (m_selected_game == BuildGameName(*game))
|
||||
{
|
||||
netplay_ptr->StartGame(game->GetFileName());
|
||||
return;
|
||||
}
|
||||
}
|
||||
return game->GetFileName();
|
||||
|
||||
PanicAlertT("Game not found!");
|
||||
return "";
|
||||
}
|
||||
|
||||
void NetPlayDiag::OnStop(wxCommandEvent&)
|
||||
void NetPlayDiag::OnStart(wxCommandEvent&)
|
||||
{
|
||||
netplay_ptr->StopGame();
|
||||
NetSettings settings;
|
||||
GetNetSettings(settings);
|
||||
netplay_server->SetNetSettings(settings);
|
||||
netplay_server->StartGame(FindGame());
|
||||
}
|
||||
|
||||
void NetPlayDiag::BootGame(const std::string& filename)
|
||||
{
|
||||
main_frame->BootGame(filename);
|
||||
|
||||
Core::g_CoreStartupParameter.bEnableMemcardSaving = m_memcard_write->GetValue();
|
||||
}
|
||||
|
||||
void NetPlayDiag::StopGame()
|
||||
@ -444,27 +465,26 @@ void NetPlayDiag::OnMsgStartGame()
|
||||
{
|
||||
wxCommandEvent evt(wxEVT_THREAD, NP_GUI_EVT_START_GAME);
|
||||
GetEventHandler()->AddPendingEvent(evt);
|
||||
if (m_start_btn)
|
||||
m_start_btn->Disable();
|
||||
}
|
||||
|
||||
void NetPlayDiag::OnMsgStopGame()
|
||||
{
|
||||
wxCommandEvent evt(wxEVT_THREAD, NP_GUI_EVT_STOP_GAME);
|
||||
GetEventHandler()->AddPendingEvent(evt);
|
||||
}
|
||||
|
||||
void NetPlayDiag::OnMemcardWriteCheck(wxCommandEvent &event)
|
||||
{
|
||||
netplay_ptr->SetMemcardWriteEnabled(m_memcard_write->GetValue());
|
||||
if (m_start_btn)
|
||||
m_start_btn->Enable();
|
||||
}
|
||||
|
||||
void NetPlayDiag::OnAdjustBuffer(wxCommandEvent& event)
|
||||
{
|
||||
const int val = ((wxSpinCtrl*)event.GetEventObject())->GetValue();
|
||||
((NetPlayServer*)netplay_ptr)->AdjustPadBufferSize(val);
|
||||
netplay_server->AdjustPadBufferSize(val);
|
||||
|
||||
std::ostringstream ss;
|
||||
ss << "< Pad Buffer: " << val << " >";
|
||||
netplay_ptr->SendChatMessage(ss.str());
|
||||
netplay_client->SendChatMessage(ss.str());
|
||||
m_chat_text->AppendText(StrToWxStr(ss.str()).Append(wxT('\n')));
|
||||
}
|
||||
|
||||
@ -479,7 +499,7 @@ void NetPlayDiag::OnThread(wxCommandEvent& event)
|
||||
// player list
|
||||
m_playerids.clear();
|
||||
std::string tmps;
|
||||
netplay_ptr->GetPlayerList(tmps, m_playerids);
|
||||
netplay_client->GetPlayerList(tmps, m_playerids);
|
||||
|
||||
const int selection = m_player_lbox->GetSelection();
|
||||
|
||||
@ -502,15 +522,13 @@ void NetPlayDiag::OnThread(wxCommandEvent& event)
|
||||
case NP_GUI_EVT_START_GAME :
|
||||
// client start game :/
|
||||
{
|
||||
wxCommandEvent evt;
|
||||
OnStart(evt);
|
||||
netplay_client->StartGame(FindGame());
|
||||
}
|
||||
break;
|
||||
case NP_GUI_EVT_STOP_GAME :
|
||||
// client stop game
|
||||
{
|
||||
wxCommandEvent evt;
|
||||
OnStop(evt);
|
||||
netplay_client->StopGame();
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -534,7 +552,7 @@ void NetPlayDiag::OnChangeGame(wxCommandEvent&)
|
||||
if (game_name.length())
|
||||
{
|
||||
m_selected_game = WxStrToStr(game_name);
|
||||
netplay_ptr->ChangeGame(m_selected_game);
|
||||
netplay_server->ChangeGame(m_selected_game);
|
||||
m_game_btn->SetLabel(game_name.Prepend(_(" Game : ")));
|
||||
}
|
||||
}
|
||||
@ -549,13 +567,13 @@ void NetPlayDiag::OnConfigPads(wxCommandEvent&)
|
||||
return;
|
||||
pid = m_playerids.at(pid);
|
||||
|
||||
if (false == ((NetPlayServer*)netplay_ptr)->GetPadMapping(pid, mapping))
|
||||
if (false == netplay_server->GetPadMapping(pid, mapping))
|
||||
return;
|
||||
|
||||
PadMapDiag pmd(this, mapping);
|
||||
pmd.ShowModal();
|
||||
|
||||
if (false == ((NetPlayServer*)netplay_ptr)->SetPadMapping(pid, mapping))
|
||||
if (false == netplay_server->SetPadMapping(pid, mapping))
|
||||
PanicAlertT("Could not set pads. The player left or the game is currently running!\n"
|
||||
"(setting pads while the game is running is not yet supported)");
|
||||
}
|
||||
@ -641,3 +659,11 @@ void PadMapDiag::OnAdjust(wxCommandEvent& event)
|
||||
for (unsigned int i=0; i<4; ++i)
|
||||
m_mapping[i] = m_map_cbox[i]->GetSelection() - 1;
|
||||
}
|
||||
|
||||
void NetPlay::StopGame()
|
||||
{
|
||||
if (netplay_server != NULL)
|
||||
netplay_server->StopGame();
|
||||
|
||||
// TODO: allow non-hosting clients to close the window
|
||||
}
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
#include "FifoQueue.h"
|
||||
|
||||
#include "NetPlay.h"
|
||||
#include "NetPlayClient.h"
|
||||
|
||||
enum
|
||||
{
|
||||
@ -42,6 +42,8 @@ private:
|
||||
void OnHost(wxCommandEvent& event);
|
||||
void OnQuit(wxCommandEvent& event);
|
||||
|
||||
void MakeNetPlayDiag(int port, const std::string &game, bool is_hosting);
|
||||
|
||||
wxTextCtrl *m_nickname_text,
|
||||
*m_host_port_text,
|
||||
*m_connect_port_text,
|
||||
@ -65,7 +67,6 @@ public:
|
||||
Common::FifoQueue<std::string> chat_msgs;
|
||||
|
||||
void OnStart(wxCommandEvent& event);
|
||||
void OnStop(wxCommandEvent& event);
|
||||
|
||||
// implementation of NetPlayUI methods
|
||||
void BootGame(const std::string& filename);
|
||||
@ -85,11 +86,12 @@ private:
|
||||
|
||||
void OnChat(wxCommandEvent& event);
|
||||
void OnQuit(wxCommandEvent& event);
|
||||
void OnMemcardWriteCheck(wxCommandEvent& event);
|
||||
void OnThread(wxCommandEvent& event);
|
||||
void OnChangeGame(wxCommandEvent& event);
|
||||
void OnAdjustBuffer(wxCommandEvent& event);
|
||||
void OnConfigPads(wxCommandEvent& event);
|
||||
void GetNetSettings(NetSettings &settings);
|
||||
std::string FindGame();
|
||||
|
||||
wxListBox* m_player_lbox;
|
||||
wxTextCtrl* m_chat_text;
|
||||
@ -98,6 +100,7 @@ private:
|
||||
|
||||
std::string m_selected_game;
|
||||
wxButton* m_game_btn;
|
||||
wxButton* m_start_btn;
|
||||
|
||||
std::vector<int> m_playerids;
|
||||
|
||||
@ -130,5 +133,10 @@ private:
|
||||
int* const m_mapping;
|
||||
};
|
||||
|
||||
namespace NetPlay
|
||||
{
|
||||
void StopGame();
|
||||
}
|
||||
|
||||
#endif // _NETWINDOW_H_
|
||||
|
||||
|
@ -86,7 +86,7 @@ wxString af_desc = wxTRANSLATE("Enable anisotropic filtering.\nEnhances visual q
|
||||
wxString aa_desc = wxTRANSLATE("Reduces the amount of aliasing caused by rasterizing 3D graphics.\nThis makes the rendered picture look less blocky.\nHeavily decreases emulation speed and sometimes causes issues.\n\nIf unsure, select None.");
|
||||
wxString scaled_efb_copy_desc = wxTRANSLATE("Greatly increases quality of textures generated using render to texture effects.\nRaising the internal resolution will improve the effect of this setting.\nSlightly decreases performance and possibly causes issues (although unlikely).\n\nIf unsure, leave this checked.");
|
||||
wxString pixel_lighting_desc = wxTRANSLATE("Calculate lighting of 3D graphics per-pixel rather than per vertex.\nDecreases emulation speed by some percent (depending on your GPU).\nThis usually is a safe enhancement, but might cause issues sometimes.\n\nIf unsure, leave this unchecked.");
|
||||
wxString hacked_buffer_upload_desc = wxTRANSLATE("Use a hacked upload strategy to stream vertices.\nThis usually speed up, but is forbidden by OpenGL specification and may causes heavy glitches.\n\nIf unsure, leave this unchecked.");
|
||||
wxString hacked_buffer_upload_desc = wxTRANSLATE("Speed up vertex streaming by using unsafe OpenGL code. Enabling this option might cause heavy glitches or even crash the emulator.\n\nIf unsure, leave this unchecked.");
|
||||
wxString fast_depth_calc_desc = wxTRANSLATE("Use a less accurate algorithm to calculate depth values.\nCauses issues in a few games but might give a decent speedup.\n\nIf unsure, leave this checked.");
|
||||
wxString force_filtering_desc = wxTRANSLATE("Force texture filtering even if the emulated game explicitly disabled it.\nImproves texture quality slightly but causes glitches in some games.\n\nIf unsure, leave this unchecked.");
|
||||
wxString _3d_vision_desc = wxTRANSLATE("Enable 3D effects via stereoscopy using Nvidia 3D Vision technology if it's supported by your GPU.\nPossibly causes issues.\nRequires fullscreen to work.\n\nIf unsure, leave this unchecked.");
|
||||
@ -121,7 +121,6 @@ wxString crop_desc = wxTRANSLATE("Crop the picture from 4:3 to 5:4 or from 16:9
|
||||
wxString opencl_desc = wxTRANSLATE("[EXPERIMENTAL]\nAims to speed up emulation by offloading texture decoding to the GPU using the OpenCL framework.\nHowever, right now it's known to cause texture defects in various games. Also it's slower than regular CPU texture decoding in most cases.\n\nIf unsure, leave this unchecked.");
|
||||
wxString dlc_desc = wxTRANSLATE("[EXPERIMENTAL]\nSpeeds up emulation a bit by caching display lists.\nPossibly causes issues though.\n\nIf unsure, leave this unchecked.");
|
||||
wxString omp_desc = wxTRANSLATE("Use multiple threads to decode textures.\nMight result in a speedup (especially on CPUs with more than two cores).\n\nIf unsure, leave this unchecked.");
|
||||
wxString hotkeys_desc = wxTRANSLATE("Allows toggling certain options via the hotkeys 3 (Internal Resolution), 4 (Aspect Ratio), 5 (Copy EFB) and 6 (Fog) within the emulation window.\n\nIf unsure, leave this unchecked.");
|
||||
wxString ppshader_desc = wxTRANSLATE("Apply a post-processing effect after finishing a frame.\n\nIf unsure, select (off).");
|
||||
wxString cache_efb_copies_desc = wxTRANSLATE("Slightly speeds up EFB to RAM copies by sacrificing emulation accuracy.\nSometimes also increases visual quality.\nIf you're experiencing any issues, try raising texture cache accuracy or disable this option.\n\nIf unsure, leave this unchecked.");
|
||||
wxString shader_errors_desc = wxTRANSLATE("Usually if shader compilation fails, an error message is displayed.\nHowever, one may skip the popups to allow interruption free gameplay by checking this option.\n\nIf unsure, leave this unchecked.");
|
||||
@ -503,7 +502,7 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con
|
||||
szr_other->Add(CreateCheckBox(page_hacks, _("OpenCL Texture Decoder"), wxGetTranslation(opencl_desc), vconfig.bEnableOpenCL));
|
||||
szr_other->Add(CreateCheckBox(page_hacks, _("OpenMP Texture Decoder"), wxGetTranslation(omp_desc), vconfig.bOMPDecoder));
|
||||
szr_other->Add(CreateCheckBox(page_hacks, _("Fast Depth Calculation"), wxGetTranslation(fast_depth_calc_desc), vconfig.bFastDepthCalc));
|
||||
szr_other->Add(hacked_buffer_upload = CreateCheckBox(page_hacks, _("Hacked Buffer Upload"), wxGetTranslation(hacked_buffer_upload_desc), vconfig.bHackedBufferUpload));
|
||||
szr_other->Add(hacked_buffer_upload = CreateCheckBox(page_hacks, _("Vertex Streaming Hack"), wxGetTranslation(hacked_buffer_upload_desc), vconfig.bHackedBufferUpload));
|
||||
|
||||
wxStaticBoxSizer* const group_other = new wxStaticBoxSizer(wxVERTICAL, page_hacks, _("Other"));
|
||||
group_other->Add(szr_other, 1, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);
|
||||
@ -559,7 +558,6 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con
|
||||
|
||||
szr_misc->Add(CreateCheckBox(page_advanced, _("Show Input Display"), wxGetTranslation(show_input_display_desc), vconfig.bShowInputDisplay));
|
||||
szr_misc->Add(CreateCheckBox(page_advanced, _("Crop"), wxGetTranslation(crop_desc), vconfig.bCrop));
|
||||
szr_misc->Add(CreateCheckBox(page_advanced, _("Enable Hotkeys"), wxGetTranslation(hotkeys_desc), vconfig.bOSDHotKey));
|
||||
|
||||
// Progressive Scan
|
||||
{
|
||||
|
Reference in New Issue
Block a user