some cleanup
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1227 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
58f998cb55
commit
12a8174446
|
@ -86,6 +86,7 @@ void GetMousePos(float& x, float& y)
|
||||||
x = point.x / (float)width;
|
x = point.x / (float)width;
|
||||||
y = point.y / (float)height;
|
y = point.y / (float)height;
|
||||||
#else
|
#else
|
||||||
|
// TODO fix on linux
|
||||||
x = 0.5f;
|
x = 0.5f;
|
||||||
y = 0.5f;
|
y = 0.5f;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -37,7 +37,7 @@ namespace WiiMoteReal
|
||||||
#define MAX_WIIMOTES 1
|
#define MAX_WIIMOTES 1
|
||||||
|
|
||||||
//******************************************************************************
|
//******************************************************************************
|
||||||
// Forwording
|
// Forwarding
|
||||||
//******************************************************************************
|
//******************************************************************************
|
||||||
|
|
||||||
class CWiiMote;
|
class CWiiMote;
|
||||||
|
@ -57,7 +57,7 @@ namespace WiiMoteReal
|
||||||
bool g_Shutdown = false;
|
bool g_Shutdown = false;
|
||||||
|
|
||||||
//******************************************************************************
|
//******************************************************************************
|
||||||
// Prolly this class should be in its own file
|
// Probably this class should be in its own file
|
||||||
//******************************************************************************
|
//******************************************************************************
|
||||||
|
|
||||||
class CWiiMote
|
class CWiiMote
|
||||||
|
@ -100,7 +100,8 @@ namespace WiiMoteReal
|
||||||
m_pCriticalSection->Leave();
|
m_pCriticalSection->Leave();
|
||||||
}
|
}
|
||||||
|
|
||||||
// read data from wiimote (but don't send it to the core, just filter and queue)
|
// read data from wiimote (but don't send it to the core, just filter
|
||||||
|
// and queue)
|
||||||
void ReadData()
|
void ReadData()
|
||||||
{
|
{
|
||||||
m_pCriticalSection->Enter();
|
m_pCriticalSection->Enter();
|
||||||
|
@ -118,7 +119,8 @@ namespace WiiMoteReal
|
||||||
{
|
{
|
||||||
const byte* pBuffer = m_pWiiMote->event_buf;
|
const byte* pBuffer = m_pWiiMote->event_buf;
|
||||||
|
|
||||||
// check if we have a channel (connection) if so save the data...
|
// check if we have a channel (connection) if so save the
|
||||||
|
// data...
|
||||||
if (m_channelID > 0)
|
if (m_channelID > 0)
|
||||||
{
|
{
|
||||||
m_pCriticalSection->Enter();
|
m_pCriticalSection->Enter();
|
||||||
|
@ -126,13 +128,15 @@ namespace WiiMoteReal
|
||||||
// filter out reports
|
// filter out reports
|
||||||
if (pBuffer[0] >= 0x30)
|
if (pBuffer[0] >= 0x30)
|
||||||
{
|
{
|
||||||
memcpy(m_LastReport.m_PayLoad, pBuffer, MAX_PAYLOAD);
|
memcpy(m_LastReport.m_PayLoad, pBuffer,
|
||||||
|
MAX_PAYLOAD);
|
||||||
m_LastReportValid = true;
|
m_LastReportValid = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SEvent ImportantEvent;
|
SEvent ImportantEvent;
|
||||||
memcpy(ImportantEvent.m_PayLoad, pBuffer, MAX_PAYLOAD);
|
memcpy(ImportantEvent.m_PayLoad, pBuffer,
|
||||||
|
MAX_PAYLOAD);
|
||||||
m_EventReadQueue.push(ImportantEvent);
|
m_EventReadQueue.push(ImportantEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -218,12 +222,10 @@ namespace WiiMoteReal
|
||||||
g_WiiMotes[i] = new CWiiMote(i+1, g_WiiMotesFromWiiUse[i]);
|
g_WiiMotes[i] = new CWiiMote(i+1, g_WiiMotesFromWiiUse[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_NumberOfWiiMotes == 0)
|
if (g_NumberOfWiiMotes > 0)
|
||||||
return 0;
|
|
||||||
|
|
||||||
g_pReadThread = new Common::Thread(ReadWiimote_ThreadFunc, NULL);
|
g_pReadThread = new Common::Thread(ReadWiimote_ThreadFunc, NULL);
|
||||||
|
|
||||||
return true;
|
return g_NumberOfWiiMotes;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoState(void* ptr, int mode)
|
void DoState(void* ptr, int mode)
|
||||||
|
|
Loading…
Reference in New Issue