mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
WiimoteNew: Added button mappings for tables and crossfade slider on emulated turntable extension.(completely untested in game)
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6260 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -259,6 +259,14 @@ ControllerEmu::Triggers::Triggers( const char* const _name ) : ControlGroup( _na
|
||||
settings.push_back( new Setting("Dead Zone", 0, 0, 50 ) );
|
||||
}
|
||||
|
||||
ControllerEmu::Slider::Slider(const char* const _name) : ControlGroup(_name, GROUP_TYPE_SLIDER)
|
||||
{
|
||||
controls.push_back(new Input("Left"));
|
||||
controls.push_back(new Input("Right"));
|
||||
|
||||
settings.push_back(new Setting("Dead Zone", 0, 0, 50));
|
||||
}
|
||||
|
||||
ControllerEmu::Force::Force( const char* const _name ) : ControlGroup( _name, GROUP_TYPE_FORCE )
|
||||
{
|
||||
memset(m_swing, 0, sizeof(m_swing));
|
||||
|
@ -45,7 +45,8 @@ enum
|
||||
GROUP_TYPE_TILT,
|
||||
GROUP_TYPE_CURSOR,
|
||||
GROUP_TYPE_TRIGGERS,
|
||||
GROUP_TYPE_UDPWII
|
||||
GROUP_TYPE_UDPWII,
|
||||
GROUP_TYPE_SLIDER,
|
||||
};
|
||||
|
||||
const char * const named_directions[] =
|
||||
@ -247,6 +248,26 @@ public:
|
||||
|
||||
};
|
||||
|
||||
class Slider : public ControlGroup
|
||||
{
|
||||
public:
|
||||
|
||||
template <typename S>
|
||||
void GetState(S* const slider, const unsigned int range, const unsigned int base = 0)
|
||||
{
|
||||
const float deadzone = settings[0]->value;
|
||||
const float state = controls[1]->control_ref->State() - controls[0]->control_ref->State();
|
||||
|
||||
if (fabsf(state) > deadzone)
|
||||
*slider = (S)((state - (deadzone * sign(state))) / (1 - deadzone) * range + base);
|
||||
else
|
||||
*slider = 0;
|
||||
}
|
||||
|
||||
Slider(const char* const _name);
|
||||
|
||||
};
|
||||
|
||||
class Force : public ControlGroup
|
||||
{
|
||||
public:
|
||||
|
Reference in New Issue
Block a user