mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-19 08:50:48 +00:00
meh
This commit is contained in:
parent
2c393d35f0
commit
98c174edc4
520 changed files with 74815 additions and 58942 deletions
|
@ -49,7 +49,8 @@ enum class GroupType
|
|||
Shake,
|
||||
IMUAccelerometer,
|
||||
IMUGyroscope,
|
||||
IMUCursor
|
||||
IMUCursor,
|
||||
IRPassthrough,
|
||||
};
|
||||
|
||||
class ControlGroup
|
||||
|
|
|
@ -181,6 +181,11 @@ ControlState Cursor::GetVerticalOffset() const
|
|||
return m_vertical_offset_setting.GetValue() / 100;
|
||||
}
|
||||
|
||||
void Cursor::SetRelativeInput(bool value)
|
||||
{
|
||||
m_relative_setting.SetValue(value);
|
||||
}
|
||||
|
||||
bool Cursor::StateData::IsVisible() const
|
||||
{
|
||||
return !std::isnan(x);
|
||||
|
|
|
@ -40,6 +40,8 @@ public:
|
|||
// Vertical offset in meters.
|
||||
ControlState GetVerticalOffset() const;
|
||||
|
||||
void SetRelativeInput(bool enabled);
|
||||
|
||||
private:
|
||||
Cursor::StateData UpdateState(Cursor::ReshapeData input);
|
||||
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
// Copyright 2024 Dolphin Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "InputCommon/ControllerEmu/ControlGroup/IRPassthrough.h"
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "Common/Common.h"
|
||||
#include "Common/MathUtil.h"
|
||||
|
||||
#include "InputCommon/ControlReference/ControlReference.h"
|
||||
#include "InputCommon/ControllerEmu/Control/Control.h"
|
||||
#include "InputCommon/ControllerEmu/Control/Input.h"
|
||||
|
||||
namespace ControllerEmu
|
||||
{
|
||||
IRPassthrough::IRPassthrough(std::string name_, std::string ui_name_)
|
||||
: ControlGroup(std::move(name_), std::move(ui_name_), GroupType::IRPassthrough,
|
||||
ControlGroup::DefaultValue::Disabled)
|
||||
{
|
||||
AddInput(Translatability::Translate, _trans("Object 1 X"));
|
||||
AddInput(Translatability::Translate, _trans("Object 1 Y"));
|
||||
AddInput(Translatability::Translate, _trans("Object 1 Size"));
|
||||
AddInput(Translatability::Translate, _trans("Object 2 X"));
|
||||
AddInput(Translatability::Translate, _trans("Object 2 Y"));
|
||||
AddInput(Translatability::Translate, _trans("Object 2 Size"));
|
||||
AddInput(Translatability::Translate, _trans("Object 3 X"));
|
||||
AddInput(Translatability::Translate, _trans("Object 3 Y"));
|
||||
AddInput(Translatability::Translate, _trans("Object 3 Size"));
|
||||
AddInput(Translatability::Translate, _trans("Object 4 X"));
|
||||
AddInput(Translatability::Translate, _trans("Object 4 Y"));
|
||||
AddInput(Translatability::Translate, _trans("Object 4 Size"));
|
||||
}
|
||||
|
||||
ControlState IRPassthrough::GetObjectPositionX(size_t object_index) const
|
||||
{
|
||||
return controls[object_index * 3 + 0]->GetState();
|
||||
}
|
||||
|
||||
ControlState IRPassthrough::GetObjectPositionY(size_t object_index) const
|
||||
{
|
||||
return controls[object_index * 3 + 1]->GetState();
|
||||
}
|
||||
|
||||
ControlState IRPassthrough::GetObjectSize(size_t object_index) const
|
||||
{
|
||||
return controls[object_index * 3 + 2]->GetState();
|
||||
}
|
||||
|
||||
} // namespace ControllerEmu
|
|
@ -0,0 +1,23 @@
|
|||
// Copyright 2024 Dolphin Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "InputCommon/ControllerEmu/ControlGroup/ControlGroup.h"
|
||||
#include "InputCommon/ControllerEmu/Setting/NumericSetting.h"
|
||||
#include "InputCommon/ControllerInterface/CoreDevice.h"
|
||||
|
||||
namespace ControllerEmu
|
||||
{
|
||||
class IRPassthrough : public ControlGroup
|
||||
{
|
||||
public:
|
||||
IRPassthrough(std::string name, std::string ui_name);
|
||||
|
||||
ControlState GetObjectPositionX(size_t object_index) const;
|
||||
ControlState GetObjectPositionY(size_t object_index) const;
|
||||
ControlState GetObjectSize(size_t object_index) const;
|
||||
};
|
||||
} // namespace ControllerEmu
|
Loading…
Add table
Add a link
Reference in a new issue