Clean up and comment changes to Dolphin Input Compatibility files

This commit is contained in:
Duckey77
2019-06-28 08:38:17 -07:00
parent 24576d3435
commit 8ef256daed
3 changed files with 3 additions and 182 deletions
+1 -1
View File
@@ -500,7 +500,7 @@ void SConfig::LoadCoreSettings(IniFile& ini)
for (int i = 0; i < SerialInterface::MAX_SI_CHANNELS; ++i)
{
core->Get(StringFromFormat("SIDevice%i", i), (u32*)&m_SIDevice[i],
SerialInterface::SIDEVICE_GC_CONTROLLER );
SerialInterface::SIDEVICE_GC_CONTROLLER ); // OpenEmu default all SI DEvices to GC Controller
core->Get(StringFromFormat("AdapterRumble%i", i), &m_AdapterRumble[i], true);
core->Get(StringFromFormat("SimulateKonga%i", i), &m_AdapterKonga[i], false);
}
+1 -68
View File
@@ -8,29 +8,6 @@
#include "Common/Logging/Log.h"
#ifdef CIFACE_USE_WIN32
#include "InputCommon/ControllerInterface/Win32/Win32.h"
#endif
#ifdef CIFACE_USE_XLIB
#include "InputCommon/ControllerInterface/Xlib/XInput2.h"
#endif
#ifdef CIFACE_USE_OSX
#include "InputCommon/ControllerInterface/OSX/OSX.h"
#include "InputCommon/ControllerInterface/Quartz/Quartz.h"
#endif
#ifdef CIFACE_USE_SDL
#include "InputCommon/ControllerInterface/SDL/SDL.h"
#endif
#ifdef CIFACE_USE_ANDROID
#include "InputCommon/ControllerInterface/Android/Android.h"
#endif
#ifdef CIFACE_USE_EVDEV
#include "InputCommon/ControllerInterface/evdev/evdev.h"
#endif
#ifdef CIFACE_USE_PIPES
#include "InputCommon/ControllerInterface/Pipes/Pipes.h"
#endif
ControllerInterface g_controller_interface;
void ControllerInterface::Initialize(const WindowSystemInfo& wsi)
@@ -44,31 +21,6 @@ void ControllerInterface::Initialize(const WindowSystemInfo& wsi)
m_is_init = true;
m_is_populating_devices = true;
#ifdef CIFACE_USE_WIN32
ciface::Win32::Init(wsi.render_surface);
#endif
#ifdef CIFACE_USE_XLIB
// nothing needed
#endif
#ifdef CIFACE_USE_OSX
if (m_wsi.type == WindowSystemType::MacOS)
ciface::OSX::Init(wsi.render_surface);
// nothing needed for Quartz
#endif
#ifdef CIFACE_USE_SDL
ciface::SDL::Init();
#endif
#ifdef CIFACE_USE_ANDROID
// nothing needed
#endif
#ifdef CIFACE_USE_EVDEV
ciface::evdev::Init();
#endif
#ifdef CIFACE_USE_PIPES
// nothing needed
#endif
RefreshDevices();
}
@@ -83,6 +35,7 @@ void ControllerInterface::ChangeWindow(void* hwnd)
void ControllerInterface::RefreshDevices()
{
//OpenEmu Stub
return ;
}
@@ -111,26 +64,6 @@ void ControllerInterface::Shutdown()
// This will update control references so shared_ptr<Device>s are freed up
// BEFORE we shutdown the backends.
InvokeDevicesChangedCallbacks();
#ifdef CIFACE_USE_WIN32
ciface::Win32::DeInit();
#endif
#ifdef CIFACE_USE_XLIB
// nothing needed
#endif
#ifdef CIFACE_USE_OSX
ciface::OSX::DeInit();
ciface::Quartz::DeInit();
#endif
#ifdef CIFACE_USE_SDL
ciface::SDL::DeInit();
#endif
#ifdef CIFACE_USE_ANDROID
// nothing needed
#endif
#ifdef CIFACE_USE_EVDEV
ciface::evdev::Shutdown();
#endif
}
void ControllerInterface::AddDevice(std::shared_ptr<ciface::Core::Device> device)
+1 -113
View File
@@ -28,120 +28,8 @@ InputConfig::~InputConfig() = default;
bool InputConfig::LoadConfig(bool isGC)
{
//OpenEmu Stub
return false;
IniFile inifile;
bool useProfile[MAX_BBMOTES] = {false, false, false, false, false};
std::string num[MAX_BBMOTES] = {"1", "2", "3", "4", "BB"};
std::string profile[MAX_BBMOTES];
std::string path;
#if defined(ANDROID)
bool use_ir_config = false;
std::string ir_values[3];
#endif
if (SConfig::GetInstance().GetGameID() != "00000000")
{
std::string type;
if (isGC)
{
type = "Pad";
path = "Profiles/GCPad/";
}
else
{
type = "Wiimote";
path = "Profiles/Wiimote/";
}
IniFile game_ini = SConfig::GetInstance().LoadGameIni();
IniFile::Section* control_section = game_ini.GetOrCreateSection("Controls");
for (int i = 0; i < 4; i++)
{
if (control_section->Exists(type + "Profile" + num[i]))
{
std::string profile_setting;
if (control_section->Get(type + "Profile" + num[i], &profile_setting))
{
auto profiles = InputProfile::GetProfilesFromSetting(
profile_setting, File::GetUserPath(D_CONFIG_IDX) + path);
if (profiles.empty())
{
// TODO: PanicAlert shouldn't be used for this.
PanicAlertT("No profiles found for game setting '%s'", profile_setting.c_str());
continue;
}
// Use the first profile by default
profile[i] = profiles[0];
useProfile[i] = true;
}
}
}
#if defined(ANDROID)
// For use on android touchscreen IR pointer
// Check for IR values
if (control_section->Exists("IRTotalYaw") && control_section->Exists("IRTotalPitch") &&
control_section->Exists("IRVerticalOffset"))
{
use_ir_config = true;
control_section->Get("IRTotalYaw", &ir_values[0]);
control_section->Get("IRTotalPitch", &ir_values[1]);
control_section->Get("IRVerticalOffset", &ir_values[2]);
}
#endif
}
if (inifile.Load(File::GetUserPath(D_CONFIG_IDX) + m_ini_name + ".ini"))
{
int n = 0;
for (auto& controller : m_controllers)
{
IniFile::Section config;
// Load settings from ini
if (useProfile[n])
{
std::string base;
SplitPath(profile[n], nullptr, &base, nullptr);
Core::DisplayMessage("Loading game specific input profile '" + base + "' for device '" +
controller->GetName() + "'",
6000);
IniFile profile_ini;
profile_ini.Load(profile[n]);
config = *profile_ini.GetOrCreateSection("Profile");
}
else
{
config = *inifile.GetOrCreateSection(controller->GetName());
}
#if defined(ANDROID)
// Only set for wii pads
if (!isGC && use_ir_config)
{
config.Set("IR/Total Yaw", ir_values[0]);
config.Set("IR/Total Pitch", ir_values[1]);
config.Set("IR/Vertical Offset", ir_values[2]);
}
#endif
controller->LoadConfig(&config);
// Update refs
controller->UpdateReferences(g_controller_interface);
// Next profile
n++;
}
return true;
}
else
{
m_controllers[0]->LoadDefaults(g_controller_interface);
m_controllers[0]->UpdateReferences(g_controller_interface);
return false;
}
}
void InputConfig::SaveConfig()