dolphin/Source/Core/Core/HW/GCPad.cpp
Martino Fontana a14c88ba67 Remove unused imports
Yellow squiggly lines begone!
Done automatically on .cpp files through `run-clang-tidy`, with manual corrections to the mistakes.
If an import is directly used, but is technically unnecessary since it's recursively imported by something else, it is *not* removed.
The tool doesn't touch .h files, so I did some of them by hand while fixing errors due to old recursive imports.
Not everything is removed, but the cleanup should be substantial enough.
Because this done on Linux, code that isn't used on it is mostly untouched.
(Hopefully no open PR is depending on these imports...)
2026-01-25 16:12:15 +01:00

81 lines
1.6 KiB
C++

// Copyright 2010 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "Core/HW/GCPad.h"
#include "Common/Common.h"
#include "Core/HW/GCPadEmu.h"
#include "InputCommon/ControllerEmu/ControlGroup/ControlGroup.h"
#include "InputCommon/GCPadStatus.h"
#include "InputCommon/InputConfig.h"
namespace Pad
{
static InputConfig s_config("GCPadNew", _trans("Pad"), "GCPad", "Pad");
InputConfig* GetConfig()
{
return &s_config;
}
void Shutdown()
{
s_config.UnregisterHotplugCallback();
s_config.ClearControllers();
}
void Initialize()
{
if (s_config.ControllersNeedToBeCreated())
{
for (unsigned int i = 0; i < 4; ++i)
s_config.CreateController<GCPad>(i);
}
s_config.RegisterHotplugCallback();
// Load the saved controller config
s_config.LoadConfig();
}
void LoadConfig()
{
s_config.LoadConfig();
}
void GenerateDynamicInputTextures()
{
s_config.GenerateControllerTextures();
}
bool IsInitialized()
{
return !s_config.ControllersNeedToBeCreated();
}
GCPadStatus GetStatus(int pad_num)
{
return static_cast<GCPad*>(s_config.GetController(pad_num))->GetInput();
}
ControllerEmu::ControlGroup* GetGroup(int pad_num, PadGroup group)
{
return static_cast<GCPad*>(s_config.GetController(pad_num))->GetGroup(group);
}
void Rumble(const int pad_num, const ControlState strength)
{
static_cast<GCPad*>(s_config.GetController(pad_num))->SetOutput(strength);
}
void ResetRumble(const int pad_num)
{
static_cast<GCPad*>(s_config.GetController(pad_num))->SetOutput(0.0);
}
bool GetMicButton(const int pad_num)
{
return static_cast<GCPad*>(s_config.GetController(pad_num))->GetMicButton();
}
} // namespace Pad