mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
New Wiimote Plugin: Added "Upright Wiimote" option. Fixed a nunchuk problem in ZTP and Wii Sports with some Hacks. Some work on emulated Swing and Speaker (disabled). Fixes/Cleanups. ControllerInterface: Fixed an issue when a DInput device reports the same axis more than once. Fixed some old comments.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5422 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -237,7 +237,20 @@ public:
|
||||
public:
|
||||
Force( const char* const _name );
|
||||
|
||||
void GetState( u8* data, const u8 base, const u8 range );
|
||||
template <typename C, typename R>
|
||||
void GetState( C* axis, const u8 base, const R range )
|
||||
{
|
||||
const float deadzone = settings[0]->value;
|
||||
for ( unsigned int i=0; i<6; i+=2 )
|
||||
{
|
||||
const float state = controls[i+1]->control_ref->State() - controls[i]->control_ref->State();
|
||||
if (abs(state) > deadzone)
|
||||
*axis++ = (C)((state - (deadzone * sign(state))) / (1 - deadzone) * range + base);
|
||||
//*axis++ = state * range + base;
|
||||
else
|
||||
*axis++ = (C)(base);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
class Tilt : public ControlGroup
|
||||
@ -333,9 +346,9 @@ public:
|
||||
// adjust cursor according to settings
|
||||
if (adjusted)
|
||||
{
|
||||
xx *= ( settings[0]->value * 2 );
|
||||
yy *= ( settings[1]->value * 2 );
|
||||
yy += ( settings[2]->value - 0.5f );
|
||||
xx *= ( settings[1]->value * 2 );
|
||||
yy *= ( settings[2]->value * 2 );
|
||||
yy += ( settings[0]->value - 0.5f );
|
||||
}
|
||||
|
||||
*x = xx;
|
||||
|
Reference in New Issue
Block a user