fix osx build, and first step to get real wiimotes on osx

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2277 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
tmator 2009-02-16 21:12:00 +00:00
parent 82a10c9692
commit cf8220dc9c
6 changed files with 23 additions and 3 deletions

View File

@ -1,8 +1,9 @@
# -*- python -*-
import sys
Import('env')
if not env['HAVE_BLUEZ']:
if not (env['HAVE_BLUEZ'] or sys.platform == 'darwin'):
env['HAVE_WIIUSE'] = 0
Return()
@ -11,13 +12,18 @@ files = [
"dynamics.c",
"events.c",
"io.c",
"io_nix.c",
"ir.c",
"nunchuk.c",
"guitar_hero_3.c",
"wiiuse.c",
]
if env['HAVE_BLUEZ']:
files += [ "io_nix.c", ]
if sys.platform == 'darwin':
files += [ "io_osx.c", ]
env_wiiuse = env.Clone(
CCFLAGS = env.filterWarnings(env['CCFLAGS']) + ' -fvisibility=default',
CXXFLAGS = env.filterWarnings(env['CXXFLAGS']),

View File

@ -35,8 +35,10 @@
#define CONNECT_H_INCLUDED
#ifndef WIN32
#if !defined(__APPLE__)
#include <bluetooth/bluetooth.h>
#endif
#endif
#include "wiiuse_internal.h"

View File

@ -124,9 +124,11 @@ struct wiimote_t** wiiuse_init(int wiimotes) {
wm[i]->unid = i+1;
#ifndef WIN32
#if !defined(__APPLE__)
wm[i]->bdaddr = *BDADDR_ANY;
wm[i]->out_sock = -1;
wm[i]->in_sock = -1;
#endif
#else
wm[i]->dev_handle = 0;
wm[i]->stack = WIIUSE_STACK_UNKNOWN;

View File

@ -42,6 +42,8 @@
#ifdef _WIN32
/* windows */
#include <windows.h>
#elif defined(__APPLE__)
#include <string.h>
#else
/* nix */
#include <bluetooth/bluetooth.h>
@ -533,7 +535,11 @@ typedef struct wiimote_t {
WCONST int unid; /**< user specified id */
#ifndef WIN32
#if defined(__APPLE__)
WCONST char bdaddr[10]; /**< bt address on osx addr are string */
#else
WCONST bdaddr_t bdaddr; /**< bt address */
#endif
WCONST char bdaddr_str[18]; /**< readable bt address */
WCONST int out_sock; /**< output socket */
WCONST int in_sock; /**< input socket */

View File

@ -45,9 +45,11 @@
#define WIIUSE_INTERNAL_H_INCLUDED
#ifndef WIN32
#if !defined(__APPLE__)
#include <arpa/inet.h> /* htons() */
#include <bluetooth/bluetooth.h>
#endif
#endif
#include "definitions.h"

View File

@ -160,6 +160,7 @@ void ConfigDialog::UpdateGUIButtonMapping(int controller)
m_TiltInvertPitch[controller]->SetValue(WiiMoteEmu::PadMapping[controller].bPitchInvert);
// Wiimote
#ifdef _WIN32
m_bWmA[controller]->SetLabel(wxString::FromAscii(InputCommon::VKToString(WiiMoteEmu::PadMapping[controller].Wm.A).c_str()));
m_bWmB[controller]->SetLabel(wxString::FromAscii(InputCommon::VKToString(WiiMoteEmu::PadMapping[controller].Wm.B).c_str()));
m_bWm1[controller]->SetLabel(wxString::FromAscii(InputCommon::VKToString(WiiMoteEmu::PadMapping[controller].Wm.One).c_str()));
@ -183,6 +184,7 @@ void ConfigDialog::UpdateGUIButtonMapping(int controller)
m_bNcU[controller]->SetLabel(wxString::FromAscii(InputCommon::VKToString(WiiMoteEmu::PadMapping[controller].Nc.U).c_str()));
m_bNcD[controller]->SetLabel(wxString::FromAscii(InputCommon::VKToString(WiiMoteEmu::PadMapping[controller].Nc.D).c_str()));
m_bNcShake[controller]->SetLabel(wxString::FromAscii(InputCommon::VKToString(WiiMoteEmu::PadMapping[controller].Nc.Shake).c_str()));
#endif
//Console::Print("m_bWmA[%i] = %i = %s\n", controller, WiiMoteEmu::PadMapping[controller].Wm.A, InputCommon::VKToString(WiiMoteEmu::PadMapping[controller].Wm.A).c_str());
}
@ -754,4 +756,4 @@ void ConfigDialog::UpdatePad(wxTimerEvent& WXUNUSED(event))
PadGetStatus();
}
/////////////////////////////////////////////////////
/////////////////////////////////////////////////////