Fix IR pointer of emulated Wiimote if sensor bar position is set to bottom.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7490 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
NeoBrainX 2011-04-30 01:27:03 +00:00
parent 770b0d4552
commit fdc05bfe29
2 changed files with 8 additions and 1 deletions

View File

@ -29,6 +29,7 @@
#include "Timer.h"
#include "Common.h"
#include "../../Host.h"
#include "../../ConfigManager.h"
#include "UDPTLayer.h"
@ -299,6 +300,9 @@ Wiimote::Wiimote( const unsigned int index )
m_options->settings.push_back(new ControlGroup::Setting(_trans("Sideways Wiimote"), false));
m_options->settings.push_back(new ControlGroup::Setting(_trans("Upright Wiimote"), false));
// TODO: This value should probably be re-read if SYSCONF gets changed
m_sensor_bar_on_top = (bool)SConfig::GetInstance().m_SYSCONF->GetData<u8>("BT.BAR");
// --- reset eeprom/register/values to default ---
Reset();
}
@ -474,7 +478,8 @@ void Wiimote::GetIRData(u8* const data, bool use_accel)
for (int i=0; i<4; i++)
{
v[i].x=xx*(bndright-bndleft)/2+(bndleft+bndright)/2;
v[i].y=yy*(bndup-bnddown)/2+(bndup+bnddown)/2;
if (m_sensor_bar_on_top) v[i].y=yy*(bndup-bnddown)/2+(bndup+bnddown)/2;
else v[i].y=yy*(bndup-bnddown)/2-(bndup+bnddown)/2;
v[i].z=0;
}

View File

@ -170,6 +170,8 @@ private:
u8 m_shake_step[3];
bool m_sensor_bar_on_top;
wm_status_report m_status;
ADPCMState m_adpcm_state;