mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
WiimoteEmu: Add user-accessible controls that report the desired state of the IR camera objects.
This commit is contained in:
@ -37,6 +37,8 @@ add_library(inputcommon
|
||||
ControllerEmu/ControlGroup/IMUCursor.h
|
||||
ControllerEmu/ControlGroup/IMUGyroscope.cpp
|
||||
ControllerEmu/ControlGroup/IMUGyroscope.h
|
||||
ControllerEmu/ControlGroup/IRPassthrough.cpp
|
||||
ControllerEmu/ControlGroup/IRPassthrough.h
|
||||
ControllerEmu/ControlGroup/MixedTriggers.cpp
|
||||
ControllerEmu/ControlGroup/MixedTriggers.h
|
||||
ControllerEmu/ControlGroup/ModifySettingsButton.cpp
|
||||
|
@ -49,7 +49,8 @@ enum class GroupType
|
||||
Shake,
|
||||
IMUAccelerometer,
|
||||
IMUGyroscope,
|
||||
IMUCursor
|
||||
IMUCursor,
|
||||
IRPassthrough,
|
||||
};
|
||||
|
||||
class ControlGroup
|
||||
|
@ -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
|
Reference in New Issue
Block a user