Fix compile in OSX by reverting my change, dunno why OpenAL is different on my machine. Bit of debug work in nJoy test
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3100 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
1f4c000ae6
commit
be61375c01
|
@ -33,11 +33,7 @@ bool OpenALStream::Start()
|
||||||
pDeviceList = new ALDeviceList();
|
pDeviceList = new ALDeviceList();
|
||||||
if ((pDeviceList) && (pDeviceList->GetNumDevices()))
|
if ((pDeviceList) && (pDeviceList->GetNumDevices()))
|
||||||
{
|
{
|
||||||
#ifdef __APPLE__
|
|
||||||
pDevice = alcOpenDevice((ALCubyte*)pDeviceList->GetDeviceName(pDeviceList->GetDefaultDevice()));
|
|
||||||
#else
|
|
||||||
pDevice = alcOpenDevice((const ALCchar *)pDeviceList->GetDeviceName(pDeviceList->GetDefaultDevice()));
|
pDevice = alcOpenDevice((const ALCchar *)pDeviceList->GetDeviceName(pDeviceList->GetDefaultDevice()));
|
||||||
#endif
|
|
||||||
if (pDevice)
|
if (pDevice)
|
||||||
{
|
{
|
||||||
pContext = alcCreateContext(pDevice, NULL);
|
pContext = alcCreateContext(pDevice, NULL);
|
||||||
|
|
|
@ -73,6 +73,7 @@ BEGIN_EVENT_TABLE(ConfigBox,wxDialog)
|
||||||
EVT_BUTTON(IDB_ANALOG_MAIN_Y, ConfigBox::GetInputs)
|
EVT_BUTTON(IDB_ANALOG_MAIN_Y, ConfigBox::GetInputs)
|
||||||
EVT_BUTTON(IDB_ANALOG_SUB_X, ConfigBox::GetInputs)
|
EVT_BUTTON(IDB_ANALOG_SUB_X, ConfigBox::GetInputs)
|
||||||
EVT_BUTTON(IDB_ANALOG_SUB_Y, ConfigBox::GetInputs)
|
EVT_BUTTON(IDB_ANALOG_SUB_Y, ConfigBox::GetInputs)
|
||||||
|
EVT_BUTTON(IDB_BUTTONDEBUGSTART,ConfigBox::StartDebug)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
ConfigBox::ConfigBox(wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &position, const wxSize& size, long style)
|
ConfigBox::ConfigBox(wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &position, const wxSize& size, long style)
|
||||||
|
@ -123,6 +124,8 @@ void ConfigBox::CreateGUIControls()
|
||||||
m_Notebook->AddPage(m_Controller[2], wxT("Controller 3"));
|
m_Notebook->AddPage(m_Controller[2], wxT("Controller 3"));
|
||||||
m_Controller[3] = new wxPanel(m_Notebook, ID_CONTROLLERPAGE4, wxPoint(0, 0), wxSize(600, 400));
|
m_Controller[3] = new wxPanel(m_Notebook, ID_CONTROLLERPAGE4, wxPoint(0, 0), wxSize(600, 400));
|
||||||
m_Notebook->AddPage(m_Controller[3], wxT("Controller 4"));
|
m_Notebook->AddPage(m_Controller[3], wxT("Controller 4"));
|
||||||
|
m_Controller[4] = new wxPanel(m_Notebook, ID_CONTROLLERPAGE5, wxPoint(0, 0), wxSize(600, 400));
|
||||||
|
m_Notebook->AddPage(m_Controller[4], wxT("Debug"));
|
||||||
|
|
||||||
// Add controls
|
// Add controls
|
||||||
wxArrayString arrayStringFor_Joyname;
|
wxArrayString arrayStringFor_Joyname;
|
||||||
|
@ -275,6 +278,14 @@ void ConfigBox::CreateGUIControls()
|
||||||
|
|
||||||
SetControllerAll(i);
|
SetControllerAll(i);
|
||||||
}
|
}
|
||||||
|
for(int a = 0; a < 16; ++a)
|
||||||
|
{
|
||||||
|
char temp[128];
|
||||||
|
sprintf(temp, "Axis %d:", a);
|
||||||
|
m_textAxises[a] = new wxStaticText(m_Controller[4], ID_DEBUGAXISSTATICTEXT0 + a, wxString::FromAscii(temp), wxPoint(15, 15 + (a * 25)), wxDefaultSize, 0, wxString::FromAscii(temp));
|
||||||
|
m_JoyAxises[a] = new wxTextCtrl(m_Controller[4], ID_DEBUGAXISCTRLTEXT0 + a, wxT("0"), wxPoint(60, 15 + (a * 25)), wxSize(59, 25), wxTE_READONLY | wxTE_CENTRE, wxDefaultValidator, wxT("0"));
|
||||||
|
}
|
||||||
|
m_bJoyDebug = new wxButton(m_Controller[4], IDB_BUTTONDEBUGSTART, wxT("Start"), wxPoint(297, 385), wxDefaultSize, 0, wxDefaultValidator, wxT("Start"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigBox::OnClose(wxCloseEvent& /*event*/)
|
void ConfigBox::OnClose(wxCloseEvent& /*event*/)
|
||||||
|
@ -322,7 +333,29 @@ void ConfigBox::CancelClick(wxCommandEvent& event)
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
void ConfigBox::StartDebug(wxCommandEvent& event)
|
||||||
|
{
|
||||||
|
SDL_Joystick *joy = SDL_JoystickOpen(joysticks[0].ID);
|
||||||
|
int axes = SDL_JoystickNumAxes(joy);
|
||||||
|
for(int a = 16; a >= axes; --a)
|
||||||
|
{
|
||||||
|
m_textAxises[a]->Hide();
|
||||||
|
m_JoyAxises[a]->Hide();
|
||||||
|
}
|
||||||
|
Sint16 value;
|
||||||
|
while(1)
|
||||||
|
{
|
||||||
|
for(int b = 0; b < axes; b++)
|
||||||
|
{
|
||||||
|
SDL_JoystickUpdate();
|
||||||
|
value = SDL_JoystickGetAxis(joy, b);
|
||||||
|
char temp[128];
|
||||||
|
sprintf(temp, "%d", value);
|
||||||
|
m_JoyAxises[b]->SetValue(wxString::FromAscii(temp));
|
||||||
|
wxWindow::Update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
void ConfigBox::Calibrate(wxCommandEvent& event)
|
void ConfigBox::Calibrate(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
int controller = notebookpage;
|
int controller = notebookpage;
|
||||||
|
@ -332,6 +365,11 @@ void ConfigBox::Calibrate(wxCommandEvent& event)
|
||||||
int axes = SDL_JoystickNumAxes(joy);
|
int axes = SDL_JoystickNumAxes(joy);
|
||||||
Sint16 value;
|
Sint16 value;
|
||||||
unsigned long Started = SDL_GetTicks();
|
unsigned long Started = SDL_GetTicks();
|
||||||
|
for(int b = 0; b < axes; b++)
|
||||||
|
{
|
||||||
|
joysticks[controller].sData[b].Min = 0;
|
||||||
|
joysticks[controller].sData[b].Max = 0;
|
||||||
|
}
|
||||||
while(1)
|
while(1)
|
||||||
{
|
{
|
||||||
for(int b = 0; b < axes; b++)
|
for(int b = 0; b < axes; b++)
|
||||||
|
@ -669,7 +707,7 @@ void ConfigBox::GetInputs(wxCommandEvent& event)
|
||||||
(value <= (joysticks[controller].sData[b].Min - joysticks[controller].sData[b].Min * joysticks[controller].deadzone/100.0f) ) ||
|
(value <= (joysticks[controller].sData[b].Min - joysticks[controller].sData[b].Min * joysticks[controller].deadzone/100.0f) ) ||
|
||||||
(value >= (joysticks[controller].sData[b].Max - joysticks[controller].sData[b].Max * joysticks[controller].deadzone/100.0f) )) // Add and subtract a small value
|
(value >= (joysticks[controller].sData[b].Max - joysticks[controller].sData[b].Max * joysticks[controller].deadzone/100.0f) )) // Add and subtract a small value
|
||||||
{ // It allows for some small jitter
|
{ // It allows for some small jitter
|
||||||
printf("value %d, Min %d Max %d Removal %f %f\n", value, joysticks[controller].sData[b].Min,joysticks[controller].sData[b].Max, joysticks[controller].sData[b].Min * joysticks[controller].deadzone/100.0f, joysticks[controller].sData[b].Max * joysticks[controller].deadzone/100.0f);
|
printf("value %d, Min %d Max %d Removal %f %f Cur: %d\n", value, joysticks[controller].sData[b].Min,joysticks[controller].sData[b].Max, joysticks[controller].sData[b].Min * joysticks[controller].deadzone/100.0f, joysticks[controller].sData[b].Max * joysticks[controller].deadzone/100.0f, value);
|
||||||
value = value < 0 ? -1 : 1; // Makes it know if the value is negative or positive
|
value = value < 0 ? -1 : 1; // Makes it know if the value is negative or positive
|
||||||
pressed = b;
|
pressed = b;
|
||||||
waiting = false;
|
waiting = false;
|
||||||
|
|
|
@ -62,7 +62,7 @@ class ConfigBox : public wxDialog
|
||||||
wxButton *m_OK;
|
wxButton *m_OK;
|
||||||
wxButton *m_Cancel;
|
wxButton *m_Cancel;
|
||||||
|
|
||||||
wxPanel *m_Controller[4];
|
wxPanel *m_Controller[5];
|
||||||
wxNotebook *m_Notebook;
|
wxNotebook *m_Notebook;
|
||||||
|
|
||||||
wxComboBox *m_Joyname[4];
|
wxComboBox *m_Joyname[4];
|
||||||
|
@ -133,6 +133,11 @@ class ConfigBox : public wxDialog
|
||||||
wxTextCtrl *m_PlaceholderBMP[4];
|
wxTextCtrl *m_PlaceholderBMP[4];
|
||||||
wxStaticBitmap *m_controllerimage[4];
|
wxStaticBitmap *m_controllerimage[4];
|
||||||
|
|
||||||
|
// DEBUG
|
||||||
|
wxStaticText *m_textAxises[16]; // Support 16 axises
|
||||||
|
wxTextCtrl *m_JoyAxises[16]; // Support 16 axises
|
||||||
|
wxButton *m_bJoyDebug;
|
||||||
|
|
||||||
int notebookpage;
|
int notebookpage;
|
||||||
private:
|
private:
|
||||||
enum
|
enum
|
||||||
|
@ -145,6 +150,7 @@ class ConfigBox : public wxDialog
|
||||||
ID_CONTROLLERPAGE2,
|
ID_CONTROLLERPAGE2,
|
||||||
ID_CONTROLLERPAGE3,
|
ID_CONTROLLERPAGE3,
|
||||||
ID_CONTROLLERPAGE4,
|
ID_CONTROLLERPAGE4,
|
||||||
|
ID_CONTROLLERPAGE5,
|
||||||
|
|
||||||
IDC_JOYNAME,
|
IDC_JOYNAME,
|
||||||
IDC_CONTROLTYPE,
|
IDC_CONTROLTYPE,
|
||||||
|
@ -211,6 +217,42 @@ class ConfigBox : public wxDialog
|
||||||
IDT_WEBSITE,
|
IDT_WEBSITE,
|
||||||
ID_BUTTONCALIBRATE,
|
ID_BUTTONCALIBRATE,
|
||||||
|
|
||||||
|
ID_DEBUGAXISCTRLTEXT0,
|
||||||
|
ID_DEBUGAXISCTRLTEXT1,
|
||||||
|
ID_DEBUGAXISCTRLTEXT2,
|
||||||
|
ID_DEBUGAXISCTRLTEXT3,
|
||||||
|
ID_DEBUGAXISCTRLTEXT4,
|
||||||
|
ID_DEBUGAXISCTRLTEXT5,
|
||||||
|
ID_DEBUGAXISCTRLTEXT6,
|
||||||
|
ID_DEBUGAXISCTRLTEXT7,
|
||||||
|
ID_DEBUGAXISCTRLTEXT8,
|
||||||
|
ID_DEBUGAXISCTRLTEXT9,
|
||||||
|
ID_DEBUGAXISCTRLTEXT10,
|
||||||
|
ID_DEBUGAXISCTRLTEXT11,
|
||||||
|
ID_DEBUGAXISCTRLTEXT12,
|
||||||
|
ID_DEBUGAXISCTRLTEXT13,
|
||||||
|
ID_DEBUGAXISCTRLTEXT14,
|
||||||
|
ID_DEBUGAXISCTRLTEXT15,
|
||||||
|
|
||||||
|
ID_DEBUGAXISSTATICTEXT0,
|
||||||
|
ID_DEBUGAXISSTATICTEXT1,
|
||||||
|
ID_DEBUGAXISSTATICTEXT2,
|
||||||
|
ID_DEBUGAXISSTATICTEXT3,
|
||||||
|
ID_DEBUGAXISSTATICTEXT4,
|
||||||
|
ID_DEBUGAXISSTATICTEXT5,
|
||||||
|
ID_DEBUGAXISSTATICTEXT6,
|
||||||
|
ID_DEBUGAXISSTATICTEXT7,
|
||||||
|
ID_DEBUGAXISSTATICTEXT8,
|
||||||
|
ID_DEBUGAXISSTATICTEXT9,
|
||||||
|
ID_DEBUGAXISSTATICTEXT10,
|
||||||
|
ID_DEBUGAXISSTATICTEXT11,
|
||||||
|
ID_DEBUGAXISSTATICTEXT12,
|
||||||
|
ID_DEBUGAXISSTATICTEXT13,
|
||||||
|
ID_DEBUGAXISSTATICTEXT14,
|
||||||
|
ID_DEBUGAXISSTATICTEXT15,
|
||||||
|
|
||||||
|
IDB_BUTTONDEBUGSTART,
|
||||||
|
|
||||||
ID_DUMMY_VALUE_ //don't remove this value unless you have other enum values
|
ID_DUMMY_VALUE_ //don't remove this value unless you have other enum values
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -235,6 +277,8 @@ class ConfigBox : public wxDialog
|
||||||
void GetInputs(wxCommandEvent& event);
|
void GetInputs(wxCommandEvent& event);
|
||||||
void GetHats(int ID);
|
void GetHats(int ID);
|
||||||
|
|
||||||
|
void StartDebug(wxCommandEvent& event);
|
||||||
|
|
||||||
void SetButtonText(int id, char text[128]);
|
void SetButtonText(int id, char text[128]);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue