Skip to content

Commit

Permalink
Revert all input changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Filoppi committed May 14, 2021
1 parent 56efd3e commit 78d7281
Show file tree
Hide file tree
Showing 82 changed files with 309 additions and 728 deletions.
5 changes: 0 additions & 5 deletions Source/Android/jni/MainAndroid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,6 @@ bool Host_RendererHasFocus()
return true;
}

bool Host_RendererHasFullFocus()
{
return true;
}

bool Host_RendererIsFullscreen()
{
return false;
Expand Down
1 change: 0 additions & 1 deletion Source/Core/AudioCommon/Mixer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ Mixer::Mixer(u32 sample_rate)
Mixer::~Mixer()
{
INFO_LOG_FMT(AUDIO_INTERFACE, "Mixer is initialized");
Core::RemoveOnStateChangedCallback(m_on_state_changed_handle);
}

void Mixer::SetPaused(bool paused)
Expand Down
1 change: 1 addition & 0 deletions Source/Core/Common/Logging/Log.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ enum LOG_TYPE
COMMANDPROCESSOR,
COMMON,
CONSOLE,
CONTROLLERINTERFACE,
CORE,
DISCIO,
DSPHLE,
Expand Down
1 change: 1 addition & 0 deletions Source/Core/Common/Logging/LogManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ LogManager::LogManager()
m_log[COMMANDPROCESSOR] = {"CP", "Command Processor"};
m_log[COMMON] = {"COMMON", "Common"};
m_log[CONSOLE] = {"CONSOLE", "Dolphin Console"};
m_log[CONTROLLERINTERFACE] = {"CI", "Controller Interface"};
m_log[CORE] = {"CORE", "Core"};
m_log[DISCIO] = {"DIO", "Disc IO"};
m_log[DSPHLE] = {"DSPHLE", "DSP HLE"};
Expand Down
2 changes: 0 additions & 2 deletions Source/Core/Core/ConfigManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ void SConfig::SaveInterfaceSettings(IniFile& ini)

interface->Set("ConfirmStop", bConfirmStop);
interface->Set("HideCursor", bHideCursor);
interface->Set("LockCursor", bLockCursor);
interface->Set("LanguageCode", m_InterfaceLanguage);
interface->Set("ExtendedFPSInfo", m_InterfaceExtendedFPSInfo);
interface->Set("ShowActiveTitle", m_show_active_title);
Expand Down Expand Up @@ -405,7 +404,6 @@ void SConfig::LoadInterfaceSettings(IniFile& ini)

interface->Get("ConfirmStop", &bConfirmStop, true);
interface->Get("HideCursor", &bHideCursor, false);
interface->Get("LockCursor", &bLockCursor, false);
interface->Get("LanguageCode", &m_InterfaceLanguage, "");
interface->Get("ExtendedFPSInfo", &m_InterfaceExtendedFPSInfo, false);
interface->Get("ShowActiveTitle", &m_show_active_title, true);
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/HW/EXI/EXI_DeviceIPL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ void CEXIIPL::TransferByte(u8& data)
if (!m_command.is_write())
{
u32 dev_addr = DEV_ADDR_CURSOR(ROM);
// Technically we should descramble here if descrambling logic is enabled.
// Technically we should descramble here iff descrambling logic is enabled.
// At the moment, we pre-decrypt the whole thing and
// ignore the "enabled" bit - see CEXIIPL::CEXIIPL
data = m_rom[dev_addr];
Expand Down
71 changes: 40 additions & 31 deletions Source/Core/Core/HW/GCPadEmu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,15 @@ GCPad::GCPad(const unsigned int index) : m_index(index)

// options
groups.emplace_back(m_options = new ControllerEmu::ControlGroup(_trans("Options")));
m_options->AddSetting(&m_always_connected_setting,
// i18n: Treat a controller as always being connected regardless of what
// devices the user actually has plugged in
_trans("Always Connected"), false);
m_options->AddSetting(
&m_always_connected_setting,
// i18n: Treat a controller as always being connected regardless of what
// devices the user actually has plugged in
{_trans("Always Connected"), _trans(""),
_trans("Always connected if checked.\n"
"If unchecked, it will link the emulated controller connection state\n"
"to the real default device connection state (if there is one).")},
false);
}

std::string GCPad::GetName() const
Expand Down Expand Up @@ -181,60 +186,64 @@ void GCPad::LoadDefaults(const ControllerInterface& ciface)
EmulatedController::LoadDefaults(ciface);

// Buttons
m_buttons->SetControlExpression(0, "X"); // A
m_buttons->SetControlExpression(1, "Z"); // B
m_buttons->SetControlExpression(2, "C"); // X
m_buttons->SetControlExpression(3, "S"); // Y
m_buttons->SetControlExpression(4, "D"); // Z
m_buttons->SetControlExpression(0, "`X`"); // A
m_buttons->SetControlExpression(1, "`Z`"); // B
m_buttons->SetControlExpression(2, "`C`"); // X
m_buttons->SetControlExpression(3, "`S`"); // Y
m_buttons->SetControlExpression(4, "`D`"); // Z
#ifdef _WIN32
m_buttons->SetControlExpression(5, "RETURN"); // Start
m_buttons->SetControlExpression(5, "`RETURN`"); // Start
#else
// OS X/Linux
// Start
m_buttons->SetControlExpression(5, "Return");
m_buttons->SetControlExpression(5, "`Return`");
#endif

// stick modifiers to 50 %
m_main_stick->controls[4]->control_ref->range = 0.5f;
m_c_stick->controls[4]->control_ref->range = 0.5f;

// D-Pad
m_dpad->SetControlExpression(0, "T"); // Up
m_dpad->SetControlExpression(1, "G"); // Down
m_dpad->SetControlExpression(2, "F"); // Left
m_dpad->SetControlExpression(3, "H"); // Right
m_dpad->SetControlExpression(0, "`T`"); // Up
m_dpad->SetControlExpression(1, "`G`"); // Down
m_dpad->SetControlExpression(2, "`F`"); // Left
m_dpad->SetControlExpression(3, "`H`"); // Right

// C Stick
m_c_stick->SetControlExpression(0, "I"); // Up
m_c_stick->SetControlExpression(1, "K"); // Down
m_c_stick->SetControlExpression(2, "J"); // Left
m_c_stick->SetControlExpression(3, "L"); // Right
m_c_stick->SetControlExpression(0, "`I`"); // Up
m_c_stick->SetControlExpression(1, "`K`"); // Down
m_c_stick->SetControlExpression(2, "`J`"); // Left
m_c_stick->SetControlExpression(3, "`L`"); // Right
// Modifier
m_c_stick->SetControlExpression(4, "Ctrl");
m_c_stick->SetControlExpression(4, "`Ctrl`");

// Control Stick
#ifdef _WIN32
m_main_stick->SetControlExpression(0, "UP"); // Up
m_main_stick->SetControlExpression(1, "DOWN"); // Down
m_main_stick->SetControlExpression(2, "LEFT"); // Left
m_main_stick->SetControlExpression(3, "RIGHT"); // Right
m_main_stick->SetControlExpression(0, "`UP`"); // Up
m_main_stick->SetControlExpression(1, "`DOWN`"); // Down
m_main_stick->SetControlExpression(2, "`LEFT`"); // Left
m_main_stick->SetControlExpression(3, "`RIGHT`"); // Right
#elif __APPLE__
m_main_stick->SetControlExpression(0, "`Up Arrow`"); // Up
m_main_stick->SetControlExpression(1, "`Down Arrow`"); // Down
m_main_stick->SetControlExpression(2, "`Left Arrow`"); // Left
m_main_stick->SetControlExpression(3, "`Right Arrow`"); // Right
#else
m_main_stick->SetControlExpression(0, "Up"); // Up
m_main_stick->SetControlExpression(1, "Down"); // Down
m_main_stick->SetControlExpression(2, "Left"); // Left
m_main_stick->SetControlExpression(3, "Right"); // Right
m_main_stick->SetControlExpression(0, "`Up`"); // Up
m_main_stick->SetControlExpression(1, "`Down`"); // Down
m_main_stick->SetControlExpression(2, "`Left`"); // Left
m_main_stick->SetControlExpression(3, "`Right`"); // Right
#endif
// Modifier
m_main_stick->SetControlExpression(4, "Shift");
m_main_stick->SetControlExpression(4, "`Shift`");

// Because our defaults use keyboard input, set calibration shapes to squares.
m_c_stick->SetCalibrationFromGate(ControllerEmu::SquareStickGate(1.0));
m_main_stick->SetCalibrationFromGate(ControllerEmu::SquareStickGate(1.0));

// Triggers
m_triggers->SetControlExpression(0, "Q"); // L
m_triggers->SetControlExpression(1, "W"); // R
m_triggers->SetControlExpression(0, "`Q`"); // L
m_triggers->SetControlExpression(1, "`W`"); // R
}

bool GCPad::GetMicButton() const
Expand Down
9 changes: 1 addition & 8 deletions Source/Core/Core/HW/VideoInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@

#include "DiscIO/Enums.h"

#include "InputCommon/ControlReference/ControlReference.h"

#include "VideoCommon/VideoBackendBase.h"
#include "VideoCommon/VideoConfig.h"

Expand Down Expand Up @@ -869,12 +867,7 @@ void Update(u64 ticks)

if (s_half_line_of_next_si_poll == s_half_line_count)
{
// If we wanted to add an option to not block the mouse input when it's
// responsable for capturing focus on the game window, put it as the last param,
// though it would break the code to prevent mouse clicks from being accepted
// after we lost focus (more flags could be added for that)
InputReference::UpdateInputGate(!SConfig::GetInstance().m_BackgroundInput,
SConfig::GetInstance().bLockCursor, true);
Core::UpdateInputGate(!SConfig::GetInstance().m_BackgroundInput);
SerialInterface::UpdateDevices();
s_half_line_of_next_si_poll += 2 * SerialInterface::GetPollXLines();
}
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/HW/WiimoteEmu/Dynamics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ WiimoteCommon::AccelData ConvertAccelData(const Common::Vec3& accel, u16 zero_g,

void EmulatePoint(MotionState* state, ControllerEmu::Cursor* ir_group, float time_elapsed)
{
const auto cursor = ir_group->GetState(time_elapsed, false);
const auto cursor = ir_group->GetState(true);

if (!cursor.IsVisible())
{
Expand Down
1 change: 0 additions & 1 deletion Source/Core/Core/HW/WiimoteEmu/ExtensionPort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ void ExtensionPort::AttachExtension(Extension* ext)

m_extension = ext;
m_i2c_bus.AddSlave(m_extension);
;
}

} // namespace WiimoteEmu
2 changes: 2 additions & 0 deletions Source/Core/Core/HW/WiimoteEmu/ExtensionPort.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ enum ExtensionNumber : u8
UDRAW_TABLET,
DRAWSOME_TABLET,
TATACON,

MAX
};

// FYI: An extension must be attached.
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/HW/WiimoteEmu/WiimoteEmu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ void Wiimote::Update()

// Hotkey / settings modifier
// Data is later accessed in IsSideways and IsUpright
m_hotkeys->GetState();
m_hotkeys->UpdateState();

// Update our motion simulations.
StepDynamics();
Expand Down
1 change: 0 additions & 1 deletion Source/Core/Core/Host.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ enum class HostMessageID
std::vector<std::string> Host_GetPreferredLocales();
bool Host_UIBlocksControllerState();
bool Host_RendererHasFocus();
bool Host_RendererHasFullFocus();
bool Host_RendererIsFullscreen();

void Host_Message(HostMessageID id);
Expand Down
1 change: 0 additions & 1 deletion Source/Core/Core/HotkeyManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ enum Hotkey
HK_FULLSCREEN,
HK_SCREENSHOT,
HK_EXIT,
HK_UNLOCK_CURSOR,
HK_ACTIVATE_CHAT,
HK_REQUEST_GOLF_CONTROL,

Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/IOS/USB/USB_KBD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ std::optional<IPCReply> USB_KBD::Write(const ReadWriteRequest& request)
std::optional<IPCReply> USB_KBD::IOCtl(const IOCtlRequest& request)
{
if (SConfig::GetInstance().m_WiiKeyboard && !Core::WantsDeterminism() &&
InputReference::GetInputGate() && !m_message_queue.empty())
ControlReference::GetInputGate() && !m_message_queue.empty())
{
Memory::CopyToEmu(request.buffer_out, &m_message_queue.front(), sizeof(MessageData));
m_message_queue.pop();
Expand Down
6 changes: 0 additions & 6 deletions Source/Core/DolphinNoGUI/MainNoGUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,6 @@ bool Host_RendererHasFocus()
return s_platform->IsWindowFocused();
}

bool Host_RendererHasFullFocus()
{
// Mouse capturing isn't implemented
return s_platform->IsWindowFocused();
}

bool Host_RendererIsFullscreen()
{
return s_platform->IsWindowFullscreen();
Expand Down
5 changes: 1 addition & 4 deletions Source/Core/DolphinQt/Config/Mapping/MappingIndicator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
#include <QPainterPath>
#include <QTimer>

#include "Core/Core.h"
#include "Core/HW/Wiimote.h"

#include "Common/MathUtil.h"

#include "InputCommon/ControlReference/ControlReference.h"
Expand Down Expand Up @@ -296,7 +293,7 @@ void MappingIndicator::paintEvent(QPaintEvent*)

void CursorIndicator::Draw()
{
const auto adj_coord = m_cursor_group.GetState(0.f, true);
const auto adj_coord = m_cursor_group.GetState(true);

DrawReshapableInput(m_cursor_group, CURSOR_TV_COLOR,
adj_coord.IsVisible() ?
Expand Down
5 changes: 1 addition & 4 deletions Source/Core/DolphinQt/Config/Mapping/MappingIndicator.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,7 @@ class TiltIndicator : public ReshapableInputIndicator
class CursorIndicator : public ReshapableInputIndicator
{
public:
explicit CursorIndicator(ControllerEmu::Cursor& cursor) : m_cursor_group(cursor)
{
m_cursor_group.ResetState(true);
}
explicit CursorIndicator(ControllerEmu::Cursor& cursor) : m_cursor_group(cursor) {}

private:
void Draw() override;
Expand Down
Loading

0 comments on commit 78d7281

Please sign in to comment.