mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Added UDPWii support to the new plugin. Hopefully I didn't made a mess... Nunchuck support not implemented yet. I want to make it a separate extension.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5835 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -257,7 +257,16 @@ void TiltWiimote(int &_x, int &_y, int &_z)
|
||||
{
|
||||
// Select input method and return the x, y, x values
|
||||
if ((WiiMapping[g_ID].UDPWM.instance)&&(WiiMapping[g_ID].UDPWM.enableAccel))
|
||||
WiiMapping[g_ID].UDPWM.instance->getAccel(_x,_y,_z);
|
||||
{
|
||||
float x,y,z;
|
||||
WiiMapping[g_ID].UDPWM.instance->getAccel(x,y,z);
|
||||
float xg = WiiMoteEmu::g_wm.cal_g.x;
|
||||
float yg = WiiMoteEmu::g_wm.cal_g.y;
|
||||
float zg = WiiMoteEmu::g_wm.cal_g.z;
|
||||
_x = WiiMoteEmu::g_wm.cal_zero.x + (int)(xg * x);
|
||||
_y = WiiMoteEmu::g_wm.cal_zero.y + (int)(yg * y);
|
||||
_z = WiiMoteEmu::g_wm.cal_zero.z + (int)(zg * z);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (WiiMapping[g_ID].Tilt.InputWM == FROM_KEYBOARD)
|
||||
|
@ -260,15 +260,12 @@ void UDPWiimote::broadcastPresence()
|
||||
// NOTICE_LOG(WIIMOTE,"UDPWii broadcasting presence");
|
||||
}
|
||||
|
||||
void UDPWiimote::getAccel(int &_x, int &_y, int &_z)
|
||||
void UDPWiimote::getAccel(float &_x, float &_y, float &_z)
|
||||
{
|
||||
float xg = WiiMoteEmu::g_wm.cal_g.x;
|
||||
float yg = WiiMoteEmu::g_wm.cal_g.y;
|
||||
float zg = WiiMoteEmu::g_wm.cal_g.z;
|
||||
d->mutex.Enter();
|
||||
_x = WiiMoteEmu::g_wm.cal_zero.x + (int)(xg * x);
|
||||
_y = WiiMoteEmu::g_wm.cal_zero.y + (int)(yg * y);
|
||||
_z = WiiMoteEmu::g_wm.cal_zero.z + (int)(zg * z);
|
||||
_x=x;
|
||||
_y=y;
|
||||
_z=z;
|
||||
d->mutex.Leave();
|
||||
//NOTICE_LOG(WIIMOTE,"%lf %lf %lf",_x, _y, _z);
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ class UDPWiimote
|
||||
public:
|
||||
UDPWiimote(const char * port);
|
||||
virtual ~UDPWiimote();
|
||||
void getAccel(int &x, int &y, int &z);
|
||||
void getAccel(float &x, float &y, float &z);
|
||||
u32 getButtons();
|
||||
void getNunchuck(float &x, float &y, u8 &mask);
|
||||
void getIR(float &x, float &y);
|
||||
|
Reference in New Issue
Block a user